Message ID | 20170207221524.22394-10-stephen@that.guru |
---|---|
State | Superseded |
Headers | show |
Hi Stephen, > class="btn btn-default" role="button" data-toggle="tooltip" > title="Download patch mbox">mbox</a> > + {% if submission.latest_series %} > + <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 %} Can we test at runtime if there are multiple series and only do a drop-down if necessary? Apart from that, looks good! Regards, Daniel > </div> > </h2> > > -- > 2.9.3 > > _______________________________________________ > Patchwork mailing list > Patchwork@lists.ozlabs.org > https://lists.ozlabs.org/listinfo/patchwork
On Fri, 2017-02-24 at 14:49 +1100, Daniel Axtens wrote: > Hi Stephen, > > > class="btn btn-default" role="button" data-toggle="tooltip" > > title="Download patch mbox">mbox</a> > > + {% if submission.latest_series %} > > + <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 %} > > Can we test at runtime if there are multiple series and only do a > drop-down if necessary? Sure. Let me whip that together for v3. Stephen
diff --git a/patchwork/templates/patchwork/submission.html b/patchwork/templates/patchwork/submission.html index 66c1159..5e86ac3 100644 --- a/patchwork/templates/patchwork/submission.html +++ b/patchwork/templates/patchwork/submission.html @@ -288,6 +288,18 @@ function toggle_div(link_id, headers_id) <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.latest_series %} + <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> </h2>
This will allow users to download entire series including the current patch. Since a patch can belong to many series a dropdown is used. Signed-off-by: Stephen Finucane <stephen@that.guru> --- patchwork/templates/patchwork/submission.html | 12 ++++++++++++ 1 file changed, 12 insertions(+)