Projet

Général

Profil

0001-backoffice-don-t-use-a-popup-for-card-templates-opti.patch

Frédéric Péters, 24 janvier 2021 18:25

Télécharger (2,33 ko)

Voir les différences:

Subject: [PATCH] backoffice: don't use a popup for card templates option
 (#50481)

 tests/admin_pages/test_card.py | 1 +
 wcs/backoffice/cards.py        | 7 ++++---
 2 files changed, 5 insertions(+), 3 deletions(-)
tests/admin_pages/test_card.py
204 204
    resp = app.get('/backoffice/cards/1/')
205 205

  
206 206
    assert_option_display(resp, 'Templates', 'None')
207
    assert resp.pyquery('[href="options/templates"]').attr.rel == ''  # no popup
207 208
    resp = resp.click('Templates')
208 209
    resp.form['digest_template'] = 'X{{form_var_test}}Y'
209 210
    resp = resp.form.submit()
wcs/backoffice/cards.py
81 81
        r += utils.last_modification_block(obj=self.formdef)
82 82
        r += get_session().display_message()
83 83

  
84
        def add_option_line(link, label, current_value):
84
        def add_option_line(link, label, current_value, popup=True):
85 85
            return htmltext(
86
                    '<li><a rel="popup" href="%(link)s">'
86
                    '<li><a rel="%(popup)s" href="%(link)s">'
87 87
                    '<span class="label">%(label)s</span> '
88 88
                    '<span class="value">%(current_value)s</span>'
89 89
                    '</a></li>' % {
90
                              'popup': 'popup' if popup else '',
90 91
                              'link': link,
91 92
                              'label': label,
92 93
                              'current_value': current_value})
......
170 171
        else:
171 172
            digest_template_status = C_('template|None')
172 173
        r += add_option_line('options/templates',
173
                _('Templates'), digest_template_status)
174
                _('Templates'), digest_template_status, popup=False)
174 175
        if self.formdef.user_support == 'optional':
175 176
            user_support_status = C_('user_support|Optional')
176 177
        else:
177
-