backoffice: don't use a popup for form/card templates option (#50437)

This commit is contained in:
Frédéric Péters 2021-01-22 14:07:43 +01:00
parent ee5c8246e7
commit e365347d2e
2 changed files with 9 additions and 3 deletions

View File

@ -834,6 +834,7 @@ def test_form_templates(pub):
resp = app.get('/backoffice/forms/1/')
assert_option_display(resp, 'Templates', 'None')
assert resp.pyquery('[href="options/templates"]').attr.rel == '' # no popup
resp = resp.click('Templates')
resp.form['digest_template'] = 'X{{form_var_test}}Y'
resp = resp.form.submit()

View File

@ -378,6 +378,10 @@ class OptionsDirectory(Directory):
return False
def _q_traverse(self, path):
get_response().breadcrumb.append((path[0] + '/', self.formdef.name))
return super()._q_traverse(path)
class WorkflowRoleDirectory(Directory):
def __init__(self, formdef):
@ -481,12 +485,13 @@ class FormDefPage(Directory):
r += utils.last_modification_block(obj=self.formdef)
r += get_session().display_message()
def add_option_line(link, label, current_value):
def add_option_line(link, label, current_value, popup=True):
return htmltext(
'<li><a rel="popup" href="%(link)s">'
'<li><a rel="%(popup)s" href="%(link)s">'
'<span class="label">%(label)s</span> '
'<span class="value">%(current_value)s</span>'
'</a></li>' % {
'popup': 'popup' if popup else '',
'link': link,
'label': label,
'current_value': current_value})
@ -621,7 +626,7 @@ class FormDefPage(Directory):
else:
digest_template_status = C_('template|None')
r += add_option_line('options/templates',
_('Templates'), digest_template_status)
_('Templates'), digest_template_status, popup=False)
online_status = C_('online status|Active')
if self.formdef.disabled: