remove the rename link

This commit is contained in:
Jacky 2017-11-13 15:28:44 -05:00
parent cd94d4baad
commit e65a8c1d9a
2 changed files with 16 additions and 56 deletions

View File

@ -138,7 +138,6 @@ Refine.OpenProjectUI.prototype._renderProjects = function(data) {
'<table class="tablesorter-blue list-table"><thead><tr>' + '<table class="tablesorter-blue list-table"><thead><tr>' +
'<th></th>' + '<th></th>' +
'<th></th>' + '<th></th>' +
'<th></th>' +
'<th>'+$.i18n._('core-index-open')["last-mod"]+'</th>' + '<th>'+$.i18n._('core-index-open')["last-mod"]+'</th>' +
'<th>'+$.i18n._('core-index-open')["name"]+'</th>' + '<th>'+$.i18n._('core-index-open')["name"]+'</th>' +
'<th>'+$.i18n._('core-index-open')["creator"]+'</th>' + '<th>'+$.i18n._('core-index-open')["creator"]+'</th>' +
@ -183,39 +182,7 @@ Refine.OpenProjectUI.prototype._renderProjects = function(data) {
} }
return false; return false;
}).appendTo( }).appendTo(
$(tr.insertCell(tr.cells.length)).css('width', '1%') $(tr.insertCell(tr.cells.length))
);
var renameLink = $('<a></a>')
.text($.i18n._('core-index-open')["rename"])
.addClass("secondary")
.attr("href", "javascript:{}")
.click(function() {
var name = window.prompt($.i18n._('core-index-open')["new-title"], project.name);
if (name === null) {
return;
}
name = $.trim(name);
if (project.name == name || name.length === 0) {
return;
}
$.ajax({
type: "POST",
url: "command/core/rename-project",
data: { "project" : project.id, "name" : name },
dataType: "json",
success: function (data) {
if (data && typeof data.code != 'undefined' && data.code == "ok") {
nameLink.text(name);
} else {
alert($.i18n._('core-index-open')["warning-rename"]+" " + data.message);
}
}
});
}).appendTo(
$(tr.insertCell(tr.cells.length)).css('width', '1%')
); );
var editMetadataLink = $('<a></a>') var editMetadataLink = $('<a></a>')
@ -226,25 +193,24 @@ Refine.OpenProjectUI.prototype._renderProjects = function(data) {
new EditMetadataDialog(project, $(this).parent().parent()); new EditMetadataDialog(project, $(this).parent().parent());
}) })
.appendTo( .appendTo(
$(tr.insertCell(tr.cells.length)).css('width', '3%') $(tr.insertCell(tr.cells.length))
); );
$('<div></div>') $('<div></div>')
.html(project.date) .html(project.date)
.addClass("last-modified") .addClass("last-modified")
.appendTo($(tr.insertCell(tr.cells.length)).attr('width', '1%')); .appendTo($(tr.insertCell(tr.cells.length)));
var nameLink = $('<a></a>') var nameLink = $('<a></a>')
.addClass("project-name") .addClass("project-name")
.text(project.name) .text(project.name)
.attr("href", "project?project=" + project.id) .attr("href", "project?project=" + project.id)
.appendTo($(tr.insertCell(tr.cells.length)).attr('width', '10%')); .appendTo($(tr.insertCell(tr.cells.length)));
var appendMetaField = function(data, width) { var appendMetaField = function(data) {
width = width || '1%';
$('<div></div>') $('<div></div>')
.html(data) .html(data)
.appendTo($(tr.insertCell(tr.cells.length)).attr('width', width)); .appendTo($(tr.insertCell(tr.cells.length)));
}; };
appendMetaField(project.creator); appendMetaField(project.creator);
@ -269,10 +235,9 @@ Refine.OpenProjectUI.prototype._renderProjects = function(data) {
headers : { headers : {
0: { sorter: false }, 0: { sorter: false },
1: { sorter: false }, 1: { sorter: false },
2: { sorter: false }, 2: { sorter: "text" }
3: { sorter: "text" }
}, },
sortList: [[3,1]], sortList: [[2,1]],
widthFixed: false widthFixed: false
}); });
} }
@ -310,7 +275,7 @@ Refine.OpenProjectUI.prototype._onClickUploadFileButton = function(evt) {
Refine.OpenProjectUI.refreshProject = function(tr, metaData) { Refine.OpenProjectUI.refreshProject = function(tr, metaData) {
var refreshMetaField = function(data, index) { var refreshMetaField = function(data, index) {
if (index === 4) { if (index === 3) {
$('a', $('td', tr).eq(index)) $('a', $('td', tr).eq(index))
.text(data); .text(data);
} else { } else {
@ -319,7 +284,7 @@ Refine.OpenProjectUI.refreshProject = function(tr, metaData) {
} }
}; };
var index = 4; var index = 3;
refreshMetaField(metaData.name, index); index++; refreshMetaField(metaData.name, index); index++;
refreshMetaField(metaData.creator, index); index++; refreshMetaField(metaData.creator, index); index++;
refreshMetaField(metaData.subject,index); index++; refreshMetaField(metaData.subject,index); index++;

View File

@ -97,32 +97,27 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
} }
#projects-container > table thead th:nth-child(2) { #projects-container > table thead th:nth-child(2) {
border: 0;
width: 3.5%
}
#projects-container > table thead th:nth-child(3) {
left-border: 0; left-border: 0;
width: 3% width: 3%
} }
#projects-container > table thead th:nth-child(4) { #projects-container > table thead th:nth-child(3) {
width: 8% width: 8%
} }
#projects-container > table thead th:nth-child(5) { #projects-container > table thead th:nth-child(4) {
width: 15% width: 15%
} }
#projects-container > table thead th:nth-child(6) { #projects-container > table thead th:nth-child(5) {
width: 6% width: 6%
} }
#projects-container > table thead th:nth-child(8) { #projects-container > table thead th:nth-child(7) {
width: 35% width: 38%
} }
#projects-container > table thead th:nth-child(9) { #projects-container > table thead th:nth-child(8) {
width: 5% width: 5%
} }