From 3f71df3d29b37be2d99d3df1091bdf6c962cafc6 Mon Sep 17 00:00:00 2001 From: Zlatin Balevsky Date: Mon, 9 Dec 2019 23:00:40 +0000 Subject: [PATCH] certification support in tree view --- webui/src/main/js/files.js | 37 ++++++++++++++++++++++++++------ webui/templates/web.xml.template | 10 +++++++++ 2 files changed, 40 insertions(+), 7 deletions(-) diff --git a/webui/src/main/js/files.js b/webui/src/main/js/files.js index 9b42c553..de7394c1 100644 --- a/webui/src/main/js/files.js +++ b/webui/src/main/js/files.js @@ -1,6 +1,6 @@ class Node { - constructor(nodeId, parent, leaf, path, size, comment, revision) { + constructor(nodeId, parent, leaf, path, size, comment, certified, revision) { this.nodeId = nodeId this.parent = parent this.leaf = leaf @@ -8,6 +8,7 @@ class Node { this.path = path this.size = size this.comment = comment + this.certified = certified this.revision = revision } @@ -15,15 +16,21 @@ class Node { var div = document.getElementById(this.nodeId) var unshareLink = "" + _t("Unshare") + "" var commentLink = "" + _t("Comment") + ""; + var certifyLink = "" + _t("Certify") + "" if (this.leaf) { - div.innerHTML = "
  • "+this.path+"
    "+ unshareLink + " " + commentLink + "
  • " + var certified = "" + if (this.certified == "true") + certified = _t("Certified") + + div.innerHTML = "
  • "+this.path+"
    "+ unshareLink + " " + certifyLink + " " + certified + " " + + commentLink + "
  • " } else { if (this.children.length == 0) { div.innerHTML = "
  • " + - this.path + " " + unshareLink + "" + commentLink + "
  • " + this.path + " " + unshareLink + "" + " " + certifyLink + " " + commentLink + "
    " } else { var l = "
  • "+this.path+" " + unshareLink - l += " " + commentLink+"
    " + l += " " + certifyLink + " " + commentLink+"
    " l += "