1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-02 07:47:32 +00:00
seahub/templates/snippets/events.html

76 lines
3.8 KiB
HTML

{% load seahub_tags avatar_tags group_avatar_tags %}
{% load url from future %}
<h3>最近事件</h3>
<ul id="events" class="hide">
{% for ev in events %}
<li class="event-item w100 ovhd">
{% if ev.etype == 'repo-update' %}
{% with author=ev.commit.creator_name commit=ev.commit repo=ev.repo %}
<div class="pic fleft" data="{{ author }}">
<a href="{% url 'user_profile' author %}" title="{{ author|email2nickname}}">{% avatar author 40 %}</a>
</div>
<div class="txt fright">
<div class="event-hd">
<span class="time">{{ commit.ctime|translate_commit_time }}</span>
<a href="{% url 'user_profile' author %}" title="{{ author|email2nickname}}">{{ author|email2nickname }}</a>
</div>
<p>更新了资料库 <a href="{{SITE_ROOT}}repo/{{repo.id}}">{{ repo.name }}</a></p>
<p class="commit-msg ovhd">{{ commit.desc|translate_commit_desc }}
{% if repo.encrypted %}
{% if repo.password_set %}
<a class="lsch-encrypted" password_set="true" href="{{ SITE_ROOT }}repo/history/changes/{{ repo.id }}/?commit_id={{ commit.id }}" repo_id="{{repo.id}}" repo_name="{{repo.name}}" data="{{ commit.props.ctime|tsstr_sec }}">详情</a>
{% else %}
<a class="lsch-encrypted" password_set="false" href="{{ SITE_ROOT }}repo/history/changes/{{ repo.id }}/?commit_id={{ commit.id }}" repo_id="{{repo.id}}" repo_name="{{repo.name}}" data="{{ commit.props.ctime|tsstr_sec }}">详情</a>
{% endif %}
{% else %}
<a class="lsch" href="{{ SITE_ROOT }}repo/history/changes/{{ repo.id }}/?commit_id={{ commit.id }}" data="{{ commit.props.ctime|tsstr_sec }}">详情</a>
{% endif %}
</p>
</div>
{% endwith %}
{% endif %}
{% if ev.etype == 'repo-create' %}
{% with author=ev.creator repo_id=ev.repo_id repo_name=ev.repo_name %}
<div class="pic fleft" data="{{ author }}">
<a href="{% url 'user_profile' author %}" title="{{ author|email2nickname}}">{% avatar author 40 %}</a>
</div>
<div class="txt fright">
<div class="event-hd">
<span class="time">{{ ev.timestamp|translate_commit_time }}</span>
<a href="{% url 'user_profile' author %}" title="{{ author|email2nickname}}">{{ author|email2nickname }}</a>
</div>
<p>创建了资料库 <a href="{{SITE_ROOT}}repo/{{repo_id}}">{{ repo_name }}</a></p>
</div>
{% endwith %}
{% endif %}
{% if ev.etype == 'repo-delete' %}
{% with author=ev.repo_owner repo_name=ev.repo_name %}
<div class="pic fleft" data="{{ author }}">
<a href="{% url 'user_profile' author %}" title="{{ author|email2nickname}}">{% avatar author 40 %}</a>
</div>
<div class="txt fright">
<div class="event-hd">
<span class="time">{{ ev.timestamp|translate_commit_time }}</span>
<a href="{% url 'user_profile' author %}" title="{{ author|email2nickname}}">{{ author|email2nickname }}</a>
</div>
<p>删除了资料库 {{ repo_name }}</p>
</div>
{% endwith %}
{% endif %}
</li>
{% endfor %}
</ul>
<form id="repo-set-password-form" class="hide">
<h3>资料库 <span class="repo-name"></span> 已加密</h3>
<input type="hidden" name="repo_id" value="" />
<label>密码:</label>
<input type="password" name="password" maxlength="64" />
<p class="tip">密码只会在服务器上暂存1小时</p>
<p class="error"></p>
<input type="submit" class="submit" value="提交" />
<button class="simplemodal-close">取消</button>
</form>
<div id="ls-ch" class="hide"></div><!--list modification details of a commit-->