role-input.jsp 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <%@page contentType="text/html;charset=UTF-8"%>
  2. <%@include file="/taglibs.jsp"%>
  3. <%pageContext.setAttribute("currentHeader", "auth");%>
  4. <%pageContext.setAttribute("currentMenu", "auth");%>
  5. <!doctype html>
  6. <html>
  7. <head>
  8. <%@include file="/common/meta.jsp"%>
  9. <title><spring:message code="auth.role.input.title" text="编辑角色"/></title>
  10. <%@include file="/common/s.jsp"%>
  11. <script type="text/javascript">
  12. $(function() {
  13. $("#roleForm").validate({
  14. submitHandler: function(form) {
  15. bootbox.animate(false);
  16. var box = bootbox.dialog('<div class="progress progress-striped active" style="margin:0px;"><div class="bar" style="width: 100%;"></div></div>');
  17. form.submit();
  18. },
  19. errorClass: 'validate-error',
  20. rules: {
  21. name: {
  22. remote: {
  23. url: 'role-checkName.do',
  24. data: {
  25. <c:if test="${model != null}">
  26. id: function() {
  27. return $('#role_id').val();
  28. }
  29. </c:if>
  30. }
  31. }
  32. }
  33. },
  34. messages: {
  35. name: {
  36. remote: "<spring:message code='auth.role.input.duplicate' text='存在重复名称'/>"
  37. }
  38. }
  39. });
  40. })
  41. </script>
  42. </head>
  43. <body>
  44. <%@include file="/header/auth.jsp"%>
  45. <div class="row-fluid">
  46. <%@include file="/menu/auth.jsp"%>
  47. <!-- start of main -->
  48. <section id="m-main" class="span10">
  49. <article class="m-widget">
  50. <header class="header">
  51. <h4 class="title"><spring:message code="auth.role.input.title" text="编辑角色"/></h4>
  52. </header>
  53. <div class="content content-inner">
  54. <form id="roleForm" method="post" action="role-save.do" class="form-horizontal">
  55. <c:if test="${model != null}">
  56. <input id="role_id" type="hidden" name="id" value="${model.id}">
  57. </c:if>
  58. <!--
  59. <div class="control-group">
  60. <label class="control-label" for="role_name"><spring:message code='auth.role.input.name' text='名称'/></label>
  61. <div class="controls">
  62. <input id="role_name" type="text" name="name" value="${model.name}" size="40" class="text required" minlength="2" maxlength="50">
  63. </div>
  64. </div>
  65. -->
  66. <div class="control-group">
  67. <label class="control-label" for="role_roleDef">模板</label>
  68. <div class="controls">
  69. <select id="role_roleDef" name="roleDefId">
  70. <c:forEach items="${roleDefs}" var="item">
  71. <option value="${item.id}">${item.name}</option>
  72. </c:forEach>
  73. </select>
  74. </div>
  75. </div>
  76. <div class="control-group">
  77. <label class="control-label" for="role_descn"><spring:message code='auth.role.input.description' text='描述'/></label>
  78. <div class="controls">
  79. <textarea id="role_descn" name="descn" maxlength="60" rows="4">${model.descn}</textarea>
  80. </div>
  81. </div>
  82. <div class="control-group">
  83. <div class="controls">
  84. <button id="submitButton" class="btn a-submit"><spring:message code='core.input.save' text='保存'/></button>
  85. &nbsp;
  86. <button type="button" onclick="history.back();" class="btn"><spring:message code='core.input.back' text='返回'/></button>
  87. </div>
  88. </div>
  89. </form>
  90. </div>
  91. </article>
  92. <div class="m-spacer"></div>
  93. </section>
  94. <!-- end of main -->
  95. </div>
  96. </body>
  97. </html>