0001-misc-update-card-related-labels-37510.patch
tests/test_admin_pages.py | ||
---|---|---|
5372 | 5372 |
create_superuser(pub) |
5373 | 5373 |
app = login(get_app(pub)) |
5374 | 5374 |
resp = app.get('/backoffice/cards/') |
5375 |
resp = resp.click('New Card') |
|
5375 |
resp = resp.click('New Card Model')
|
|
5376 | 5376 |
resp.form['name'] = 'card title' |
5377 | 5377 |
resp = resp.form.submit() |
5378 | 5378 |
assert resp.location == 'http://example.net/backoffice/cards/1/' |
... | ... | |
5399 | 5399 |
create_superuser(pub) |
5400 | 5400 |
app = login(get_app(pub)) |
5401 | 5401 |
resp = app.get('/backoffice/cards/') |
5402 |
resp = resp.click('New Card') |
|
5402 |
resp = resp.click('New Card Model')
|
|
5403 | 5403 |
resp.form['name'] = 'card title' |
5404 | 5404 |
resp = resp.form.submit() |
5405 | 5405 |
resp = resp.follow() |
tests/test_backoffice_pages.py | ||
---|---|---|
5070 | 5070 |
user = create_user(pub) |
5071 | 5071 |
app = login(get_app(pub)) |
5072 | 5072 |
resp = app.get('/backoffice/') |
5073 |
assert not 'Cards Data' in resp.body
|
|
5073 |
assert not 'Cards' in resp.body |
|
5074 | 5074 |
carddef = CardDef() |
5075 | 5075 |
carddef.name = 'foo' |
5076 | 5076 |
carddef.fields = [ |
... | ... | |
5079 | 5079 |
carddef.store() |
5080 | 5080 | |
5081 | 5081 |
resp = app.get('/backoffice/') |
5082 |
assert not 'Cards Data' in resp.body
|
|
5082 |
assert not 'Cards' in resp.body |
|
5083 | 5083 | |
5084 | 5084 |
carddef.backoffice_submission_roles = user.roles |
5085 | 5085 |
carddef.store() |
5086 | 5086 |
resp = app.get('/backoffice/') |
5087 |
assert 'Cards Data' in resp.body
|
|
5087 |
assert 'Cards' in resp.body |
|
5088 | 5088 | |
5089 | 5089 |
carddef.backoffice_submission_roles = None |
5090 | 5090 |
carddef.workflow_roles = {'_editor': user.roles[0]} |
5091 | 5091 |
carddef.store() |
5092 | 5092 |
resp = app.get('/backoffice/') |
5093 |
assert 'Cards Data' in resp.body
|
|
5093 |
assert 'Cards' in resp.body |
|
5094 | 5094 | |
5095 | 5095 |
resp = app.get('/backoffice/data/') |
5096 | 5096 |
resp = resp.click('foo') |
wcs/admin/settings.py | ||
---|---|---|
559 | 559 |
permission_keys = [] |
560 | 560 |
admin_sections = [ |
561 | 561 |
('forms', N_('Forms')), |
562 |
('carddefs', N_('Cards')), |
|
562 |
('carddefs', N_('Card Models')),
|
|
563 | 563 |
('workflows', N_('Workflows')), |
564 | 564 |
('users', N_('Users')), |
565 | 565 |
('roles', N_('Roles')), |
... | ... | |
865 | 865 |
form = Form(enctype="multipart/form-data") |
866 | 866 |
form.add(CheckboxWidget, 'formdefs', title = _('Forms'), value = True) |
867 | 867 |
if StudioDirectory.is_visible(): |
868 |
form.add(CheckboxWidget, 'carddefs', title=_('Cards'), value=True) |
|
868 |
form.add(CheckboxWidget, 'carddefs', title=_('Card Models'), value=True)
|
|
869 | 869 |
form.add(CheckboxWidget, 'workflows', title = _('Workflows'), value = True) |
870 | 870 |
if not get_cfg('sp', {}).get('idp-manage-roles'): |
871 | 871 |
form.add(CheckboxWidget, 'roles', title = _('Roles'), value = True) |
wcs/backoffice/cards.py | ||
---|---|---|
44 | 44 |
formdef_ui_class = CardDefUI |
45 | 45 |
formdef_default_workflow = '_carddef_default' |
46 | 46 | |
47 |
delete_message = N_('You are about to irrevocably delete this card.') |
|
48 |
delete_title = N_('Deleting Card:') |
|
47 |
delete_message = N_('You are about to irrevocably delete this card model.')
|
|
48 |
delete_title = N_('Deleting Card Model:')
|
|
49 | 49 |
overwrite_message = N_( |
50 |
'You can replace this card by uploading a file ' |
|
50 |
'You can replace this card model by uploading a file '
|
|
51 | 51 |
'or by pointing to a form URL.') |
52 | 52 |
overwrite_success_message = N_( |
53 |
'The card has been successfully overwritten. ' |
|
53 |
'The card model has been successfully overwritten. '
|
|
54 | 54 |
'Do note it kept its existing address and role and workflow parameters.') |
55 | 55 | |
56 | 56 |
def html_top(self, title): |
... | ... | |
206 | 206 |
formdef_page_class = CardDefPage |
207 | 207 |
formdef_ui_class = CardDefUI |
208 | 208 | |
209 |
import_title = N_('Import Card') |
|
210 |
import_submit_label = N_('Import Card') |
|
209 |
import_title = N_('Import Card Model')
|
|
210 |
import_submit_label = N_('Import Card Model')
|
|
211 | 211 |
import_paragraph = N_( |
212 |
'You can install a new card by uploading a file ' |
|
213 |
'or by pointing to the card URL.') |
|
214 |
import_loading_error_message = N_('Error loading card (%s).') |
|
212 |
'You can install a new card model by uploading a file '
|
|
213 |
'or by pointing to the card model URL.')
|
|
214 |
import_loading_error_message = N_('Error loading card model (%s).')
|
|
215 | 215 |
import_success_message = N_( |
216 |
'This card has been successfully imported. ') |
|
216 |
'This card model has been successfully imported. ')
|
|
217 | 217 |
import_error_message = N_( |
218 |
'Imported card contained errors and has been automatically fixed, ' |
|
218 |
'Imported card model contained errors and has been automatically fixed, '
|
|
219 | 219 |
'you should nevertheless check everything is ok. ') |
220 | 220 | |
221 | 221 |
def html_top(self, title): |
222 | 222 |
return html_top('cards', title) |
223 | 223 | |
224 | 224 |
def _q_index(self): |
225 |
get_response().breadcrumb.append(('cards/', _('Cards'))) |
|
226 |
self.html_top(title=_('Cards')) |
|
225 |
get_response().breadcrumb.append(('cards/', _('Card Models')))
|
|
226 |
self.html_top(title=_('Card Models'))
|
|
227 | 227 |
r = TemplateIO(html=True) |
228 | 228 | |
229 | 229 |
r += htmltext('<div id="appbar">') |
230 |
r += htmltext('<h2>%s</h2>') % _('Cards') |
|
230 |
r += htmltext('<h2>%s</h2>') % _('Card Models')
|
|
231 | 231 |
r += htmltext('<span class="actions">') |
232 | 232 |
r += htmltext('<a href="import" rel="popup">%s</a>') % _('Import') |
233 |
r += htmltext('<a class="new-item" href="new" rel="popup">%s</a>') % _('New Card') |
|
233 |
r += htmltext('<a class="new-item" href="new" rel="popup">%s</a>') % _('New Card Model')
|
|
234 | 234 |
r += htmltext('</span>') |
235 | 235 |
r += htmltext('</div>') |
236 | 236 | |
... | ... | |
239 | 239 |
return r.getvalue() |
240 | 240 | |
241 | 241 |
def new(self): |
242 |
get_response().breadcrumb.append(('cards/', _('Cards'))) |
|
242 |
get_response().breadcrumb.append(('cards/', _('Card Models')))
|
|
243 | 243 |
get_response().breadcrumb.append(('new', _('New'))) |
244 | 244 |
formdefui = self.formdef_ui_class(None) |
245 | 245 |
form = formdefui.new_form_ui() |
... | ... | |
256 | 256 |
else: |
257 | 257 |
return redirect(str(formdef.id) + '/') |
258 | 258 | |
259 |
self.html_top(title=_('New Card')) |
|
259 |
self.html_top(title=_('New Card Model'))
|
|
260 | 260 |
r = TemplateIO(html=True) |
261 |
r += htmltext('<h2>%s</h2>') % _('New Card') |
|
261 |
r += htmltext('<h2>%s</h2>') % _('New Card Model')
|
|
262 | 262 |
r += form.render() |
263 | 263 |
return r.getvalue() |
264 | 264 | |
... | ... | |
270 | 270 |
return response |
271 | 271 | |
272 | 272 |
def _q_lookup(self, component): |
273 |
get_response().breadcrumb.append(('cards/', _('Cards'))) |
|
273 |
get_response().breadcrumb.append(('cards/', _('Card Models')))
|
|
274 | 274 |
return self.formdef_page_class(component) |
wcs/backoffice/data_management.py | ||
---|---|---|
29 | 29 |
_q_exports = [''] |
30 | 30 | |
31 | 31 |
def _q_traverse(self, path): |
32 |
get_response().breadcrumb.append(('data/', _('Cards Data')))
|
|
32 |
get_response().breadcrumb.append(('data/', _('Cards'))) |
|
33 | 33 |
return super(ManagementDirectory, self)._q_traverse(path) |
34 | 34 | |
35 | 35 |
def is_accessible(self, user): |
... | ... | |
45 | 45 |
return False |
46 | 46 | |
47 | 47 |
def _q_index(self): |
48 |
html_top('data_management', _('Data'))
|
|
48 |
html_top('data_management', _('Cards'))
|
|
49 | 49 |
formdefs = CardDef.select(order_by='name', ignore_errors=True, lightweight=True) |
50 | 50 |
if len(formdefs) == 0: |
51 | 51 |
return self.empty_site_message(_('Cards')) |
wcs/backoffice/root.py | ||
---|---|---|
62 | 62 |
menu_items = [ |
63 | 63 |
('submission/', N_('Submission')), |
64 | 64 |
('management/', N_('Management')), |
65 |
('data/', N_('Cards Data'), {'check_display_function': studio.is_visible}),
|
|
65 |
('data/', N_('Cards'), {'check_display_function': studio.is_visible}), |
|
66 | 66 |
('studio/', N_('Studio'), {'check_display_function': studio.is_visible}), |
67 | 67 |
('forms/', N_('Forms Workshop'), {'sub': True}), |
68 |
('cards/', N_('Cards'), {'sub': True, 'check_display_function': studio.is_visible}), |
|
68 |
('cards/', N_('Card Models'), {'sub': True, 'check_display_function': studio.is_visible}),
|
|
69 | 69 |
('workflows/', N_('Workflows Workshop'), {'sub': True}), |
70 | 70 |
('users/', N_('Users'), {'check_display_function': roles.is_visible}), |
71 | 71 |
('roles/', N_('Roles'), {'check_display_function': roles.is_visible}), |
... | ... | |
273 | 273 |
if slug == 'forms': |
274 | 274 |
label = misc.site_encode(pgettext('studio', 'Forms')) |
275 | 275 |
elif slug == 'cards': |
276 |
label = misc.site_encode(pgettext('studio', 'Cards')) |
|
276 |
label = misc.site_encode(pgettext('studio', 'Card Models'))
|
|
277 | 277 |
elif slug == 'workflows': |
278 | 278 |
label = misc.site_encode(pgettext('studio', 'Workflows')) |
279 | 279 |
menu_items.append({ |
280 |
- |