feat(base): add dynamic docs icon

specifying `context['model_docs_path']` with the path will add the docs icon

!21
This commit is contained in:
2024-06-12 05:06:22 +09:30
parent 4016d4c200
commit 87282ce41c
3 changed files with 11 additions and 1 deletions

View File

@ -72,6 +72,10 @@ section h2 span svg {
fill: #ff0000;
}
.icon-help svg {
fill: #177ee6;
}
</style>
<section>
@ -81,6 +85,11 @@ section h2 span svg {
{% include 'icons/delete.svg' %}
</span>
{% endif %}
{% if model_docs_path %}
<span title="Documentation" id="content_header_icon" class="icon-help" onclick="window.open('{% settings_value 'DOCS_ROOT' %}{{ model_docs_path }}', '_blank')">
{% include 'icons/help.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 %}';">