@@ -55,7 +55,9 @@ $(function () {
<em class="text-muted">None</em>
{% endif %}
</span>
+{% if is_editable %}
<span class="glyphicon glyphicon-pencil" ></span>
+{% endif %}
</span>
<div id="edit-reviewer" class="form-inline" style="display:none;">
<div class="form-group">
@@ -37,6 +37,7 @@ class SeriesView(View):
return render(request, 'patchwork/series.html', {
'series': series,
'project': series.project,
+ 'is_editable': series.project.is_editable(request.user),
'cover_letter': revision.cover_letter,
'patches': revision.patches.all(),
})
While the permissions are enforced at the API level, people will be upset if allow them to see the edition widget but deny the edit when saving the new field. So let's not show any edit icon when we're not allowed to edit an object. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> --- patchwork/templates/patchwork/series.html | 2 ++ patchwork/views/series.py | 1 + 2 files changed, 3 insertions(+)