backoffice: include page numbers in list of fields (#15426)

This commit is contained in:
Frédéric Péters 2017-05-16 15:37:15 +02:00 committed by Thomas NOEL
parent 4c3c150f2b
commit 70da7d2ac4
2 changed files with 7 additions and 2 deletions

View File

@ -1049,6 +1049,7 @@ def test_form_edit_page_field(pub):
resp = resp.forms[0].submit()
assert resp.location == 'http://example.net/backoffice/forms/1/fields/'
resp = resp.follow()
assert 'Page #1' in resp.body
assert 'foobar' in resp.body
assert 'Use drag and drop' in resp.body

View File

@ -246,9 +246,13 @@ class FieldsDirectory(Directory):
r += htmltext('<p class="commands">')
r += command_icon('%s/' % field.id, 'edit')
else:
r += htmltext('<strong class="label" id="label%s">%s</strong>') % (field.id, field.label)
r += htmltext('<strong class="label" id="label%s">' % field.id)
if field.type == 'page':
r += htmltext('<span class="page-no">%s</span> ') % _('Page #%s:') % current_page_no
r += htmltext('%s</strong>') % field.label
r += htmltext('<p class="details">')
r += htmltext('<span class="type">%s</span>') % _(type_label)
if field.type != 'page':
r += htmltext('<span class="type">%s</span>') % _(type_label)
if hasattr(field, str('required')):
if field.required:
required = ''