feat(base): Add delete icon to content header

only display if model_delete_url is set

!11 #23
This commit is contained in:
2024-05-25 19:08:22 +09:30
parent af809183c8
commit b2f7c83155
2 changed files with 14 additions and 1 deletions

View File

@ -59,13 +59,25 @@ section h2 span svg {
margin: auto 0 auto 0;
fill: #666;
cursor: pointer;
width: 30px;
/*height: 30px;*/
}
.icon-delete svg {
fill: #ff0000;
}
</style>
<section>
<h2>{% block title %}{{ content_title }}{% endblock %}
{% if model_name and model_pk%}
{% if model_delete_url %}
<span title="Delete Item" id="content_header_icon" class="icon-delete" onclick="window.location='{{ model_delete_url }}';">
{% include 'icons/delete.svg' %}
</span>
{% endif %}
{% if model_name and model_pk %}
{% block content_header_icon %}
<span title="View History" id="content_header_icon" onclick="window.location='{% url '_history' model_name=model_name model_pk=model_pk %}';">
<svg xmlns="http://www.w3.org/2000/svg" height="30px" viewBox="0 -960 960 960" width="30px">

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="M280-120q-33 0-56.5-23.5T200-200v-520h-40v-80h200v-40h240v40h200v80h-40v520q0 33-23.5 56.5T680-120H280Zm400-600H280v520h400v-520ZM360-280h80v-360h-80v360Zm160 0h80v-360h-80v360ZM280-720v520-520Z"/></svg>

After

Width:  |  Height:  |  Size: 277 B