diff --git a/templates/repo_view_file.html b/templates/repo_view_file.html index 07e964aa72..f6ef5b5a24 100644 --- a/templates/repo_view_file.html +++ b/templates/repo_view_file.html @@ -7,16 +7,25 @@ {% endblock %} {% block main_panel %} -

- {% if not view_history %} - {{ u_filename }} - {% else %} - {{repo.props.name}} - {% if page_from == 'snapshot' %}镜像浏览{% endif %} - {% if page_from == 'file_history' %}历史浏览{% endif %} - ({{ current_commit.props.ctime|tsstr_sec }}) + {% if not view_history %} +

{{ u_filename }}

+ {% else %} + {% if page_from == 'snapshot' %} +

+ {{repo.props.name}} 镜像浏览 + ({{ current_commit.props.ctime|tsstr_sec }}) +

{% endif %} - + {% if page_from == 'file_history' %} +
+

+ {{repo.props.name}} 历史浏览 + ({{ current_commit.props.ctime|tsstr_sec }}) +

+ +
+ {% endif %} + {% endif %}

当前路径: @@ -32,11 +41,7 @@ {{ name }} / {% endif %} {% else %} - {% if view_history and page_from == 'file_history' %} - {{ name }} - {% else %} {{ name }} - {% endif %} {% endif %} {% endfor %}

@@ -160,11 +165,8 @@ $('#view-original, #download').click(function() { window.open($(this).attr('data')); }); -$('#history').click(function() { - location.href = $(this).attr('data'); -}); {% if not view_history %} -$('#edit').click(function() { +$('#edit, #history').click(function() { location.href = $(this).attr('data'); }); function showLink() { @@ -337,8 +339,6 @@ $('#file-comment-form .submit').click(function() { }); {% endif %} -{% endif %} - function send_open_local_file_request(path) { var callback = 'xx'; $.ajax({ @@ -381,13 +381,6 @@ $('#download-repo').click(function() { location.href = $(this).attr('data'); }); -// When user clicks 'open local file': -// -// - First, check client version to determine is this operation supported by client -// - second check whether repo exists on local machine, then: -// - if exists, send an open local file requst -// - if not exits, redirect to repo download page - $('#open-local').click(function () { var path = $(this).attr('data'); var local_applet_running = false; @@ -420,5 +413,13 @@ $('#open-local').click(function () { } }, 2000); }); +//'not view_history' ends here +{% endif %} + +{% if view_history and page_from == 'file_history' %} +$('#back').click(function() { + location.href = $(this).attr('data'); +}); +{% endif %} {% endblock %}