Subversion Repositories WebE

Rev

Rev 30 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
22 moos 1
<%@taglib uri="/struts-tags" prefix="s"%>
37 PointedEar 2
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
30 moos 3
<c:set var="contextPath" value="${pageContext.request.contextPath}" />
4
 
20 moos 5
<html>
37 PointedEar 6
  <head>
7
    <title>User bearbeiten</title>
8
  </head>
9
  <body>
10
    <s:if test="edit">
11
      <h1>Benutzer bearbeiten</h1>
12
    </s:if>
13
    <s:else>
14
      <h1>Benutzer verwalten</h1>
15
    </s:else>
16
 
17
    <s:if test="added">
18
      <p>Der Benutzer <b><s:text name="savedUser.username"/>
19
        <s:if test="savedUser.firstname.length() > 0 || savedUser.lastname.length() > 0))">
20
          (<s:text name="savedUser.firstname"/> <s:text name="savedUser.lastname"/>)
21
        </s:if></b>
22
        wurde hinzugef&uuml;gt.</p>
23
    </s:if>
24
 
25
    <s:if test="edit">
26
      <h2>Dieser Benutzer</h2>
27
    </s:if>
28
    <s:else>
29
      <h2>Neuer Benutzer</h2>
30
    </s:else>
31
 
32
    <s:form action="saveUser">
33
      <s:hidden name="edit" />
34
      <s:hidden name="user.id" />
35
      <s:textfield name="user.username" label="Benutzername" required="true" />
36
      <s:password name="user.password" label="Passwort" required="true" />
37
      <s:textfield name="user.firstname" label="Vorname" />
38
      <s:textfield name="user.lastname" label="Nachname" />
39
      <s:checkbox name="user.admin" label="Administrator" />
40
 
41
      <s:if test="edit">
42
        <s:submit type="button"><img src="${contextPath}/resources/icons/tick.png" alt="" />
43
          Speichern</s:submit>
44
      </s:if>
45
      <s:else>
46
        <s:submit type="button"><img src="${contextPath}/resources/icons/add.png" alt="" />
47
          Hinzuf&uuml;gen
48
        </s:submit>
49
      </s:else>
50
    </s:form>
51
 
52
    <h2>Registrierte Benutzer</h2>
53
    <s:if test="userList.size() == 0">
54
      <p>Keine Benutzer gefunden</p>
55
    </s:if>
56
    <s:else>
57
      <table>
58
        <thead>
59
        	<tr>
60
        		<th>Benutzername</th>
61
        		<th>Vorname</th>
62
        		<th>Nachname</th>
63
        		<th>Administrator</th>
64
        	</tr>
65
        </thead>
66
        <tbody>
67
          <s:iterator value="userList" status="stat">
68
          	<tr>
69
          		<td><s:property value="username" /></td>
70
          		<td><s:property value="firstname" /></td>
71
          		<td><s:property value="lastname" /></td>
72
          		<td><s:if test="admin">ja</s:if><s:else>nein</s:else></td>
73
 
74
          		<td><s:url id="editURL" action="editUser">
75
          			<s:param name="id" value="%{id}"></s:param>
76
          		</s:url> <s:a href="%{editURL}">
77
          			<img src="${contextPath}/resources/icons/page_white_edit.png" alt="edit" />
78
          		</s:a></td>
79
 
80
              <s:if test="!admin">
81
            		<td><s:url id="deleteURL" action="deleteUser">
82
            			<s:param name="id" value="%{id}"></s:param>
83
            		</s:url> <s:a href="%{deleteURL}">
84
            			<img src="${contextPath}/resources/icons/delete.png" alt="delete" />
85
            		</s:a></td>
86
              </s:if>
87
          	</tr>
88
          </s:iterator>
89
        </tbody>
90
      </table>
91
    </s:else>
92
  </body>
20 moos 93
</html>