edit.gsp
上传用户:steveyhw
上传日期:2019-05-13
资源大小:307k
文件大小:6k
-
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
- <meta name="layout" content="main" />
- <title><g:message code="user.edit" default="Edit Person" /></title>
- </head>
- <body>
- <div class="nav">
- <span class="menuButton"><a class="home" href="${createLinkTo(dir:'')}"><g:message code="home" default="Home" /></a></span>
- <span class="menuButton"><g:link class="list" action="list"><g:message code="user.list" default="User List" /></g:link></span>
- <span class="menuButton"><g:link class="create" action="create"><g:message code="user.new" default="New Person" /></g:link></span>
- </div>
- <div class="body">
- <h1><g:message code="user.edit" default="Edit Person" /></h1>
- <g:if test="${flash.message}">
- <div class="message">${flash.message}</div>
- </g:if>
- <g:hasErrors bean="${person}">
- <div class="errors">
- <g:renderErrors bean="${person}" as="list" />
- </div>
- </g:hasErrors>
-
- <div class="prop">
- <span class="name">Id:</span>
- <span class="value">${person?.id}</span>
- </div>
-
- <g:form controller="user" method="post" >
- <input type="hidden" name="id" value="${person?.id}" />
- <div class="dialog">
- <table>
- <tbody>
-
- <tr class='prop'>
- <td valign='top' class='name'>
- <label for='username'><g:message code="user.loginName" default="Login Name:" /></label>
- </td>
- <td valign='top'
- class='value ${hasErrors(bean:person,field:'username','errors')}'>
- <input type="text" name='username'
- value="${person?.username?.encodeAsHTML()}"/>
- </td>
- </tr>
-
- <tr class='prop'>
- <td valign='top' class='name'>
- <label for='userRealName'><g:message code="user.fullName" default="Full Name:" /></label>
- </td>
- <td valign='top'
- class='value ${hasErrors(bean:person,field:'userRealName','errors')}'>
- <input type="text" name='userRealName'
- value="${person?.userRealName?.encodeAsHTML()}"/>
- </td>
- </tr>
-
- <tr class='prop'>
- <td valign='top' class='name'>
- <label for='passwd'><g:message code="user.password" default="Password:" /></label>
- </td>
- <td valign='top'
- class='value ${hasErrors(bean:person,field:'passwd','errors')}'>
- <input type="password" name='passwd'
- value="${person?.passwd?.encodeAsHTML()}"/>
- </td>
- </tr>
-
- <tr class='prop'>
- <td valign='top' class='name'>
- <label for='enabled'><g:message code="user.enabled" default="Enabled:" /></label>
- </td>
- <td valign='top'
- class='value ${hasErrors(bean:person,field:'enabled','errors')}'>
- <g:checkBox name='enabled' value="${person?.enabled}" ></g:checkBox>
- </td>
- </tr>
-
- <tr class='prop'>
- <td valign='top' class='name'>
- <label for='description'><g:message code="user.description" default="Description:" /></label>
- </td>
- <td valign='top'
- class='value ${hasErrors(bean:person,field:'description','errors')}'>
- <input type="text" name='description'
- value="${person?.description?.encodeAsHTML()}"/>
- </td>
- </tr>
-
- <tr class='prop'>
- <td valign='top' class='name'>
- <label for='email'><g:message code="user.email" default="Email:" /></label>
- </td>
- <td valign='top'
- class='value ${hasErrors(bean:person,field:'email','errors')}'>
- <input type="text" name='email'
- value="${person?.email?.encodeAsHTML()}"/>
- </td>
- </tr>
-
- <tr class='prop'>
- <td valign='top' class='name'>
- <label for='email_show'><g:message code="user.showEmail" default="Show Email:" /></label>
- </td>
- <td valign='top'
- class='value ${hasErrors(bean:person,field:'email_show','errors')}'>
- <g:checkBox name='email_show' value="${person?.email_show}" >
- </g:checkBox>
- </td>
- </tr>
-
- <tr class='prop'>
- <td valign='top' class='name'>
- <label for='authorities'><g:message code="user.assignRoles" default="Assign Roles:" /></label>
- </td>
- <td valign='top'
- class='value ${hasErrors(bean:person,field:'authorities','errors')}'>
- <ul>
- <g:set var="list" value="[]"/>
- <g:each var='b' in="${authorityList.authority}">
- <g:each var='a' in='${person?.authorities?}'>
- <g:if test="${b==~ a.authority}">
- <%if(!list.contains(b)){list.add(b);%>
- <li>${a.authority?.substring(5)?.toLowerCase()?.encodeAsHTML()}
- <g:checkBox name='${a.authority}' value="${true}" ></g:checkBox>
- </li>
- <%}%>
- </g:if>
- </g:each>
- <%if(!list.contains(b)){list.add(b);%>
- <li>${b.substring(5)?.toLowerCase()?.encodeAsHTML()}
- <g:checkBox name='${b}' value="${false}" ></g:checkBox>
- </li>
- <%}%>
- </g:each>
- </ul>
- </td>
- </tr>
-
- </tbody>
- </table>
- </div>
- <div class="buttons">
- <span class="button"><g:actionSubmit class="save" action="Update" value="${message(code:'update', 'default':'Update')}" /></span>
- <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>
- <span class="button"><input class="delete" type="button" onclick=" history.go(-1);" value="${message(code:'back', 'default':'Back')}"/> </span>
- </div>
-
- </g:form>
-
- </div>
- </body>
- </html>