Commit c996dc2c authored by Arkadiusz Hiler's avatar Arkadiusz Hiler
Browse files

series: Display historical cover letters



Cover letters are now using details/summary HTML block to be expandable
with the latest one being expanded by default.
Signed-off-by: default avatarArkadiusz Hiler <arkadiusz.hiler@intel.com>
parent 1c5522df
Pipeline #39098 failed with stage
in 1 minute and 21 seconds
...@@ -99,17 +99,22 @@ $(document).ready(function() { ...@@ -99,17 +99,22 @@ $(document).ready(function() {
</tr> </tr>
</table> </table>
{% if cover_letter %}
<h2>Cover Letter</h2>
<div class="comment">
<pre class="content">
{{ cover_letter }}
</pre>
</div>
{% if cover_letters %}
<h2>Cover Letter(s)</h2>
{% endif %} {% endif %}
{% for version, cover_letter in cover_letters %}
<details {% if forloop.last %}open{% endif %}>
<summary style="display: list-item;">Revision {{ version }}</summary>
<div class="comment">
<pre class="content">
{{ cover_letter }}
</pre>
</div>
</details>
{% endfor %}
<h2>Revisions</h2> <h2>Revisions</h2>
<div> <div>
......
...@@ -49,11 +49,13 @@ class SeriesView(View): ...@@ -49,11 +49,13 @@ class SeriesView(View):
.filter(revision=revision, patch=None) \ .filter(revision=revision, patch=None) \
.order_by('test__name').select_related('test') .order_by('test__name').select_related('test')
cover_letters = [(r.version, r.cover_letter) for r in revisions if r.cover_letter]
return render(request, 'patchwork/series.html', { return render(request, 'patchwork/series.html', {
'series': series, 'series': series,
'project': project, 'project': project,
'is_editable': Can(request.user).edit(project), 'is_editable': Can(request.user).edit(project),
'is_retestable': Can(request.user).retest(series), 'is_retestable': Can(request.user).retest(series),
'cover_letter': revision.cover_letter, 'cover_letters': cover_letters,
'revisions': revisions, 'revisions': revisions,
}) })
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment