misc: remove code that was used by old theming (#71998)

This commit is contained in:
Frédéric Péters 2022-12-04 15:10:55 +01:00
parent fd36f89b23
commit cb4c30bcae
1 changed files with 0 additions and 44 deletions

View File

@ -1,11 +1,4 @@
from quixote import get_request, get_publisher, get_response
from qommon.publisher import get_publisher_class
from quixote.html import htmltext
from wcs.qommon import _, N_
from wcs.qommon import template
from wcs.qommon.admin.texts import TextsDirectory
from wcs.categories import Category
wcs_get_decorate_vars = template.get_decorate_vars
@ -22,41 +15,4 @@ def get_decorate_vars(body, response, generate_breadcrumb=True, template_context
return wcs_get_decorate_vars(body, response, generate_breadcrumb)
def render_response(publisher, body):
response = get_response()
if isinstance(body, template.QommonTemplateResponse):
body = template.render(body.templates, body.context)
body = str(body)
root_url = publisher.get_root_url()
wcs_path = publisher.get_request().get_path()[len(root_url) :]
section = wcs_path.split('/')[0]
if section in ('backoffice', 'admin'):
return template.decorate(body, response)
section_title = ''
page_title = response.filter.get('title')
if 'error-page' in response.filter:
pass
elif section == 'consultations':
section_title = '<h2 id="consultations">%s</h2>\n' % _('Consultations')
response.filter['bigdiv'] = 'rub_consultation'
elif section and len(section) > 1:
# XXX: this works but is not efficient
if Category.has_urlname(section):
section_title = '<h2 id="services">%s</h2>\n' % _('Services')
response.filter['bigdiv'] = 'rub_service'
if hasattr(response, 'breadcrumb') and response.breadcrumb:
if len(response.breadcrumb) == 1:
response.breadcrumb = None
return template.decorate(body, response)
template.get_decorate_vars = get_decorate_vars
get_publisher_class().render_response = render_response
TextsDirectory.register('aq-error-assistance', N_('Assistance text next to errors'))