{% extends "base.html" %}
{% load i18n %}
{% get_current_language as LANGUAGE_CODE %}
{% block content %}
<div class="boxes">
    <div class="contentblock" id="group-members">
        <h2>{% trans "Members of" %}: {{group.name}}</h2>
        <ul class="wm-list">
            {% for member in members %}
            <li class="wm small-row">
                <div class="summary">
                    <div class="name">
                        {% if not member.user %}
                        {{member.code}}
                        {% else %}
                        {{member}} ({{member.code}})
                        {% endif %}
                    </div>
                    <div class="actions">
                        <a href="#" class="remove" data-gid="{{group.id}}" data-neptun="{{member.code}}">
                            <img src="/static/icons/minus-circle.png" alt="{% trans 'Remove' %}" />
                        </a>
                    </div>
                    <div class="clear"></div>
                </div>
                <div class="details">
                    <div class="container">
                        {% if not member.user %}
                        {% trans "This user never logged in, no data available" %}
                        {% else %}
                        <ul>
                            <li>
                                {% trans "Name" %}<span class="value">{{member}}</span>
                            </li>
                            <li>
                                {% trans "NEPTUN" %}<span class="value">{{member.code}}</span>
                            </li>
                            <li>
                                E-mail:<span class="value"><a href="mailto:{{member.user.email}}">{{member.user.email}}</a></span>
                            </li>
                        </ul>
                        {% endif %}
                    </div>
                </div>
            </li>
            {% endfor %}
            <li class="wm small-row">
                <div class="summary" id="new-member">
                    <div class="name">{% trans "Add user" %}</div>
                    <div id="new-member-form">
                        <input type="text" placeholder="{% trans "User NEPTUN code" %}" />
                        <input type="submit" value="{% trans "Add user" %}" data-id="{{group.id}}"/>
                    </div>
                    <div class="clear"></div>
                </div>
            </li>
        </ul>
    </div>
    <div class="contentblock" id="group-owners">
        <h2>{% trans "Owners of" %}: {{group.name}}</h2>
        <ul class="wm-list">
            {% for owner in owners %}
            <li class="wm small-row">
                <div class="summary">
                    <div class="name">
                        {% if not owner.user %}
                        {{owner.code}}
                        {% else %}
                        {{owner}} ({{owner.code}})
                        {% endif %}
                    </div>
                    <div class="actions">
                        <a href="#" class="remove" data-gid="{{group.id}}" data-neptun="{{owner.code}}">
                            <img src="/static/icons/minus-circle.png" alt="{% trans 'Remove' %}" />
                        </a>
                    </div>
                    <div class="clear"></div>
                </div>
                <div class="details">
                    <div class="container">
                        {% if not owner.user %}
                        {% trans "This user never logged in, no data available" %}
                        {% else %}
                        <ul>
                            <li>
                                {% trans "Name" %}<span class="value">{{owner}}</span>
                            </li>
                            <li>
                                {% trans "NEPTUN" %}<span class="value">{{owner.code}}</span>
                            </li>
                            <li>
                                E-mail:<span class="value"><a href="mailto:{{owner.user.email}}">{{owner.user.email}}</a></span>
                            </li>
                        </ul>
                        {% endif %}
                    </div>
                </div>
            </li>
            {% endfor %}
            <li class="wm small-row">
                <div class="summary" id="new-owner">
                    <div class="name">{% trans "Add owner" %}</div>
                    <div id="new-owner-form">
                        <input type="text" placeholder="{% trans "Owner name/NEPTUN" %}" disabled="disabled" />
                        <input type="submit" value="{% trans "Add owner" %}" data-id="{{group.id}}" disabled="disabled" />
                    </div>
                    <div class="clear"></div>
                </div>
            </li>
        </ul>
    </div>
</div>
<div class="boxes">
    {% if noshare %}
        <div class="tooltip" style="position:absolute">
            <div class="container">
                <p>
                    {% trans "This group has no shared templates." %}
                </p>
                <p>
                    {% trans "Share one, and the group members can start their own virtual machine." %}
                </p>
                <div class="tail"></div>
            </div>
        </div>
    {% endif %}
    {% include "box-templatelist.html" %}
</div>
{% endblock %}
