From e8f133887eeae34642d32a0aa0f0c1dbbec4d021 Mon Sep 17 00:00:00 2001 From: Jacky Date: Thu, 9 Nov 2017 16:23:29 -0500 Subject: [PATCH] UI improvement on metadata view and project list view --- main/webapp/modules/core/langs/translation-en.json | 14 +++++++++++++- .../core/scripts/index/edit-metadata-dialog.js | 6 +++++- .../modules/core/scripts/index/open-project-ui.js | 13 ------------- .../core/scripts/project/edit-metadata-dialog.html | 2 +- .../modules/core/styles/index/open-project-ui.less | 13 ++++++++++++- 5 files changed, 31 insertions(+), 17 deletions(-) diff --git a/main/webapp/modules/core/langs/translation-en.json b/main/webapp/modules/core/langs/translation-en.json index c2ac93c05..7c9d05299 100644 --- a/main/webapp/modules/core/langs/translation-en.json +++ b/main/webapp/modules/core/langs/translation-en.json @@ -22,7 +22,19 @@ "no-proj": "No existing project. Select 'Create Project' on the left to create a new project.", "try-these": "If you have no data to work with, try these", "sample-data": "sample data sets", - "change-metadata-value": "Change value of metadata key" + "change-metadata-value": "Change value of metadata key", + "name": "Project Name:", + "created": "Create Time:", + "modified": "Last Modified Time:", + "creator": "Creator:", + "contributors": "Contributors:", + "subject": "Subject:", + "description": "Description:", + "rowCount": "Row Count:", + "customMetadata": "Custom Metadata(JSON):", + "id": "Project Id:", + "date": "Date:", + "importOptionMetadata": "Import Option Metadata(JSON):" }, "core-index-create": { "create-proj": "Create Project", diff --git a/main/webapp/modules/core/scripts/index/edit-metadata-dialog.js b/main/webapp/modules/core/scripts/index/edit-metadata-dialog.js index 5afd5b3c5..0943e25d4 100644 --- a/main/webapp/modules/core/scripts/index/edit-metadata-dialog.js +++ b/main/webapp/modules/core/scripts/index/edit-metadata-dialog.js @@ -7,7 +7,9 @@ function EditMetadataDialog(metaData, targetRowElem) { this._MetadataUI = function(tr, key, value, project) { var self = this; var td0 = tr.insertCell(0); - $(td0).text(key); + + var keyLable = $.i18n._('core-index')[key] || key; + $(td0).text(keyLable); var td1 = tr.insertCell(1); $(td1).text((value !== null) ? value : ""); @@ -92,6 +94,8 @@ EditMetadataDialog.prototype._createDialog = function() { this._metaDataUIs.push(new this._MetadataUI(tr, k, v, flatMetadata.id)); } + + $(".dialog-container").css("top", Math.round(($(".dialog-overlay").height() - $(frame).height()) / 2) + "px"); }; EditMetadataDialog.prototype._dismiss = function() { diff --git a/main/webapp/modules/core/scripts/index/open-project-ui.js b/main/webapp/modules/core/scripts/index/open-project-ui.js index dd93bf53a..d2db23a96 100644 --- a/main/webapp/modules/core/scripts/index/open-project-ui.js +++ b/main/webapp/modules/core/scripts/index/open-project-ui.js @@ -167,7 +167,6 @@ Refine.OpenProjectUI.prototype._renderProjects = function(data) { .addClass("delete-project") .attr("title",$.i18n._('core-index-open')["del-title"]) .attr("href","") - .css("visibility", "hidden") .html("") .click(function() { if (window.confirm($.i18n._('core-index-open')["del-body"] + project.name + "\"?")) { @@ -192,7 +191,6 @@ Refine.OpenProjectUI.prototype._renderProjects = function(data) { .text($.i18n._('core-index-open')["rename"]) .addClass("secondary") .attr("href", "javascript:{}") - .css("visibility", "hidden") .click(function() { var name = window.prompt($.i18n._('core-index-open')["new-title"], project.name); if (name === null) { @@ -225,7 +223,6 @@ Refine.OpenProjectUI.prototype._renderProjects = function(data) { .text($.i18n._('core-index-open')["edit-meta-data"]) .addClass("secondary") .attr("href", "javascript:{}") - .css("visibility", "hidden") .click(function() { new EditMetadataDialog(project, $(this).parent().parent()); }) @@ -264,16 +261,6 @@ Refine.OpenProjectUI.prototype._renderProjects = function(data) { appendMetaField(data[i].value); } } - - $(tr).mouseenter(function() { - renameLink.css("visibility", "visible"); - deleteLink.css("visibility", "visible"); - editMetadataLink.css("visibility", "visible"); - }).mouseleave(function() { - renameLink.css("visibility", "hidden"); - deleteLink.css("visibility", "hidden"); - editMetadataLink.css("visibility", "hidden"); - }); }; for (var i = 0; i < projects.length; i++) { diff --git a/main/webapp/modules/core/scripts/project/edit-metadata-dialog.html b/main/webapp/modules/core/scripts/project/edit-metadata-dialog.html index 5c8ee1617..ab7eb6110 100644 --- a/main/webapp/modules/core/scripts/project/edit-metadata-dialog.html +++ b/main/webapp/modules/core/scripts/project/edit-metadata-dialog.html @@ -1,4 +1,4 @@ -
+
diff --git a/main/webapp/modules/core/styles/index/open-project-ui.less b/main/webapp/modules/core/styles/index/open-project-ui.less index c3992014b..bbab23d98 100644 --- a/main/webapp/modules/core/styles/index/open-project-ui.less +++ b/main/webapp/modules/core/styles/index/open-project-ui.less @@ -92,14 +92,17 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. } #projects-container > table thead th:nth-child(1) { + border: 0; width: 1% } #projects-container > table thead th:nth-child(2) { + border: 0; width: 3% } #projects-container > table thead th:nth-child(3) { + left-border: 0; width: 3% } @@ -119,7 +122,15 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. word-wrap: break-word; } -#metadata-body tr:nth-child(even) {background: #CCC} +#metadata-body table { + border-collapse:collapse +} + +#metadata-body td { + padding: 8px +} + +#metadata-body tr:nth-child(even) {background: #BFDBFF} #metadata-body tr:nth-child(odd) {background: #FFF} #metadata-body > table {