[PATCH 3/3] views: Display correct download links for covers

Stephen Finucane stephen at that.guru
Fri May 26 18:34:17 AEST 2017


This means using the correct link for the cover mbox and not displaying
one for the non-existent diff.

Signed-off-by: Stephen Finucane <stephen at that.guru>
---
 patchwork/templates/patchwork/download_buttons.html | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/patchwork/templates/patchwork/download_buttons.html b/patchwork/templates/patchwork/download_buttons.html
index df392b3..1322eed 100644
--- a/patchwork/templates/patchwork/download_buttons.html
+++ b/patchwork/templates/patchwork/download_buttons.html
@@ -1,10 +1,16 @@
 <div class="btn-group pull-right">
+  {% if submission.diff %}
   <a href="{% url 'patch-raw' patch_id=submission.id %}"
    class="btn btn-default" role="button" title="Download patch diff"
    >diff</a>
   <a href="{% url 'patch-mbox' patch_id=submission.id %}"
    class="btn btn-default" role="button" title="Download patch mbox"
    >mbox</a>
+  {% else %}
+  <a href="{% url 'cover-mbox' cover_id=submission.id %}"
+   class="btn btn-default" role="button" title="Download cover mbox"
+   >mbox</a>
+  {% endif %}
   {% if submission.series.all|length == 1 %}
   <a href="{% url 'series-mbox' series_id=submission.latest_series.id %}"
    class="btn btn-default" role="button"
-- 
2.9.4



More information about the Patchwork mailing list