From e9eafe938024e29b92246eec98e700394e97d183 Mon Sep 17 00:00:00 2001 From: Zlatin Balevsky Date: Fri, 20 Mar 2020 16:56:00 +0000 Subject: [PATCH] Actions menu in table view --- webui/src/main/js/filesTable.js | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/webui/src/main/js/filesTable.js b/webui/src/main/js/filesTable.js index 93bb2547..3d31176d 100644 --- a/webui/src/main/js/filesTable.js +++ b/webui/src/main/js/filesTable.js @@ -14,14 +14,20 @@ class SharedFile { var unshareLink = new Link(_t("Unshare"), "unshare", [this.path]) var certifyLink = new Link(_t("Certify"), "certify", [this.path]) - var certifyHtml = certifyLink.render() + var certified if (this.certified == "true") - certifyHtml += " " + _t("Certified") - var publishLink - if (this.published == "true") - publishLink = new Link(_t("Unpublish"), "unpublish", [this.path]) + certified = " " + _t("Certified") else + certified = "" + var publishLink + var published + if (this.published == "true") { + publishLink = new Link(_t("Unpublish"), "unpublish", [this.path]) + published = _t("Published") + } else { publishLink = new Link(_t("Publish"), "publish", [this.path]) + published = "" + } var showCommentHtml = "" var showCommentLink = new Link(_t("Comment"), "showCommentForm", [this.path]) @@ -29,7 +35,10 @@ class SharedFile { var commentDiv = "
" var nameLink = "" + this.name + "" - var html = nameLink + "
" + unshareLink.render() + " " + showCommentHtml + " " + certifyHtml + " " + publishLink.render()+ "
" + var html = nameLink + "
" + certified + " " + published + " " + html += "
" html += "
" + commentDiv mapping.set("File", html)