Projet

Général

Profil

0001-backoffice-update-to-new-appbar-markup-25983.patch

Frédéric Péters, 31 août 2018 10:01

Télécharger (10,1 ko)

Voir les différences:

Subject: [PATCH] backoffice: update to new appbar markup (#25983)

 wcs/admin/categories.py      |  4 ++++
 wcs/admin/data_sources.py    |  4 ++++
 wcs/admin/forms.py           |  2 ++
 wcs/admin/roles.py           |  4 ++++
 wcs/admin/users.py           |  4 ++++
 wcs/admin/workflows.py       |  2 ++
 wcs/admin/wscalls.py         |  4 ++++
 wcs/backoffice/management.py | 12 ++++++++++--
 8 files changed, 34 insertions(+), 2 deletions(-)
wcs/admin/categories.py
74 74

  
75 75
        r += htmltext('<div id="appbar">')
76 76
        r += htmltext('<h2>%s</h2>') % self.category.name
77
        r += htmltext('<span class="actions">')
77 78
        r += htmltext('<a href="delete" rel="popup">%s</a>') % _('Delete')
78 79
        r += htmltext('<a href="edit">%s</a>') % _('Edit')
80
        r += htmltext('</span>')
79 81
        r += htmltext('</div>')
80 82

  
81 83
        if self.category.description:
......
175 177

  
176 178
        r += htmltext('<div id="appbar">')
177 179
        r += htmltext('<h2>%s</h2>') % _('Categories')
180
        r += htmltext('<span class="actions">')
178 181
        r += htmltext('<a class="new-item" href="new" rel="popup">%s</a>') % _('New Category')
182
        r += htmltext('</span>')
179 183
        r += htmltext('</div>')
180 184
        r += htmltext('<div class="explanation bo-block"><p>%s</p></div>') % \
181 185
                _('Categories are used to sort the different forms.')
wcs/admin/data_sources.py
95 95
        r += htmltext('<h2>%s - ') % _('Data Source')
96 96
        r += self.datasource.name
97 97
        r += htmltext('</h2>')
98
        r += htmltext('<span class="actions">')
98 99
        r += htmltext('<a href="delete" rel="popup">%s</a>') % _('Delete')
99 100
        r += htmltext('<a href="edit">%s</a>') % _('Edit')
101
        r += htmltext('</span>')
100 102
        r += htmltext('</div>')
101 103

  
102 104
        if self.datasource.description:
......
213 215

  
214 216
        r += htmltext('<div id="appbar">')
215 217
        r += htmltext('<h2>%s</h2>') % _('Data Sources')
218
        r += htmltext('<span class="actions">')
216 219
        r += htmltext('<a class="new-item" href="new">%s</a>') % _('New Data Source')
220
        r += htmltext('</span>')
217 221
        r += htmltext('</div>')
218 222
        r += htmltext('<ul class="biglist" id="datasource-list">')
219 223
        datasources = NamedDataSource.select(order_by='name')
wcs/admin/forms.py
1458 1458
        r += htmltext('<div id="appbar">')
1459 1459
        r += htmltext('<h2>%s</h2>') % _('Forms')
1460 1460
        if has_roles:
1461
            r += htmltext('<span class="actions">')
1461 1462
            r += htmltext('<a href="data-sources/">%s</a>') % _('Data sources')
1462 1463
            r += htmltext('<a href="import" rel="popup">%s</a>') % _('Import')
1463 1464
            r += htmltext('<a class="new-item" href="new" rel="popup">%s</a>') % _('New Form')
1465
            r += htmltext('</span>')
1464 1466
        r += htmltext('</div>')
1465 1467

  
1466 1468
        if not has_roles:
wcs/admin/roles.py
88 88
        r = TemplateIO(html=True)
89 89
        r += htmltext('<div id="appbar">')
90 90
        r += htmltext('<h2>%s</h2>') % self.role.name
91
        r += htmltext('<span class="actions">')
91 92
        r += htmltext('<a href="delete" rel="popup">%s</a>') % _('Delete')
92 93
        r += htmltext('<a href="edit">%s</a>') % _('Edit')
94
        r += htmltext('</span>')
93 95
        r += htmltext('</div>')
94 96

  
95 97
        if self.role.details or self.role.emails:
......
204 206

  
205 207
        r += htmltext('<div id="appbar">')
206 208
        r += htmltext('<h2>%s</h2>') % _('Roles')
209
        r += htmltext('<span class="actions">')
207 210
        r += htmltext('<a class="new-item" rel="popup" href="new">%s</a>') % _('New Role')
211
        r += htmltext('</span>')
208 212
        r += htmltext('</div>')
209 213

  
210 214
        r += htmltext('<div class="explanation bo-block">')
wcs/admin/users.py
118 118
        r = TemplateIO(html=True)
119 119
        r += htmltext('<div id="appbar">')
120 120
        r += htmltext('<h2>%s</h2>') % self.user.display_name
121
        r += htmltext('<span class="actions">')
121 122
        r += self.get_actions()
123
        r += htmltext('</span>')
122 124
        r += htmltext('</div>')
123 125
        users_cfg = get_cfg('users', {})
124 126

  
......
397 399
            # the possibility to create users, as only the roles field would
398 400
            # be shown, and the creation would fail on missing fields.
399 401
            if not is_idp_managing_user_attributes():
402
                r2 += htmltext('<span class="actions">')
400 403
                r2 += htmltext('<a class="new-item" href="new">%s</a>') % _('New User')
404
                r2 += htmltext('</span>')
401 405
            get_response().filter['sidebar'] = self.get_sidebar(offset, limit)
402 406

  
403 407
        r2 += htmltext('</div>')
wcs/admin/workflows.py
1781 1781

  
1782 1782
        r += htmltext('<div id="appbar">')
1783 1783
        r += htmltext('<h2>%s</h2>') % _('Workflows')
1784
        r += htmltext('<span class="actions">')
1784 1785
        r += htmltext('<a href="data-sources/">%s</a>') % _('Data sources')
1785 1786
        r += htmltext('<a href="import" rel="popup">%s</a>') % _('Import')
1786 1787
        r += htmltext('<a class="new-item" rel="popup" href="new">%s</a>') % _('New Workflow')
1788
        r += htmltext('</span>')
1787 1789
        r += htmltext('</div>')
1788 1790
        r += htmltext('<ul class="biglist">')
1789 1791
        workflows_in_use = set(['_default'])
wcs/admin/wscalls.py
97 97
        r += htmltext('<h2>%s - ') % _('Webservice Call')
98 98
        r += self.wscall.name
99 99
        r += htmltext('</h2>')
100
        r += htmltext('<span class="actions">')
100 101
        r += htmltext('<a href="delete" rel="popup">%s</a>') % _('Delete')
101 102
        r += htmltext('<a href="edit">%s</a>') % _('Edit')
103
        r += htmltext('</span>')
102 104
        r += htmltext('</div>')
103 105

  
104 106
        if self.wscall.description:
......
192 194

  
193 195
        r += htmltext('<div id="appbar">')
194 196
        r += htmltext('<h2>%s</h2>') % _('Webservice Calls')
197
        r += htmltext('<span class="actions">')
195 198
        r += htmltext('<a class="new-item" href="new">%s</a>') % _('New webservice call')
199
        r += htmltext('</span>')
196 200
        r += htmltext('</div>')
197 201
        r += htmltext('<ul class="biglist" id="wscall-list">')
198 202
        wscalls = NamedWsCall.select(order_by='name')
wcs/backoffice/management.py
495 495
                    append_form_entry(formdef)
496 496

  
497 497
        if forms_with_pending_stuff:
498
            r += htmltext('<div class="bo-block" id="forms-in-your-care">')
498
            r += htmltext('<div id="appbar">')
499 499
            r += htmltext('<h2>%s</h2>') % _('Forms in your care')
500
            r += htmltext('</div>')
501
            r += htmltext('<div class="bo-block" id="forms-in-your-care">')
500 502
            r += self.display_forms(forms_with_pending_stuff)
501 503
            r += htmltext('</div>')
502 504

  
503 505
        if forms_without_pending_stuff:
504
            r += htmltext('<div class="bo-block" id="other-forms">')
506
            r += htmltext('<div id="appbar">')
505 507
            r += htmltext('<h2>%s</h2>') % _('Other Forms')
508
            r += htmltext('</div>')
509
            r += htmltext('<div class="bo-block" id="other-forms">')
506 510
            r += self.display_forms(forms_without_pending_stuff)
507 511
            r += htmltext('</div>')
508 512

  
......
910 914
        rt = TemplateIO(html=True)
911 915
        rt += htmltext('<div id="appbar">')
912 916
        rt += htmltext('<h2>%s</h2>') % _('Global View')
917
        rt += htmltext('<span class="actions">')
913 918
        rt += htmltext('<a href="forms">%s</a>') % _('Forms View')
914 919
        for formdef in FormDef.select(lightweight=True):
915 920
            if formdef.geolocations:
916 921
                rt += htmltext(' <a href="map">%s</a>') % _('Map View')
917 922
                break
923
        rt += htmltext('</span>')
918 924
        rt += htmltext('</div>')
919 925
        rt += get_session().display_message()
920 926
        rt += r.getvalue()
......
2198 2204
        r = TemplateIO(html=True)
2199 2205
        r += htmltext('<div id="appbar">')
2200 2206
        r += htmltext('<h2>%s</h2>') % _('Form Inspector')
2207
        r += htmltext('<span class="actions">')
2201 2208
        if get_publisher().get_backoffice_root().is_accessible('forms'):
2202 2209
            r += htmltext(' <a href="../../../forms/%s/">%s</a>') % (
2203 2210
                    self.formdef.id, _('Form Definition'))
2204 2211
        if get_publisher().get_backoffice_root().is_accessible('workflows'):
2205 2212
            r += htmltext(' <a href="../../../workflows/%s/">%s</a>') % (
2206 2213
                    self.formdef.workflow.id, _('Workflow Definition'))
2214
        r += htmltext('</span>')
2207 2215
        r += htmltext('</div>')
2208 2216
        r += htmltext('<ul class="biglist form-inspector">')
2209 2217
        r += htmltext(' <li><h3>%s</h3></li>') % _('Substitution variables')
2210
-