{% load i18n %}
{% load common_filters %}
{% load wikitags %}

{% comment %}
<!--
  Copyright (C) 2011-2014 University of Dundee & Open Microscopy Environment.
  All rights reserved.

  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU Affero General Public License as
  published by the Free Software Foundation, either version 3 of the
  License, or (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU Affero General Public License for more details.

  You should have received a copy of the GNU Affero General Public License
  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-->
{% endcomment %}

{% comment %}
<!--
  This comment block is used as an 'include' in the metadata_general panel and is also used in the 
  add-comment AJAX response, to add new comment blocks to the metadata_general panel.
-->
{% endcomment %}

<div class="ann_comment_wrapper" data-added-by="{{ added_by }}">

    <div class="avatar">
		<img src="{% url 'avatar' tann.details.owner.id.val %}" alt="{{ tann.getOwner.getFullName }}" title="{{ tann.getOwner.getFullName }}" />
	</div>

    <div class="ann_comment_text tooltip">
        <div class="ann_comment_header">
            <strong>{{ tann.getOwner.getFullName }}</strong> 
            {% trans "at" %} 
            {{ tann.creationEventDate|date:"Y-m-d H:i:s" }}
        </div>
    
        {% if tann.canDelete %}
            <img class='removeComment' id="{{ tann.id }}-comment" src="{% static "webclient/image/icon_basic_delete.png"%}" 
                url='{% url 'manage_action_containers' "remove" %}comment/{{ tann.id }}/' title="Delete comment"/>
        {% endif %}
    
        <div class='commentText'>
        {{ tann.getTextValue|escape|linebreaksbr }}
        </div>
    </div>

    {% if tann.ns or tann.description %}
    <span class="tooltip_html" style='display:none'>
        <b>ID:</b> {{ tann.id }}<br />
        {% if tann.ns %}<b>Namespace:</b> {{ tann.ns }}<br />{% endif %}
        {% if tann.description %}<b>Description:</b> {{ tann.description|escape }}<br />{% endif %}
    </span>
    {% endif %}

</div>