2012-07-30 02:25:46 +00:00
|
|
|
{% extends base_template %}
|
2012-08-09 09:19:15 +00:00
|
|
|
{% load seahub_tags avatar_tags %}
|
2012-04-24 08:15:29 +00:00
|
|
|
|
|
|
|
{% block left_panel %}
|
2012-05-19 13:27:46 +00:00
|
|
|
<h3>操作</h3>
|
|
|
|
<ul class="with-bg">
|
2012-05-04 08:18:27 +00:00
|
|
|
<li><a href="{{ SITE_ROOT }}repo/{{ repo.props.id }}/">返回同步目录</a></li>
|
2012-04-24 08:15:29 +00:00
|
|
|
</ul>
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block right_panel %}
|
2012-05-31 18:10:31 +00:00
|
|
|
<h2 class="repo-history">{{repo.props.name}} 修改历史</h2>
|
2012-04-24 08:15:29 +00:00
|
|
|
<table>
|
|
|
|
<tr>
|
2012-05-31 11:21:07 +00:00
|
|
|
<th width="12%">修改时间</th>
|
2012-08-11 07:42:23 +00:00
|
|
|
<th width="13%">修改者</th>
|
|
|
|
<th width="62%">描述</th>
|
2012-05-30 12:23:28 +00:00
|
|
|
<th width="13%">操作</th>
|
2012-04-24 08:15:29 +00:00
|
|
|
</tr>
|
2012-05-31 04:00:32 +00:00
|
|
|
|
2012-04-24 08:15:29 +00:00
|
|
|
{% for commit in commits %}
|
|
|
|
<tr>
|
2012-08-09 09:19:15 +00:00
|
|
|
<td>{{ commit.ctime|translate_commit_time }}</td>
|
2012-05-31 04:00:32 +00:00
|
|
|
|
2012-08-09 09:19:15 +00:00
|
|
|
{% if commit.creator_name %}
|
|
|
|
<td>
|
2012-08-11 07:38:00 +00:00
|
|
|
<a href="{{ SITE_ROOT }}profile/{{ commit.creator_name }}/">{% avatar commit.creator_name 16 %}</a>
|
|
|
|
<a href="{{ SITE_ROOT }}profile/{{ commit.creator_name }}/">{{ commit.creator_name|email2nickname }}</a>
|
2012-08-09 09:19:15 +00:00
|
|
|
</td>
|
2012-04-28 11:47:38 +00:00
|
|
|
{% else %}
|
|
|
|
<td>未知</td>
|
|
|
|
{% endif %}
|
2012-05-31 04:00:32 +00:00
|
|
|
|
2012-05-30 06:11:33 +00:00
|
|
|
<td>
|
2012-05-31 04:00:32 +00:00
|
|
|
{{ commit.props.desc|translate_commit_desc }}
|
|
|
|
{% if not forloop.last %}
|
|
|
|
<a class="lsch" href="{{ SITE_ROOT }}repo/history/changes/{{ repo.id }}/?commit_id={{ commit.id }}" data="{{ commit.props.ctime|tsstr_sec }}">详情</a>
|
|
|
|
{% endif %}
|
|
|
|
</td>
|
|
|
|
|
2012-05-22 07:28:24 +00:00
|
|
|
{% if not forloop.last %}
|
2012-05-25 09:07:08 +00:00
|
|
|
<td>
|
2012-07-03 13:48:33 +00:00
|
|
|
<a href="{{ SITE_ROOT }}repo/{{ repo.id }}/?commit_id={{ commit.id }}&history=y" class="op">浏览</a>
|
2012-05-30 06:44:03 +00:00
|
|
|
<a href="#" data="{{ SITE_ROOT }}repo/history/revert/{{ repo.id }}/?commit_id={{ commit.id }}" class="repo-revert op">还原</a>
|
2012-05-30 06:12:48 +00:00
|
|
|
</td>
|
2012-05-22 07:28:24 +00:00
|
|
|
{% else %}
|
|
|
|
<td></td>
|
|
|
|
{% endif %}
|
2012-04-24 08:15:29 +00:00
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</table>
|
|
|
|
<div id="paginator">
|
|
|
|
{% if current_page != 1 %}
|
|
|
|
<a href="?page={{ prev_page }}&per_page={{ per_page }}">上一页</a>
|
|
|
|
{% endif %}
|
|
|
|
{% if page_next %}
|
|
|
|
<a href="?page={{ next_page }}&per_page={{ per_page }}">下一页</a>
|
|
|
|
{% endif %}
|
|
|
|
<span>每页:</span>
|
|
|
|
{% if per_page == 25 %}
|
|
|
|
<span> 25 </span>
|
|
|
|
{% else %}
|
|
|
|
<a href="?per_page=25" class="per-page">25</a>
|
|
|
|
{% endif %}
|
|
|
|
{% if per_page == 50 %}
|
|
|
|
<span> 50 </span>
|
|
|
|
{% else %}
|
|
|
|
<a href="?per_page=50" class="per-page">50</a>
|
|
|
|
{% endif %}
|
|
|
|
{% if per_page == 100 %}
|
|
|
|
<span> 100 </span>
|
|
|
|
{% else %}
|
|
|
|
<a href="?per_page=100" class="per-page">100</a>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
2012-05-30 06:11:33 +00:00
|
|
|
|
|
|
|
<div id="ls-ch" class="hide"></div><!--list modification details of a commit-->
|
2012-04-24 08:15:29 +00:00
|
|
|
{% endblock %}
|
2012-05-29 03:04:03 +00:00
|
|
|
|
|
|
|
{% block extra_script %}
|
|
|
|
<script type="text/javascript">
|
2012-05-31 04:00:32 +00:00
|
|
|
//list modification made by a commit
|
|
|
|
$('.lsch').each(function() {
|
2012-05-30 06:11:33 +00:00
|
|
|
$(this).click(function() {
|
2012-07-05 09:44:43 +00:00
|
|
|
var time = '<span class="latest-commit-time-author">(' + $(this).attr('data') + ')</span>';
|
2012-05-30 06:11:33 +00:00
|
|
|
$.ajax({
|
|
|
|
url: $(this).attr('href'),
|
|
|
|
dataType: 'json',
|
|
|
|
cache: false,
|
|
|
|
contentType: 'application/json; charset=utf-8',
|
|
|
|
success: function(data) {
|
2012-07-05 09:44:43 +00:00
|
|
|
var title = '<h3>修改详情' + time + '</h3>',
|
|
|
|
con = '';
|
2012-05-30 06:11:33 +00:00
|
|
|
var show = function(data_) {
|
2012-07-05 09:44:43 +00:00
|
|
|
con += '<ul>';
|
2012-05-30 06:11:33 +00:00
|
|
|
for (var i = 0, len = data_.length; i < len; i++) {
|
2012-07-05 09:44:43 +00:00
|
|
|
con += '<li>' + data_[i] + '</li>';
|
2012-05-30 06:11:33 +00:00
|
|
|
}
|
2012-07-05 09:44:43 +00:00
|
|
|
con += '</ul>';
|
2012-05-30 06:11:33 +00:00
|
|
|
};
|
|
|
|
if (data['new'].length > 0) {
|
2012-07-05 09:44:43 +00:00
|
|
|
con += '<h4 id="ls-ch-new">新文件</h4>';
|
2012-05-30 06:11:33 +00:00
|
|
|
show(data['new']);
|
|
|
|
}
|
|
|
|
if (data['removed'].length > 0) {
|
2012-07-05 09:44:43 +00:00
|
|
|
con += '<h4 id="ls-ch-rm">删除的文件</h4>';
|
2012-05-30 06:11:33 +00:00
|
|
|
show(data['removed']);
|
|
|
|
}
|
|
|
|
if (data['renamed'].length > 0) {
|
2012-07-05 09:44:43 +00:00
|
|
|
con += '<h4 id="ls-ch-rn">重命名或移动的文件</h4>';
|
2012-05-30 06:11:33 +00:00
|
|
|
show(data['renamed']);
|
|
|
|
}
|
|
|
|
if (data['modified'].length > 0) {
|
2012-07-05 09:44:43 +00:00
|
|
|
con += '<h4 id="ls-ch-modi">修改的文件</h4>';
|
2012-05-30 06:11:33 +00:00
|
|
|
show(data['modified']);
|
|
|
|
}
|
2012-07-05 11:56:39 +00:00
|
|
|
if (data['newdir'].length > 0) {
|
|
|
|
con += '<h4 id="ls-ch-newdir">新目录</h4>';
|
|
|
|
show(data['newdir']);
|
|
|
|
}
|
|
|
|
if (data['deldir'].length > 0) {
|
|
|
|
con += '<h4 id="ls-ch-deldir">删除的目录</h4>';
|
|
|
|
show(data['deldir']);
|
|
|
|
}
|
2012-07-05 09:44:43 +00:00
|
|
|
if (!con) {
|
|
|
|
con = '<p>没有文件被改动</p>';
|
2012-05-30 06:11:33 +00:00
|
|
|
}
|
2012-07-05 09:44:43 +00:00
|
|
|
$('#ls-ch').html(title + con).modal({appendTo:'#main', maxHeight: window.innerHeight - 57, autoResize:true});
|
2012-05-30 06:11:33 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2012-05-31 04:00:32 +00:00
|
|
|
addConfirmTo($(".repo-revert"), '确定要还原该目录?');
|
2012-05-30 11:59:15 +00:00
|
|
|
</script>
|
2012-05-29 03:04:03 +00:00
|
|
|
{% endblock %}
|