{% load video_tags %}
{% load tagging_tags %}
{% load base_tags %}
{% load base_filters %}
{% load category_tags %}
{% load perm_tags %}
{% load i18n %}

{% has_perm user videos.change_video video as can_edit %}
{% has_perm user videos.delete_video video as can_delete %}

<div class="meta {% if not user.is_authenticated and not category and not nonhash_tags %}anon{% endif %}">
    <div class="meta-left">
        {% if video.category %}
        <div class="categories">
            <strong>{% trans "Category:" %} </strong><a href="{% url video.search %}?q=category:{{ video.category }}">{{ video.category }}</a>
        </div>
        {% endif %}
        
        {% if user.is_authenticated %}
            <div class="submitted">{% blocktrans with video.create_dt|date:"long" as create_date %}Created on {{ create_date }}
            by:{% endblocktrans %} <a href="{{ video.creator.get_absolute_url }}">
            {% if video.creator.first_name %}{{ video.creator.first_name }} {{ video.creator.last_name }}
            {% else %}
            {{ video.creator }}
            {% endif %}</a>
            </div>
            <div class="submitted">{% blocktrans with video.update_dt|date:"long" as update_date %}Last updated {{ update_date }}
            by:{% endblocktrans %} <a href="{{ video.owner.get_absolute_url }}">
            {% if video.owner.first_name %}{{ video.owner.first_name }} {{ video.owner.last_name }}
            {% else %}
            {{ video.owner }}
            {% endif %}</a>
            </div>
        {% endif %}
    </div>
    
    <div class="meta-right">
        <a class="share-link" >{% trans "Share" %}</a>
    </div>
    
</div>
{% if can_edit %}
<div class="editor-bar">

    <div class="perm-status">
    <ul>
        <li>{{ video.obj_perms }}</li>
        <li>{{ video.obj_status }}</li>
    </ul>
    </div>
    <div class="edit-links">
    <ul>
        <li><a class="eventlog-link" href="{% url event_log.search %}?object_id={{ video.pk }}&source={{ video.opt_app_label }}">{% trans "Eventlogs" %}</a></li>
        <li><a class="option-link edit" href="{% url admin:videos_video_change video.pk %}?next={{ request.path }}">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="option-link delete" href="{% url admin:videos_video_delete video.pk %}">Delete</a></li>
                {% endif %}
            </ul>
        </div>
        </li>
    </ul>
    </div>
</div> 
{% endif %}
