{% load base_filters %}
{% load base_tags %}
{% load resume_tags %}
{% load perm_tags %}
{% load tagging_tags %}
{% load i18n %}

{% has_perm user resumes.change_resume resume as can_edit %}
{% has_perm user resumes.delete_resume resume as can_delete %}
{% tags_hash_tags resume as hash_tags %}
{% tags_strip_hash resume as nonhash_tags %}

<div class="meta {% if not user.is_authenticated and not category and not nonhash_tags %}anon{% endif %}">
    <div class="meta-left">

        {% if nonhash_tags or hash_tags %}
        <div class="tags">
            {% if nonhash_tags or can_edit %}<strong>Tags: </strong>{% endif %}
            {% for tag in nonhash_tags %}
                <a href="{% url resumes %}?q=tag:{{ tag }}">{{ tag }}</a>{% if not forloop.last %}, {% endif %}
            {% endfor %}
            
            {% if hash_tags and can_edit %}
            {% for tag in hash_tags %}
                {% if forloop.first and nonhash_tags %}| {% endif %}<a href="{% url resumes %}?q=tag:{{ tag }}">{{ tag }}</a>{% if not forloop.last %}, {% endif %}
            {% endfor %}
            {% endif %}
        </div>
        {% endif %}
        
        {% if user.is_authenticated %}
            <div class="submitted">{% blocktrans with resume.create_dt|date:"long" as create_date %}Created on {{ create_date }}
            by:{% endblocktrans %} <a href="{{ resume.creator.get_absolute_url }}">
            {% if resume.creator.first_name %}{{ resume.creator.first_name }} {{ resume.creator.last_name }}
            {% else %}
                {{ resume.creator }}
            {% endif %}</a>
            </div>
            <div class="submitted">{% blocktrans with resume.update_dt|date:"long" as update_date %}Last updated {{ update_date }}
            by:{% endblocktrans %} <a href="{{ resume.owner.get_absolute_url }}">
            {% if resume.owner.first_name %}{{ resume.owner.first_name }} {{ resume.owner.last_name }}
            {% else %}
                {{ resume.owner }}
            {% endif %}</a>
            </div>
        {% endif %}
    </div>
    <div class="meta-right">
        <a class="print-link" href="{% url resume.print_view resume.slug %}">{% trans "Print" %}</a>
    </div>
</div>
{% if can_edit %}
<div class="editor-bar">

    <div class="perm-status">
    <ul>
        <li>{{ resume.obj_perms }}</li>
        <li>{{ resume.obj_status }}</li>
    </ul>
    </div>
    <div class="edit-links">
    <ul>
        <li><a class="eventlog-link" href="{% url event_log.search %}?object_id={{ resume.pk }}&source={{ resume.opt_app_label }}">{% trans "Eventlogs" %}</a></li>
        <li><a class="edit-link" href="{% url resume.edit resume.pk %}">{% trans "Edit" %}</a></li>
        <li><a class="options-link" href="#">{% trans "Options" %} <small>&#9650;</small></a>
        <div class="options-list">
            <ul>
            {% if can_delete %}
            <li>
                <a class="delete" href="{% url resume.delete resume.pk %}">{% trans "Delete" %}</a>
            </li>               
            {% endif %}
                <li><a href="{% url resume.edit.meta resume.pk %}">{% trans "Edit Meta" %}</a></li>
                
            </ul>
        </div>
        </li>
    </ul>
    </div>
</div> 
{% endif %}
