1
0
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:
xiez
2012-05-29 11:04:03 +08:00
parent 966971446d
commit 4c69bfa942
4 changed files with 18 additions and 3 deletions

2
po.py
View File

@@ -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'合并了其他人的修改',
} }

View File

@@ -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 %}

View File

@@ -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 %}

View File

@@ -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):