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