{% load seahub_tags group_avatar_tags i18n %}
{% load url from future %}

<h3>{% trans "My Groups" %}</h3>
<button id="group-add"><span class="add icon-plus-sign-alt"></span>{% trans "New Group" %}</button>
{% if joined_groups %}
<ul class="group-list w100 ovhd">
    {% for group in joined_groups %}
    <li class="group ovhd">
    <a href="{{ SITE_ROOT }}group/{{ group.props.id }}/" class="no-deco fleft" title="{{ group.props.group_name }}">{% grp_avatar group.props.id 56 %}</a>
    <div class="txt fright">
        <h4><a href="{% url 'group_info' group.props.id %}">{{ group.props.group_name }}</a></h4>
        <p><span class="item-name">{% trans "Creator: " %}</span>{{ group.props.creator_name }}</p>
        <p><span class="item-name">{% trans "Time: "%}</span>{{ group.props.timestamp|tsstr_sec }}</p>
        <div class="fast vh">
            <a href="{% url 'group_info' group.props.id %}" title="{% trans "Libraries" %}" class="a"><span class="sf2-icon-archive"></span></a>
            <a href="{% url 'group_discuss' group.props.id %}" title="{% trans "Discussion" %}" class="a discuss"><span class="icon-comment"></span></a>
            {% if group.wiki_enabled %}
            <a href="{% url 'group_wiki' group.props.id %}" title="{% trans "Wiki" %}" class="a"><span class="icon-book"></span></a>
            {% endif %}
        </div>
    </div>
    </li>
    {% endfor %}
</ul>
{% else %}
<div class="empty-tips">
  <h2 class="alc">{% trans "You are not in any groups" %}</h2>
  <p>{% blocktrans %}You can create a group by clicking "New Group" button. Group is a place for you and your friends leaving messages and collaborating on libraries.{% endblocktrans %}</p>
</div>
{% endif %}
<form id="group-add-form" action="" method="post" name="group-add-form" class="hide">{% csrf_token %}
    <h3>{% trans "New Group" %}</h3>
    <label>{% trans "Group Name" %}</label><br />
    <input id="group_name" name="group_name" value="" class="input" /><br />
    <p class="error hide"></p>
    <input id="group-add-submit" type="submit" class="submit" value="{% trans "Submit" %}" />
</form>
