mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-03 16:10:26 +00:00
Modify repo history
This commit is contained in:
2
po.py
2
po.py
@@ -8,6 +8,6 @@ TRANSLATION_MAP = {
|
||||
'Renamed' : u'重命名了',
|
||||
'and' : u'以及另外',
|
||||
'more files' : u'个文件',
|
||||
'Reverted repo to status at' : u'同步目录状态恢复到',
|
||||
'Reverted repo to status at' : u'同步目录内容还原到',
|
||||
'Merged others\' changes' : u'合并了其他人的修改',
|
||||
}
|
||||
|
@@ -31,6 +31,8 @@
|
||||
|
||||
{% block extra_script %}
|
||||
<script type="text/javascript">
|
||||
addConfirmTo($('.logout-btn'), '确定要退出登录?')
|
||||
$('.logout-btn').click(function(){
|
||||
//location.href = $(this).attr('data');
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
@@ -29,7 +29,9 @@
|
||||
{% if not forloop.last %}
|
||||
<td>
|
||||
<a href="{{ SITE_ROOT }}repo/history/dir/{{ repo.id }}/?commit_id={{ commit.id }}">浏览</a>
|
||||
<a href="{{ SITE_ROOT }}repo/history/revert/{{ repo.id }}/?commit_id={{ commit.id }}">还原</a>
|
||||
{% if is_owner %}
|
||||
<a href="#" data="{{ SITE_ROOT }}repo/history/revert/{{ repo.id }}/?commit_id={{ commit.id }}" class="repo-revert">还原</a>
|
||||
{% endif %}
|
||||
</td>
|
||||
{% else %}
|
||||
<td></td>
|
||||
@@ -62,3 +64,9 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block extra_script %}
|
||||
<script type="text/javascript">
|
||||
addConfirmTo($(".repo-revert"), '确定要还原该目录?');
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
5
views.py
5
views.py
@@ -279,6 +279,10 @@ def repo_history(request, repo_id):
|
||||
else:
|
||||
page_next = False
|
||||
|
||||
is_owner = False
|
||||
if request.user.is_authenticated():
|
||||
if validate_owner(request, repo_id):
|
||||
is_owner = True
|
||||
|
||||
return render_to_response('repo_history.html', {
|
||||
"repo": repo,
|
||||
@@ -288,6 +292,7 @@ def repo_history(request, repo_id):
|
||||
'next_page': current_page+1,
|
||||
'per_page': per_page,
|
||||
'page_next': page_next,
|
||||
'is_owner': is_owner,
|
||||
}, context_instance=RequestContext(request))
|
||||
|
||||
def repo_history_dir(request, repo_id):
|
||||
|
Reference in New Issue
Block a user