edit.gsp
上传用户:steveyhw
上传日期:2019-05-13
资源大小:307k
文件大小:6k
源码类别:

PlugIns编程

开发平台:

Java

  1.   
  2. <html>
  3.   <head>
  4.     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  5.     <meta name="layout" content="main" />
  6.     <title><g:message code="user.edit" default="Edit Person" /></title>
  7.   </head>
  8.   <body>
  9.     <div class="nav">
  10.       <span class="menuButton"><a class="home" href="${createLinkTo(dir:'')}"><g:message code="home" default="Home" /></a></span>
  11.       <span class="menuButton"><g:link class="list" action="list"><g:message code="user.list" default="User List" /></g:link></span>
  12.       <span class="menuButton"><g:link class="create" action="create"><g:message code="user.new" default="New Person" /></g:link></span>
  13.     </div>
  14.     <div class="body">
  15.       <h1><g:message code="user.edit" default="Edit Person" /></h1>
  16.       <g:if test="${flash.message}">
  17.         <div class="message">${flash.message}</div>
  18.       </g:if>
  19.       <g:hasErrors bean="${person}">
  20.         <div class="errors">
  21.           <g:renderErrors bean="${person}" as="list" />
  22.         </div>
  23.       </g:hasErrors>
  24.       
  25.       <div class="prop">
  26.     <span class="name">Id:</span>
  27.     <span class="value">${person?.id}</span>
  28.       </div>
  29.                  
  30.       <g:form controller="user" method="post" >
  31.         <input type="hidden" name="id" value="${person?.id}" />
  32.         <div class="dialog">
  33.           <table>
  34.             <tbody> 
  35.                        
  36.       <tr class='prop'>
  37.     <td valign='top' class='name'>
  38.       <label for='username'><g:message code="user.loginName" default="Login Name:" /></label>
  39.     </td>
  40. <td valign='top' 
  41.     class='value ${hasErrors(bean:person,field:'username','errors')}'>
  42.   <input type="text" name='username' 
  43.          value="${person?.username?.encodeAsHTML()}"/>
  44. </td>
  45.   </tr>
  46.                        
  47.   <tr class='prop'>
  48.     <td valign='top' class='name'>
  49.       <label for='userRealName'><g:message code="user.fullName" default="Full Name:" /></label>
  50.     </td>
  51. <td valign='top' 
  52.     class='value ${hasErrors(bean:person,field:'userRealName','errors')}'>
  53.   <input type="text" name='userRealName' 
  54.          value="${person?.userRealName?.encodeAsHTML()}"/>
  55. </td>
  56.   </tr>
  57.                        
  58.   <tr class='prop'>
  59.     <td valign='top' class='name'>
  60.       <label for='passwd'><g:message code="user.password" default="Password:" /></label>
  61.     </td>
  62. <td valign='top' 
  63.     class='value ${hasErrors(bean:person,field:'passwd','errors')}'>
  64.   <input type="password" name='passwd' 
  65.          value="${person?.passwd?.encodeAsHTML()}"/>
  66. </td>
  67.   </tr>
  68.                        
  69.   <tr class='prop'>
  70. <td valign='top' class='name'>
  71.   <label for='enabled'><g:message code="user.enabled" default="Enabled:" /></label>
  72. </td>
  73. <td valign='top' 
  74.     class='value ${hasErrors(bean:person,field:'enabled','errors')}'>
  75.   <g:checkBox name='enabled' value="${person?.enabled}" ></g:checkBox>
  76. </td>
  77.   </tr>
  78.                        
  79.   <tr class='prop'>
  80.     <td valign='top' class='name'>
  81.       <label for='description'><g:message code="user.description" default="Description:" /></label>
  82.     </td>
  83. <td valign='top' 
  84.     class='value ${hasErrors(bean:person,field:'description','errors')}'>
  85.   <input type="text" name='description' 
  86.          value="${person?.description?.encodeAsHTML()}"/>
  87. </td>
  88.   </tr>
  89.                        
  90.   <tr class='prop'>
  91.     <td valign='top' class='name'>
  92.       <label for='email'><g:message code="user.email" default="Email:" /></label>
  93.     </td>
  94. <td valign='top' 
  95.     class='value ${hasErrors(bean:person,field:'email','errors')}'>
  96.   <input type="text" name='email' 
  97.          value="${person?.email?.encodeAsHTML()}"/>
  98. </td>
  99.   </tr>
  100.                        
  101.   <tr class='prop'>
  102.     <td valign='top' class='name'>
  103.       <label for='email_show'><g:message code="user.showEmail" default="Show Email:" /></label>
  104.     </td>
  105. <td valign='top' 
  106.     class='value ${hasErrors(bean:person,field:'email_show','errors')}'>
  107.   <g:checkBox name='email_show' value="${person?.email_show}" >
  108.   </g:checkBox>
  109. </td>
  110.   </tr>
  111.                   
  112.   <tr class='prop'>
  113. <td valign='top' class='name'>
  114.   <label for='authorities'><g:message code="user.assignRoles" default="Assign Roles:" /></label>
  115. </td>
  116.      <td valign='top' 
  117.      class='value ${hasErrors(bean:person,field:'authorities','errors')}'>
  118.   <ul>
  119. <g:set var="list" value="[]"/>
  120. <g:each var='b' in="${authorityList.authority}">
  121.        <g:each var='a' in='${person?.authorities?}'>
  122.              <g:if test="${b==~ a.authority}">
  123.        <%if(!list.contains(b)){list.add(b);%>
  124.          <li>${a.authority?.substring(5)?.toLowerCase()?.encodeAsHTML()}
  125.        <g:checkBox name='${a.authority}' value="${true}" ></g:checkBox>
  126.      </li>
  127.        <%}%>
  128.      </g:if>
  129.        </g:each>
  130.        <%if(!list.contains(b)){list.add(b);%>
  131.          <li>${b.substring(5)?.toLowerCase()?.encodeAsHTML()}
  132.        <g:checkBox name='${b}' value="${false}" ></g:checkBox>
  133.      </li>
  134.        <%}%>
  135.      </g:each>
  136.   </ul>
  137. </td>
  138.   </tr>
  139.                        
  140.             </tbody>
  141.           </table>
  142.         </div>
  143.         <div class="buttons">
  144.           <span class="button"><g:actionSubmit class="save" action="Update" value="${message(code:'update', 'default':'Update')}" /></span>
  145.           <span class="button"><g:actionSubmit class="delete" onclick="return confirm('${message(code:'delete.confirm', 'default':'Are you sure?')}');" action="Delete" value="${message(code:'delete', 'default':'Delete')}" /></span>
  146.           <span class="button"><input  class="delete" type="button" onclick=" history.go(-1);" value="${message(code:'back', 'default':'Back')}"/> </span>
  147.         </div>
  148.         
  149.       </g:form>
  150.       
  151.     </div>
  152.   </body>
  153. </html>