role-def-input.jsp 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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.roleDef.input.title" text="编辑角色"/></title>
  10. <%@include file="/common/s.jsp"%>
  11. <script type="text/javascript">
  12. $(function() {
  13. $("#roleDefForm").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-def-checkName.do',
  24. data: {
  25. <c:if test="${model != null}">
  26. id: function() {
  27. return $('#roleDef_id').val();
  28. }
  29. </c:if>
  30. }
  31. }
  32. }
  33. },
  34. messages: {
  35. name: {
  36. remote: "<spring:message code='auth.roleDef.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.roleDef.input.title" text="编辑角色"/></h4>
  52. </header>
  53. <div class="content content-inner">
  54. <form id="roleDefForm" method="post" action="role-def-save.do" class="form-horizontal">
  55. <c:if test="${model != null}">
  56. <input id="roleDef_id" type="hidden" name="id" value="${model.id}">
  57. </c:if>
  58. <div class="control-group">
  59. <label class="control-label" for="roleDef_name"><spring:message code='auth.roleDef.input.name' text='名称'/></label>
  60. <div class="controls">
  61. <input id="roleDef_name" type="text" name="name" value="${model.name}" size="40" class="text required" minlength="2" maxlength="50">
  62. </div>
  63. </div>
  64. <div class="control-group">
  65. <label class="control-label" for="roleDef_descn"><spring:message code='auth.roleDef.input.description' text='描述'/></label>
  66. <div class="controls">
  67. <textarea id="roleDef_descn" name="descn" maxlength="60" rows="4">${model.descn}</textarea>
  68. </div>
  69. </div>
  70. <div class="control-group">
  71. <div class="controls">
  72. <button id="submitButton" class="btn a-submit"><spring:message code='core.input.save' text='保存'/></button>
  73. &nbsp;
  74. <button type="button" onclick="history.back();" class="btn"><spring:message code='core.input.back' text='返回'/></button>
  75. </div>
  76. </div>
  77. </form>
  78. </div>
  79. </article>
  80. <div class="m-spacer"></div>
  81. </section>
  82. <!-- end of main -->
  83. </div>
  84. </body>
  85. </html>