Rev 30 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 30 | Rev 37 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | <%@taglib uri="/struts-tags" prefix="s"%> |
1 | <%@taglib uri="/struts-tags" prefix="s"%> |
2 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> |
2 | <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> |
3 | <c:set var="contextPath" value="${pageContext.request.contextPath}" /> |
3 | <c:set var="contextPath" value="${pageContext.request.contextPath}" /> |
4 | 4 | ||
5 | <html> |
5 | <html> |
6 | <head> |
6 | <head> |
7 | <title>User bearbeiten</title> |
7 | <title>User bearbeiten</title> |
8 | </head> |
8 | </head> |
9 | <body> |
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ügt.</p> |
|
- | 23 | </s:if> |
|
10 | 24 | ||
- | 25 | <s:if test="edit"> |
|
11 | <h1>UserListe</h1> |
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ügen |
|
- | 48 | </s:submit> |
|
12 | <p>Die Liste:</p> |
49 | </s:else> |
- | 50 | </s:form> |
|
13 | 51 | ||
- | 52 | <h2>Registrierte Benutzer</h2> |
|
14 | <s:if test="userList.size() == 0"> |
53 | <s:if test="userList.size() == 0"> |
15 | <p>Keine Benutzer gefunden</p> |
54 | <p>Keine Benutzer gefunden</p> |
16 | </s:if> |
55 | </s:if> |
17 | <s:else> |
56 | <s:else> |
18 | <table> |
57 | <table> |
- | 58 | <thead> |
|
19 | <tr> |
59 | <tr> |
20 | <th>Username</th> |
60 | <th>Benutzername</th> |
21 | <th>Vorname</th> |
61 | <th>Vorname</th> |
22 | <th>Nachname</th> |
62 | <th>Nachname</th> |
23 | <th>Admin?</th> |
63 | <th>Administrator</th> |
24 | </tr> |
64 | </tr> |
- | 65 | </thead> |
|
- | 66 | <tbody> |
|
25 | <s:iterator value="userList" status="stat"> |
67 | <s:iterator value="userList" status="stat"> |
26 | <tr> |
68 | <tr> |
27 | <td><s:property value="username" /></td> |
69 | <td><s:property value="username" /></td> |
28 | <td><s:property value="firstname" /></td> |
70 | <td><s:property value="firstname" /></td> |
29 | <td><s:property value="lastname" /></td> |
71 | <td><s:property value="lastname" /></td> |
30 | <td><s:property value="admin" /></td> |
72 | <td><s:if test="admin">ja</s:if><s:else>nein</s:else></td> |
31 | 73 | ||
32 | <td><s:url id="editURL" action="editUser"> |
74 | <td><s:url id="editURL" action="editUser"> |
33 | <s:param name="id" value="%{id}"></s:param> |
75 | <s:param name="id" value="%{id}"></s:param> |
34 | </s:url> <s:a href="%{editURL}"> |
76 | </s:url> <s:a href="%{editURL}"> |
35 | <img src="${contextPath}/resources/icons/page_white_edit.png" alt="edit" /> |
77 | <img src="${contextPath}/resources/icons/page_white_edit.png" alt="edit" /> |
36 | </s:a></td> |
78 | </s:a></td> |
37 | 79 | ||
- | 80 | <s:if test="!admin"> |
|
38 | <td><s:url id="deleteURL" action="deleteUser"> |
81 | <td><s:url id="deleteURL" action="deleteUser"> |
39 | <s:param name="id" value="%{id}"></s:param> |
82 | <s:param name="id" value="%{id}"></s:param> |
40 | </s:url> <s:a href="%{deleteURL}"> |
83 | </s:url> <s:a href="%{deleteURL}"> |
41 | <img src="${contextPath}/resources/icons/delete.png" alt="delete" /> |
84 | <img src="${contextPath}/resources/icons/delete.png" alt="delete" /> |
42 | </s:a></td> |
85 | </s:a></td> |
- | 86 | </s:if> |
|
43 | </tr> |
87 | </tr> |
44 | </s:iterator> |
88 | </s:iterator> |
- | 89 | </tbody> |
|
45 | </table> |
90 | </table> |
46 | </s:else> |
91 | </s:else> |
47 | - | ||
48 | </body> |
92 | </body> |
49 | </html> |
93 | </html> |
50 | 94 |