diff --git a/hypha/apply/funds/templates/funds/includes/actions.html b/hypha/apply/funds/templates/funds/includes/actions.html index 3aca979d6edbe386d02ac6d4625dcb9f3975bfb3..56c86171fc96094e80a980704c6e7936c6cfcf18 100644 --- a/hypha/apply/funds/templates/funds/includes/actions.html +++ b/hypha/apply/funds/templates/funds/includes/actions.html @@ -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" %} diff --git a/hypha/apply/funds/templates/funds/includes/screening_status_block.html b/hypha/apply/funds/templates/funds/includes/screening_status_block.html index b0ee680e1c2329d5d708212641cb7b71c238bf61..6026ffa868edaa1b3eaf79ab283711ae911106b6 100644 --- a/hypha/apply/funds/templates/funds/includes/screening_status_block.html +++ b/hypha/apply/funds/templates/funds/includes/screening_status_block.html @@ -1,6 +1,6 @@ <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> diff --git a/hypha/apply/funds/tests/test_views.py b/hypha/apply/funds/tests/test_views.py index 9b3734a115d58011a930aa63426490f989c3640b..e4015cb94083d09e527b2808d363f84e79381626 100644 --- a/hypha/apply/funds/tests/test_views.py +++ b/hypha/apply/funds/tests/test_views.py @@ -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 diff --git a/hypha/static_src/src/sass/apply/components/_link.scss b/hypha/static_src/src/sass/apply/components/_link.scss index 195c1ca543f9b2a72ef2888ba5f1cb489562be2b..934e699534db9650451f4ede28cbec5562718fcc 100644 --- a/hypha/static_src/src/sass/apply/components/_link.scss +++ b/hypha/static_src/src/sass/apply/components/_link.scss @@ -260,4 +260,9 @@ } } } + + &--secondary-change { + font-size: 95%; + margin-left: 5px; + } }