new_resource_add_edit.html 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <{include file="admin/permission/header.html"}>
  2. <{include file="admin/permission/nav.html"}>
  3. <div class="container">
  4. <p></p>
  5. <form role="form" method="post">
  6. <div class="form-group">
  7. <label><{$alias}>名称:</label>
  8. <input name="name" type="text" class="form-control" value="<{$resource.name}>">
  9. </div>
  10. <{if $type != 'dir'}>
  11. <div class="form-group">
  12. <label>所属目录:</label>
  13. <input type="text" class="form-control" value="<{$parent_resource.name}>" disabled>
  14. </div>
  15. <div class="form-group">
  16. <label>所属应用名称:</label>
  17. <div class="row-lsm">
  18. <input name="app_name" type="text" class="form-control" value="<{$resource.app_name}>">
  19. </div>
  20. </div>
  21. <div class="form-group">
  22. <label>所属控制器名称:</label>
  23. <div class="row-lsm">
  24. <input name="control_name" type="text" class="form-control" value="<{$resource.control_name}>">
  25. </div>
  26. </div>
  27. <div class="form-group">
  28. <label>所属行为名称:</label>
  29. <div class="row-lsm">
  30. <input name="action_name" type="text" class="form-control" value="<{$resource.action_name}>">
  31. <i>不输入action名称,即对整个控制器拥有所有权限。(不推荐)</i>
  32. </div>
  33. </div>
  34. <div class="form-group">
  35. <label>是否最终节点:<input name="is_end" type="checkbox" value="1" <{if $is_end}>checked<{/if}>/></label>
  36. </div>
  37. <input name="parent_id" type="hidden" value="<{$parent_resource.id}>" />
  38. <{if $resource}>
  39. <input name="cas_token" type="hidden" value="<{$resource.cas_token}>" />
  40. <{/if}>
  41. <{/if}>
  42. <div class="form-group">
  43. <input id="submit" type="submit" class="btn" value="提交" />
  44. </div>
  45. </form>
  46. </div>
  47. <script type="text/javascript">
  48. KISSY.use('node', function (S, Node) {
  49. var $ = S.all;
  50. $("#submit").on('click', function () {
  51. var name = $("input[name=name]").val();
  52. if (!name) {
  53. alert('请输入<{$alias}>名称');
  54. return false;
  55. }
  56. <{if $type != 'dir'}>
  57. var app_name = $("input[name=app_name]").val();
  58. if (!app_name) {
  59. alert('请输入应用名称');
  60. return false;
  61. }
  62. var control_name = $("input[name=control_name]").val();
  63. if (!control_name) {
  64. alert('请输入控制器名称');
  65. return false;
  66. }
  67. <{/if}>
  68. });
  69. });
  70. </script>
  71. <{include file="admin/permission/bottom.html"}>