|
2 | 2 |
|
3 | 3 | {% user_can_update_project_reports object user as can_update_project_reports %} |
4 | 4 | {% if can_update_project_reports %} |
5 | | - <div class="wrapper wrapper--outer-space-large"> |
6 | | - <div class="data-block"> |
7 | | - <div class="data-block__header"> |
8 | | - <p class="data-block__title">{% trans "Reports" %}</p> |
9 | | - </div> |
10 | | - <div class="data-block__body"> |
11 | | - {% user_can_update_report_config object user as can_update_report_config %} |
12 | | - {% if can_update_report_config %} |
13 | | - <div class="data-block__card"> |
14 | | - <p class="data-block__card-title">{% trans "Report frequency" %}</p> |
15 | | - <p class="data-block__card-copy">{{ object.report_config.get_frequency_display }}</p> |
16 | | - <p class="data-block__card-copy"> |
17 | | - <a class="data-block__action-link" |
18 | | - href="{% url 'apply:projects:report_frequency_update' pk=object.id %}" |
19 | | - hx-get="{% url 'apply:projects:report_frequency_update' pk=object.id %}" |
20 | | - hx-target="#htmx-modal" |
21 | | - > |
22 | | - {% if object.report_config.disable_reporting %}{% trans "Enable" %}{% else %}{% trans "Change" %}{% endif %} |
23 | | - </a> |
24 | | - </p> |
25 | | - </div> |
26 | | - {% endif %} |
27 | | - <ul class="data-block__list"> |
28 | | - {% for report in object.report_config.past_due_reports %} |
29 | | - {% include "application_projects/includes/report_line.html" with report=report %} |
30 | | - {% endfor %} |
31 | | - {% with next_report=object.report_config.current_due_report %} |
32 | | - {% if next_report %} |
33 | | - {% include "application_projects/includes/report_line.html" with report=next_report current=True %} |
| 5 | + <section class="docs-block wrapper--outer-space-large"> |
| 6 | + <div class="docs-block__header"> |
| 7 | + <h2 class="m-0 text-lg font-semibold"> |
| 8 | + {% trans "Reports" %} |
| 9 | + </h2> |
| 10 | + {% user_can_update_report_config object user as can_update_report_config %} |
| 11 | + {% if can_update_report_config %} |
| 12 | + <p class="m-0 text-fg-muted"> |
| 13 | + {{ object.report_config.get_frequency_display }} · |
| 14 | + <a class="font-semibold" |
| 15 | + href="{% url 'apply:projects:report_frequency_update' pk=object.id %}" |
| 16 | + hx-get="{% url 'apply:projects:report_frequency_update' pk=object.id %}" |
| 17 | + hx-target="#htmx-modal" |
| 18 | + > |
| 19 | + {% if object.report_config.disable_reporting %} |
| 20 | + {% trans "Enable" %} |
| 21 | + {% else %} |
| 22 | + {% trans "Update" %} |
34 | 23 | {% endif %} |
35 | | - {% endwith %} |
36 | | - </ul> |
37 | | - </div> |
| 24 | + </a> |
| 25 | + </p> |
| 26 | + {% endif %} |
38 | 27 | </div> |
39 | | - </div> |
| 28 | + |
| 29 | + <div class="docs-block__inner"> |
| 30 | + <ul class="data-block__list"> |
| 31 | + {% for report in object.report_config.past_due_reports %} |
| 32 | + {% include "application_projects/includes/report_line.html" with report=report %} |
| 33 | + {% endfor %} |
| 34 | + {% with next_report=object.report_config.current_due_report %} |
| 35 | + {% if next_report %} |
| 36 | + {% include "application_projects/includes/report_line.html" with report=next_report current=True %} |
| 37 | + {% endif %} |
| 38 | + {% endwith %} |
| 39 | + </ul> |
| 40 | + </div> |
| 41 | + </section> |
40 | 42 | {% endif %} |
41 | 43 |
|
42 | 44 |
|
43 | | -<div class="wrapper wrapper--outer-space-large"> |
44 | | - <div class="data-block"> |
45 | | - <div class="data-block__header"> |
46 | | - <p class="data-block__title">{% trans "Past reports" %}</p> |
47 | | - </div> |
48 | | - <div class="data-block__body"> |
49 | | - <table class="data-block__table js-past-reports-table"> |
50 | | - <thead> |
51 | | - <tr> |
52 | | - <th class="data-block__table-date">{% trans "Period End" %}</th> |
53 | | - <th class="data-block__table-date">{% trans "Submitted" %}</th> |
54 | | - <th class="data-block__table-update"></th> |
55 | | - </tr> |
56 | | - </thead> |
57 | | - <tbody> |
58 | | - {% for report in object.reports.done %} |
59 | | - <tr {% if forloop.counter > 8 %}class="is-hidden"{% endif %}> |
60 | | - <td class="py-4 px-2.5"> |
61 | | - <span class="data-block__mobile-label">{% trans "Period End" %}: </span>{{ report.end_date }} |
62 | | - </td> |
63 | | - <td class="py-4 px-2.5"> |
64 | | - <span class="data-block__mobile-label">{% trans "Submitted" %}: </span>{{ report.submitted_date|default:"Skipped" }} |
65 | | - </td> |
66 | | - <td class="py-4 px-2.5 data-block__links"> |
67 | | - {% if not report.skipped %} |
68 | | - {% user_can_view_report report user as can_view_report %} |
69 | | - {% if can_view_report %} |
70 | | - <a class="data-block__action-icon-link" href="{% url "apply:projects:reports:detail" pk=report.pk %}"> |
71 | | - {% heroicon_micro "eye" class="inline w-4 h-4 me-1" aria_hidden=true %} |
72 | | - {% trans "View" %} |
73 | | - </a> |
74 | | - {% endif %} |
75 | 45 |
|
76 | | - {% user_can_update_report report user as can_update_report %} |
77 | | - {% if can_update_report %} |
78 | | - <a class="data-block__action-icon-link" href="{% url "apply:projects:reports:edit" pk=report.pk %}"> |
79 | | - {% heroicon_micro "pencil-square" class="inline me-1" aria_hidden=true %} |
80 | | - {% trans "Edit" %} |
81 | | - </a> |
82 | | - {% endif %} |
83 | | - {% else %} |
84 | | - {% if can_update_project_reports %} |
85 | | - <button type="button" class="btn data-block__action-link" hx-post="{% url "apply:projects:reports:skip" pk=report.pk %}">{% trans "Unskip" %}</button> |
86 | | - {% endif %} |
| 46 | +<section class="docs-block wrapper--outer-space-large"> |
| 47 | + <h2 class="m-0 text-lg font-semibold docs-block__header"> |
| 48 | + {% trans "Past reports" %} |
| 49 | + </h2> |
| 50 | + <div class="docs-block__inner"> |
| 51 | + <table class="data-block__table js-past-reports-table"> |
| 52 | + <thead> |
| 53 | + <tr> |
| 54 | + <th class="data-block__table-date">{% trans "Period End" %}</th> |
| 55 | + <th class="data-block__table-date">{% trans "Submitted" %}</th> |
| 56 | + <th class="data-block__table-update"></th> |
| 57 | + </tr> |
| 58 | + </thead> |
| 59 | + <tbody> |
| 60 | + {% for report in object.reports.done %} |
| 61 | + <tr {% if forloop.counter > 8 %}class="is-hidden"{% endif %}> |
| 62 | + <td class="py-4 px-2.5"> |
| 63 | + <span class="data-block__mobile-label">{% trans "Period End" %}: </span>{{ report.end_date }} |
| 64 | + </td> |
| 65 | + <td class="py-4 px-2.5"> |
| 66 | + <span class="data-block__mobile-label">{% trans "Submitted" %}: </span>{{ report.submitted_date|default:"Skipped" }} |
| 67 | + </td> |
| 68 | + <td class="flex gap-2 py-4 px-2.5 md:justify-end"> |
| 69 | + {% if not report.skipped %} |
| 70 | + {% user_can_view_report report user as can_view_report %} |
| 71 | + {% if can_view_report %} |
| 72 | + <a class="data-block__action-icon-link" href="{% url "apply:projects:reports:detail" pk=report.pk %}"> |
| 73 | + {% heroicon_micro "eye" class="inline w-4 h-4 me-1" aria_hidden=true %} |
| 74 | + {% trans "View" %} |
| 75 | + </a> |
87 | 76 | {% endif %} |
88 | | - </td> |
89 | | - </tr> |
90 | | - {% empty %} |
91 | | - <tr> |
92 | | - <td colspan="3">{% trans "No reports submitted" %}</td> |
93 | | - </tr> |
94 | | - {% endfor %} |
95 | | - </tbody> |
96 | | - </table> |
97 | | - {% if object.reports.done.count > 8 %} |
98 | | - <p class="data-block__pagination"> |
99 | | - <a class="data-block__pagination-link js-data-block-pagination" href="#">{% trans "Show more" %}</a> |
100 | | - </p> |
101 | | - {% endif %} |
102 | | - </div> |
| 77 | + |
| 78 | + {% user_can_update_report report user as can_update_report %} |
| 79 | + {% if can_update_report %} |
| 80 | + <a class="data-block__action-icon-link" href="{% url "apply:projects:reports:edit" pk=report.pk %}"> |
| 81 | + {% heroicon_micro "pencil-square" class="inline me-1" aria_hidden=true %} |
| 82 | + {% trans "Edit" %} |
| 83 | + </a> |
| 84 | + {% endif %} |
| 85 | + {% else %} |
| 86 | + {% if can_update_project_reports %} |
| 87 | + <button type="button" class="btn data-block__action-link" hx-post="{% url "apply:projects:reports:skip" pk=report.pk %}">{% trans "Unskip" %}</button> |
| 88 | + {% endif %} |
| 89 | + {% endif %} |
| 90 | + </td> |
| 91 | + </tr> |
| 92 | + {% empty %} |
| 93 | + <tr> |
| 94 | + <td colspan="3">{% trans "No reports submitted" %}</td> |
| 95 | + </tr> |
| 96 | + {% endfor %} |
| 97 | + </tbody> |
| 98 | + </table> |
| 99 | + {% if object.reports.done.count > 4 %} |
| 100 | + <p class="text-center"> |
| 101 | + <a class="font-semibold js-data-block-pagination" href="#">{% trans "Show more" %}</a> |
| 102 | + </p> |
| 103 | + {% endif %} |
103 | 104 | </div> |
104 | | -</div> |
| 105 | +</section> |
0 commit comments