Skip to content

Commit

Permalink
Update job tree behavior. add new folder icons
Browse files Browse the repository at this point in the history
  • Loading branch information
gschueler committed Mar 3, 2011
1 parent b13a68c commit a5c378d
Show file tree
Hide file tree
Showing 8 changed files with 81 additions and 32 deletions.
15 changes: 15 additions & 0 deletions rundeckapp/grails-app/views/common/_css.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -209,4 +209,19 @@
z-index: 1;
}
.expandComponentHolder.expanded > div > span.expandComponentControl.jobgroupexpand span.foldertoggle {
width: 16px;
/*padding-bottom:14px;*/
height: 14px;
display: inline-block;
background: transparent url(${resource(dir:'images',file:'icon-small-folder-open.png')}) top left no-repeat;
}
.expandComponentHolder > div > span.expandComponentControl.jobgroupexpand span.foldertoggle {
width: 16px;
height:14px;
display: inline-block;
background: transparent url(${resource(dir:'images',file:'icon-small-folder.png')}) top left no-repeat;
}
</style>
2 changes: 1 addition & 1 deletion rundeckapp/grails-app/views/common/_expander.gsp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<span class="${classnames?classnames:''} action expandComponentControl toggle ${open=='true'?'expanded':'closed'}" onmousedown="${key?'Expander.toggle(this,\''+key+'\')':'Expander.toggle(this)'};return false;" style="padding:2px;${style}" id="_exp_${key}"><!--
<span class="${classnames?classnames:''} action expandComponentControl toggle ${open=='true'?'expanded':'closed'}" onmousedown="${key?'Expander.toggle(this,\''+key+'\')':jsfunc?jsfunc:'Expander.toggle(this)'};return false;" style="padding:2px;${style}" id="_exp_${key}"><!--
-->${text!=null && !imgfirst ?text:''}<!--
--><g:img file="icon-tiny-disclosure${open=='true'?'-open':''}.png" width="12px" height="12px"/><!--
-->${text!=null && imgfirst ?text:''}<!--
Expand Down
71 changes: 44 additions & 27 deletions rundeckapp/grails-app/views/menu/_groupTree.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -6,70 +6,87 @@
To change this template use File | Settings | File Templates.
--%>
<g:timerStart key="gtx"/>
<g:set var="indentpx" value="${16}"/>
<style type="text/css">
.jobGroups.subjobs, .expandComponent.sub_group{
margin-left:${indentpx}px;
}
</style>
<div class="jobGroups ${subtree?' subdirs':'topgroup'} expandComponent" ${subtree && !expanded && !(wasfiltered) ?'style="display:none"':''}>
<g:if test="${!prefix && wasfiltered && paginateParams.groupPath}">
<div>
<a class=" groupname" href="${createLink(controller:'menu',action:'jobs')}" title="Top level"><img src="${resource(dir:'images',file:'icon-small-folder-up.png')}" width="16px" height="15px" alt="dir"/> Top</a>
<div style="margin-bottom:4px">
<g:if test="${paginateParams.groupPath.indexOf('/')>0}">
<g:set var="uplevel" value="${paginateParams.groupPath.substring(0,paginateParams.groupPath.lastIndexOf('/'))}"/>
<g:set var="newparams" value="${paginateParams}"/>
%{
newparams['groupPath']=uplevel
}%
<a class=" groupname" href="${createLink(controller:'menu',action:'jobs',params:newparams)}" title="Previous level"><img src="${resource(dir:'images',file:'icon-small-folder-up.png')}" width="16px" height="15px" alt="dir"/> Up</a>
<g:link controller="menu" action="jobs" class="groupname" title="Previous level" params="${newparams}">
<g:img file="icon-small-folder-up.png" width="16px" height="15px"/>
Up
</g:link>
</g:if>
<g:else>
<g:link controller="menu" action="jobs" class="groupname" title="Top level">
<g:img file="icon-small-folder-up.png" width="16px" height="15px"/>
Top
</g:link>
</g:else>
</div>
</g:if>
<g:set var="gkeys" value="${jobgroups.sort{a,b->a.key<=>b.key}.grep{it.key!=''}}"/>
<g:timerEnd key="gtx"/>
<g:set var="indentpx" value="${16}"/>
<g:set var="prevkey" value="${null}"/>
<g:set var="indent" value="${0}"/>
<g:set var="divcount" value="${[]}"/>
<g:each in="${gkeys}" var="group">
<g:timerStart key="_groupTree2.gsp-loop"/>
<g:timerStart key="prepare"/>
<g:set var="displaygroup" value="${group.key}"/>
<g:set var="currkey" value="${g.rkey()}"/>
<g:if test="${prevkey && group.key.startsWith(prevkey+'/')}">
%{
indent++
indent++;
}%
<g:set var="displaygroup" value="${group.key.substring(prevkey.length()+1)}"/>
</g:if>
<g:else>
${divcount.join('<!--rend-->')}
<g:set var="indent" value="${0}"/>
<g:set var="divcount" value="${[]}"/>
</g:else>
<g:set var="prevkey" value="${group.key}"/>

