Refactoring tagging

This commit is contained in:
2020-09-12 11:24:16 +02:00
parent 317437fedc
commit 7f73035b02
5 changed files with 11 additions and 15 deletions

View File

@@ -1,6 +1,6 @@
<div class="LP-TagList">
<ul class="LP-TagList__List">
{% for tag in tag_list %}
{% for tag in config.tagged_item.tags.all %}
<li class="LP-TagList__Item">
<div class="LP-Tag">
<a href="#" class="LP-Link">
@@ -23,7 +23,7 @@
</ul>
</div>
<form id="id_tag_submit_form" class="LP-Form LP-Form--inline LP-Form--tagging" method="POST" action="{{config.submit_url}}">
<form id="id_tag_submit_form" class="LP-Form LP-Form--inline LP-Form--tagging" method="POST" action="{% url config.submit_url_name tagged_id=config.tagged_item.id%}">
<fieldset class="LP-Form__Fieldset">
<legend class="LP-Form__Legend">Tags hinzufügen</legend>
{% csrf_token %}
@@ -46,14 +46,10 @@
submit_form.onsubmit = () => false
const tagify = new Tagify(input, {
'whitelist': [{
%
for tag in all_tags %
}
'whitelist': [
{% for tag in config.tagged_item.tags.all %}
'{{tag}}',
{
% endfor %
}
{% endfor %}
]
})