remove theme keyword variants (#70129)

This commit is contained in:
Frédéric Péters 2022-10-11 17:16:21 +02:00
parent fe9a8f281e
commit 4997618bb8
3 changed files with 2 additions and 26 deletions

View File

@ -278,7 +278,6 @@ class AlternateRootDirectory(OldRootDirectory):
if not path or (path[0] not in ('api', 'backoffice') and not get_request().is_json()):
# api & backoffice have no use for a side box
response.filter['gauche'] = lambda x: self.box_side(path)
response.filter['keywords'] = template.get_current_theme().get('keywords')
get_publisher().substitutions.feed(self)
response.breadcrumb = [('', _('Home'))]
@ -384,18 +383,6 @@ class AlternateRootDirectory(OldRootDirectory):
r = TemplateIO(html=True)
get_response().filter['is_index'] = True
if not 'auquotidien-welcome-in-services' in get_response().filter.get('keywords', []):
t = TextsDirectory.get_html_text('aq-home-page')
if not t:
if get_request().user:
t = TextsDirectory.get_html_text('welcome-logged')
else:
t = TextsDirectory.get_html_text('welcome-unlogged')
if t:
r += htmltext('<div id="home-page-intro">')
r += t
r += htmltext('</div>')
r += htmltext('<div id="centre">')
r += self.box_services(position='1st')
r += htmltext('</div>')

View File

@ -49,17 +49,6 @@ def render_response(publisher, body):
section_title = '<h2 id="services">%s</h2>\n' % _('Services')
response.filter['bigdiv'] = 'rub_service'
if not 'auquotidien-no-titles-in-section' in response.filter.get('keywords', []):
if page_title:
if section_title:
page_title = '<h3>%s</h3>' % page_title
else:
page_title = '<h2 id="info">%s</h2>' % page_title
else:
page_title = ''
body = '\n'.join((section_title, page_title, body))
if hasattr(response, 'breadcrumb') and response.breadcrumb:
if len(response.breadcrumb) == 1:
response.breadcrumb = None

View File

@ -200,9 +200,9 @@ def test_form_and_category_same_slug2():
assert resp.location == 'http://example.net/test/foobar/'
resp = resp.follow()
assert resp.form
assert '<h3>foobar</h3>' in resp
assert '<h1>foobar</h1>' in resp
# check we get to the test form
resp = get_app(pub).get('/test/')
assert resp.form
assert '<h3>test</h3>' in resp
assert '<h1>test</h1>' in resp