diff --git a/hypha/apply/dashboard/templates/dashboard/community_dashboard.html b/hypha/apply/dashboard/templates/dashboard/community_dashboard.html index ee32db164a..2ecf340942 100644 --- a/hypha/apply/dashboard/templates/dashboard/community_dashboard.html +++ b/hypha/apply/dashboard/templates/dashboard/community_dashboard.html @@ -57,57 +57,35 @@

{% endif %} -
-

- {% trans "Your active submissions" %} -

- {% for submission in my_submissions %} -
-
-
-
-

- - {{ submission.title }} - #{{ submission.application_id }} - -

-

- {% trans "Submitted" %}: {{ submission.submit_time.date }} {% trans "by" %} {{ submission.user.get_full_name }} -

+ {% if my_submissions_exists %} +
+

{% trans "My submissions" %}

+
+ - - {% status_bar submission.workflow submission.phase request.user css_class="status-bar--small" %} + {% endfor %}
- {% empty %} - {% trans "No active submissions" %} - {% endfor %} -
+ + {% endif %} - {% if my_inactive_submissions.data %} -
+ {% if historical_submissions.count %} +

{% trans "Submission history" %}

- {% render_table my_inactive_submissions %} +
+ {% render_table historical_submissions.table %} +
{% endif %} - {% endblock %} diff --git a/hypha/apply/dashboard/templates/dashboard/reviewer_dashboard.html b/hypha/apply/dashboard/templates/dashboard/reviewer_dashboard.html index 957d82dac2..cb72c64888 100644 --- a/hypha/apply/dashboard/templates/dashboard/reviewer_dashboard.html +++ b/hypha/apply/dashboard/templates/dashboard/reviewer_dashboard.html @@ -55,40 +55,34 @@

{% endif %} - {% if my_submissions %} + {% if my_submissions_exists %}
-

- {% trans "Your active submissions" %} -

- {% for submission in my_submissions %} -
-
-
-
{{ submission.title }}
-
{% trans "Submitted" %}: {{ submission.submit_time.date }} {% trans "by" %} {{ submission.user.get_full_name }}
+

{% trans "My submissions" %}

+
+
+ {% for dummy_item in per_section_items %} +
+
- {% status_bar submission.workflow submission.phase request.user css_class="status-bar--small" %} -
- {% if request.user|has_edit_perm:submission %} - - {% if submission.status == 'draft_proposal' %} - {% trans "Start your" %} {{ submission.stage }} {% trans "application" %} - {% else %} - {% trans "Edit" %} - {% endif %} - - {% endif %} + {% endfor %}
- {% endfor %} +
{% endif %} - {% if my_inactive_submissions.data %} -
+ {% if historical_submissions.count %} +

{% trans "Submission history" %}

