{% load seahub_tags avatar_tags i18n %}

{% for e_group in event_groups %}
<h4 class="event-group-hd">{{ e_group.date }}</h4>
<ol class="event-group-bd">
    {% for e in e_group.events %}
    <li class="event-item">
        {% avatar e.author 36 %}
        <div class="txt">
            {% if e.etype == "repo-update" %}
            {% with repo=e.repo commit=e.commit %} 
            <p class="w100 ovhd">
            <a href="{% url 'view_common_lib_dir' repo.id '' %}" class="updated-repo normal fright">{{ repo.name }}</a>
            <span class="cmt-desc">
            {{ commit.converted_cmmt_desc|translate_commit_desc_escape|safe }}
            {% if commit.more_files %}
              {% if repo.encrypted %}
              <a class="lsch-encrypted"{% if repo.password_set %} data-passwordset="true"{% endif %} href="#" data-url="{% url 'repo_history_changes' repo.id %}?commit_id={{ commit.id }}" data-repoid="{{repo.id}}" data-reponame="{{repo.name}}" data-time="{{ commit.props.ctime|tsstr_sec }}">{% trans 'Details' %}</a>
              {% else %}
              <a class="lsch" href="#" data-url="{% url 'repo_history_changes' repo.id %}?commit_id={{ commit.id }}" data-time="{{ commit.props.ctime|tsstr_sec }}">{% trans 'Details' %}</a>
              {% endif %}
            {% endif %}
            </span>
            </p>
            {% endwith %}
            {% endif %}

            {% if e.etype == "repo-create" %}
            <p>{% trans "Created library" %} <a href="{% url 'view_common_lib_dir' e.repo_id '' %}" class="normal">{{ e.repo_name }}</a></p>
            {% endif %}

            {% if e.etype == "repo-delete" %}
            <p>{% blocktrans with library_name=e.repo_name %}Deleted library {{ library_name }}{% endblocktrans %}</p>
            {% endif %}

            <p><a class="normal" href="{% url 'user_profile' e.author %}">{{ e.author|email2nickname }}</a> <span class="time">{{ e.time|translate_seahub_time }}</span></p>
        </div>
    </li>
    {% endfor %}
</ol>
{% endfor %}
