2012-04-24 08:15:29 +00:00
|
|
|
{% extends "myhome_base.html" %}
|
|
|
|
{% load seahub_tags %}
|
|
|
|
|
|
|
|
{% 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-05-30 06:12:48 +00:00
|
|
|
<th width="10%">修改者</th>
|
2012-05-31 11:21:07 +00:00
|
|
|
<th width="65%">描述</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-05-29 12:29:59 +00:00
|
|
|
<td>{{ commit.props.ctime|translate_commit_time }}</td>
|
2012-05-31 04:00:32 +00:00
|
|
|
|
2012-04-28 11:47:38 +00:00
|
|
|
{% if commit.props.creator_name %}
|
|
|
|
<td>{{ commit.props.creator_name }}</td>
|
|
|
|
{% 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-05-30 06:44:03 +00:00
|
|
|
<a href="{{ SITE_ROOT }}repo/history/dir/{{ repo.id }}/?commit_id={{ commit.id }}" class="op">浏览</a>
|
2012-05-29 03:04:03 +00:00
|
|
|
{% if is_owner %}
|
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-29 03:04:03 +00:00
|
|
|
{% endif %}
|
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-05-31 09:50:46 +00:00
|
|
|
var str_time_author = '<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-05-31 09:50:46 +00:00
|
|
|
var str_title = '<h3>修改详情' + str_time_author + '</h3>';
|
2012-05-30 06:11:33 +00:00
|
|
|
var str_con = '';
|
|
|
|
var show = function(data_) {
|
|
|
|
str_con += '<ul>';
|
|
|
|
for (var i = 0, len = data_.length; i < len; i++) {
|
|
|
|
str_con += '<li>' + data_[i] + '</li>';
|
|
|
|
}
|
|
|
|
str_con += '</ul>';
|
|
|
|
};
|
|
|
|
if (data['new'].length > 0) {
|
|
|
|
str_con += '<h4 id="ls-ch-new">新文件</h4>';
|
|
|
|
show(data['new']);
|
|
|
|
}
|
|
|
|
if (data['removed'].length > 0) {
|
|
|
|
str_con += '<h4 id="ls-ch-rm">删除的文件</h4>';
|
|
|
|
show(data['removed']);
|
|
|
|
}
|
|
|
|
if (data['renamed'].length > 0) {
|
|
|
|
str_con += '<h4 id="ls-ch-rn">移动的文件</h4>';
|
|
|
|
show(data['renamed']);
|
|
|
|
}
|
|
|
|
if (data['modified'].length > 0) {
|
|
|
|
str_con += '<h4 id="ls-ch-modi">修改的文件</h4>';
|
|
|
|
show(data['modified']);
|
|
|
|
}
|
|
|
|
if (!str_con) {
|
|
|
|
str_con = '<p>没有文件被改动</p>';
|
|
|
|
}
|
2012-05-31 09:50:46 +00:00
|
|
|
$('#ls-ch').html(str_title + str_con);
|
2012-05-30 06:11:33 +00:00
|
|
|
$('#ls-ch').modal({appendTo:'#main'});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
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 %}
|