Skip to content
Snippets Groups Projects
Commit 4844afa2 authored by Pete Andrew's avatar Pete Andrew Committed by Fredrik Jonsson
Browse files

Ref 1903: Improve display of screen application primary action

    - Added 'Change' link to 'Screening Status' sidebar block
    - Only display 'Screen application' primary action when application hasn't yet been screened
    - Added test to ensure primary action is displayed correctly for staff
parent d0dda246
No related branches found
No related tags found
No related merge requests found
......@@ -12,7 +12,9 @@
{% endif %}
{% endif %}
<a data-fancybox data-src="#screen-application" class="button button--bottom-space button--primary button--full-width {% if screening_form.should_show %}is-not-disabled{% else %}is-disabled{% endif %}" href="#">Screen application</a>
{% if not object.screening_status %}
<a data-fancybox data-src="#screen-application" class="button button--bottom-space button--primary button--full-width is-not-disabled" href="#">Screen application</a>
{% endif %}
{% if object.ready_for_determination %}
{% include 'determinations/includes/determination_button.html' with submission=object class="button--bottom-space" draft_text="Complete draft determination" %}
......
<div class="sidebar__inner">
<h5>Screening Status</h5>
<p>
{{ object.screening_status|default:"Awaiting Screen status" }}
{{ object.screening_status|default:"Awaiting Screen status" }} <a data-fancybox data-src="#screen-application" class="link link--secondary-change" href="#">Change</a>
</p>
</div>
......@@ -251,6 +251,20 @@ class TestStaffSubmissionView(BaseSubmissionViewTestCase):
assert_add_determination_not_displayed(submission, 'Add determination')
assert_add_determination_not_displayed(submission, 'Complete draft determination')
def test_screen_application_primary_action_is_displayed(self):
# Submission not screened
response = self.get_page(self.submission)
buttons = BeautifulSoup(response.content, 'html5lib').find(class_='sidebar').find_all('a', text='Screen application')
self.assertEqual(len(buttons), 1)
def test_screen_application_primary_action_is_not_displayed(self):
# Submission screened
self.submission.screening_status = ScreeningStatusFactory()
self.submission.save()
response = self.get_page(self.submission)
buttons = BeautifulSoup(response.content, 'html5lib').find(class_='sidebar').find_all('a', text='Screen application')
self.assertEqual(len(buttons), 0)
class TestReviewersUpdateView(BaseSubmissionViewTestCase):
user_factory = StaffFactory
......
......@@ -260,4 +260,9 @@
}
}
}
&--secondary-change {
font-size: 95%;
margin-left: 5px;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment