Skip to content

Commit

Permalink
#33 Display Images - Folders tree - show count of pictures in folder
Browse files Browse the repository at this point in the history
  • Loading branch information
spuliaiev-sfdc committed Jul 28, 2018
1 parent b7e14c1 commit 52cb5e8
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 21 deletions.
18 changes: 17 additions & 1 deletion ui/web/src/main/resources/static/css/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,20 @@ div#pageCenterButtons {
height: 50px;
margin-left: -25%;
float: right;
}
}
/** Tree table nodes */
.jstree-node div.node_postblock {
float:right;
/*border:1px solid red;*/
width: auto;
}
.jstree-node div.node_postblock div.status {
float: left;
width: 100px;
text-align: left;
}
.jstree-node div.node_postblock div.counts {
float: left;
width: 65px;
text-align: right;
}
15 changes: 0 additions & 15 deletions ui/web/src/main/resources/static/css/importRequest.css
Original file line number Diff line number Diff line change
Expand Up @@ -93,21 +93,6 @@ div#pageContentScroller {
/*font-size: x-small;*/
height: 20px;
}
div.node_postblock {
float:right;
/*border:1px solid red;*/
width: auto;
}
div.node_postblock div.status {
float: left;
width: 100px;
text-align: left;
}
div.node_postblock div.counts {
float: left;
width: 65px;
text-align: right;
}
li.jstree-node i.NODE_STATUS_FOUND {
background-image: url(../images/loading-16.gif);
background-position: 1px 4px;
Expand Down
9 changes: 9 additions & 0 deletions ui/web/src/main/resources/static/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,13 @@
}
.paginatorContainer .pagination {
margin: 9px;
}

#folderTree .jstree-anchor {
right: 0px;
width: 100%;
padding-right: 25px;
}
#folderTree div[name='filesCount'] {
color: grey;
}
14 changes: 11 additions & 3 deletions ui/web/src/main/resources/static/js/cmp/TreePath.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,20 @@
*/
var TreePath = {

init: function(){
TreePath.treePathColumnsTemplate = $("#TreePathRowTemplate");
},

create: function (element, clickJSTreeNode, prepareCriteria) {
TreePath.init();

function preprocessFoldersAsNodes(nodesList, nodeParent) {
var nodes = [];
for(nodexIndex in nodesList.content) {
var data = nodesList.content[nodexIndex];
var path = data.name;
var node = {
// id: (nodesList.root ? nodesList.root : "") + path,
text: (path === "")? "Gallery Root" : path,
text: path,
icon: "glyphicon glyphicon-folder-open",
children: data.foldersCount > 0,
state: {
Expand Down Expand Up @@ -62,10 +67,13 @@ var TreePath = {
},
"postprocessor": function (node, data, par2) {
return preprocessFoldersAsNodes(data.list, node);
},
"renderer" : function (node, obj, settings, jstree, document) {
populateTemplate(TreePath.treePathColumnsTemplate, obj.original.content, node.childNodes[1]);
}
}
},
"plugins": ["contextmenu", "dnd"],
"plugins": ["contextmenu", "dnd", "wholerow"],
"contextmenu": {
"items": function ($node) {
return {
Expand Down
5 changes: 4 additions & 1 deletion ui/web/src/main/resources/static/js/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,14 @@ function moveChildren(source, target) {
target = target[0];
}
var sourceNodes = source.childNodes;
var children = [];
if (sourceNodes == null || sourceNodes.length === 0) {
return children;
}
var nodesList = [];
sourceNodes.forEach(function(child) {
nodesList.push(child);
});
var children = [];
nodesList.forEach(function(child) {
target.appendChild(child);
children.push(child);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
<div id="indexRequestTreeHeaderRightColumns"></div>
</div>
<div class="indexRequestsTreeHeader" >
<div id="indexRequestTreeHeaderTotalColumns"></div>
<div id="indexRequestTreeHeaderTotalColumns" class="jstree-node"></div>
</div>
<div id="importDetailsBrowsingArea" class="bottomMatch">
<div id="indexRequestsTreeScroller" class="heightHalf">
Expand Down
6 changes: 6 additions & 0 deletions ui/web/src/main/resources/templates/main/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@
<section layout:fragment="dialogs" class="container">
<div id="templates">
<div th:replace="support/sourceBlock" ></div>
<div id="TreePathRowTemplate">
<span name="name"></span>
<div class="node_postblock">
<div name="filesCount" class="counts">Photoes</div>
</div>
</div>
</div>
<div id="contextMenuFolderAction" class="dropdown clearfix contextmenu">
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu" style="display:block;position:static;margin-bottom:5px;">
Expand Down

0 comments on commit 52cb5e8

Please sign in to comment.