Merge pull request #1317 from jackyq2015/master

UI improvement on metadata view and project list view
This commit is contained in:
Jacky 2017-11-09 16:23:54 -05:00 committed by GitHub
commit bc686f9cf6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 31 additions and 17 deletions

View File

@ -22,7 +22,19 @@
"no-proj": "No existing project. Select 'Create Project' on the left to create a new project.", "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", "try-these": "If you have no data to work with, try these",
"sample-data": "sample data sets", "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": { "core-index-create": {
"create-proj": "Create Project", "create-proj": "Create Project",

View File

@ -7,7 +7,9 @@ function EditMetadataDialog(metaData, targetRowElem) {
this._MetadataUI = function(tr, key, value, project) { this._MetadataUI = function(tr, key, value, project) {
var self = this; var self = this;
var td0 = tr.insertCell(0); var td0 = tr.insertCell(0);
$(td0).text(key);
var keyLable = $.i18n._('core-index')[key] || key;
$(td0).text(keyLable);
var td1 = tr.insertCell(1); var td1 = tr.insertCell(1);
$(td1).text((value !== null) ? value : ""); $(td1).text((value !== null) ? value : "");
@ -92,6 +94,8 @@ EditMetadataDialog.prototype._createDialog = function() {
this._metaDataUIs.push(new this._MetadataUI(tr, k, v, flatMetadata.id)); 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() { EditMetadataDialog.prototype._dismiss = function() {

View File

@ -167,7 +167,6 @@ Refine.OpenProjectUI.prototype._renderProjects = function(data) {
.addClass("delete-project") .addClass("delete-project")
.attr("title",$.i18n._('core-index-open')["del-title"]) .attr("title",$.i18n._('core-index-open')["del-title"])
.attr("href","") .attr("href","")
.css("visibility", "hidden")
.html("<img src='images/close.png' />") .html("<img src='images/close.png' />")
.click(function() { .click(function() {
if (window.confirm($.i18n._('core-index-open')["del-body"] + project.name + "\"?")) { 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"]) .text($.i18n._('core-index-open')["rename"])
.addClass("secondary") .addClass("secondary")
.attr("href", "javascript:{}") .attr("href", "javascript:{}")
.css("visibility", "hidden")
.click(function() { .click(function() {
var name = window.prompt($.i18n._('core-index-open')["new-title"], project.name); var name = window.prompt($.i18n._('core-index-open')["new-title"], project.name);
if (name === null) { if (name === null) {
@ -225,7 +223,6 @@ Refine.OpenProjectUI.prototype._renderProjects = function(data) {
.text($.i18n._('core-index-open')["edit-meta-data"]) .text($.i18n._('core-index-open')["edit-meta-data"])
.addClass("secondary") .addClass("secondary")
.attr("href", "javascript:{}") .attr("href", "javascript:{}")
.css("visibility", "hidden")
.click(function() { .click(function() {
new EditMetadataDialog(project, $(this).parent().parent()); new EditMetadataDialog(project, $(this).parent().parent());
}) })
@ -264,16 +261,6 @@ Refine.OpenProjectUI.prototype._renderProjects = function(data) {
appendMetaField(data[i].value); 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++) { for (var i = 0; i < projects.length; i++) {

View File

@ -1,4 +1,4 @@
<div class="dialog-frame" style="width: 1600px; height: 700px"> <div class="dialog-frame" style="width: 1600px;">
<div class="dialog-border"> <div class="dialog-border">
<div class="dialog-header" bind="dialogHeader"></div> <div class="dialog-header" bind="dialogHeader"></div>
<div class="dialog-body" bind="dialogBody"> <div class="dialog-body" bind="dialogBody">

View File

@ -92,14 +92,17 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
} }
#projects-container > table thead th:nth-child(1) { #projects-container > table thead th:nth-child(1) {
border: 0;
width: 1% width: 1%
} }
#projects-container > table thead th:nth-child(2) { #projects-container > table thead th:nth-child(2) {
border: 0;
width: 3% width: 3%
} }
#projects-container > table thead th:nth-child(3) { #projects-container > table thead th:nth-child(3) {
left-border: 0;
width: 3% width: 3%
} }
@ -119,7 +122,15 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
word-wrap: break-word; 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 tr:nth-child(odd) {background: #FFF}
#metadata-body > table { #metadata-body > table {