]> source.dussan.org Git - archiva.git/blob
3748dd3374cf1393081387a97a1f68f1c1a66c8e
[archiva.git] /
1 <%--
2   ~
3   ~ Licensed under the Apache License, Version 2.0 (the "License");
4   ~ you may not use this file except in compliance with the License.
5   ~ You may obtain a copy of the License at
6   ~
7   ~      http://www.apache.org/licenses/LICENSE-2.0
8   ~
9   ~ Unless required by applicable law or agreed to in writing, software
10   ~ distributed under the License is distributed on an "AS IS" BASIS,
11   ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12   ~ See the License for the specific language governing permissions and
13   ~ limitations under the License.
14   --%>
15
16 <%@ taglib prefix="s" uri="/struts-tags"%>
17 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
18 <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
19
20 <html>
21 <s:i18n name="org.apache.archiva.redback.struts2.default">
22 <head>
23   <title><s:text name="assignments.page.title"/></title>
24 </head>
25
26 <body>
27
28 <h2><s:text name="assignments.section.title"/></h2>
29
30     <div class="axial">
31       <table border="1" cellspacing="2" cellpadding="3" width="100%">
32         <s:label label="%{getText('username')}" name="principal"/>
33         <s:label label="%{getText('full.name')}" name="user.fullName"/>
34         <s:label label="%{getText('email')}" name="user.email"/>
35       </table>
36     </div>
37
38 <!--<h3><s:text name="assignments.available.roles"/></h3>-->
39
40     <s:form action="addRolesToUser" namespace="/security" name="addRoles">
41       <s:hidden name="principal"/>
42       <s:hidden name="addRolesButton" value="true"/>
43       <s:token/>
44
45       <s:iterator id="application" value="applicationRoleDetails">
46
47         <h3><c:out value="${application.name}" /></h3>
48         <c:if test="${!empty application.description}">
49           <p><i><c:out value="${application.description}" /></i></p>
50         </c:if>
51
52         <c:if test="${!empty assignedRoles}">
53
54          <h5><s:text name="assignments.assigned.roles"/></h5>
55          <table>
56          <s:iterator id="assignedRole" value="assignedRoles">
57            <s:checkbox label="%{assignedRole}" name="addNDSelectedRoles" fieldValue="%{assignedRole}"/>
58          </s:iterator>
59          </table>
60
61         </c:if>
62         <c:if test="${!empty availableRoles}">
63           <h5><s:text name="assignments.available.roles"/></h5>
64           <table>
65           <s:iterator id="availableRole" value="availableRoles">
66             <s:checkbox label="%{availableRole}" name="addNDSelectedRoles" value="false" fieldValue="%{availableRole}"/>
67           </s:iterator>
68           </table>
69         </c:if>
70
71         <c:if test="${!empty table}">
72           <h5><s:text name="assignments.resource.roles"/></h5>
73           <table>
74             <tr>
75               <td></td>
76               <s:iterator id="column" value="tableHeader">
77                 <td>${column.namePrefix}</td>
78               </s:iterator>
79             </tr>
80
81             <c:forEach var="row" items="${table}">
82               <tr>
83                 <c:forEach var="column" items="${row}">
84
85                   <c:choose>
86                     <c:when test="${column.label}">
87                       <td>${column.name}</td>
88                     </c:when>
89                     <c:when test="${column.assigned}">
90                       <td>
91                         <center>
92                           <input type="checkbox" name="addDSelectedRoles" value="${column.name}" checked="checked"/>
93                         </center>
94                       </td>
95                     </c:when>
96                     <c:when test="${column.effectivelyAssigned}">
97                       <td>
98                         <center>
99                           <input type="checkbox" name="addDSelectedRoles" value="${column.name}" disabled="disabled"/>
100                         </center>
101                       </td>
102                     </c:when>
103                     <c:otherwise>
104                       <td>
105                         <center>
106                           <input type="checkbox" name="addDSelectedRoles" value="${column.name}"/>
107                         </center>
108                       </td>
109                      </c:otherwise>
110                    </c:choose>
111
112                 </c:forEach>
113               </tr>
114             </c:forEach>
115           </table>
116         </c:if>
117       </s:iterator>
118    <%--
119       <h4>Global Roles</h4>
120       <s:checkboxlist list="nondynamicroles" name="addNDSelectedRoles" value="NDRoles" theme="redback"/>
121       <br/>
122
123       <h4>Resource Roles</h4>
124       <c:choose>
125         <c:when test="${!empty dynamicroles}">
126           <c:set var="numtemplates" value="0"/>
127           <table border="1">
128            <tr>
129              <td>&nbsp</td>
130              <s:iterator id="template" value="templates">
131                <td>${template.namePrefix}</td>
132                <c:set var="numtemplates" value="${numtemplates + 1}"/>
133               </s:iterator>
134            </tr>
135            <tr>
136              <c:set var="count" value="0"/>
137              <s:iterator id="dynamicrole" value="dynamicroles" status="row_status">
138                <c:if test="${count == 0}">
139                  <td>${dynamicrole.resource}</td>
140                </c:if>
141                <c:set var="chkbx" value="<input type='checkbox' name='addDSelectedRoles' value='${dynamicrole.name}'/>"/>
142                <s:iterator id="drole" value="DRoles">
143                  <c:if test="${(drole == dynamicrole.name)}">
144                    <c:set var="chkbx" value="<input type='checkbox' name='addDSelectedRoles' value='${dynamicrole.name}' checked='yes'/>"/>
145                  </c:if>
146                </s:iterator>
147                <td><center>${chkbx}</center></td>
148                <c:set var="count" value="${count + 1}"/>
149                <c:if test="${count == numtemplates}">
150                  <c:choose>
151                    <c:when test="${row_status.last}">
152                      </tr>
153                    </c:when>
154                    <c:otherwise>
155                      </tr><tr>
156                    </c:otherwise>
157                  </c:choose>
158                  <c:set var="count" value="0"/>
159                </c:if>
160              </s:iterator>
161           </table>
162         </c:when>
163         <c:otherwise>
164           <p><em><s:text name="assignments.no.roles.to.grant"/></em></p>
165         </c:otherwise>
166       </c:choose>
167 --%>
168       <br/>
169       <s:submit value="%{getText('assignments.submit')}" name="submitRolesButton" theme="simple" />
170       <br/>
171       <s:reset type="button" value="%{getText('assignments.reset')}" name="resetRolesButton" theme="simple" />
172     </s:form>
173
174 </body>
175 </s:i18n>
176 </html>