fix: Hide recently used tags when tag list is empty

This commit is contained in:
earthcomfy 2022-09-30 22:52:32 +03:00 committed by Christopher Charbonneau Wells
parent 364676aeac
commit 62bde09b3d
1 changed files with 15 additions and 7 deletions

View File

@ -24,13 +24,21 @@
<button class="btn btn-outline-primary bg-dark btn-add-new-tag" type="button">{% trans "Add" %}</button> <button class="btn btn-outline-primary bg-dark btn-add-new-tag" type="button">{% trans "Add" %}</button>
</div> </div>
</div> </div>
<span>{% trans "Recently used:" %}</span> {% if widget.tag_suggestions.quick %}
{% for t in widget.tag_suggestions.quick %} <span>{% trans "Recently used:" %}</span>
<span data-value="{{ t.name }}" data-color="{{ t.color }}" class="tag btn badge badge-pill cursor-pointer mr-1" style="background-color: {{ t.color }};"> {% for t in widget.tag_suggestions.quick %}
{{ t.name }} <span data-value="{{ t.name }}" data-color="{{ t.color }}" class="tag btn badge badge-pill cursor-pointer mr-1" style="background-color: {{ t.color }};">
<span class="add-remove-icon pl-1 pr-1">+</span> {{ t.name }}
</span> <span class="add-remove-icon pl-1 pr-1">+</span>
{% endfor %} </span>
{% endfor %}
{% else %}
<style>
.help-block{
display: none;
}
</style>
{%endif%}
</div> </div>
<input <input
type="hidden" type="hidden"