cards: don't display status on summary (#55494)
gitea-wip/wcs/pipeline/head Build started... Details
gitea/wcs/pipeline/head Something is wrong with the build of this commit Details

This commit is contained in:
Lauréline Guérin 2021-07-16 16:14:15 +02:00
parent f6c363e959
commit 26074a7b8f
No known key found for this signature in database
GPG Key ID: 1FAB9B9B4F93D473
4 changed files with 10 additions and 2 deletions

View File

@ -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()

View File

@ -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'}

View File

@ -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):

View File

@ -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()