sysIndexLayoutEdit.jsp 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <%--
  2. time:2015-03-18 15:39:18
  3. desc:edit the 首页布局
  4. --%>
  5. <%@page language="java" pageEncoding="UTF-8"%>
  6. <%@include file="/commons/include/html_doctype.html"%>
  7. <%@ taglib prefix="ht" tagdir="/WEB-INF/tags/wf"%>
  8. <html>
  9. <head>
  10. <title>编辑 首页布局</title>
  11. <%@include file="/commons/include/form.jsp" %>
  12. <script type="text/javascript" src="${ctx}/js/hotent/CustomValid.js"></script>
  13. <f:link href="codemirror/lib/codemirror.css"></f:link>
  14. <script type="text/javascript" src="${ctx}/js/codemirror/lib/codemirror.js"></script>
  15. <script type="text/javascript" src="${ctx}/js/codemirror/mode/xml/xml.js"></script>
  16. <script type="text/javascript" src="${ctx}/js/codemirror/mode/javascript/javascript.js"></script>
  17. <script type="text/javascript" src="${ctx}/js/codemirror/mode/css/css.js"></script>
  18. <script type="text/javascript" src="${ctx}/js/codemirror/mode/htmlmixed/htmlmixed.js"></script>
  19. <script type="text/javascript">
  20. var returnUrl="${returnUrl}";
  21. $(function() {
  22. var width = $("#templateHtml").width();
  23. var height = $("#templateHtml").height();
  24. editor = CodeMirror.fromTextArea(document.getElementById("templateHtml"), {
  25. mode: "text/html",
  26. tabMode: "indent",
  27. lineNumbers: true
  28. });
  29. editor.setSize(width,height);
  30. $("a.save").click(function() {
  31. $("#templateHtml").val(editor.getValue());
  32. if(editor.getValue() == ''){
  33. $.ligerDialog.alert("请填写模版","提示信息");
  34. return;
  35. }
  36. submitForm();
  37. });
  38. });
  39. //提交表单
  40. function submitForm(){
  41. var options={};
  42. if(showResponse){
  43. options.success=showResponse;
  44. }
  45. var frm=$('#frmSubmit').form();
  46. frm.ajaxForm(options);
  47. if(frm.valid()){
  48. frm.submit();
  49. }
  50. }
  51. function showResponse(responseText) {
  52. var obj = new com.hotent.form.ResultMessage(responseText);
  53. if (obj.isSuccess()) {
  54. $.ligerDialog.success("保存成功!","提示信息", function(rtn) {
  55. if(rtn){
  56. if(window.opener){
  57. window.opener.location.reload();
  58. window.close();
  59. }else{
  60. this.close();
  61. window.location.href="list.ht";
  62. }
  63. }
  64. });
  65. } else {
  66. $.ligerDialog.err("提示信息","首页布局保存失败!",obj.getMessage());
  67. }
  68. }
  69. </script>
  70. </head>
  71. <body>
  72. <form id="frmSubmit" method="post" action="save.ht">
  73. <div class="panel">
  74. <div class="panel-top">
  75. <div class="tbar-title">
  76. <c:choose>
  77. <c:when test="${sysIndexLayout.id !=null}">
  78. <span class="tbar-label">编辑首页布局</span>
  79. </c:when>
  80. <c:otherwise>
  81. <span class="tbar-label">添加首页布局</span>
  82. </c:otherwise>
  83. </c:choose>
  84. </div>
  85. <div class="panel-toolbar">
  86. <div class="toolBar">
  87. <div class="group"><a class="link save" href="javascript:void(0);"><span></span>保存</a></div>
  88. <div class="group"><a class="link back" href="${returnUrl}"><span></span>返回</a></div>
  89. </div>
  90. </div>
  91. </div>
  92. <div class="panel-body">
  93. <table class="table-detail" cellpadding="0" cellspacing="0" border="0" type="main">
  94. <tr>
  95. <th width="20%">布局名称: <span class="required">*</span></th>
  96. <td><input type="text" name="name" id="name" value="${sysIndexLayout.name}" class="inputText" validate="{required:true,maxlength:600}" /></td>
  97. </tr>
  98. <tr>
  99. <th width="20%">排序: <span class="required">*</span></th>
  100. <td><input type="text" name="sn" id="sn" value="${sysIndexLayout.sn}" class="inputText" validate="{required:true,number:true}" /></td>
  101. </tr>
  102. <tr>
  103. <th width="20%">描述: </th>
  104. <td><textarea id="memo" name="memo" class="inputText">${fn:escapeXml(sysIndexLayout.memo)}</textarea></td>
  105. </tr>
  106. <tr>
  107. <th width="20%">模版: <span class="required">*</span></th>
  108. <td><textarea id="templateHtml" name="templateHtml" style="width: 90%;height: 220px;" validate="{required:true}" >${fn:escapeXml(sysIndexLayout.templateHtml)}</textarea></td>
  109. </tr>
  110. </table>
  111. <input type="hidden" name="id" value="${sysIndexLayout.id}" />
  112. </div>
  113. </div>
  114. </form>
  115. </body>
  116. </html>