- {% render_table my_inactive_submissions %} +
+ {% render_table historical_submissions.table %} +
{% endif %} diff --git a/hypha/apply/dashboard/views.py b/hypha/apply/dashboard/views.py index 563bd33620..8d4e7e9bf1 100644 --- a/hypha/apply/dashboard/views.py +++ b/hypha/apply/dashboard/views.py @@ -39,31 +39,6 @@ def get_preview_context(queryset, limit=5): } -class MySubmissionContextMixin: - def get_context_data(self, **kwargs): - submissions = ApplicationSubmission.objects.all().for_table(self.request.user) - my_submissions = ( - submissions.filter(user=self.request.user) - .active() - .current() - .select_related("draft_revision") - ) - my_submissions = [submission.from_draft() for submission in my_submissions] - - my_inactive_submissions = ( - submissions.filter(user=self.request.user).inactive().current() - ) - my_inactive_submissions_table = ReviewerSubmissionsTable( - my_inactive_submissions, prefix="my-submissions-" - ) - - return super().get_context_data( - my_submissions=my_submissions, - my_inactive_submissions=my_inactive_submissions_table, - **kwargs, - ) - - class MyFlaggedMixin: def my_flagged(self, submissions): return get_preview_context( @@ -94,6 +69,22 @@ def paf_for_review(self): } +class HistoricalSubmissionMixin: + def historical_submission_data(self): + historical_submissions = list( + ApplicationSubmission.objects.filter( + user=self.request.user, + ) + .inactive() + .current() + .for_table(self.request.user) + ) + return { + "count": len(historical_submissions), + "table": SubmissionsTable(data=historical_submissions), + } + + class AdminDashboardView(PAFReviewMixin, MyFlaggedMixin, TemplateView): template_name = "dashboard/staff_dashboard.html" paf_reviewer_role = "is_apply_staff" @@ -233,7 +224,7 @@ def invoices_to_convert(self): } -class ReviewerDashboardView(MyFlaggedMixin, MySubmissionContextMixin, TemplateView): +class ReviewerDashboardView(HistoricalSubmissionMixin, MyFlaggedMixin, TemplateView): template_name = "dashboard/reviewer_dashboard.html" def get(self, request, *args, **kwargs): @@ -268,6 +259,10 @@ def get_context_data(self, **kwargs): context.update( { + "my_submissions_exists": ApplicationSubmission.objects.filter( + Q(user=self.request.user) | Q(co_applicants__user=self.request.user) + ).exists(), + "historical_submissions": self.historical_submission_data(), "awaiting_reviews": self.awaiting_reviews(submissions), "my_reviewed": get_preview_context( submissions.reviewed_by(self.request.user).order_by("-submit_time") @@ -353,7 +348,7 @@ def projects_in_contracting(self): } -class CommunityDashboardView(MySubmissionContextMixin, TemplateView): +class CommunityDashboardView(HistoricalSubmissionMixin, TemplateView): template_name = "dashboard/community_dashboard.html" def get_context_data(self, **kwargs): @@ -366,6 +361,10 @@ def get_context_data(self, **kwargs): ) context.update( { + "my_submissions_exists": ApplicationSubmission.objects.filter( + Q(user=self.request.user) | Q(co_applicants__user=self.request.user) + ).exists(), + "historical_submissions": self.historical_submission_data(), "my_community_review": my_community_review_table, "my_community_review_count": my_community_review_qs.count(), "my_reviewed": get_preview_context( @@ -387,7 +386,7 @@ def my_community_review(self, user, submissions): return my_community_review, my_community_review_table -class ApplicantDashboardView(TemplateView): +class ApplicantDashboardView(HistoricalSubmissionMixin, TemplateView): template_name = "dashboard/applicant_dashboard.html" def get_context_data(self, **kwargs): @@ -434,20 +433,6 @@ def historical_project_data(self): ), } - def historical_submission_data(self): - historical_submissions = list( - ApplicationSubmission.objects.filter( - user=self.request.user, - ) - .inactive() - .current() - .for_table(self.request.user) - ) - return { - "count": len(historical_submissions), - "table": SubmissionsTable(data=historical_submissions), - } - class DashboardView(ViewDispatcher): admin_view = AdminDashboardView diff --git a/hypha/apply/funds/templates/funds/applicationsubmission_detail.html b/hypha/apply/funds/templates/funds/applicationsubmission_detail.html index 1149290e39..a0e7a52dc4 100644 --- a/hypha/apply/funds/templates/funds/applicationsubmission_detail.html +++ b/hypha/apply/funds/templates/funds/applicationsubmission_detail.html @@ -56,7 +56,7 @@ {% block content %}
-
+
{% if request.user|has_edit_perm:object and object.status == 'draft_proposal' and not request.user.is_apply_staff %}

{% trans "Congratulations!" %}

{% blocktrans with stage=object.previous.stage %}Your {{ stage }} application has been accepted.{% endblocktrans %}
@@ -147,7 +147,7 @@
{% blocktrans with stage=object.previous.stage %}Your {{ stage }} applicatio
{% endif %} - +
-{% endblock %} +{% endblock content %} diff --git a/hypha/apply/projects/templates/application_projects/project_detail.html b/hypha/apply/projects/templates/application_projects/project_detail.html index ea42ad7c03..1429d9bef0 100644 --- a/hypha/apply/projects/templates/application_projects/project_detail.html +++ b/hypha/apply/projects/templates/application_projects/project_detail.html @@ -36,9 +36,8 @@ {% block content %} -
- - {% block notifications %} +
+
{% show_closing_banner object as show_banner %} {% if show_banner %}
@@ -46,11 +45,9 @@ {% blocktrans with status=project_status %} This project is in {{ status }} state. {% endblocktrans %}
{% endif %} - {% endblock %} -
-
+

{% trans "Project Information" %}

@@ -62,7 +59,7 @@

> {% include "application_projects/partials/project_information.html" %} -

+ {% project_can_have_invoices object as can_have_invoices %} {% user_can_view_invoices object user as can_view_invoices %} @@ -87,110 +84,107 @@

{% include "application_projects/includes/project_documents.html" %} {% endif %}

+
- {% block sidebar %} -
+ {% endif %} + + {% if request.user.is_apply_staff %} + {% block admin_assignments %}{% endblock %} + {% endif %} + {% display_coapplicant_section user object as coapplicant_section %} + {% if coapplicant_section %} + {% block co_applicant %} +
+ {% endblock %} + {% endif %} +
{% endblock content %} diff --git a/hypha/static_src/sass/components/_wrapper.scss b/hypha/static_src/sass/components/_wrapper.scss deleted file mode 100644 index 231c3414f4..0000000000 --- a/hypha/static_src/sass/components/_wrapper.scss +++ /dev/null @@ -1,36 +0,0 @@ -@use "../abstracts/mixins"; - -.wrapper { - width: 100%; - - &--sidebar { - display: flex; - flex-direction: column; - gap: 1.5rem; - - @include mixins.media-query(md) { - flex-direction: row; - - > div:last-child { - flex-basis: 210px; - } - } - } - - &--status-bar-outer { - padding: 20px 0; - background-color: var(--color-base-100); - border-block-end: 3px solid var(--color-base-200); - } - - &--status-bar-inner { - display: flex; - flex-wrap: wrap; - justify-content: space-between; - margin-block-end: 20px; - - @include mixins.media-query(md) { - margin-block-end: 0; - } - } -} diff --git a/hypha/static_src/sass/main.scss b/hypha/static_src/sass/main.scss index 1aec8adfe7..070659e333 100644 --- a/hypha/static_src/sass/main.scss +++ b/hypha/static_src/sass/main.scss @@ -4,7 +4,6 @@ @use "components/reviews-sidebar"; @use "components/sidebar"; @use "components/two-factor"; -@use "components/wrapper"; // Custom overrides @use "custom/custom";