From 978eb3973ed35c47b38117b687c645160d7e7550 Mon Sep 17 00:00:00 2001 From: Daniel Pan Date: Sun, 31 Jan 2016 22:06:40 +0800 Subject: [PATCH 01/17] Add grid view for dirView --- media/css/seahub.css | 127 +++--- seahub/templates/js/dir-view.html | 2 + seahub/templates/js/templates.html | 35 ++ seahub/templates/view_shared_dir.html | 16 +- static/scripts/app/views/dir.js | 250 +++++++----- static/scripts/app/views/dirent-grid.js | 521 ++++++++++++++++++++++++ 6 files changed, 797 insertions(+), 154 deletions(-) create mode 100644 static/scripts/app/views/dirent-grid.js diff --git a/media/css/seahub.css b/media/css/seahub.css index f6c6731df8..54915473cc 100644 --- a/media/css/seahub.css +++ b/media/css/seahub.css @@ -3727,54 +3727,6 @@ img.thumbnail { .shared-dir-zip { margin-left:5px; } -.grid { - display:inline-block; - width:100px; - padding:10px 24px; - position:relative; -} -.grid .img-link, -.grid .text-link { - display:block; - text-align:center; -} -.grid .img-link { - height:100px; - font-size:0; - line-height:0; - border-radius:3px; - margin-bottom:6px; -} -.grid .img-link:before { - content:' '; - display:inline-block; - vertical-align:middle; - height:100%; -} -.grid .thumbnail { - max-width:96px; - max-height:96px; - padding:1px; - border:1px solid #ddd; - border-radius:3px; -} -.grid .text-link { - color:#333; - font-size:14px; - line-height:17px; - height:34px; - white-space:normal; -} -.grid .op-icon { - position:absolute; - top:10px; - right:24px; - padding:2px 6px; - background:#fff; - border:1px solid #eee; - border-radius:3px; - margin:0; -} /**** #groups ****/ /* groups page */ #groups .group-name { font-size:16px; @@ -3833,3 +3785,82 @@ img.thumbnail { #add-group-members-form .submit { margin:0 0 0 5px; } +/****** grid view *****/ +/* view mode */ +.switch-mode { + display:inline-block; + margin-left:12px; +} +.switch-mode .active { + background:#ccc; +} +.list-view-btn, +.grid-view-btn { + outline:none; + padding:3px 6px 4px; + height:20px; + border:1px solid #ccc; + background:#fff; + display:inline-block; +} +.grid-view-btn { + border-left:none; +} +/* grid view */ +.grid-item { + display:inline-block; + width:100px; + padding:10px 24px; + position:relative; +} +.grid-item .img-link { + display:block; + text-align:center; + height:100px; + font-size:0; + line-height:0; + border-radius:3px; + margin-bottom:6px; +} +.grid-item .img-link:before { + content:' '; + display:inline-block; + vertical-align:middle; + height:100%; +} +.grid-item .img-link.hl { + background:#f8f8f8; +} +.grid-item .thumbnail { + max-width:96px; + max-height:96px; + padding:1px; + border:1px solid #ddd; + border-radius:3px; +} +.grid-item .text-link { + display:block; + text-align:center; + color:#333; + font-size:14px; + line-height:17px; + height:34px; + white-space:normal; +} +.grid-item .text-link.hl { + color:#f93; + background:#fff; +} +.grid-item .op-icon { + position:absolute; + top:10px; + right:24px; + padding:2px 6px; + background:#fff; + border:1px solid #eee; + border-radius:3px; + margin:0; +} +#dir-view .grid-item { + padding:10px 20px; /* use less padding */ +} diff --git a/seahub/templates/js/dir-view.html b/seahub/templates/js/dir-view.html index dcfa17a000..7540ad681b 100644 --- a/seahub/templates/js/dir-view.html +++ b/seahub/templates/js/dir-view.html @@ -8,6 +8,8 @@ +

diff --git a/seahub/templates/js/templates.html b/seahub/templates/js/templates.html index c8360cc404..a0fefa1d56 100644 --- a/seahub/templates/js/templates.html +++ b/seahub/templates/js/templates.html @@ -147,6 +147,12 @@ <% if (!encrypted && can_generate_shared_link) { %> <% } %> + +
+ + +
+ <% if (path == '/') { %>
<% if (user_perm == 'rw') { %> @@ -349,6 +355,35 @@ <% } %> + + + + + + + + + + + + + @@ -420,9 +406,7 @@
  • {% trans "Rename" %}
  • {% trans "Move" %}
  • {% trans "Copy" %}
  • - <% if (is_pro) { %>
  • {% trans "Open via Client" %}
  • - <% } %> <% } %> diff --git a/seahub/templates/libraries.html b/seahub/templates/libraries.html index 4cf339f858..5478debb1f 100644 --- a/seahub/templates/libraries.html +++ b/seahub/templates/libraries.html @@ -238,7 +238,6 @@ - -