|
235
|
1 |
<!DOCTYPE html> |
|
|
2 |
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" th:lang="${#ctx.getLocale().toLanguageTag()}" > |
|
|
3 |
<head> |
|
|
4 |
<meta charset="utf-8"/> |
|
|
5 |
<title>User form</title> |
|
|
6 |
</head> |
|
|
7 |
<body> |
|
|
8 |
<div id="groupForm" th:fragment="groupFormFragment" > |
|
|
9 |
<script type="text/javascript" th:inline="javascript"> |
|
|
10 |
//<![CDATA[ |
|
|
11 |
|
|
|
12 |
function groupFormSubmit() { |
|
|
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 |
showformErrors(errors); |
|
|
23 |
|
|
|
24 |
return valid; |
|
|
25 |
} |
|
|
26 |
|
|
|
27 |
|
|
|
28 |
$(function(){ |
|
|
29 |
|
|
|
30 |
$('#color').spectrum({ |
|
|
31 |
showInput: true, |
|
|
32 |
showAlpha: true, |
|
|
33 |
showPalette: true, |
|
|
34 |
showInitial: true, |
|
|
35 |
preferredFormat: 'hex' |
|
|
36 |
}); |
|
|
37 |
$("#model-form").submit(function(e) { |
|
|
38 |
return groupFormSubmit(); |
|
|
39 |
}); |
|
|
40 |
|
|
|
41 |
}); |
|
|
42 |
//]]> |
|
|
43 |
</script> |
|
|
44 |
<form action="#" th:object="${group}" th:action="@{/admin/groups/save}" method="post" id="model-form"> |
|
|
45 |
<fieldset class="form-fields"> |
|
|
46 |
<input type="hidden" th:field="*{id}" th:if="*{id}" /> |
|
|
47 |
<div> |
|
|
48 |
<label for="title" th:text="#{renkanAdmin.form.name}">Name: </label> |
|
|
49 |
<input type="text" th:field="*{title}" /> |
|
|
50 |
<div th:if="${#fields.hasErrors('title')}" th:errors="*{title}" class="form-error"></div> |
|
|
51 |
</div> |
|
|
52 |
<div> |
|
|
53 |
<label for="uri" th:text="#{renkanAdmin.form.uri}">Uri: </label> |
|
|
54 |
<input type="text" th:field="*{uri}" /> |
|
|
55 |
</div> |
|
|
56 |
<div> |
|
|
57 |
<label for="description" th:text="#{renkanAdmin.form.description}">Description: </label> |
|
|
58 |
<textarea th:field="*{description}"></textarea> |
|
|
59 |
</div> |
|
|
60 |
<div> |
|
|
61 |
<label for="color" th:text="#{renkanAdmin.form.color}">Color: </label> |
|
|
62 |
<input type="text" th:field="*{color}" /> |
|
|
63 |
</div> |
|
|
64 |
<div> |
|
|
65 |
<label for="avatar" th:text="#{renkanAdmin.form.avatar}">Avatar: </label> |
|
|
66 |
<input type="text" th:field="*{avatar}" /> |
|
|
67 |
</div> |
|
|
68 |
<div class="submit"> |
|
|
69 |
<button type="submit" name="save" th:text="#{renkanAdmin.form.user.submit}">Save</button> |
|
|
70 |
<!--button type="button" name="cancel" th:text="#{renkanAdmin.form.user.cancel}" th:onclick="location">Cancel</button--> |
|
|
71 |
</div> |
|
|
72 |
|
|
|
73 |
</fieldset> |
|
|
74 |
</form> |
|
|
75 |
</div> |
|
|
76 |
</body> |
|
|
77 |
</html> |