server/src/main/webapp/WEB-INF/templates/fragment/userForm.html
branchuser_management
changeset 222 6ac00231ee34
child 224 0167b777ad15
equal deleted inserted replaced
221:a392390de1a7 222:6ac00231ee34
       
     1 <!DOCTYPE html>
       
     2 <html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
       
     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(){
       
    33             $(".datepicker").datepicker();
       
    34             $('#color').spectrum({
       
    35             	showInput: true,
       
    36             	showAlpha: true,
       
    37             	showPalette: true,
       
    38             	showInitial: true
       
    39             });
       
    40         });
       
    41     //]]>
       
    42   </script>
       
    43   <form action="#" th:object="${user}" th:action="@{/admin/users/save}" method="post" onsubmit="return userFormSubmit()">
       
    44      <fieldset class="form-fields">
       
    45        <input type="hidden" th:field="*{id}" th:if="*{id}" />
       
    46        <div>
       
    47          <label for="title" th:text="#{renkanAdmin.form.title}">Title: </label> 
       
    48          <input type="text" th:field="*{title}" />
       
    49          <div th:if="${#fields.hasErrors('title')}" th:errors="*{title}" class="form-error"></div>
       
    50        </div> 
       
    51        <div>
       
    52          <label for="uri" th:text="#{renkanAdmin.form.uri}">Uri: </label> 
       
    53          <input type="text" th:field="*{uri}" /> 
       
    54        </div> 
       
    55        <div>
       
    56          <label for="description" th:text="#{renkanAdmin.form.description}">Description: </label> 
       
    57          <textarea th:field="*{description}"></textarea> 
       
    58        </div> 
       
    59        <div>
       
    60          <label for="color" th:text="#{renkanAdmin.form.color}">Color: </label> 
       
    61          <input type="text" th:field="*{color}" /> 
       
    62        </div>
       
    63        <div>
       
    64          <label for="avatar" th:text="#{renkanAdmin.form.avatar}">Avatar: </label> 
       
    65          <input type="text" th:field="*{avatar}" /> 
       
    66        </div>
       
    67        <div>
       
    68          <label for="credentialExpirationDate" th:text="#{renkanAdmin.form.credentialExpirationDate}">Credential expiration date: </label> 
       
    69          <input type="text" th:field="*{credentialExpirationDate}" class="datepicker"/> 
       
    70        </div>
       
    71        <div>
       
    72          <label for="expirationDate" th:text="#{renkanAdmin.form.expirationDate}">Expiration date: </label> 
       
    73          <input type="text" th:field="*{expirationDate}" class="datepicker"/> 
       
    74        </div>
       
    75        <div>
       
    76          <label for="email" th:text="#{renkanAdmin.form.email}">Email: </label> 
       
    77          <input type="email" th:field="*{email}" /> 
       
    78        </div>
       
    79        <div>
       
    80          <label for="enabled" th:text="#{renkanAdmin.form.enabled}">Enabled: </label> 
       
    81          <input type="checkbox" th:field="*{enabled}" /> 
       
    82        </div>
       
    83        <div>
       
    84          <label for="locked" th:text="#{renkanAdmin.form.locked}">Locked: </label> 
       
    85          <input type="checkbox" th:field="*{locked}" /> 
       
    86        </div>
       
    87        <div class="submit"> 
       
    88          <button type="submit" name="save" th:text="#{renkanAdmin.form.user.submit}">Save</button>
       
    89          <!--button type="button" name="cancel" th:text="#{renkanAdmin.form.user.cancel}" th:onclick="location">Cancel</button-->
       
    90        </div> 
       
    91       
       
    92      </fieldset>  
       
    93   </form>
       
    94 </div>
       
    95 </body>
       
    96 </html>