]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
views: Display correct download links for covers
authorStephen Finucane <stephen@that.guru>
Wed, 24 May 2017 10:32:49 +0000 (11:32 +0100)
committerStephen Finucane <stephen@that.guru>
Tue, 30 May 2017 20:42:55 +0000 (21:42 +0100)
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@that.guru>
patchwork/templates/patchwork/download_buttons.html

index df392b36ec7f17c1d8c09bf6d92f6a512dbbf310..1322eed2e5116250f06a8f99c79f23d33cf44aec 100644 (file)
@@ -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"