From 65f591b431b26e65e779fc45355c9b2b40b75518 Mon Sep 17 00:00:00 2001 From: llj Date: Tue, 21 Feb 2017 18:23:14 +0800 Subject: [PATCH 1/3] [file view] modification --- media/css/seahub.css | 37 +++++++++----- seahub/templates/view_file_base.html | 74 +++++++++++----------------- 2 files changed, 53 insertions(+), 58 deletions(-) diff --git a/media/css/seahub.css b/media/css/seahub.css index e29f4cc11b..7bbd57bdd8 100644 --- a/media/css/seahub.css +++ b/media/css/seahub.css @@ -2629,6 +2629,13 @@ button.sf-dropdown-toggle:focus { } /* file view online, file edit */ +.file-view-hd { + font-size:1.4em; + margin-bottom:0px; +} +.file-view-op { + margin-top:10px; +} #shared-link, #shared-upload-link, #shared-link-text, @@ -2664,7 +2671,7 @@ button.sf-dropdown-toggle:focus { #file-view-tip { height:130px; padding:30px 10px 10px; - width:930px; + width:950px; background:#fff; text-align:center; } @@ -2674,24 +2681,28 @@ button.sf-dropdown-toggle:focus { font-family: Consolas,"Liberation Mono",Courier,monospace;/*override .ace_editor*/ min-height: 200px; } -#img-prev { +#img-prev, +#img-next { position:absolute; + top:48%; + text-decoration:none; + color:#888; + width:50px; + height:50px; + background:#fff; + border-radius:100%; + line-height:50px; +} +#img-prev { left:15px; } #img-next { - position:absolute; right:15px; } -#img-prev, -#img-next { - top:48%; - text-decoration:none; - color: #333; - width: 50px; - height: 50px; - background: #fff; - border-radius: 100%; - line-height: 50px; + +#img-prev:hover, +#img-next:hover { + color:#333; } #image-view { padding:1px; diff --git a/seahub/templates/view_file_base.html b/seahub/templates/view_file_base.html index 005b567f42..dcb4fc1e11 100644 --- a/seahub/templates/view_file_base.html +++ b/seahub/templates/view_file_base.html @@ -13,47 +13,32 @@ {% block main_css_class %}{% endblock %} {# remove the padding-top css #} {% block main_content %} -
-

{{ filename }} - {% if is_starred %} - - {% else %} - - {% endif %} +
+
+

