mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-04 00:20:07 +00:00
Modify repo history list page
* Remove restore * Add tooltip
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
# Django settings for seahub project.
|
# Django settings for seahub project.
|
||||||
import os
|
import os
|
||||||
|
|
||||||
DEBUG = True
|
DEBUG = False
|
||||||
TEMPLATE_DEBUG = DEBUG
|
TEMPLATE_DEBUG = DEBUG
|
||||||
|
|
||||||
ADMINS = (
|
ADMINS = (
|
||||||
|
@@ -7,6 +7,8 @@
|
|||||||
<h2 class="fleft">{{repo.props.name}} 修改历史</h2>
|
<h2 class="fleft">{{repo.props.name}} 修改历史</h2>
|
||||||
<button data="{{ SITE_ROOT }}repo/{{ repo.props.id }}/" class="fright" id="history-back-to-repo">返回同步目录</button>
|
<button data="{{ SITE_ROOT }}repo/{{ repo.props.id }}/" class="fright" id="history-back-to-repo">返回同步目录</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<p class="tip">Tip:在每次修改后会生成一个镜像,记录修改后的目录状态。</p>
|
||||||
<div class="commit-list-outer-container">
|
<div class="commit-list-outer-container">
|
||||||
<div class="commit-list-inner-container">
|
<div class="commit-list-inner-container">
|
||||||
<table class="commit-list">
|
<table class="commit-list">
|
||||||
@@ -32,18 +34,18 @@
|
|||||||
|
|
||||||
<td>
|
<td>
|
||||||
{{ commit.props.desc|translate_commit_desc }}
|
{{ commit.props.desc|translate_commit_desc }}
|
||||||
{% if not forloop.last %}
|
{% if page_next or 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>
|
<a class="lsch" href="{{ SITE_ROOT }}repo/history/changes/{{ repo.id }}/?commit_id={{ commit.id }}" data="{{ commit.props.ctime|tsstr_sec }}">详情</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
{% if not forloop.last %}
|
|
||||||
|
{% if forloop.first and current_page == 1 %}
|
||||||
|
<td>这是当前版本</td>
|
||||||
|
{% else %}
|
||||||
<td>
|
<td>
|
||||||
<a href="{% url 'repo_history_view' repo.id %}?commit_id={{ commit.id }}" class="op">浏览</a>
|
<a href="{% url 'repo_history_view' repo.id %}?commit_id={{ commit.id }}" class="op">查看镜像</a>
|
||||||
<a href="#" data="{{ SITE_ROOT }}repo/history/revert/{{ repo.id }}/?commit_id={{ commit.id }}" class="repo-revert op">还原</a>
|
|
||||||
</td>
|
</td>
|
||||||
{% else %}
|
|
||||||
<td></td>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
6
views.py
6
views.py
@@ -518,11 +518,6 @@ 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,
|
||||||
"commits": commits,
|
"commits": commits,
|
||||||
@@ -531,7 +526,6 @@ 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))
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
|
Reference in New Issue
Block a user