{% extends 'devilry_group/listbuilder_feedbackfeed/base_groupcomment_item_value.django.html' %}

{% load i18n %}
{% load cradmin_legacy_tags %}

{% block edit-links %}
    <a href="{% cradmin_url instanceid='devilry_group_examiner' appname='feedbackfeed' viewname='groupcomment-edit' pk=me.group_comment.id roleid=request.cradmin_role.id %}"
       class="devilry-group-comment-edit-link devilry-group-comment-edit-link__examiner">
        <strong>{% trans "Edit" context "devilry_group feedbackfeed edit groupcomment" %}</strong></a>&nbsp;
    {% if me.group_comment.visibility == 'private' %}
        <a href="{% cradmin_url instanceid='devilry_group_examiner' appname="feedbackfeed" viewname="groupcomment-delete" pk=me.group_comment.id roleid=request.cradmin_role.id %}"
           class="devilry-group-comment-delete-link devilry-group-comment-delete-link__examiner">
            <strong>{% trans "Delete" context "devilry_group feedbackfeed delete groupcomment" %}</strong></a>
    {% endif %}
{% endblock edit-links %}

{% block details %}

    <!--
    Handles published and unpublished comment styles
    -->
    {% if me.group_comment.part_of_grading == True %}
        {% if me.group_comment.get_published_datetime == None %}
            <!--
            Comment is part of grading, but not published.
            -->
            <div class="devilry-group-feedbackfeed-right-badge-field not-published-badge">
                <p class="devilry-group-feedbackfeed-badge-text">{% trans "not published" context 'devilry_group feedbackfeed' %}</p>
            </div>
        {% else %}
            <!--
            Comment is published as part of the feedback.
            -->
            <div class="devilry-group-feedbackfeed-right-badge-field not-published-badge">
                <p class="devilry-group-feedbackfeed-badge-text">
                    {% trans "feedback" context 'devilry_group feedbackfeed part of feedback badge' %}
                </p>
            </div>
        {% endif %}
    {% elif me.group_comment.visibility == 'visible-to-examiner-and-admins' %}
        <div class="devilry-group-feedbackfeed-right-badge-field not-published-badge">
            <p class="devilry-group-feedbackfeed-badge-text">
                {% trans "only visible to examiners and admins" context 'devilry_group feedbackfeed' %}
            </p>
        </div>
    {% endif %}
{% endblock details %}
