{% extends "base.html" %}
{% load i18n static wger_extras django_bootstrap_breadcrumbs %}

{% block title %}{% trans "User notes" %}{% endblock %}



{% block breadcrumbs %}
    {{ block.super }}

    {% if perms.gym.manage_gyms %}
        {% breadcrumb "Gyms" "gym:gym:list" %}
    {% endif %}
    {% breadcrumb_raw member.userprofile.gym "gym:gym:user-list" member.userprofile.gym.pk %}
    {% breadcrumb_raw member|format_username "core:user:overview" member.pk %}
    {% breadcrumb "User notes" "gym:user_notes:list" member.pk %}
{% endblock %}


{% block content %}
<ul class="list-group">
    {% for note in adminusernote_list %}
    <li class="list-group-item ">
        <div class="btn-group pull-right">
            <button type="button" class="btn btn-default dropdown-toggle btn-xs" data-toggle="dropdown">
                <span class="{% fa_class 'cog' %}"></span>
            </button>
            <ul class="dropdown-menu" role="menu">
                {% if perms.gym.change_adminusernote %}
                <li>
                    <a href="{% url 'gym:admin_note:edit' note.pk %}" class="wger-modal-dialog">
                        {% trans 'Edit' %}
                    </a>
                </li>
                {% endif %}

                {% if perms.gym.delete_adminusernote %}
                <li>
                    <a href="{% url 'gym:admin_note:delete' note.pk %}" class="wger-modal-dialog">
                        {% trans 'Delete' %}
                    </a>
                <li>
                {% endif %}
            </ul>
        </div>

        <h4 class="list-group-item-heading">{{ note.timestamp_created }} - {{ note.user|format_username }}</h4>
        <p class="list-group-item-text">{{ note.note }}</p>
    </li>
    {% empty %}
    <li class="list-group-item">
        {% trans "Nothing found" %}
    </li>
    {% endfor %}
</ul>
{% endblock %}




{#         #}
{# Options #}
{#         #}
{% block options %}
{% if perms.gym.add_adminusernote %}
    <a href="{% url 'gym:admin_note:add' member.pk %}" class="wger-modal-dialog btn btn-success btn-sm">
        {% trans "Add" %}
    </a>
{% endif %}
{% endblock %}
