Skip to content

Commit

Permalink
Fix pkginfo list & detail edit & delete buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
np5 committed Dec 10, 2024
1 parent d2c49ba commit 49603f3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 17 deletions.
14 changes: 6 additions & 8 deletions zentral/contrib/monolith/templates/monolith/pkg_info_name.html
Original file line number Diff line number Diff line change
Expand Up @@ -128,19 +128,17 @@ <h4>Version{{ pkg_infos|length|pluralize }} ({{ pkg_infos|length }})</h4>
<td>
{% if pkg_info.local %}
{% if perms.monolith.change_pkginfo %}
<a class="btn btn-outline-secondary" href="{% url 'monolith:update_package' pkg_info.pk %}">
<span class="bi bi-square-edit" aria-hidden="true"></span>
</a>
{% url 'monolith:update_package' pkg_info.pk as url %}
{% button 'UPDATE' url "Edit PkgInfo" %}
{% endif %}
{% if perms.monolith.delete_pkginfo %}
{% url 'monolith:delete_pkg_info' pkg_info.pk as url %}
{% button 'DELETE' url "Delete Package Info" %}
{% url 'monolith:delete_pkg_info' pkg_info.pk as url %}
{% button 'DELETE' url "Delete Package Info" %}
{% endif %}
{% else %}
{% if perms.monolith.change_pkginfo and pkg_info.local %}
<a class="btn btn-outline-secondary" href="{% url 'monolith:update_pkg_info_catalog' pkg_info.pk %}">
<span class="bi bi-edit" aria-hidden="true"></span>
</a>
{% url 'monolith:update_pkg_info_catalog' pkg_info.pk as url %}
{% button 'UPDATE' url "Change PkgInfo catalogs" %}
{% endif %}
{% endif %}
</td>
Expand Down
15 changes: 6 additions & 9 deletions zentral/contrib/monolith/templates/monolith/pkginfo_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -107,20 +107,17 @@ <h2>Package name{{ name_number|pluralize }} ({{ name_number }}) / Package{{ in
<td>
{% if pkg_info.local %}
{% if perms.monolith.change_pkginfo %}
<a class="btn btn-outline-secondary" href="{% url 'monolith:update_package' pkg_info.pk %}">
<span class="glyphicon glyphicon-edit" aria-hidden="true"></span>
</a>
{% url 'monolith:update_package' pkg_info.pk as url %}
{% button 'UPDATE' url "Edit PkgInfo" %}
{% endif %}
{% if perms.monolith.delete_pkginfo %}
<a class="btn btn-danger" href="{% url 'monolith:delete_pkg_info' pkg_info.pk %}">
<span class="glyphicon glyphicon-trash" aria-hidden="true"></span>
</a>
{% url 'monolith:delete_pkg_info' pkg_info.pk as url %}
{% button 'DELETE' url "Delete PkgInfo" %}
{% endif %}
{% else %}
{% if perms.monolith.change_pkginfo and pkg_info.local %}
<a class="btn btn-outline-secondary" href="{% url 'monolith:update_pkg_info_catalog' pkg_info.pk %}">
<span class="glyphicon glyphicon-edit" aria-hidden="true"></span>
</a>
{% url 'monolith:update_pkg_info_catalog' pkg_info.pk as url %}
{% button 'UPDATE' url "Change PkgInfo catalogs" %}
{% endif %}
{% endif %}
</td>
Expand Down

0 comments on commit 49603f3

Please sign in to comment.