From 6f3ae6da9d9bf0ad925c483a16ca76b8a2736f9f Mon Sep 17 00:00:00 2001 From: Benjamin Gamard Date: Sat, 11 Nov 2017 23:25:52 +0100 Subject: [PATCH] Better thumbnails UI --- .../docs/controller/document/DocumentEdit.js | 5 +- .../document/DocumentViewContent.js | 32 +++---- .../app/docs/controller/document/FileView.js | 3 +- .../src/app/share/controller/FileView.js | 3 +- .../src/partial/docs/document.default.html | 94 ++++++++++--------- .../src/partial/docs/document.edit.html | 8 +- .../webapp/src/partial/docs/document.html | 4 +- .../partial/docs/document.view.content.html | 42 +++++---- .../src/main/webapp/src/partial/docs/tag.html | 2 +- .../main/webapp/src/partial/share/main.html | 4 +- .../main/webapp/src/partial/share/share.html | 7 +- docs-web/src/main/webapp/src/style/main.less | 78 +++++++++------ 12 files changed, 159 insertions(+), 123 deletions(-) diff --git a/docs-web/src/main/webapp/src/app/docs/controller/document/DocumentEdit.js b/docs-web/src/main/webapp/src/app/docs/controller/document/DocumentEdit.js index 99c07b60..de41440c 100644 --- a/docs-web/src/main/webapp/src/app/docs/controller/document/DocumentEdit.js +++ b/docs-web/src/main/webapp/src/app/docs/controller/document/DocumentEdit.js @@ -11,7 +11,10 @@ angular.module('docs').controller('DocumentEdit', function($rootScope, $scope, $ $scope.vocabularies = []; // Orphan files to add - $scope.orphanFiles = $stateParams.files ? $stateParams.files : []; + $scope.orphanFiles = []; + if ($stateParams.files) { + $scope.orphanFiles = _.isArray($stateParams.files) ? $stateParams.files : [ $stateParams.files ]; + } /** * Close an alert. diff --git a/docs-web/src/main/webapp/src/app/docs/controller/document/DocumentViewContent.js b/docs-web/src/main/webapp/src/app/docs/controller/document/DocumentViewContent.js index 2d33e949..0317163f 100644 --- a/docs-web/src/main/webapp/src/app/docs/controller/document/DocumentViewContent.js +++ b/docs-web/src/main/webapp/src/app/docs/controller/document/DocumentViewContent.js @@ -113,22 +113,22 @@ angular.module('docs').controller('DocumentViewContent', function ($scope, $root id: $stateParams.id } }) - .progress(function(e) { - newfile.progress = parseInt(100.0 * e.loaded / e.total); - }) - .success(function(data) { - // Update local model with real data - newfile.id = data.id; - newfile.size = data.size; + .progress(function(e) { + newfile.progress = parseInt(100.0 * e.loaded / e.total); + }) + .success(function(data) { + // Update local model with real data + newfile.id = data.id; + newfile.size = data.size; - // New file uploaded, increase used quota - $rootScope.userInfo.storage_current += data.size; - }) - .error(function (data) { - newfile.status = $translate.instant('document.view.content.upload_error'); - if (data.type === 'QuotaReached') { - newfile.status += ' - ' + $translate.instant('document.view.content.upload_error_quota'); - } - }); + // New file uploaded, increase used quota + $rootScope.userInfo.storage_current += data.size; + }) + .error(function (data) { + newfile.status = $translate.instant('document.view.content.upload_error'); + if (data.type === 'QuotaReached') { + newfile.status += ' - ' + $translate.instant('document.view.content.upload_error_quota'); + } + }); }; }); \ No newline at end of file diff --git a/docs-web/src/main/webapp/src/app/docs/controller/document/FileView.js b/docs-web/src/main/webapp/src/app/docs/controller/document/FileView.js index 45b86c10..5e80f083 100644 --- a/docs-web/src/main/webapp/src/app/docs/controller/document/FileView.js +++ b/docs-web/src/main/webapp/src/app/docs/controller/document/FileView.js @@ -7,7 +7,8 @@ angular.module('docs').controller('FileView', function($uibModal, $state, $state var modal = $uibModal.open({ windowClass: 'modal modal-fileview', templateUrl: 'partial/docs/file.view.html', - controller: 'FileModalView' + controller: 'FileModalView', + size: 'lg' }); // Returns to document view on file close diff --git a/docs-web/src/main/webapp/src/app/share/controller/FileView.js b/docs-web/src/main/webapp/src/app/share/controller/FileView.js index 9ae22d2d..3df5724e 100644 --- a/docs-web/src/main/webapp/src/app/share/controller/FileView.js +++ b/docs-web/src/main/webapp/src/app/share/controller/FileView.js @@ -7,7 +7,8 @@ angular.module('share').controller('FileView', function($uibModal, $state, $stat var modal = $uibModal.open({ windowClass: 'modal modal-fileview', templateUrl: 'partial/share/file.view.html', - controller: 'FileModalView' + controller: 'FileModalView', + size: 'lg' }); // Returns to share view on file close diff --git a/docs-web/src/main/webapp/src/partial/docs/document.default.html b/docs-web/src/main/webapp/src/partial/docs/document.default.html index 24b22bb3..dda7e611 100644 --- a/docs-web/src/main/webapp/src/partial/docs/document.default.html +++ b/docs-web/src/main/webapp/src/partial/docs/document.default.html @@ -1,62 +1,70 @@
-
-

{{ 'document.default.quick_upload' | translate }}

-
-
-
- - - - -
-
- -
-
- -
-
+ +
+
+
+ + + + +
+
+
-
- -
-

- {{ file.status }} -

-
- +
+
+
-

- - {{ 'document.default.drop_zone' | translate }} -

- -
-
- +
+

+ {{ file.status }} +

+
+ +
-
- -
+

+ + {{ 'document.default.drop_zone' | translate }} +

+
+ +
+ + +
-

{{ 'document.default.latest_activity' | translate }}

+
\ No newline at end of file diff --git a/docs-web/src/main/webapp/src/partial/docs/document.edit.html b/docs-web/src/main/webapp/src/partial/docs/document.edit.html index 99f244b8..581b6ba4 100644 --- a/docs-web/src/main/webapp/src/partial/docs/document.edit.html +++ b/docs-web/src/main/webapp/src/partial/docs/document.edit.html @@ -6,8 +6,6 @@
-
{{ alert.msg }}
-
- +

{{ document.title }} 

+ +
{{ alert.msg }}
{{ 'document.edit.primary_metadata' | translate }} diff --git a/docs-web/src/main/webapp/src/partial/docs/document.html b/docs-web/src/main/webapp/src/partial/docs/document.html index d4d5be8d..fb961775 100644 --- a/docs-web/src/main/webapp/src/partial/docs/document.html +++ b/docs-web/src/main/webapp/src/partial/docs/document.html @@ -61,7 +61,7 @@ {{ document.title }} ({{ document.file_count }}) - +
{{ document.create_date | timeAgo: dateFormat }}
@@ -104,7 +104,7 @@
-
+
diff --git a/docs-web/src/main/webapp/src/partial/docs/document.view.content.html b/docs-web/src/main/webapp/src/partial/docs/document.view.content.html index e1bf86fb..ced552b5 100644 --- a/docs-web/src/main/webapp/src/partial/docs/document.view.content.html +++ b/docs-web/src/main/webapp/src/partial/docs/document.view.content.html @@ -38,15 +38,19 @@ -
-
+
+
-
+
- + - -
+ +
@@ -66,21 +70,21 @@
- -

- - {{ 'document.view.content.drop_zone' | translate }} -

-
- -
+

+ + {{ 'document.view.content.drop_zone' | translate }} +

+

+ +

+
\ No newline at end of file diff --git a/docs-web/src/main/webapp/src/partial/docs/tag.html b/docs-web/src/main/webapp/src/partial/docs/tag.html index cf6dd575..4dad28a2 100644 --- a/docs-web/src/main/webapp/src/partial/docs/tag.html +++ b/docs-web/src/main/webapp/src/partial/docs/tag.html @@ -35,7 +35,7 @@
-
+
\ No newline at end of file diff --git a/docs-web/src/main/webapp/src/partial/share/main.html b/docs-web/src/main/webapp/src/partial/share/main.html index 9b09c1ea..eedf528b 100644 --- a/docs-web/src/main/webapp/src/partial/share/main.html +++ b/docs-web/src/main/webapp/src/partial/share/main.html @@ -1,4 +1,4 @@ -
-

Sismics Docs

+
+

{{ appName }}

Ask a shared document link to access it

\ No newline at end of file diff --git a/docs-web/src/main/webapp/src/partial/share/share.html b/docs-web/src/main/webapp/src/partial/share/share.html index 053e3796..2e7b6d57 100644 --- a/docs-web/src/main/webapp/src/partial/share/share.html +++ b/docs-web/src/main/webapp/src/partial/share/share.html @@ -65,13 +65,12 @@ -
+
diff --git a/docs-web/src/main/webapp/src/style/main.less b/docs-web/src/main/webapp/src/style/main.less index 689407cb..f38810ce 100644 --- a/docs-web/src/main/webapp/src/style/main.less +++ b/docs-web/src/main/webapp/src/style/main.less @@ -64,11 +64,6 @@ background-color: #f5f5f5; box-shadow: inset -2px 0 0 #e5e5e5; } - - .col-full { - margin-top: 20px; - margin-bottom: 20px; - } } // Footer @@ -86,12 +81,6 @@ } } -// Drop zone -.drop-zone { - background: none; - border: 2px dashed #eee; -} - // $http loader .loader { position: relative; @@ -134,21 +123,48 @@ } // File thumbnails -.thumbnail input[type="checkbox"] { - width: 26px; - height: 26px; -} +.thumbnail { + a { + height: 200px; + display: block; + overflow: hidden; + background: #eee; + } -.thumbnail-file { - cursor: pointer; -} + .caption { + height: 60px; + overflow: hidden; + } -.thumbnails-file [class*="span"]:first-child { - margin-left: 2.5641%; -} + input[type="checkbox"] { + width: 26px; + height: 26px; + } -.collapse[style="height: auto;"] { - overflow: visible; + img { + width: 100%; + cursor: pointer; + margin-top: 100px; + transform: translateY(-50%); + } + + .caption-hover { + display: none; + } + + .caption-hover-inverse { + display: block; + } + + &:hover { + .caption-hover { + display: block; + } + + .caption-hover-inverse { + display: none; + } + } } // File name @@ -231,16 +247,22 @@ input[readonly].share-link { } // Drag & drop related +.upload-zone { + min-height: 150px; + background: none; + border: 2px dashed #eee; + padding-top: 15px; + padding-bottom: 15px; + margin-bottom: 15px; +} + .bg-success { background-color: #dff0d8; } -.upload-zone { - min-height: 150px; -} - .thumbnail-checked { - background-color: #dff0d8; + box-shadow: inset 0 1px 2px rgba(27,31,35,0.075), 0 0 0 0.2em rgba(3,102,214,0.3); + transition: box-shadow ease-in-out .15s; } .pointer {