From f0ca4ae005fa13662b26dadddf2397ccfe5128b3 Mon Sep 17 00:00:00 2001 From: Saurabh Kumar Date: Mon, 9 Sep 2024 18:37:49 +0530 Subject: [PATCH] New submission table view (#4080) Changes - [x] Replaces the old view with new table view, that is powered by the filtering and rendering logic build for the new list view. - [x] removes round detail view and round export, reuse the submission all page. - [x] Add rounds/labs menu to primary nav, makes it easy to list and view status of different rounds, for staff. - [x] Update my flags view on the dashboard page. - [x] Implement `SUBMISSION_LIST_EXCLUDE_FIELDS` on both list and table view (in progress) - [x] Expose old table view at an accessible url --------- Co-authored-by: Fredrik Jonsson --- .../templates/dashboard/includes/flagged.html | 6 +- .../submissions-waiting-for-review.html | 4 +- .../dashboard/reviewer_dashboard.html | 20 +- .../templates/dashboard/staff_dashboard.html | 21 +- hypha/apply/dashboard/views.py | 8 +- hypha/apply/funds/models/applications.py | 7 + hypha/apply/funds/permissions.py | 6 +- hypha/apply/funds/tables.py | 14 +- .../funds/applicationsubmission_detail.html | 4 +- .../funds/includes/round-block-listing.html | 12 +- .../templates/funds/includes/round-block.html | 61 +++-- .../funds/includes/submission-list-item.html | 169 ------------ .../funds/includes/submission-list-row.html | 196 ++++++++++++++ .../funds/includes/submission-table-row.html | 167 ++++++++++++ .../funds/templates/funds/submissions.html | 7 +- .../funds/templates/submissions/all.html | 245 +++++++++++------- .../submissions/partials/meta-terms-card.html | 2 +- .../partials/submissions-inline.html | 52 ++++ .../submissions/submenu/category.html | 12 +- .../templates/submissions/submenu/funds.html | 12 +- .../templates/submissions/submenu/leads.html | 8 +- .../submissions/submenu/meta-terms.html | 12 +- .../submissions/submenu/reviewers.html | 12 +- .../templates/submissions/submenu/rounds.html | 12 +- .../funds/tests/views/test_batch_progress.py | 2 +- .../funds/tests/views/test_batch_reviewers.py | 2 +- hypha/apply/funds/tests/views/test_rounds.py | 60 ----- hypha/apply/funds/urls.py | 36 ++- hypha/apply/funds/views.py | 63 ----- hypha/apply/funds/views_beta.py | 8 +- hypha/apply/funds/workflow.py | 8 +- .../application_projects/project_detail.html | 21 +- hypha/core/context_processors.py | 1 + hypha/core/navigation.py | 7 +- .../core/templates/components/admin_bar.html | 2 +- .../templates/components/dropdown-menu.html | 4 +- hypha/templates/includes/user_menu.html | 2 +- 37 files changed, 754 insertions(+), 531 deletions(-) delete mode 100644 hypha/apply/funds/templates/funds/includes/submission-list-item.html create mode 100644 hypha/apply/funds/templates/funds/includes/submission-list-row.html create mode 100644 hypha/apply/funds/templates/funds/includes/submission-table-row.html create mode 100644 hypha/apply/funds/templates/submissions/partials/submissions-inline.html diff --git a/hypha/apply/dashboard/templates/dashboard/includes/flagged.html b/hypha/apply/dashboard/templates/dashboard/includes/flagged.html index 0f7c4c68f6..c49ca29bfd 100644 --- a/hypha/apply/dashboard/templates/dashboard/includes/flagged.html +++ b/hypha/apply/dashboard/templates/dashboard/includes/flagged.html @@ -5,13 +5,13 @@

{% trans "Your flagged submissions" %}

-{% if my_flagged.data %} +{% if my_flagged.table.data %} - {% render_table my_flagged %} + {% render_table my_flagged.table %} {% if display_more %} {% endif %} {% endif %} diff --git a/hypha/apply/dashboard/templates/dashboard/includes/submissions-waiting-for-review.html b/hypha/apply/dashboard/templates/dashboard/includes/submissions-waiting-for-review.html index 06fdedc1f1..8acb370b95 100644 --- a/hypha/apply/dashboard/templates/dashboard/includes/submissions-waiting-for-review.html +++ b/hypha/apply/dashboard/templates/dashboard/includes/submissions-waiting-for-review.html @@ -6,7 +6,9 @@

{% if my_review.data %} - {% render_table my_review %} + + {% include "submissions/partials/submissions-inline.html" with submissions=my_review.data row_layout="table" %} + {% comment %} {% render_table my_review %} {% endcomment %} {% if display_more %}
diff --git a/hypha/apply/dashboard/templates/dashboard/reviewer_dashboard.html b/hypha/apply/dashboard/templates/dashboard/reviewer_dashboard.html index 5825aaccd6..c4312c5b36 100644 --- a/hypha/apply/dashboard/templates/dashboard/reviewer_dashboard.html +++ b/hypha/apply/dashboard/templates/dashboard/reviewer_dashboard.html @@ -20,19 +20,29 @@ {% include "dashboard/includes/submissions-waiting-for-review.html" with in_review_count=awaiting_reviews.count my_review=awaiting_reviews.table display_more=awaiting_reviews.display_more active_statuses_filter=awaiting_reviews.active_statuses_filter %}
- {% if my_flagged.table.data %} + {% if my_flagged.submissions %}
- {% include "dashboard/includes/flagged.html" with my_flagged=my_flagged.table display_more=my_flagged.display_more %} +

+ Your flagged submissions ({{ my_flagged.count }}) +

+ + {% include "submissions/partials/submissions-inline.html" with submissions=my_flagged.submissions row_layout="table" %} + + {% if my_flagged.display_more %} +
+ Show All +
+ {% endif %}
{% endif %} {% if my_reviewed.table.data %}
+

Your previous reviews

- {% trans "Your previous reviews" as review_heading %} - {% render_table my_reviewed.table %} + {% include "submissions/partials/submissions-inline.html" with submissions=my_reviewed.table.data row_layout="table" %} - diff --git a/hypha/apply/dashboard/templates/dashboard/staff_dashboard.html b/hypha/apply/dashboard/templates/dashboard/staff_dashboard.html index dea8429e57..51f8840b99 100644 --- a/hypha/apply/dashboard/templates/dashboard/staff_dashboard.html +++ b/hypha/apply/dashboard/templates/dashboard/staff_dashboard.html @@ -71,9 +71,19 @@ {% include "dashboard/includes/submissions-waiting-for-review.html" with in_review_count=awaiting_reviews.count my_review=awaiting_reviews.table display_more=awaiting_reviews.display_more active_statuses_filter=awaiting_reviews.active_statuses_filter %}
- {% if my_flagged.table.data %} + {% if my_flagged.submissions %}
- {% include "dashboard/includes/flagged.html" with my_flagged=my_flagged.table display_more=my_flagged.display_more %} +

+ Your flagged submissions ({{ my_flagged.count }}) +

+ + {% include "submissions/partials/submissions-inline.html" with submissions=my_flagged.submissions row_layout="table" %} + + {% if my_flagged.display_more %} +
+ Show All +
+ {% endif %}
{% endif %} @@ -83,14 +93,17 @@ {% if PROJECTS_ENABLED and paf_for_review.count %}
-

{% trans "PAFs for review" %}

+

{% trans "PAFs for review" %}

{% render_table paf_for_review.table %}
{% endif %} {% if PROJECTS_ENABLED and projects.table.data %}
- {% trans "Your projects" as project_heading %} +

+ {% trans "Your projects" %} +

+ {% render_table projects.table %}
diff --git a/hypha/apply/dashboard/views.py b/hypha/apply/dashboard/views.py index e7cd57efe3..53fcb0d66f 100644 --- a/hypha/apply/dashboard/views.py +++ b/hypha/apply/dashboard/views.py @@ -17,7 +17,6 @@ SubmissionReviewerFilterAndSearch, SubmissionsTable, SummarySubmissionsTableWithRole, - UserFlaggedSubmissionsTable, review_filter_for_user, ) from hypha.apply.projects.filters import ProjectListFilter @@ -65,10 +64,8 @@ def my_flagged(self, submissions): limit = 5 return { - "table": UserFlaggedSubmissionsTable( - submissions[:limit], - prefix="my-flagged-", - ), + "submissions": submissions[:limit], + "count": submissions.count(), "display_more": submissions.count() > limit, } @@ -197,6 +194,7 @@ def rounds(self): .order_by("-end_date") .by_lead(self.request.user) ) + return { "closed": rounds.closed()[:limit], "open": rounds.open()[:limit], diff --git a/hypha/apply/funds/models/applications.py b/hypha/apply/funds/models/applications.py index 5900d2075f..e60eba0f54 100644 --- a/hypha/apply/funds/models/applications.py +++ b/hypha/apply/funds/models/applications.py @@ -24,6 +24,7 @@ from django.http import Http404 from django.shortcuts import redirect, render from django.template.response import TemplateResponse +from django.urls import reverse from django.utils.decorators import method_decorator from django.utils.functional import cached_property from django.utils.safestring import mark_safe @@ -834,6 +835,12 @@ def __eq__(self, other): objects = RoundsAndLabsManager() + def get_absolute_url(self): + params = f"fund={self.pk}" + if self.fund: + params = f"round={self.pk}" + return f'{reverse("apply:submissions:list")}?{params}' + def save(self, *args, **kwargs): raise NotImplementedError("Do not save through this model") diff --git a/hypha/apply/funds/permissions.py b/hypha/apply/funds/permissions.py index 90bd8d8318..cd12ba1737 100644 --- a/hypha/apply/funds/permissions.py +++ b/hypha/apply/funds/permissions.py @@ -127,7 +127,7 @@ def can_change_external_reviewers(user, submission) -> bool: return False -def can_access_drafts(user): +def can_access_drafts(user) -> bool: if user.is_apply_staff and settings.SUBMISSIONS_DRAFT_ACCESS_STAFF: return True if user.is_apply_staff_admin and settings.SUBMISSIONS_DRAFT_ACCESS_STAFF_ADMIN: @@ -135,7 +135,7 @@ def can_access_drafts(user): return False -def can_export_submissions(user): +def can_export_submissions(user) -> bool: if user.is_apply_staff and settings.SUBMISSIONS_EXPORT_ACCESS_STAFF: return True if user.is_apply_staff_admin and settings.SUBMISSIONS_EXPORT_ACCESS_STAFF_ADMIN: @@ -166,7 +166,7 @@ def can_view_submission_screening(user, submission): submission_view, _ = is_user_has_access_to_view_submission(user, submission) if not submission_view: return False, "No access to view submission" - if user.is_applicant: + if submission.user == user: return False, "Applicant cannot view submission screening" return True, "" diff --git a/hypha/apply/funds/tables.py b/hypha/apply/funds/tables.py index 6500b16b4c..26e23e6b63 100644 --- a/hypha/apply/funds/tables.py +++ b/hypha/apply/funds/tables.py @@ -247,14 +247,6 @@ def render_role_icon(self, value): return "" -class UserFlaggedSubmissionsTable(SummarySubmissionsTable): - class Meta(SummarySubmissionsTable.Meta): - row_attrs = dict( - {"data-flag-type": "user"}, **SummarySubmissionsTable._meta.row_attrs - ) - attrs = {"class": "all-submissions-table flagged-table"} - - def get_used_rounds(request): return Round.objects.filter(submissions__isnull=False).distinct() @@ -509,11 +501,9 @@ class SubmissionReviewerFilterAndSearch(SubmissionDashboardFilter): class RoundsTable(tables.Table): - title = tables.LinkColumn( - "funds:rounds:detail", - args=[A("pk")], + title = tables.Column( + linkify=lambda record: record.get_absolute_url(), orderable=True, - text=lambda record: record.title, ) fund = tables.Column(accessor=A("specific__fund")) lead = tables.Column() diff --git a/hypha/apply/funds/templates/funds/applicationsubmission_detail.html b/hypha/apply/funds/templates/funds/applicationsubmission_detail.html index 7f7a134f83..b495af2147 100644 --- a/hypha/apply/funds/templates/funds/applicationsubmission_detail.html +++ b/hypha/apply/funds/templates/funds/applicationsubmission_detail.html @@ -16,7 +16,7 @@ {% if request.GET.ref == 'all-alt' %} {% trans "Back to submissions" %} @@ -29,7 +29,7 @@

{{ object.title }} {% if request.user.is_apply_staff %} {{ object.round }} {% else %} diff --git a/hypha/apply/funds/templates/funds/includes/round-block-listing.html b/hypha/apply/funds/templates/funds/includes/round-block-listing.html index 8897e973a5..0b6f01ef9d 100644 --- a/hypha/apply/funds/templates/funds/includes/round-block-listing.html +++ b/hypha/apply/funds/templates/funds/includes/round-block-listing.html @@ -4,8 +4,11 @@ {% for round in rounds %} {% if forloop.counter0 < 5 %}
  • - {{ round }} -

    {{ round.fund|default_if_none:"-" }}

    + {{ round }} +

    + {{ round.fund|default_if_none:"-" }}

    {% if round.end_date %} {{ display_text }} {{ round.end_date|date:"SHORT_DATE_FORMAT" }} @@ -20,9 +23,10 @@ {{ round.progress }}% {% trans 'Determined' %} ({{ round.closed_submissions }}/{{ round.total_submissions }}) {% endif %}

    - {% trans 'View' %} + {% trans 'View' %} + {% if can_export %} - {% trans 'Export' %} + {% trans 'Export' %} {% endif %}
  • {% else %} diff --git a/hypha/apply/funds/templates/funds/includes/round-block.html b/hypha/apply/funds/templates/funds/includes/round-block.html index 318e7d2bbb..c72fdc44c4 100644 --- a/hypha/apply/funds/templates/funds/includes/round-block.html +++ b/hypha/apply/funds/templates/funds/includes/round-block.html @@ -4,36 +4,41 @@ x-init="activeTab = window.location.hash && ['#open-rounds', '#closed-rounds'].includes(window.location.hash) ? window.location.hash.substring(1) : activeTab" >
    -

    {{ title }}

    - -
    +

    + {{ title }} +

    + + {# Open rounds/labs tab #} -
    - {% if page_type == 'dashboard' %} - {% include "funds/includes/no_round_block_dashboard.html" with rounds=open_rounds display_text="Open until" query=open_query type="Open" %} - {% else %} - {% include "funds/includes/round-block-listing.html" with can_export=can_export rounds=open_rounds display_text="Open until" query=open_query type="Open" %} - {% endif %} -
    +
    + {% if page_type == 'dashboard' %} + {% include "funds/includes/no_round_block_dashboard.html" with rounds=open_rounds display_text="Open until" query=open_query type="Open" %} + {% else %} + {% include "funds/includes/round-block-listing.html" with can_export=can_export rounds=open_rounds display_text="Open until" query=open_query type="Open" %} + {% endif %} +
    {# Closed rounds/labs tab #} -
    - {% if page_type == 'dashboard' %} - {% include "funds/includes/no_round_block_dashboard.html" with rounds=closed_rounds display_text="Closed" query=closed_query type="Closed" %} - {% else %} - {% include "funds/includes/round-block-listing.html" with rounds=closed_rounds display_text="Closed" query=closed_query type="Closed" %} - {% endif %} -
    +
    + {% if page_type == 'dashboard' %} + {% include "funds/includes/no_round_block_dashboard.html" with rounds=closed_rounds display_text="Closed" query=closed_query type="Closed" %} + {% else %} + {% include "funds/includes/round-block-listing.html" with rounds=closed_rounds display_text="Closed" query=closed_query type="Closed" %} + {% endif %} +

    diff --git a/hypha/apply/funds/templates/funds/includes/submission-list-item.html b/hypha/apply/funds/templates/funds/includes/submission-list-item.html deleted file mode 100644 index 555cd8f51f..0000000000 --- a/hypha/apply/funds/templates/funds/includes/submission-list-item.html +++ /dev/null @@ -1,169 +0,0 @@ -{% load i18n querystrings %} -{% load heroicons %} - -
    - - {% comment %} Select {% endcomment %} - - - {% comment %} Screening, and Archived icons {% endcomment %} - - {% if s.is_archive %} - {% trans "Archived Submission" as text_archived %} - {% heroicon_outline "lock-closed" aria_hidden="true" size=21 class="inline stroke-red-800 stroke-1.5 -mt-1 align-text-bottom" data_tippy_placement='right' data_tippy_content=text_archived data_tippy_delay=200 %} - {% trans "Archived" %} - {% elif s.get_current_screening_status %} - {% if s.get_yes_screening_status %} - {% heroicon_mini "hand-thumb-up" aria_hidden="true" size=21 class="inline fill-green-400 stroke-1.5 -mt-1 align-text-bottom" data_tippy_placement='right' data_tippy_content=s.get_current_screening_status data_tippy_delay=200 %} - {% else %} - {% heroicon_mini "hand-thumb-down" aria_hidden="true" size=21 class="inline fill-red-400 stroke-1.5 -mt-1 align-text-bottom" data_tippy_placement='right' data_tippy_content=s.get_current_screening_status data_tippy_delay=200 %} - {% endif %} - {% else %} - {% heroicon_outline "question-mark-circle" aria_hidden="true" size=21 class="inline stroke-slate-300 stroke-1.5 -mt-1 align-text-bottom" data_tippy_placement='right' data_tippy_content="Awaiting Screening" data_tippy_delay=200 %} - {% endif %} - - - {% comment %} Title {% endcomment %} -
    - - {{ s.form_data.title }} - - {{ s.phase.display_name }} - - {% for meta_term in s.get_assigned_meta_terms %} - {{meta_term.name}} - {% endfor %} - - - -
    -

    - #{{ s.public_id|default:s.id }} - submitted {{ s.submit_time|date:"SHORT_DATE_FORMAT" }} - by {{ s.user }} • {{ s.stage }} • - - {% heroicon_outline "briefcase" aria_hidden="true" size=15 class="stroke-1.5 inline align-text-bottom" %} - {{ s.page }} - - {% if s.round %} - {% heroicon_mini "arrow-small-right" aria_hidden="true" size=15 class="stroke-1.5 inline align-text-bottom" %} - {{ s.round }} - {% endif %} -

    -
    -
    - - {% comment %} Other items {% endcomment %} -
    - {% comment %} Lead {% endcomment %} - -
    - {% heroicon_outline "user-circle" aria_hidden="true" size=16 class="stroke-1.5 inline-block me-1" %} - {{ s.lead }} -
    -
    - - {% comment %} Reviews {% endcomment %} - -
    - - {% comment %} pre-loading animation {% endcomment %} - - - - -
    -
    - - {% comment %} Comment Count {% endcomment %} - - {% if s.comment_count %} - - {% heroicon_outline "chat-bubble-left" aria_hidden="true" size=16 class="stroke-2 me-1 inline-block group-hover:stroke-light-blue" %} - {{ s.comment_count }} - - {% endif %} - -
    -
    diff --git a/hypha/apply/funds/templates/funds/includes/submission-list-row.html b/hypha/apply/funds/templates/funds/includes/submission-list-row.html new file mode 100644 index 0000000000..0ce179265b --- /dev/null +++ b/hypha/apply/funds/templates/funds/includes/submission-list-row.html @@ -0,0 +1,196 @@ +{% load i18n querystrings %} +{% load heroicons %} + +
    + + {% comment %} Select {% endcomment %} + {% if enable_selection %} + + {% endif %} + + {% comment %} Screening, and Archived icons {% endcomment %} + + {% if s.is_archive %} + {% trans "Archived Submission" as text_archived %} + {% heroicon_outline "lock-closed" aria_hidden="true" size=21 class="inline stroke-red-800 stroke-1.5 -mt-1 align-text-bottom" data_tippy_placement='right' data_tippy_content=text_archived data_tippy_delay=200 %} + {% trans "Archived" %} + {% elif s.get_current_screening_status %} + {% if s.get_yes_screening_status %} + {% heroicon_mini "hand-thumb-up" aria_hidden="true" size=21 class="inline fill-green-400 stroke-1.5 -mt-1 align-text-bottom" data_tippy_placement='right' data_tippy_content=s.get_current_screening_status data_tippy_delay=200 %} + {% else %} + {% heroicon_mini "hand-thumb-down" aria_hidden="true" size=21 class="inline fill-red-400 stroke-1.5 -mt-1 align-text-bottom" data_tippy_placement='right' data_tippy_content=s.get_current_screening_status data_tippy_delay=200 %} + {% endif %} + {% else %} + {% heroicon_outline "question-mark-circle" aria_hidden="true" size=21 class="inline stroke-slate-300 stroke-1.5 -mt-1 align-text-bottom" data_tippy_placement='right' data_tippy_content="Awaiting Screening" data_tippy_delay=200 %} + {% endif %} + + + {% comment %} Title {% endcomment %} +
    + + {{ s.form_data.title }} + + {{ s.phase.display_name }} + + {% if "meta_terms" not in SUBMISSIONS_TABLE_EXCLUDED_FIELDS %} + {% for meta_term in s.get_assigned_meta_terms %} + {{meta_term.name}} + {% endfor %} + {% endif %} + + + +
    +

    + #{{ s.public_id|default:s.id }} + submitted {{ s.submit_time|date:"SHORT_DATE_FORMAT" }} + by {{ s.user }} • {{ s.stage }} • + + + {% if 'round' not in SUBMISSIONS_TABLE_EXCLUDED_FIELDS %} + {% if s.round %} + {% heroicon_outline "briefcase" aria_hidden="true" size=15 class="stroke-1.5 inline align-text-bottom me-1" %} + {{ s.round }} + + {% if 'fund' not in SUBMISSIONS_TABLE_EXCLUDED_FIELDS %} + ({{ s.page }}) + {% endif %} + {% else %} + {% comment %} Render lab {% endcomment %} + {% heroicon_outline "briefcase" aria_hidden="true" size=15 class="stroke-1.5 inline align-text-bottom" %} + + {{ s.page }} + {% endif %} + {% endif %} +

    +
    +
    + + {% comment %} Other items {% endcomment %} +
    + {% if 'lead' not in SUBMISSIONS_TABLE_EXCLUDED_FIELDS %} + {% comment %} Lead {% endcomment %} + +
    + {% comment %} Lead: {% endcomment %} + {% heroicon_micro "user-circle" aria_hidden="true" size=16 class="fill-fg-muted" %} + + {{ s.lead }} + +
    +
    + {% endif %} + + {% if 'reviews' not in SUBMISSIONS_TABLE_EXCLUDED_FIELDS %} + {% comment %} Reviews {% endcomment %} + +
    + + {% comment %} pre-loading animation {% endcomment %} + + + + +
    +
    + {% endif %} + + {% comment %} Comment Count {% endcomment %} + + {% if s.comment_count %} + + {% heroicon_outline "chat-bubble-left" aria_hidden="true" size=16 class="inline-block stroke-2 me-1 group-hover:stroke-light-blue" %} + {{ s.comment_count }} + + {% endif %} + +
    +
    diff --git a/hypha/apply/funds/templates/funds/includes/submission-table-row.html b/hypha/apply/funds/templates/funds/includes/submission-table-row.html new file mode 100644 index 0000000000..5554662ba6 --- /dev/null +++ b/hypha/apply/funds/templates/funds/includes/submission-table-row.html @@ -0,0 +1,167 @@ +{% load i18n querystrings %} +{% load heroicons %} + + + {% if enable_selection %} + + + + + {% endif %} + + +
    + {% if s.is_archive %} + {% trans "Archived Submission" as text_archived %} + {% heroicon_outline "lock-closed" aria_hidden="true" size=21 class="inline stroke-red-800 stroke-1.5 -mt-1 align-text-bottom" data_tippy_placement='right' data_tippy_content=text_archived data_tippy_delay=200 %} + {% trans "Archived" %} + {% elif s.get_current_screening_status %} + {% if s.get_yes_screening_status %} + {% heroicon_mini "hand-thumb-up" aria_hidden="true" size=21 class="inline fill-green-400 stroke-1.5 -mt-1 align-text-bottom" data_tippy_placement='right' data_tippy_content=s.get_current_screening_status data_tippy_delay=200 %} + {% else %} + {% heroicon_mini "hand-thumb-down" aria_hidden="true" size=21 class="inline fill-red-400 stroke-1.5 -mt-1 align-text-bottom" data_tippy_placement='right' data_tippy_content=s.get_current_screening_status data_tippy_delay=200 %} + {% endif %} + {% else %} + {% heroicon_outline "question-mark-circle" aria_hidden="true" size=21 class="inline stroke-slate-300 stroke-1.5 -mt-1 align-text-bottom" data_tippy_placement='right' data_tippy_content="Awaiting Screening" data_tippy_delay=200 %} + {% endif %} +
    + + + + + {{ s.form_data.title }} +
    + #{{ s.public_id|default:s.id }} + submitted {{ s.submit_time|date:"SHORT_DATE_FORMAT" }} + • {{ s.stage }} +
    + + + + {{ s.phase.display_name }} + + + + + {{ s.user }} + + {% if 'organization_name' not in SUBMISSIONS_TABLE_EXCLUDED_FIELDS and s.form_data.organization_name %} + / {{ s.form_data.organization_name }} + {% endif %} + + + {% if "round" not in SUBMISSIONS_TABLE_EXCLUDED_FIELDS %} + + + {% if s.round %} + {{ s.round }} + {% if 'fund' not in SUBMISSIONS_TABLE_EXCLUDED_FIELDS %} + / {{ s.page }} + {% endif %} + {% else %} + + {{ s.page }} + + {% endif %} + + {% endif %} + + {% if not 'lead' in SUBMISSIONS_TABLE_EXCLUDED_FIELDS %} + + {{ s.lead }} + + {% endif %} + +
    + {% if 'reviews' not in SUBMISSIONS_TABLE_EXCLUDED_FIELDS %} + {% comment %} Reviews {% endcomment %} + +
    + + {% comment %} pre-loading animation {% endcomment %} + + + + +
    +
    + {% endif %} + {% if s.comment_count %} + + {% heroicon_outline "chat-bubble-left" aria_hidden="true" size=16 class="inline-block stroke-2 me-1 group-hover:stroke-light-blue" %} + {{ s.comment_count }} + + {% endif %} +
    + + diff --git a/hypha/apply/funds/templates/funds/submissions.html b/hypha/apply/funds/templates/funds/submissions.html index 945b02c92e..ef41590025 100644 --- a/hypha/apply/funds/templates/funds/submissions.html +++ b/hypha/apply/funds/templates/funds/submissions.html @@ -10,12 +10,15 @@ {% slot header %} {% trans "All Submissions" %} ({{ table.rows|length }}) {% endslot %} - {% slot sub_heading %}{% trans "Search and filter all submissions" %}{% endslot %} + {% slot sub_heading %} + {% trans "Search and filter all submissions" %} • + Switch to new table view + {% endslot %} {% slot buttons %} {% heroicon_mini "queue-list" aria_hidden="true" size=16 class="inline align-text-bottom" %} {% trans "List view" %} diff --git a/hypha/apply/funds/templates/submissions/all.html b/hypha/apply/funds/templates/submissions/all.html index d4faa0336e..b44397f2d4 100644 --- a/hypha/apply/funds/templates/submissions/all.html +++ b/hypha/apply/funds/templates/submissions/all.html @@ -11,28 +11,43 @@ {% slot header %} {% trans "All Submissions" %} ({{ page.paginator.count }}) {% endslot %} - {% slot sub_heading %}{% trans "Search and filter all submissions" %}{% endslot %} + + {% slot sub_heading %} + {% trans "Search and filter all submissions" %} • + Switch to old table view + {% endslot %} {% slot buttons %} - - {% heroicon_mini "table-cells" aria_hidden="true" size=16 class="inline align-text-bottom" %} - {% trans "Table view" %} + {% if request.GET.format == 'list' %} + + {% heroicon_mini "table-cells" aria_hidden="true" size=16 class="inline align-text-bottom" %} + {% trans "Table view" %} + + {% else %} + + {% heroicon_mini "queue-list" aria_hidden="true" size=16 class="inline align-text-bottom" %} + {% trans "List View" %} + + {% endif %} {% endslot %} {% endadminbar %} -
    + {% for key, value in request.GET.items %} - {% if key != 'archived' %}{% endif %} + {% if key != 'archived' and key != 'drafts' %}{% endif %} {% endfor %} {% dropdown_menu title="Filters" heading="Filter submissions" %} - + {% heroicon_mini "magnifying-glass" size=20 class="text-fg-muted" %}
    - {% trans "Archived" %} + {% trans "Archived" %} + + + {% endif %} + + {% if can_access_drafts %} + + {% endif %} + {% if can_export_submissions %} {% heroicon_mini "x-mark" aria_hidden="true" fill="currentColor" %} {% trans "Remove all filters" %} {% if selected_statuses %} - + status:{% for s in selected_statuses %}{{ s }}{% endfor %} {% heroicon_mini "x-mark" aria_hidden="true" fill="currentColor" %} @@ -161,7 +197,7 @@ {% endif %} {% if selected_fund_objects %} - + fund:{% for s in selected_fund_objects %}"{{ s }}"{% endfor %} {% heroicon_mini "x-mark" aria_hidden="true" fill="currentColor" %} @@ -170,7 +206,7 @@ {% endif %} {% if selected_round_objects %} - + round:{% for s in selected_round_objects %}"{{ s }}"{% endfor %} {% heroicon_mini "x-mark" aria_hidden="true" fill="currentColor" %} @@ -179,7 +215,7 @@ {% endif %} {% if selected_leads %} - + Lead:{% for s in selected_leads %}{{ s }}{% endfor %} {% heroicon_mini "x-mark" aria_hidden="true" fill="currentColor" %} @@ -188,7 +224,7 @@ {% endif %} {% if selected_applicants %} - + Applicant:{% for s in selected_applicants %}{{ s }}{% endfor %} {% heroicon_mini "x-mark" aria_hidden="true" fill="currentColor" %} @@ -197,7 +233,7 @@ {% endif %} {% for s in selected_reviewers %} - + Reviewer:{{ s }} {% heroicon_mini "x-mark" aria_hidden="true" fill="currentColor" %} @@ -206,7 +242,7 @@ {% endfor %} {% for s in selected_meta_terms %} - + Meta Term:{{ s }} {% heroicon_mini "x-mark" aria_hidden="true" fill="currentColor" %} @@ -215,7 +251,7 @@ {% endfor %} {% for s in selected_category_options %} - + Category:{{ s.value }} {% heroicon_mini "x-mark" aria_hidden="true" fill="currentColor" %} @@ -224,7 +260,7 @@ {% endfor %} {% for s in selected_screening_statuses_objects %} - + screening:"{{ s.title }}" {% heroicon_mini "x-mark" aria_hidden="true" fill="currentColor" %} @@ -233,7 +269,7 @@ {% endfor %} {% if selected_sort %} - + sort:{{ selected_sort }} {% heroicon_mini "x-mark" aria_hidden="true" fill="currentColor" %} @@ -244,52 +280,54 @@ {% endif %} +
    -
    {% endspaceless %}{% endblock content %} + {% block extra_js %} {% endblock %} diff --git a/hypha/apply/funds/templates/submissions/partials/meta-terms-card.html b/hypha/apply/funds/templates/submissions/partials/meta-terms-card.html index 180360bb4e..e329d9a573 100644 --- a/hypha/apply/funds/templates/submissions/partials/meta-terms-card.html +++ b/hypha/apply/funds/templates/submissions/partials/meta-terms-card.html @@ -33,7 +33,7 @@

    {{ group.gro {% for meta_term in group.list %} + {% if row_layout != "list" %} +
    + + + + {% if enable_selection %}{% endif %} + + + + + + {% if "round" not in SUBMISSIONS_TABLE_EXCLUDED_FIELDS %} + + {% endif %} + + {% if 'lead' not in SUBMISSIONS_TABLE_EXCLUDED_FIELDS %} + + {% endif %} + + + + + {% for s in submissions %} + {% include "funds/includes/submission-table-row.html" with s=s enable_selection=enable_selection %} + {% endfor %} + +
    + Title + Status + Applicant + {% if 'organization_name' not in SUBMISSIONS_TABLE_EXCLUDED_FIELDS %} + / Organization + {% endif %} + RoundLead + {% if 'reviews' not in SUBMISSIONS_TABLE_EXCLUDED_FIELDS %}Reviews /{% endif %}
    Comments +
    +
    + {% else %} + {% for s in submissions %} + {% include "funds/includes/submission-list-row.html" with s=s enable_selection=enable_selection %} + {% endfor %} + {% endif %} + diff --git a/hypha/apply/funds/templates/submissions/submenu/category.html b/hypha/apply/funds/templates/submissions/submenu/category.html index 4835568d8b..f690e1e570 100644 --- a/hypha/apply/funds/templates/submissions/submenu/category.html +++ b/hypha/apply/funds/templates/submissions/submenu/category.html @@ -4,8 +4,8 @@ data-filter-list> {% if selected_category_options %}
  • - {% trans "All Categories" %} @@ -16,12 +16,12 @@
  • {% if selected_funds %}
  • - {% trans "All Funds & Labs" %} @@ -16,11 +16,11 @@
  • diff --git a/hypha/apply/funds/templates/submissions/submenu/leads.html b/hypha/apply/funds/templates/submissions/submenu/leads.html index 6e2ccbb4e5..26ded0c4e1 100644 --- a/hypha/apply/funds/templates/submissions/submenu/leads.html +++ b/hypha/apply/funds/templates/submissions/submenu/leads.html @@ -3,8 +3,8 @@