[PATCH 1/3] Put download buttons at the top as well
Daniel Axtens
dja at axtens.net
Mon Mar 27 16:42:50 AEDT 2017
Suggested by a few people.
Signed-off-by: Daniel Axtens <dja at axtens.net>
---
Applies on top of Stephen's button changes.
---
.../templates/patchwork/download_buttons.html | 24 +++++++++++++++++
patchwork/templates/patchwork/submission.html | 31 ++++------------------
2 files changed, 29 insertions(+), 26 deletions(-)
create mode 100644 patchwork/templates/patchwork/download_buttons.html
diff --git a/patchwork/templates/patchwork/download_buttons.html b/patchwork/templates/patchwork/download_buttons.html
new file mode 100644
index 000000000000..7697204f2ec5
--- /dev/null
+++ b/patchwork/templates/patchwork/download_buttons.html
@@ -0,0 +1,24 @@
+<div class="btn-group pull-right">
+ <a href="{% url 'patch-raw' patch_id=submission.id %}"
+ class="btn btn-default" role="button" data-toggle="tooltip"
+ title="Download patch diff">diff</a>
+ <a href="{% url 'patch-mbox' patch_id=submission.id %}"
+ class="btn btn-default" role="button" data-toggle="tooltip"
+ title="Download patch mbox">mbox</a>
+ {% if submission.series.all|length == 1 %}
+ <a href="{% url 'series-mbox' series_id=submission.latest_series.id %}"
+ class="btn btn-default" role="button" data-toggle="tooltip"
+ title="Download patch mbox">series</a>
+ {% elif submission.series.all|length > 1 %}
+ <button type="button" class="btn btn-default dropdown-toggle"
+ data-toggle="dropdown">
+ series <span class="caret"></span>
+ </button>
+ <ul class="dropdown-menu" role="menu">
+ {% for series in submission.series.all %}
+ <li><a href="{% url 'series-mbox' series_id=series.id %}"
+ >{{ series }}</a></li>
+ {% endfor %}
+ </ul>
+ {% endif %}
+</div>
diff --git a/patchwork/templates/patchwork/submission.html b/patchwork/templates/patchwork/submission.html
index e6b78d89a551..f0b674c49815 100644
--- a/patchwork/templates/patchwork/submission.html
+++ b/patchwork/templates/patchwork/submission.html
@@ -27,7 +27,9 @@ function toggle_div(link_id, headers_id)
}
</script>
-<h1>{{ submission.name }}</h1>
+<h1>{{ submission.name }}
+{% include "patchwork/download_buttons.html" %}
+</h1>
<table class="patchmeta">
<tr>
@@ -280,31 +282,8 @@ function toggle_div(link_id, headers_id)
{% if submission.diff %}
<h2>
- Patch
- <div class="btn-group pull-right">
- <a href="{% url 'patch-raw' patch_id=submission.id %}"
- class="btn btn-default" role="button" data-toggle="tooltip"
- title="Download patch diff">diff</a>
- <a href="{% url 'patch-mbox' patch_id=submission.id %}"
- class="btn btn-default" role="button" data-toggle="tooltip"
- title="Download patch mbox">mbox</a>
- {% if submission.series.all|length == 1 %}
- <a href="{% url 'series-mbox' series_id=submission.latest_series.id %}"
- class="btn btn-default" role="button" data-toggle="tooltip"
- title="Download patch mbox">series</a>
- {% elif submission.series.all|length > 1 %}
- <button type="button" class="btn btn-default dropdown-toggle"
- data-toggle="dropdown">
- series <span class="caret"></span>
- </button>
- <ul class="dropdown-menu" role="menu">
- {% for series in submission.series.all %}
- <li><a href="{% url 'series-mbox' series_id=series.id %}"
- >{{ series }}</a></li>
- {% endfor %}
- </ul>
- {% endif %}
- </div>
+ Patch
+ {% include "patchwork/download_buttons.html" %}
</h2>
<div id="patch" class="patch">
--
2.9.3
More information about the Patchwork
mailing list