added custom value to set filter on top or bottom

This commit is contained in:
Adolfo Gómez García 2020-08-08 20:15:59 +02:00
parent 27f867f71a
commit adfed4f89d
5 changed files with 7 additions and 4 deletions

View File

@ -341,6 +341,7 @@ class GlobalConfig:
SITE_LOGO_NAME: Config.Value = Config.section(CUSTOM_SECTION).value('Logo name', 'UDS', type=Config.TEXT_FIELD)
SITE_CSS: Config.Value = Config.section(CUSTOM_SECTION).value('CSS', '', type=Config.LONGTEXT_FIELD)
SITE_INFO: Config.Value = Config.section(CUSTOM_SECTION).value('Site information', '', type=Config.LONGTEXT_FIELD)
SITE_FILTER_ONTOP: Config.Value = Config.section(CUSTOM_SECTION).value('Show Filter on Top', '0', type=Config.BOOLEAN_FIELD)
# Custom HTML for login page
# CUSTOM_HTML_LOGIN: Config.Value = Config.section(CUSTOM_SECTION).value('customHtmlLogin', '', type=Config.LONGTEXT_FIELD)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -123,6 +123,7 @@ def udsJs(request: 'HttpRequest') -> str:
'site_copyright_link': GlobalConfig.SITE_COPYRIGHT_LINK.get(),
'site_logo_name': GlobalConfig.SITE_LOGO_NAME.get(),
'site_information': GlobalConfig.SITE_INFO.get(),
'site_filter_on_top': GlobalConfig.SITE_FILTER_ONTOP.getBool(True),
'messages': {
# Calendar denied message
'calendarDenied': GlobalConfig.LIMITED_BY_CALENDAR_TEXT.get().strip() or gettext('Access limited by calendar')

View File

@ -155,8 +155,9 @@ def getServicesData(request: 'HttpRequest') -> typing.Dict[str, typing.Any]: #
trans = []
for t in sorted(svr.transports.all(), key=lambda x: x.priority): # In memory sort, allows reuse prefetched and not too big array
typeTrans = t.getType()
if typeTrans is None: # This may happen if we "remove" a transport type but we have a transport of that kind on DB
try:
typeTrans = t.getType()
except Exception:
continue
if t.validForIp(request.ip) and typeTrans.supportsOs(os['OS']) and t.validForOs(os['OS']):
if typeTrans.ownLink is True: