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