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

Signed-off-by: Stephen Finucane <[email protected]>
---
 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

_______________________________________________
Patchwork mailing list
[email protected]
https://lists.ozlabs.org/listinfo/patchwork

Reply via email to