| author | ymh <ymh.work@gmail.com> |
| Mon, 21 Oct 2013 17:55:12 +0200 | |
| branch | user_management |
| changeset 224 | 0167b777ad15 |
| parent 222 | 6ac00231ee34 |
| child 225 | 0fcce86e650c |
| permissions | -rw-r--r-- |
| 222 | 1 |
<!DOCTYPE html> |
|
224
0167b777ad15
remove deprecated warnings + fix date picker default langauge
ymh <ymh.work@gmail.com>
parents:
222
diff
changeset
|
2 |
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" th:lang="${#ctx.getLocale().toLanguageTag()}" > |
| 222 | 3 |
<head> |
4 |
<meta charset="utf-8"/> |
|
5 |
<title>User form</title> |
|
6 |
</head> |
|
7 |
<body> |
|
8 |
<div id="userForm" th:fragment="userFormFragment" > |
|
9 |
<script type="text/javascript" th:inline="javascript"> |
|
10 |
//<![CDATA[ |
|
11 |
||
12 |
function userFormSubmit() { |
|
13 |
||
14 |
var errors = {}; |
|
15 |
var valid = true; |
|
16 |
|
|
17 |
if(!$('#title').val()) { |
|
18 |
errors['title'] = /*[[#{renkan.error.title.empty}]]*/"renkan.error.title.empty"; |
|
19 |
valid = false; |
|
20 |
} |
|
21 |
|
|
22 |
if($('#binConfig').val()) { |
|
23 |
|
|
24 |
} |
|
25 |
||
26 |
showformErrors(errors); |
|
27 |
||
28 |
return valid; |
|
29 |
} |
|
30 |
|
|
31 |
|
|
32 |
$(function(){ |
|
|
224
0167b777ad15
remove deprecated warnings + fix date picker default langauge
ymh <ymh.work@gmail.com>
parents:
222
diff
changeset
|
33 |
var regionalValue = /*[[${#ctx.getLocale().getLanguage()}]]*/""; |
|
0167b777ad15
remove deprecated warnings + fix date picker default langauge
ymh <ymh.work@gmail.com>
parents:
222
diff
changeset
|
34 |
$.datepicker.setDefaults($.datepicker.regional[ "" ]); |
|
0167b777ad15
remove deprecated warnings + fix date picker default langauge
ymh <ymh.work@gmail.com>
parents:
222
diff
changeset
|
35 |
$('.datepicker').datepicker($.datepicker.regional[regionalValue]); |
| 222 | 36 |
$('#color').spectrum({ |
37 |
showInput: true, |
|
38 |
showAlpha: true, |
|
39 |
showPalette: true, |
|
40 |
showInitial: true |
|
41 |
}); |
|
42 |
}); |
|
43 |
//]]> |
|
44 |
</script> |
|
45 |
<form action="#" th:object="${user}" th:action="@{/admin/users/save}" method="post" onsubmit="return userFormSubmit()"> |
|
46 |
<fieldset class="form-fields"> |
|
47 |
<input type="hidden" th:field="*{id}" th:if="*{id}" /> |
|
48 |
<div> |
|
49 |
<label for="title" th:text="#{renkanAdmin.form.title}">Title: </label> |
|
50 |
<input type="text" th:field="*{title}" /> |
|
51 |
<div th:if="${#fields.hasErrors('title')}" th:errors="*{title}" class="form-error"></div> |
|
52 |
</div> |
|
53 |
<div> |
|
54 |
<label for="uri" th:text="#{renkanAdmin.form.uri}">Uri: </label> |
|
55 |
<input type="text" th:field="*{uri}" /> |
|
56 |
</div> |
|
57 |
<div> |
|
58 |
<label for="description" th:text="#{renkanAdmin.form.description}">Description: </label> |
|
59 |
<textarea th:field="*{description}"></textarea> |
|
60 |
</div> |
|
61 |
<div> |
|
62 |
<label for="color" th:text="#{renkanAdmin.form.color}">Color: </label> |
|
63 |
<input type="text" th:field="*{color}" /> |
|
64 |
</div> |
|
65 |
<div> |
|
66 |
<label for="avatar" th:text="#{renkanAdmin.form.avatar}">Avatar: </label> |
|
67 |
<input type="text" th:field="*{avatar}" /> |
|
68 |
</div> |
|
69 |
<div> |
|
70 |
<label for="credentialExpirationDate" th:text="#{renkanAdmin.form.credentialExpirationDate}">Credential expiration date: </label> |
|
71 |
<input type="text" th:field="*{credentialExpirationDate}" class="datepicker"/> |
|
72 |
</div> |
|
73 |
<div> |
|
74 |
<label for="expirationDate" th:text="#{renkanAdmin.form.expirationDate}">Expiration date: </label> |
|
75 |
<input type="text" th:field="*{expirationDate}" class="datepicker"/> |
|
76 |
</div> |
|
77 |
<div> |
|
78 |
<label for="email" th:text="#{renkanAdmin.form.email}">Email: </label> |
|
79 |
<input type="email" th:field="*{email}" /> |
|
80 |
</div> |
|
81 |
<div> |
|
82 |
<label for="enabled" th:text="#{renkanAdmin.form.enabled}">Enabled: </label> |
|
83 |
<input type="checkbox" th:field="*{enabled}" /> |
|
84 |
</div> |
|
85 |
<div> |
|
86 |
<label for="locked" th:text="#{renkanAdmin.form.locked}">Locked: </label> |
|
87 |
<input type="checkbox" th:field="*{locked}" /> |
|
88 |
</div> |
|
89 |
<div class="submit"> |
|
90 |
<button type="submit" name="save" th:text="#{renkanAdmin.form.user.submit}">Save</button> |
|
91 |
<!--button type="button" name="cancel" th:text="#{renkanAdmin.form.user.cancel}" th:onclick="location">Cancel</button--> |
|
92 |
</div> |
|
93 |
||
94 |
</fieldset> |
|
95 |
</form> |
|
96 |
</div> |
|
97 |
</body> |
|
98 |
</html> |