<div class="expandComponentHolder" style="${indent>0? 'margin-left: '+(indent*indentpx)+'px;':''}">
<g:if test="${jobgroups[group.key]}">
<g:expander open="${group.value?.size()==0||wasfiltered?'true':'false'}"/><!--
--></g:if>
<g:else><!--
--><img src="${resource(dir:'images',file:'blank.gif')}" width="16px" height="12px"/><!--
--></g:else><!--
--><span class="expandComponentControl textbtn action groupname" onclick="${jscallback?jscallback+'(\''+(prefix?prefix+'/'+group.key:group.key)+'\');return false;':'Expander.toggle(this)'}" title="${jscallback?'Select this group':'Expand/Collapse this group'}"><!--
--><img src="${resource(dir:'images',file:'icon-small-folder.png')}" width="16px" height="15px" alt="dir"/><!--
--><g:if test="${jscallback || jobsjscallback}">
${displaygroup}
</g:if><!--
--></span>
<g:if test="${!jscallback && !jobsjscallback}">
<a class=" groupname" href="${createLink(controller:'menu',action:'jobs',params:[groupPath:prefix?prefix+'/'+group.key:group.key])}">${displaygroup}</a>
</g:if>
<g:if test="${group.value?.size()>0}">
(${group.value.size()})
<g:set var="groupopen" value="${(wasfiltered)}"/>
${"<"}div class="expandComponentHolder ${groupopen ? 'expanded' : ''} " ${">"}
%{divcount<<'</div>'}%
<div style="margin-bottom:4px;">
<g:set var="jsfunc" value="Expander.toggle(this,null,'.expandComponentHolder.sub_${currkey}_group');"/>
<g:expander open="${groupopen?'true':'false'}" jsfunc="${jsfunc}" imgfirst="true" style="padding-left:4px;" classnames="jobgroupexpand">
<span class="foldertoggle">&nbsp;</span>
</g:expander>
<g:if test="${jscallback}">
<span class="expandComponentControl textbtn action groupname jobgroupexpand" onclick="${jscallback + '(\'' + (prefix ? prefix + '/' + group.key : group.key) + '\');return false;' }" title="${jscallback ? 'Select this group' : 'Expand/Collapse this group'}" style="padding-left:4px;"><%--
--%>${displaygroup}<%--
--%></span>
</g:if>
<g:else>
<a class=" groupname" href="${createLink(controller: 'menu', action: 'jobs', params: [groupPath: prefix ? prefix + '/' + group.key : group.key])}">${displaygroup}</a>
</g:else>
</div>
<g:timerEnd key="prepare"/>
${"<"}div class="expandComponent sub_${currkey}_group sub_group" style="${wdgt.styleVisible(if: groupopen)}"${">"}
%{ divcount << '</div>' }%
<g:if test="${jobgroups[group.key]}">
<div class="jobGroups subdirs expandComponent" style="margin-left: ${(indentpx-2)}px; ${wdgt.styleVisible(unless:group.value?.size()>0 && !(wasfiltered) )}" >
<div class="jobGroups subjobs">
<g:render template="jobslist" model="[jobslist:jobgroups[group.key],total:jobgroups[group.key]?.size(),nowrunning:nowrunning,nextExecutions:nextExecutions,jobauthorizations:jobauthorizations,authMap:authMap,nowrunningtotal:nowrunningtotal,max:max,offset:offset,paginateParams:paginateParams,sortEnabled:true,headers:false,wasfiltered:wasfiltered,small:small?true:false,jobsjscallback:jobsjscallback]"/>
</div>
</g:if>
</div>
<g:timerEnd key="_groupTree2.gsp-loop"/>
</g:each>

${divcount.join('<!--rlast-->')}
<g:if test="${currentJobs}">
<g:timerStart key="_groupTree2.gsp-jobslist"/>
Expand Down
8 changes: 7 additions & 1 deletion rundeckapp/web-app/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -1689,7 +1689,7 @@ ul.jobGroups li.sub{
padding-left:20px;
}
ul.jobGroups li span.textbtn,ul.jobGroups li a.textbtn{

}
ul.jobGroups li a.currentdir{
font-weight:bold;
Expand All @@ -1704,6 +1704,12 @@ ul.jobGroups li a.alljobs{
border:1px solid #ddd;
}

.expandComponentHolder.expanded > div > span.expandComponentControl.jobgroupexpand span.foldertoggle{
}

.expandComponentHolder > div > span.expandComponentControl.jobgroupexpand span.foldertoggle{
}

/** Process Flow view styles **/


Expand Down
Binary file added rundeckapp/web-app/images/icon-small-folder-open.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified rundeckapp/web-app/images/icon-small-folder-up.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified rundeckapp/web-app/images/icon-small-folder.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 14 additions & 3 deletions rundeckapp/web-app/js/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ function cancelJobError(mesg,elem,id){
}

var Expander = {
toggle: function(elem, contain) {
toggle: function(elem, contain,expression) {
var e = $(elem);
if (!e) {
return;
Expand Down Expand Up @@ -145,9 +145,10 @@ var Expander = {
value=icn.src == AppImages.disclosure;
}
}
Expander.setOpen(elem,contain,value);
Expander.setOpen(elem,contain,value,expression);
return value;
},
setOpen: function(elem, contain,value) {
setOpen: function(elem, contain,value,expression) {
var e = $(elem);
if (!e) {
return;
Expand Down Expand Up @@ -184,6 +185,16 @@ var Expander = {
}else{
Element.hide(content);
}
if (null != expression) {
//also set open related expression match
$$(expression).each(function(e) {
if(value){
Element.show(e);
}else{
Element.hide(e);
}
});
}
}
if(holder){
if(value){
Expand Down

0 comments on commit a5c378d

Please sign in to comment.