{% block tag_table %}
	<table id="tag_table"><tr class="nodrop nodrag">
        <th>#</th>
        {% if valid != "2" and ordered_tags %}
        <th><img src="{{STATIC_URL}}hdabo/img/arrow_up_down.png"/></th>
        {% endif %}
        <th>id</th>
        <th>label</th>
        {% comment %}<th>original_label</th>{% endcomment %}
        <th class="text_centered">Lien W</th>
        <th class="text_centered">Lien D</th>
        <th>Catégorie</th>
        <th class="large_25 text_centered">Supprimer<br/>le lien W</th>
        <th>Alias</th>
        <th class="large_25 text_centered">Retirer le tag de la liste</th></tr>
    {% if ordered_tags %}
    	{# ordered_tags is a list of TaggedSheet #}
        {% for t in ordered_tags %}
            <tr class="imageline {% cycle 'hdabooddline' 'hdaboevenline' %}" id="{{forloop.counter}}">
            <td>{{forloop.counter}}</td>
            {% if valid != "2" %}
            <td class="updown_td text_centered"><img src="{{STATIC_URL}}hdabo/img/arrow_up_down.png" class="updown" alt="updown" id={{t.tag.id}} pos="{{forloop.counter0}}"></td>
            {% endif %}
            <td class="reset_wp_info">{{t.tag.id}}</td>
            <td class="{{t.tag.url_status_text}} wikipediatag" id="{{t.tag.id}}" >{{t.tag.label}}</td>
            {% comment %}<td>{{t.tag.original_label}}</td>{% endcomment %}
            <td class="text_centered">
	            {% if t.tag.wikipedia_url and t.tag.wikipedia_url != ""  %}
	            <a href="{{t.tag.wikipedia_url}}" target="_blank"><img src="{{STATIC_URL}}hdabo/img/arrow_right.png" ></a>
	            {% else %}
	            <a href="http://fr.wikipedia.org/w/index.php?search={{t.tag.label}}" target="_blank"><img src="{{STATIC_URL}}hdabo/img/wikipedia_search.png" ></a>
	            {% endif %}
	        </td>
	        <td class="text_centered">
	            {% if t.tag.dbpedia_uri and t.tag.dbpedia_uri != ""  %}
	            <a href="{{t.tag.dbpedia_uri}}" target="_blank"><img src="{{STATIC_URL}}hdabo/img/arrow_green_right.png" ></a>
	            {% else %}
	            &nbsp;
	            {% endif %}
            </td>	        
            <td>{% if t.tag.category %}{{ t.tag.category }}{% endif %}</td>
            <td class="text_centered"><img src="{{STATIC_URL}}hdabo/img/red_cross.png" class="remove_wp_link" id="{{t.tag.id}}" alt="{{t.tag.label}}" /></td>
            <td>{% if t.tag.alias %}{{t.tag.alias}}{% endif %}</td>
            <td class="text_centered"><img src="{{STATIC_URL}}hdabo/img/tag_remove.png" class="remove_tag_from_list" id="{{t.tag.id}}" alt="{{t.tag.label}}" /></td></tr>
        {% endfor %}
    {% else %}
    	{# ds is a DataSheet #}
        {% for t in ds.tags.all %}
            <tr class="imageline {% cycle 'hdabooddline' 'hdaboevenline' %}">
            <td>{{forloop.counter}}</td>
            {% if valid != "2" and ordered_tags %}
            <td class="updown_td"><img src="{{STATIC_URL}}hdabo/img/arrow_up_down.png" class="up" alt="up" id="{{t.id}}" pos="{{forloop.counter0}}"></td>
            {% endif %}
            <td>{{t.id}}</td>
            <td class="{{t.url_status_text}}">{{t.label}}</td>
            {% comment %}<td>{{t.original_label}}</td>{% endcomment %}
            <td class="text_centered">
	            {% if t.wikipedia_url and t.wikipedia_url != ""  %}
	            <a href="{{t.wikipedia_url}}" target="_blank"><img src="{{STATIC_URL}}hdabo/img/arrow_right.png" ></a>
	            {% else %}
	            <a href="http://fr.wikipedia.org/w/index.php?search={{t.label}}" target="_blank"><img src="{{STATIC_URL}}hdabo/img/wikipedia_search.png" ></a>
	            {% endif %}
	        </td>
	        <td class="text_centered">
                {% if t.tag.dbpedia_uri and t.tag.dbpedia_uri != ""  %}
                <a href="{{t.tag.dbpedia_uri}}" target="_blank"><img src="{{STATIC_URL}}hdabo/img/arrow_green_right.png" ></a>
                {% else %}
                &nbsp;
                {% endif %}
            </td>
            <td>{% if t.category %}{{ t.category }}{% endif %}</td>
            <td class="text_centered"><img src="{{STATIC_URL}}hdabo/img/red_cross.png" class="remove_wp_link" id="{{t.id}}" /></td>
            <td>{{t.alias}}</td>
            <td class="text_centered"><img src="{{STATIC_URL}}hdabo/img/tag_remove.png" class="remove_tag_from_list" id="{{t.id}}" alt="{{t.label}}" /></td></tr>
        {% endfor %}
    {% endif %}
    </table>
{% endblock %}
