add.html 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <include file="public@header"/>
  2. </head>
  3. <body>
  4. <div class="wrap">
  5. <ul class="nav nav-tabs">
  6. <li><a href="{:url('route/index')}">URL美化</a></li>
  7. <li class="active"><a href="{:url('route/add')}">添加URL规则</a></li>
  8. </ul>
  9. <form method="post" class="form-horizontal js-ajax-form margin-top-20" action="{:url('route/addPost')}">
  10. <div class="form-group">
  11. <label for="input-full_url" class="col-sm-2 control-label">原始网址<span class="form-required">*</span></label>
  12. <div class="col-md-6 col-sm-10">
  13. <input type="text" class="form-control" id="input-full_url" name="full_url"> <a href="javascript:doSelectUrl();">选择规则</a>
  14. </div>
  15. </div>
  16. <div class="form-group">
  17. <label for="input-url" class="col-sm-2 control-label">显示网址<span class="form-required">*</span></label>
  18. <div class="col-md-6 col-sm-10">
  19. <input type="text" class="form-control" id="input-url" name="url">
  20. <p class="help-block"><span id="url-vars"></span> url格式一般为list/:param1/:param2或 list-&lt;param1&gt;-&lt;param2&gt;
  21. </p>
  22. </div>
  23. </div>
  24. <div class="form-group">
  25. <label for="input-status" class="col-sm-2 control-label">是否启用</label>
  26. <div class="col-md-6 col-sm-10">
  27. <select class="form-control" name="status" id="input-status">
  28. <option value="1">启用</option>
  29. <option value="0">禁用</option>
  30. </select>
  31. </div>
  32. </div>
  33. <div class="form-group">
  34. <div class="col-sm-offset-2 col-sm-10">
  35. <button type="submit" class="btn btn-primary js-ajax-submit">{:lang('SAVE')}</button>
  36. </div>
  37. </div>
  38. </form>
  39. </div>
  40. <script type="text/javascript" src="__STATIC__/js/admin.js"></script>
  41. <script>
  42. function doSelectUrl() {
  43. var selectedCategoriesId = $('#js-categories-id-input').val();
  44. openIframeLayer("{:url('Route/select')}?ids=" + selectedCategoriesId, '请选择URL', {
  45. area: ['95%', '90%'],
  46. btn: ['确定', '取消'],
  47. yes: function (index, layero) {
  48. var iframeWin = window[layero.find('iframe')[0]['name']];
  49. var selectedUrl = iframeWin.confirm();
  50. if (selectedUrl) {
  51. $('#input-full_url').val(selectedUrl.action);
  52. $('#input-url').val(selectedUrl.url);
  53. var helpBlock = selectedUrl.vars ? "URL参数有" + selectedUrl.vars + ',' : '';
  54. $('#url-vars').text(helpBlock);
  55. }
  56. layer.close(index); //如果设定了yes回调,需进行手工关闭
  57. }
  58. });
  59. }
  60. </script>
  61. </body>
  62. </html>