Skip to content

Commit 199fdbd

Browse files
committed
Show report author and date similar to submissions
1 parent eb40cad commit 199fdbd

2 files changed

Lines changed: 28 additions & 1 deletion

File tree

hypha/apply/projects/reports/forms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ def clean(self):
4545
def save(self, commit=True, form_fields=dict):
4646
self.instance.form_fields = form_fields
4747
instance = super().save(commit)
48-
instance.author = self.user
4948
# We need to save the fields first, not attempt to save form_data on first save, then update the form_data next.
5049
# Otherwise, we don't get access to the generator method "question_field_ids" which we use to prevent temp file
5150
# fields from getting into the saved form_data.
@@ -88,6 +87,7 @@ def save(self, commit=True, form_fields=dict):
8887
# If this is the first submission of the report we track that as the
8988
# submitted date of the report
9089
if not instance.submitted:
90+
instance.author = self.user
9191
instance.submitted = version.submitted
9292
instance.current = version
9393
instance.draft = None

hypha/apply/projects/reports/templates/reports/report_detail.html

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,33 @@
1717
{% block content %}
1818
<div class="wrapper wrapper--sidebar wrapper--outer-space-medium">
1919
<div class="grow">
20+
<div class="flex gap-x-4 mb-4 text-xs text-fg-muted">
21+
<span style="margin-inline-end: 15px;">
22+
{% trans "Submitted " %}
23+
<strong class="font-semibold">
24+
<relative-time datetime={{ object.submitted|date:"c" }}>
25+
{{ object.submitted|date:"SHORT_DATETIME_FORMAT" }}
26+
</relative-time>
27+
</strong>
28+
{% trans "by" %}
29+
<strong class="font-semibold">
30+
{{ object.author }}
31+
</strong>
32+
</span>
33+
<span>
34+
{% trans "Updated on" %}
35+
<strong class="font-semibold">
36+
<relative-time datetime={{ object.current.submitted|date:"c" }}>
37+
{{ object.current.submitted|date:"SHORT_DATETIME_FORMAT" }}
38+
</relative-time>
39+
</strong>
40+
{% trans "by" %}
41+
<strong class="font-semibold">
42+
{{ object.current.author }}
43+
</strong>
44+
</span>
45+
</div>
46+
2047
<div role="alert" class="mb-4 alert alert-info">
2148
{% heroicon_outline 'exclamation-circle' stroke_width=2 size=18 aria_hidden=true %}
2249
<span>

0 commit comments

Comments
 (0)