From fc2f81046fba4ba363fdae948275baade1be3152 Mon Sep 17 00:00:00 2001 From: Jacky Date: Wed, 8 Nov 2017 17:49:49 -0500 Subject: [PATCH] adjust the width of the table --- .../google/refine/io/FileProjectManager.java | 2 +- .../webapp/modules/core/MOD-INF/controller.js | 2 +- .../core/scripts/index/open-project-ui.js | 21 ++++++++++++++-- .../core/styles/index/open-project-ui.less | 24 +++++++++++++++++++ 4 files changed, 45 insertions(+), 4 deletions(-) diff --git a/main/src/com/google/refine/io/FileProjectManager.java b/main/src/com/google/refine/io/FileProjectManager.java index e56c0f97f..04cfc8cbc 100644 --- a/main/src/com/google/refine/io/FileProjectManager.java +++ b/main/src/com/google/refine/io/FileProjectManager.java @@ -403,7 +403,7 @@ public class FileProjectManager extends ProjectManager { return found; } - private void mergeEmptyUserMetadata(ProjectMetadata metadata) { + public void mergeEmptyUserMetadata(ProjectMetadata metadata) { if (metadata == null) return; diff --git a/main/webapp/modules/core/MOD-INF/controller.js b/main/webapp/modules/core/MOD-INF/controller.js index 471a9cc34..089d27cbb 100644 --- a/main/webapp/modules/core/MOD-INF/controller.js +++ b/main/webapp/modules/core/MOD-INF/controller.js @@ -34,7 +34,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. var html = "text/html"; var encoding = "UTF-8"; var ClientSideResourceManager = Packages.com.google.refine.ClientSideResourceManager; -var bundle = true; +var bundle = false; var templatedFiles = { // Requests with last path segments mentioned here 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 97c95740c..44e24f623 100644 --- a/main/webapp/modules/core/scripts/index/open-project-ui.js +++ b/main/webapp/modules/core/scripts/index/open-project-ui.js @@ -108,8 +108,24 @@ Refine.OpenProjectUI.prototype._renderProjects = function(data) { var project = data.projects[n]; project.id = n; project.date = Date.parseExact(project.modified, "yyyy-MM-ddTHH:mm:ssZ"); - projects.push(project); + for (var n in data.customMetaDataColumns) { + var found = false; + for(var i = 0; i < project.userMetaData.length; i++) { + if (project.userMetaData[i].name === data.customMetaDataColumns[n].name) { + found = true; + break; + } + if (!found) { + project.userMetaData.push({ + name: data.customMetaDataColumns[n].name, + dispay: data.customMetaDataColumns[n].display, + value: "" + }); + } + } + } } + projects.push(project); } projects.sort(function(a, b) { return b.date.getTime() - a.date.getTime(); }); @@ -283,7 +299,8 @@ Refine.OpenProjectUI.prototype._renderProjects = function(data) { 3 : { sorter : "isoDateParser" } - } + }, + widthFixed: false }); } }; 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 1244c984f..c3992014b 100644 --- a/main/webapp/modules/core/styles/index/open-project-ui.less +++ b/main/webapp/modules/core/styles/index/open-project-ui.less @@ -90,6 +90,30 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #projects-container > table { table-layout: fixed } + +#projects-container > table thead th:nth-child(1) { + width: 1% +} + +#projects-container > table thead th:nth-child(2) { + width: 3% +} + +#projects-container > table thead th:nth-child(3) { + width: 3% +} + +#projects-container > table thead th:nth-child(4) { + width: 9% +} + +#projects-container > table thead th:nth-child(5) { + width: 15% +} + +#projects-container > table thead th:nth-child(8) { + width: 35% +} #projects-container > table > tbody > tr > td { word-wrap: break-word;