cards: don't display status on summary (#55494)
This commit is contained in:
parent
f6c363e959
commit
26074a7b8f
|
@ -3862,6 +3862,7 @@ def test_backoffice_resume_folded(pub):
|
|||
# first access: summary is not folded
|
||||
resp = app.get('/backoffice/management/form-title/%s/' % number31.id)
|
||||
assert '<div class="section foldable" id="summary">' in resp.text
|
||||
assert 'field status' in resp.text
|
||||
# do something: summary is folded
|
||||
resp = resp.form.submit('button_commentable')
|
||||
resp = resp.follow()
|
||||
|
|
|
@ -115,6 +115,7 @@ def test_carddata_management(pub):
|
|||
resp = resp.follow()
|
||||
assert 'Edit Card' in resp.text
|
||||
assert 'Delete Card' in resp.text
|
||||
assert 'field status' not in resp.text
|
||||
|
||||
carddata = carddef.data_class().select()[0]
|
||||
assert carddata.data == {'1': 'ok', '2': 'blah'}
|
||||
|
|
|
@ -345,6 +345,9 @@ class CardBackOfficeStatusPage(FormBackOfficeStatusPage):
|
|||
def should_fold_history(self):
|
||||
return True
|
||||
|
||||
def should_show_status(self):
|
||||
return False
|
||||
|
||||
|
||||
class ImportFromCsvAfterJob(AfterJob):
|
||||
def __init__(self, carddef, data_lines):
|
||||
|
|
|
@ -436,7 +436,10 @@ class FormStatusPage(Directory, FormTemplateMixin):
|
|||
def should_fold_history(self):
|
||||
return False
|
||||
|
||||
def receipt(self, always_include_user=False, show_status=True, form_url='', mine=True):
|
||||
def should_show_status(self):
|
||||
return True
|
||||
|
||||
def receipt(self, always_include_user=False, form_url='', mine=True):
|
||||
request_user = user = get_request().user
|
||||
if not always_include_user and get_request().user and get_request().user.id == self.filled.user_id:
|
||||
user = None
|
||||
|
@ -461,7 +464,7 @@ class FormStatusPage(Directory, FormTemplateMixin):
|
|||
|
||||
r += self.display_fields(form_url=form_url)
|
||||
|
||||
if show_status and self.formdef.is_user_allowed_read_status_and_history(
|
||||
if self.should_show_status() and self.formdef.is_user_allowed_read_status_and_history(
|
||||
get_request().user, self.filled
|
||||
):
|
||||
wf_status = self.filled.get_visible_status()
|
||||
|
|
Loading…
Reference in New Issue