-
Notifications
You must be signed in to change notification settings - Fork 899
/
_workflowsFull.gsp
219 lines (193 loc) · 11.2 KB
/
_workflowsFull.gsp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
<%--
Copyright 2010 DTO Labs, Inc. (http://dtolabs.com)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
--%>
<%--
workflowsFull.gsp
Author: Greg Schueler <a href="mailto:greg@dtosolutions.com">greg@dtosolutions.com</a>
Created: Feb 9, 2010 11:14:07 AM
$Id$
--%>
<g:timerStart key="_workflowsFull.gsp"/>
<g:timerStart key="head"/>
<%-- define form display conditions --%>
<g:set var="rkey" value="${rkey?:g.rkey()}"/>
<g:if test="${session.user && User.findByLogin(session.user)?.jobfilters}">
<g:set var="filterset" value="${User.findByLogin(session.user)?.jobfilters}"/>
</g:if>
<div id="${rkey}wffilterform">
<g:if test="${flash.message}">
${flash.message}
</g:if>
<g:if test="${flash.error}">
<span class="error note">${flash.error}</span>
</g:if>
<g:set var="wasfiltered" value="${paginateParams.keySet().grep(~/(?!proj).*Filter|groupPath|idlist$/)}"/>
<g:if test="${params.createFilters}">
<span class="note help">
Enter filter parameters below and click "save this filter" to set a name and save it.
</span>
</g:if>
<g:set var="filtersOpen" value="${params.createFilters||params.editFilters||params.saveFilter?true:false}"/>
<table cellspacing="0" cellpadding="0" width="100%">
<tr>
<td style="text-align:left;vertical-align:top;width:200px; ${wdgt.styleVisible(if:filtersOpen)}" id="${rkey}filter" class="wffilter" >
<g:form action="jobs" method="get">
<g:if test="${params.compact}">
<g:hiddenField name="compact" value="${params.compact}"/>
</g:if>
<span class="prompt action obs_filtertoggle">
Filter
<img src="${resource(dir:'images',file:'icon-tiny-disclosure-open.png')}" width="12px" height="12px"/>
</span>
<g:render template="/common/queryFilterManager" model="${[rkey:rkey,filterName:filterName,filterset:filterset,update:rkey+'wffilterform',deleteActionSubmitRemote:[controller:'menu',action:'deleteJobfilter',params:[fragment:true]],storeActionSubmitRemote:[controller:'menu',action:'storeJobfilter',params:[fragment:true]]]}"/>
<div class="filter">
<g:hiddenField name="max" value="${max}"/>
<g:hiddenField name="offset" value="${offset}"/>
<table class="simpleForm">
<g:if test="${params.idlist}">
<tr>
<td><label for="${rkey}idlist"><g:message code="jobquery.title.idlist"/></label>:</td>
<td><g:textField name="idlist" id="${rkey}idlist" value="${params.idlist}" /></td>
</tr>
</g:if>
<tr>
<td><label for="${rkey}jobFilter"><g:message code="jobquery.title.jobFilter"/></label>:</td>
<td><g:textField name="jobFilter" id="${rkey}jobFilter" value="${params.jobFilter}" /></td>
</tr>
<tr>
<td><label for="${rkey}groupPath"><g:message code="jobquery.title.groupPath"/></label>:</td>
<td><g:textField name="groupPath" id="${rkey}groupPath" value="${params.groupPath}"/></td>
</tr>
<tr>
<td><label for="${rkey}descFilter"><g:message code="jobquery.title.descFilter"/></label>:</td>
<td><g:textField name="descFilter" id="${rkey}descFilter" value="${params.descFilter}"/></td>
</tr>
<tr>
<td colspan="2">
<g:submitToRemote value="Filter" name="filterAll" url="[controller:'menu',action:'workflowsFragment']" update="${rkey}wffilterform" />
<g:submitToRemote value="Clear" name="clearFilter" url="[controller:'menu',action:'workflowsFragment',params:[Clear:'Clear']]" update="${rkey}wffilterform" />
</td>
</tr>
</table>
</div>
</g:form>
</td>
<td style="text-align:left;vertical-align:top;" id="${rkey}wfcontent" class="wfcontent">
<div class="jobscontent head">
<g:if test="${!params.compact}">
<auth:allowed job="[jobName:'create',groupPath:'ui']" name="${UserAuth.WF_CREATE}">
<div class=" floatr" >
<g:link controller="scheduledExecution" action="create" class="button ">New <g:message code="domain.ScheduledExecution.title"/>…</g:link>
</div>
</auth:allowed>
</g:if>
<g:if test="${wasfiltered}">
<g:if test="${!params.compact}">
<span class="prompt">${total} <g:message code="domain.ScheduledExecution.title"/>s</span>
matching filter:
</g:if>
<g:if test="${filterset}">
<g:render template="/common/selectFilter" model="[noSelection:'-All-',filterset:filterset,filterName:filterName,prefName:'workflows']"/>
<!--<span class="info note">Filter:</span>-->
</g:if>
<g:if test="${!filterName}">
<span class="prompt action obs_filtersave" id="outsidefiltersave" title="Click to save this filter with a name">
save this filter…
</span>
</g:if>
<div style="padding:5px 0;margin:5px 0;" id='${rkey}filter-toggle'>
<span title="Click to modify filter" class="info textbtn query action obs_filtertoggle" >
<g:each in="${wasfiltered.sort()}" var="qparam">
<span class="querykey"><g:message code="jobquery.title.${qparam}"/></span>:
<g:if test="${paginateParams[qparam] instanceof java.util.Date}">
<span class="queryvalue date" title="${paginateParams[qparam].toString().encodeAsHTML()}">
<g:relativeDate atDate="${paginateParams[qparam]}"/>
</span>
</g:if>
<g:else>
<span class="queryvalue text">
${g.message(code:'jobquery.title.'+qparam+'.label.'+paginateParams[qparam].toString(),default:paginateParams[qparam].toString())}
</span>
</g:else>
</g:each>
<img src="${resource(dir:'images',file:'icon-tiny-disclosure.png')}" width="12px" height="12px"/>
</span>
</div>
</g:if>
<g:else>
<g:if test="${!params.compact}">
<span class="prompt"><g:message code="domain.ScheduledExecution.title"/>s (${total})</span>
</g:if>
<span class="prompt action obs_filtertoggle" id="${rkey}filter-toggle">
Filter
<img src="${resource(dir:'images',file:'icon-tiny-disclosure'+(wasfiltered?'-open':'')+'.png')}" width="12px" height="12px"/></span>
<g:if test="${filterset}">
<span style="margin-left:10px;">
<span class="info note">Choose a Filter:</span>
<g:render template="/common/selectFilter" model="[noSelection:'-All-',filterset:filterset,filterName:filterName,prefName:'workflows']"/>
</span>
</g:if>
</g:else>
</div>
<g:if test="${flash.savedJob}">
<div class="newjob">
<span class="popout message note" style="background:white">
${flash.savedJobMessage?flash.savedJobMessage:'Saved changes to Job'}:
<g:link controller="scheduledExecution" action="show" id="${flash.savedJob.id}">${flash.savedJob.generateFullName()}</g:link>
</span>
</div>
<g:javascript>
fireWhenReady('jobrow_${flash.savedJob.id}',doyft.curry('jobrow_${flash.savedJob.id}'));
</g:javascript>
</g:if>
<span id="busy" style="display:none"></span>
<g:timerEnd key="head"/>
<g:if test="${ jobgroups}">
<g:timerStart key="groupTree"/>
<g:render template="groupTree" model="${[small:params.compact?true:false,currentJobs:jobgroups['']?jobgroups['']:[],wasfiltered:wasfiltered?true:false,nowrunning:nowrunning,nextExecutions:nextExecutions,jobauthorizations:jobauthorizations,authMap:authMap,nowrunningtotal:nowrunningtotal,max:max,offset:offset,paginateParams:paginateParams,sortEnabled:true]}"/>
<g:timerEnd key="groupTree"/>
</g:if>
<g:timerStart key="tail"/>
<g:if test="${unauthorizedcount && !g.isUserInRoleTest(role:'admin') && !g.isUserInRoleTest(role:'job_view_unauthorized')}">
<div class="note info">
${unauthorizedcount} <g:message code="unauthorized.hidden.message" />
</div>
</g:if>
</td>
</tr>
</table>
</div>
<%-- template load script, adds behavior to radio buttons to hide appropriate form elements when selected --%>
<g:javascript>
function _set_adhoc_filters(e){
if($F(e.target)=='true'){
$('${rkey}adhocFilters').show();
$('${rkey}definedFilters').hide();
}else if($F(e.target)=='false'){
$('${rkey}adhocFilters').hide();
$('${rkey}definedFilters').show();
}else{
$('${rkey}adhocFilters').hide();
$('${rkey}definedFilters').hide();
}
}
$$('#adhocFilterPick_${rkey} input').each(function(elem){
Event.observe(elem,'click',function(e){_set_adhoc_filters(e)});
});
$$('#${rkey}wffilterform input').each(function(elem){
if(elem.type=='text'){
elem.observe('keypress',noenter);
}
});
</g:javascript>
<g:timerEnd key="tail"/>
<g:timerEnd key="_workflowsFull.gsp"/>