perfs: avoid events/links in critical path (#18965)
This commit is contained in:
parent
c6f0966900
commit
e3abbabb23
|
@ -808,8 +808,10 @@ class AlternateRootDirectory(OldRootDirectory):
|
||||||
response.filter = {}
|
response.filter = {}
|
||||||
|
|
||||||
response.filter['auquotidien'] = True
|
response.filter['auquotidien'] = True
|
||||||
response.filter['gauche'] = self.box_side(path)
|
if not path or path[0] not in ('api', 'backoffice'):
|
||||||
response.filter['keywords'] = template.get_current_theme().get('keywords')
|
# api & backoffice have no use for a side box
|
||||||
|
response.filter['gauche'] = self.box_side(path)
|
||||||
|
response.filter['keywords'] = template.get_current_theme().get('keywords')
|
||||||
get_publisher().substitutions.feed(self)
|
get_publisher().substitutions.feed(self)
|
||||||
|
|
||||||
response.breadcrumb = [ ('', _('Home')) ]
|
response.breadcrumb = [ ('', _('Home')) ]
|
||||||
|
@ -1103,7 +1105,8 @@ class AlternateRootDirectory(OldRootDirectory):
|
||||||
r += htmltext('<input type="submit" value="%s"/>') % _('Load')
|
r += htmltext('<input type="submit" value="%s"/>') % _('Load')
|
||||||
r += htmltext('</form>')
|
r += htmltext('</form>')
|
||||||
|
|
||||||
r += self.links()
|
if get_cfg('aq-permissions', {}).get('links'):
|
||||||
|
r += self.links()
|
||||||
|
|
||||||
cats = Category.select(order_by = 'name')
|
cats = Category.select(order_by = 'name')
|
||||||
cats = [x for x in cats if x.url_name != 'consultations' and x.get_homepage_position() == 'side']
|
cats = [x for x in cats if x.url_name != 'consultations' and x.get_homepage_position() == 'side']
|
||||||
|
@ -1117,7 +1120,8 @@ class AlternateRootDirectory(OldRootDirectory):
|
||||||
r += htmltext('</ul>')
|
r += htmltext('</ul>')
|
||||||
r += htmltext('</div>')
|
r += htmltext('</div>')
|
||||||
|
|
||||||
if Event.keys(): # if there are events, add a link to the agenda
|
if get_cfg('aq-permissions', {}).get('events') and Event.keys():
|
||||||
|
# if there are events, add a link to the agenda
|
||||||
tags = get_cfg('misc', {}).get('event_tags')
|
tags = get_cfg('misc', {}).get('event_tags')
|
||||||
if not tags:
|
if not tags:
|
||||||
tags = get_default_event_tags()
|
tags = get_default_event_tags()
|
||||||
|
|
Reference in New Issue