mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-21 03:18:23 +00:00
Merge pull request #1586 from haiwen/file_revisions
[views] Fix file revisions page
This commit is contained in:
@@ -60,7 +60,7 @@
|
||||
<tr>
|
||||
<td class="time">
|
||||
{{ commit.props.ctime|translate_seahub_time }}
|
||||
{% if commit.is_current_version %}
|
||||
{% if commit.is_first_commit %}
|
||||
{% trans '(current version)' %}
|
||||
{% endif %}
|
||||
|
||||
@@ -80,11 +80,9 @@
|
||||
|
||||
<td>{{ commit.rev_file_size|filesizeformat }} </td>
|
||||
<td>
|
||||
{% if commit.id != repo.head_cmmt_id %}
|
||||
{% if can_revert_file %}
|
||||
{% if can_revert_file and not commit.is_first_commit %}
|
||||
<a href="#" class="op vh restore-file" data-commit_id="{{ commit.id }}" data-commit_path="{{ commit.path }}">{% trans 'Restore' %}</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<a href="{% url "download_file" repo.id commit.rev_file_id %}?p={{commit.path|urlencode}}" class="op vh">{% trans 'Download' %}</a>
|
||||
<a href="{% url 'view_history_file' repo.id %}?obj_id={{ commit.rev_file_id }}&commit_id={{ commit.id }}&p={{commit.path|urlencode}}" class="op vh" target="_blank">{% trans 'View' %}</a>
|
||||
{% if can_compare and not forloop.last %}
|
||||
|
@@ -868,6 +868,8 @@ def render_file_revisions (request, repo_id):
|
||||
(is_locked and not locked_by_me):
|
||||
can_revert_file = False
|
||||
|
||||
commits[0].is_first_commit = True
|
||||
|
||||
# for 'go back'
|
||||
referer = request.GET.get('referer', '')
|
||||
|
||||
|
Reference in New Issue
Block a user