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

{% block title %}{% trans "Gym list" %}{% endblock %}


{% block content %}

<ul class="list-group">
    {% for gym in gym_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">
                <li>
                    <a href="{% url 'gym:gym:edit' gym.id %}" class="wger-modal-dialog">{% trans 'Edit' %}</a>
                </li>
                <li>
                    <a href="{% url 'gym:gym:delete' gym.id %}" class="wger-modal-dialog">{% trans 'Delete' %}</a>
                </li>
            </ul>
        </div>
        <a href="{% url 'gym:gym:user-list' gym.pk %}">{{gym}}</a>
    </li>
    {% empty %}
        <li class="list-group-item">
            {% trans "Nothing found" %}
        </li>
    {% endfor %}
</ul>
{% endblock %}




{% block sidebar %}
{% if perms.config.change_gymconfig %}
<div class="btn-group pull-right">
    <button type="button" class="btn btn-default dropdown-toggle btn-xs" data-toggle="dropdown">
        {% trans "Actions" %} <span class="caret"></span>
    </button>
    <ul class="dropdown-menu" role="menu">
        <li>
            <a href="{% url 'config:gym_config:edit' %}" class="wger-modal-dialog">{% trans "Edit"%}</a>
        </li>
    </ul>
</div>
{% endif %}
<h4>{% trans "Global gym configuration" %}</h4>
<table class="table">
    <tr>
        <th>{% trans "Default gym" %}</th>
        <td>{{ global_gym_config.default_gym|default:"-/-" }}</td>
    </tr>
</table>
{% endblock %}



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