|
9 | 9 | style="background:{{ t.color_hex }}; |
10 | 10 | color:{% readable_text_color t.color_hex %}">{{ t.name }}</a> |
11 | 11 | {% endfor %} |
12 | | - <button data-bs-toggle="collapse" |
13 | | - data-bs-target="#tag_handler" |
14 | | - class="btn btn-add btn-circle">{% fa5_icon 'plus' 'fas' %}</button> |
15 | | - <div id="tag_handler" class="collapse"> |
16 | | - <form action="{% url 'dataedit:tags-add' %}" method="post"> |
17 | | - {% csrf_token %} |
18 | | - <h4>Choose tags to attach:</h4> |
19 | | - {% for t in all_tags %} |
20 | | - <span> |
21 | | - <input type="checkbox" |
22 | | - class="hidden" |
23 | | - name="tag_{{ t.pk }}" |
24 | | - id="select_{{ t.pk }}" |
25 | | - {% if t in selected %}checked{% endif %} /> |
26 | | - <label class="form-label" |
27 | | - style="background:{{ t.color_hex }}; |
28 | | - color:{% readable_text_color t.color_hex %}" |
29 | | - class="btn tag" |
30 | | - for="select_{{ t.pk }}">{{ t.name }}</label> |
31 | | - </span> |
32 | | - {% endfor %} |
33 | | - {% if table %} |
34 | | - <input type="hidden" name="table" value="{{ table }}" /> |
35 | | - {% endif %} |
36 | | - <input type="submit" class="btn btn-success" value="Apply" /> |
37 | | - <a type="button" |
38 | | - class="btn btn-info" |
39 | | - href="{% url 'dataedit:topic-list' %}">Edit</a> |
40 | | - </form> |
41 | | - </div> |
| 12 | + {% if is_admin %} |
| 13 | + <button data-bs-toggle="collapse" |
| 14 | + data-bs-target="#tag_handler" |
| 15 | + class="btn btn-add btn-circle">{% fa5_icon 'plus' 'fas' %}</button> |
| 16 | + <div id="tag_handler" class="collapse"> |
| 17 | + <form action="{% url 'dataedit:tags-add' %}" method="post"> |
| 18 | + {% csrf_token %} |
| 19 | + <h4>Choose tags to attach:</h4> |
| 20 | + {% for t in all_tags %} |
| 21 | + <span> |
| 22 | + <input type="checkbox" |
| 23 | + class="hidden" |
| 24 | + name="tag_{{ t.pk }}" |
| 25 | + id="select_{{ t.pk }}" |
| 26 | + {% if t in selected %}checked{% endif %} /> |
| 27 | + <label class="form-label" |
| 28 | + style="background:{{ t.color_hex }}; |
| 29 | + color:{% readable_text_color t.color_hex %}" |
| 30 | + class="btn tag" |
| 31 | + for="select_{{ t.pk }}">{{ t.name }}</label> |
| 32 | + </span> |
| 33 | + {% endfor %} |
| 34 | + {% if table %} |
| 35 | + <input type="hidden" name="table" value="{{ table }}" /> |
| 36 | + {% endif %} |
| 37 | + <input type="submit" class="btn btn-success" value="Apply" /> |
| 38 | + <a type="button" |
| 39 | + class="btn btn-info" |
| 40 | + href="{% url 'dataedit:topic-list' %}">Edit</a> |
| 41 | + </form> |
| 42 | + </div> |
| 43 | + {% endif %} |
42 | 44 | </div> |
0 commit comments