{% extends "base.html" %}

{% load tag bookmark url_add %}

{% block title %}{% if tag %}Tag: {{ tag.name }}{% else %}Untagged{% endif %}{% endblock %}

{% block content %}

{% if tag %}
    <div class='box'>
        <form action='{% url "tags:pin" tag=tag.slug %}' method='POST' id='pinForm'>{% csrf_token %}
            {% if tag.pinned %}
                <input type='submit' value='Remove this tag from the top bar'/>
            {% else %}
                <input type='hidden' name='pinned' value='on'/>
                <input type='submit' value='Pin this tag so it appears in the top bar'/>
            {% endif %}
        </form>
    </div>

    <div class='box flex'>
        {% multiTagButton %}{% url_add tag %}
    </div>

    {% multiTag "bookmark" %}
    
    {% tagBlock tag %}
{% else %}
    <div class='tagBlock box block white'>
        <div class='head'>
            <div class='title'><a href='{% url "tags:untagged" %}'>Untagged</a></div>
            <span class='count'>{{ untag_count }}</span>
        </div>
    </div>
    
    {% multiTag "bookmark" automulti=True %}
{% endif %}

<div id='bookmark-list'>
    {% for bm in bookmarks %}
        {% if tag %}
            {% bookmark bm tag %}
        {% else %}
            {% bookmark bm tag automulti=True %}
        {% endif %}
    {% endfor %}
</div>

{% endblock %}

{% extends "base.html" %}

{% load tag bookmark url_add %}

{% block title %}{% if tag %}Tag: {{ tag.name }}{% else %}Untagged{% endif %}{% endblock %}

{% block content %}

{% if tag %}
    <div class='box flex'>
        {% multiTagButton %}
        {% url_add tag %}
        <form action='{% url "tags:pin" tag=tag.slug %}' method='POST' id='pinForm' class='flex'>{% csrf_token %}
            {% if tag.pinned %}
                <input type='submit' value='Remove this tag from the top bar'/>
            {% else %}
                <input type='hidden' name='pinned' value='on'/>
                <input type='submit' value='Pin this tag so it appears in the top bar'/>
            {% endif %}
        </form>
    </div>

    {% multiTag "bookmark" %}
    
    {% tagBlock tag %}
{% else %}
    <div class='tagBlock box block white'>
        <div class='head'>
            <div class='title'><a href='{% url "tags:untagged" %}'>Untagged</a></div>
            <span class='count'>{{ untag_count }}</span>
        </div>
    </div>
    
    {% multiTag "bookmark" automulti=True %}
{% endif %}

<div id='bookmark-list'>
    {% for bm in bookmarks %}
        {% if tag %}
            {% bookmark bm tag %}
        {% else %}
            {% bookmark bm tag automulti=True %}
        {% endif %}
    {% endfor %}
</div>

{% endblock %}

Put pin tag form next to URL add form
Put pin tag form next to URL add form