+ {{ filename }} + {% if is_starred %} + + {% else %} + + {% endif %} - {% if is_pro %} - {% trans - {% endif %} -

-
- -
-

- {% trans "Current Path: "%} - {% for name, link in zipped %} - {% if not forloop.last %} - {{ name }} / - {% else %} - {{ name }} - {% endif %} - {% endfor %} -

-
- -
-
-
- {% avatar latest_contributor 24 %} {{ latest_contributor|email2nickname }} + {% if is_pro %} + {% trans + {% endif %} +

+
+ {{ latest_contributor|email2nickname }} {{ last_modified|translate_seahub_time}} {% block update_detail %} {% if last_commit_id %} {% trans "updated this file"%}. {% endif %} {% endblock %} -
+
-
+
{% if can_lock_unlock_file %} {% if not file_locked %} @@ -82,22 +67,21 @@ -
- -
-
- {% if err %} -
- {% if err != 'invalid extension' %} -

{{ err }}

- {% endif %} -
- {% else %} - {% block file_view %}{% endblock %} - {% endif %} +
+
+ +
+ {% if err %} +
+ {% if err != 'invalid extension' %} +

{{ err }}

+ {% endif %}
+ {% else %} + {% block file_view %}{% endblock %} + {% endif %}
{% include "snippets/file_share_popup.html" %} From 059954689cdb3c4f10dc17acfd8d6fb37bc70916 Mon Sep 17 00:00:00 2001 From: llj Date: Wed, 22 Feb 2017 11:30:07 +0800 Subject: [PATCH 2/3] [file view] fix --- seahub/templates/view_file_base.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/seahub/templates/view_file_base.html b/seahub/templates/view_file_base.html index dcb4fc1e11..df5f00cda2 100644 --- a/seahub/templates/view_file_base.html +++ b/seahub/templates/view_file_base.html @@ -72,7 +72,7 @@
-
+
{% if err %}
{% if err != 'invalid extension' %} @@ -80,7 +80,7 @@ {% endif %}
{% else %} - {% block file_view %}{% endblock %} + {% block file_view %}{% endblock %} {% endif %}
From e2282716da6ae56354ef089775e0c9cdfd8babbb Mon Sep 17 00:00:00 2001 From: llj Date: Wed, 22 Feb 2017 17:52:35 +0800 Subject: [PATCH 3/3] [history/snapshot/shared/trash file view] modified 'view-hd' --- media/css/seahub.css | 5 ++- seahub/templates/shared_file_view.html | 7 ++-- .../templates/snippets/file_content_html.html | 2 +- seahub/templates/view_file_base.html | 2 +- seahub/templates/view_history_file.html | 32 ++++++------------- seahub/templates/view_snapshot_file.html | 16 ---------- seahub/templates/view_trash_file.html | 6 +--- 7 files changed, 19 insertions(+), 51 deletions(-) diff --git a/media/css/seahub.css b/media/css/seahub.css index 7bbd57bdd8..ec7690d41f 100644 --- a/media/css/seahub.css +++ b/media/css/seahub.css @@ -2636,6 +2636,9 @@ button.sf-dropdown-toggle:focus { .file-view-op { margin-top:10px; } +.file-view-meta-info { + margin:0; +} #shared-link, #shared-upload-link, #shared-link-text, @@ -3476,7 +3479,7 @@ button.sf-dropdown-toggle:focus { } .shared-file-op-btn { padding:7px; - margin-top:11px; + margin-top:9px; } /*random password */ #share-popup .passwd-wrapper, diff --git a/seahub/templates/shared_file_view.html b/seahub/templates/shared_file_view.html index ceb0df1937..8ef2fdde11 100644 --- a/seahub/templates/shared_file_view.html +++ b/seahub/templates/shared_file_view.html @@ -13,7 +13,7 @@ {% endif %}
-

{{ file_name }}

+

{{ file_name }}

{% if zipped %}

{% trans "Current path: "%} @@ -42,10 +42,7 @@

-
- {% include 'snippets/file_content_html.html' %} -
- + {% include 'snippets/file_content_html.html' %}
{% csrf_token %}

{% trans "Save To:" %}

diff --git a/seahub/templates/snippets/file_content_html.html b/seahub/templates/snippets/file_content_html.html index 5552c1be68..e323792f7f 100644 --- a/seahub/templates/snippets/file_content_html.html +++ b/seahub/templates/snippets/file_content_html.html @@ -4,7 +4,7 @@ content of files that can be viewed online shows here. For details please refer to 'snippets/file_content_js.html'. {% endcomment %} -
+
{% include 'snippets/file_encoding.html' %} {% if not err %} {% if filetype == 'Text' or filetype == 'Markdown' %} diff --git a/seahub/templates/view_file_base.html b/seahub/templates/view_file_base.html index df5f00cda2..674ee6afec 100644 --- a/seahub/templates/view_file_base.html +++ b/seahub/templates/view_file_base.html @@ -285,7 +285,7 @@ if (ref_list.length > 1 && ref_list[0].indexOf('search') > 0) { $(window).load(function() { if (highlight_kw) { // hl kw in file title - highlight_kw($('#view-hd')[0]); + highlight_kw($('.file-view-hd span')[0]); // hl kw in file content if ('{{filetype}}' == 'Markdown') { diff --git a/seahub/templates/view_history_file.html b/seahub/templates/view_history_file.html index 61043b4e5b..894070151b 100644 --- a/seahub/templates/view_history_file.html +++ b/seahub/templates/view_history_file.html @@ -12,30 +12,18 @@ {% block main_css_class %}{% endblock %} {# remove the padding-top css #} {% block main_content %} -
- {% block view_hd %} -

- {{file_name}} - ({{ current_commit.props.ctime|tsstr_sec }}) -

- {% endblock %} -
- -
-
-

- {% block file_path %} - {% trans "Current Path: "%} - {% for name, link in zipped %} - {% if not forloop.last %} {{ name }} / {% else %} {{ name }} {% endif %} - {% endfor %} - {% endblock %} -

- - {% trans "Download"%} +
+
+

{{file_name}}

+ {% block file_path %} +

{{ current_commit.props.ctime|tsstr_sec }}

+ {% endblock %}
- {% include 'snippets/file_content_html.html' %} + + {% trans "Download"%}
+ + {% include 'snippets/file_content_html.html' %} {% endblock %} {% block extra_script %} diff --git a/seahub/templates/view_snapshot_file.html b/seahub/templates/view_snapshot_file.html index c76e4bede7..05486b7ddf 100644 --- a/seahub/templates/view_snapshot_file.html +++ b/seahub/templates/view_snapshot_file.html @@ -1,17 +1 @@ {% extends 'view_history_file.html' %} -{% load seahub_tags i18n %} -{% load url from future %} - -{% block view_hd %} -

- {{file_name}} - ({{ current_commit.props.ctime|tsstr_sec }}) -

-{% endblock %} - -{% block file_path %} - {% trans "Current Path: "%} - {% for name, link in zipped %} - {% if not forloop.last %} {{ name }} / {% else %} {{ name }} {% endif %} - {% endfor %} -{% endblock %} diff --git a/seahub/templates/view_trash_file.html b/seahub/templates/view_trash_file.html index bfff09ceca..221d4f2fcf 100644 --- a/seahub/templates/view_trash_file.html +++ b/seahub/templates/view_trash_file.html @@ -2,10 +2,6 @@ {% load i18n %} {% load url from future %} -{% block view_hd %} -

{{file_name}}

-{% endblock %} - {% block file_path %} - {% trans "Current Path: "%}{% trans "Trash" %} +

{% trans "Current Path: "%}{% trans "Trash" %}

{% endblock %}