Skip to content

Commit f6b5fe5

Browse files
metpstephenfin
authored andcommitted
templates: Combine series and related row
Move the series patch list from row 'Related' to 'Series'. This allows us to use the 'Related' row for actually showing submission relations instead. Signed-off-by: Mete Polat <[email protected]> Reviewed-by: Stephen Finucane <[email protected]>
1 parent 04b26de commit f6b5fe5

File tree

2 files changed

+33
-38
lines changed

2 files changed

+33
-38
lines changed

htdocs/css/style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ table.patchmeta tr th, table.patchmeta tr td {
192192
vertical-align: top;
193193
}
194194

195-
.patchrelations ul {
195+
.submissionlist ul {
196196
list-style-type: none;
197197
padding: 0;
198198
margin: 0;

patchwork/templates/patchwork/submission.html

Lines changed: 32 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@
99

1010
{% block body %}
1111
<script>
12-
function toggle_div(link_id, headers_id)
12+
function toggle_div(link_id, headers_id, label_show, label_hide)
1313
{
1414
var link = document.getElementById(link_id)
1515
var headers = document.getElementById(headers_id)
1616

1717
var hidden = headers.style['display'] == 'none';
1818

1919
if (hidden) {
20-
link.innerHTML = 'hide';
20+
link.innerHTML = label_hide || 'hide';
2121
headers.style['display'] = 'block';
2222
} else {
23-
link.innerHTML = 'show';
23+
link.innerHTML = label_show || 'show';
2424
headers.style['display'] = 'none';
2525
}
2626

@@ -74,42 +74,37 @@ <h1>{{ submission.name }}</h1>
7474
<th>Series</th>
7575
<td>
7676
<a href="{% url 'patch-list' project_id=project.linkname %}?series={{ submission.series.id }}">
77-
{{ submission.series }}
78-
</a>
79-
</td>
80-
</tr>
81-
<tr>
82-
<th>Related</th>
83-
<td>
84-
<a id="togglepatchrelations"
85-
href="javascript:toggle_div('togglepatchrelations', 'patchrelations')"
86-
>show</a>
87-
<div id="patchrelations" class="patchrelations" style="display:none;">
77+
{{ submission.series.name }}
78+
</a> |
79+
<a id="togglepatchseries"
80+
href="javascript:toggle_div('togglepatchseries', 'patchseries', 'expand', 'collapse')"
81+
>expand</a>
82+
<div id="patchseries" class="submissionlist" style="display:none;">
8883
<ul>
89-
{% with submission.series.cover_letter as cover %}
90-
<li>
91-
{% if cover %}
92-
{% if cover == submission %}
93-
{{ cover.name|default:"[no subject]"|truncatechars:100 }}
94-
{% else %}
95-
<a href="{% url 'cover-detail' project_id=project.linkname msgid=cover.url_msgid %}">
96-
{{ cover.name|default:"[no subject]"|truncatechars:100 }}
97-
</a>
98-
{% endif %}
99-
{% endif %}
100-
</li>
101-
{% endwith %}
102-
{% for sibling in submission.series.patches.all %}
103-
<li>
104-
{% if sibling == submission %}
105-
{{ sibling.name|default:"[no subject]"|truncatechars:100 }}
106-
{% else %}
107-
<a href="{% url 'patch-detail' project_id=project.linkname msgid=sibling.url_msgid %}">
108-
{{ sibling.name|default:"[no subject]"|truncatechars:100 }}
109-
</a>
84+
{% with submission.series.cover_letter as cover %}
85+
<li>
86+
{% if cover %}
87+
{% if cover == submission %}
88+
{{ cover.name|default:"[no subject]"|truncatechars:100 }}
89+
{% else %}
90+
<a href="{% url 'cover-detail' project_id=project.linkname msgid=cover.url_msgid %}">
91+
{{ cover.name|default:"[no subject]"|truncatechars:100 }}
92+
</a>
93+
{% endif %}
11094
{% endif %}
111-
</li>
112-
{% endfor %}
95+
</li>
96+
{% endwith %}
97+
{% for sibling in submission.series.patches.all %}
98+
<li>
99+
{% if sibling == submission %}
100+
{{ sibling.name|default:"[no subject]"|truncatechars:100 }}
101+
{% else %}
102+
<a href="{% url 'patch-detail' project_id=project.linkname msgid=sibling.url_msgid %}">
103+
{{ sibling.name|default:"[no subject]"|truncatechars:100 }}
104+
</a>
105+
{% endif %}
106+
</li>
107+
{% endfor %}
113108
</ul>
114109
</div>
115110
</td>

0 commit comments

Comments
 (0)