text_edit.html 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <extend name="Public:base" />
  2. <block name="content">
  3. <div class="page-header">
  4. <h1>
  5. {$breadcrumb2}
  6. <small>
  7. <i class="icon-double-angle-right"></i>
  8. {$crumbs}
  9. </small>
  10. </h1>
  11. </div>
  12. <div class="row">
  13. <div class="col-xs-12">
  14. <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="validation-form" class="form-horizontal">
  15. <notempty name="Think.get.id">
  16. <input name="tr_id" type="hidden" value="{$Think.get.id}" />
  17. </notempty>
  18. <div class="form-group">
  19. <label class="col-sm-2 control-label no-padding-left"> * 关键字 </label>
  20. <div class="col-sm-10">
  21. <div class="clearfix">
  22. <input name="keyword" id="keyword" class="col-xs-10 col-sm-5" placeholder="关键字" value="{$reply.keyword|default=''}" type="text">
  23. </div>
  24. </div>
  25. </div>
  26. <div class="form-group">
  27. <label class="col-sm-2 control-label"> * 回复内容</label>
  28. <div class="col-sm-10">
  29. <div class="clearfix">
  30. <textarea id="content" class="form-control" placeholder="回复内容" rows="5" name="content">{$reply.content|default=''}</textarea>
  31. </div>
  32. </div>
  33. </div>
  34. <div class="form-group">
  35. <label class="col-sm-2 control-label">启用</label>
  36. <div class="col-sm-10">
  37. <label class="radio-inline">
  38. <input type="radio" checked="checked" value="1" name="status">是</label>
  39. <label class="radio-inline">
  40. <input type="radio" value="0" name="status">否</label>
  41. </div>
  42. </div>
  43. <div class="form-group">
  44. <label class="col-sm-1 control-label no-padding-left"> </label>
  45. <div class="col-sm-11">
  46. <input name="send" type="submit" value="提交" class="btn btn-primary" />
  47. </div>
  48. </div>
  49. </form>
  50. </div>
  51. </div>
  52. </block>
  53. <block name="javascript">
  54. <script src="__JS__/jquery.validate.min.js"></script>
  55. <script>
  56. $(function(){
  57. <present name="Think.get.id">
  58. Oscshop.setValue("status", {$reply.status|default=1});
  59. </present>
  60. $('#validation-form').validate({
  61. errorElement: 'div',
  62. errorClass: 'help-block',
  63. focusInvalid: false,
  64. rules: {
  65. keyword: {
  66. required: true,
  67. minlength: 1
  68. },
  69. content: {
  70. required: true
  71. }
  72. },
  73. messages: {
  74. keyword: {
  75. required: "必填",
  76. minlength: "不得少于1个字"
  77. },
  78. content: {
  79. required: "必填"
  80. }
  81. },
  82. highlight: function (e) {
  83. $(e).closest('.form-group').removeClass('has-info').addClass('has-error');
  84. },
  85. success: function (e) {
  86. $(e).closest('.form-group').removeClass('has-error').addClass('has-info');
  87. $(e).remove();
  88. },
  89. errorPlacement: function (error, element) {
  90. error.insertAfter(element.parent());
  91. },
  92. });
  93. });
  94. </script>
  95. </block>