templates.html 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. {% extends "portal/layout.html" %}
  2. {% block content %}
  3. <link rel="stylesheet" href="{{ url_for('static', filename='select2/select2.css') }}"/>
  4. <link rel="stylesheet" href="{{ url_for('static', filename='css/select2-bootstrap.css') }}"/>
  5. <script type="text/javascript" src="{{ url_for('static', filename='select2/select2.min.js') }}"></script>
  6. <div class="panel panel-default">
  7. <!-- Default panel contents -->
  8. <div class="panel-heading" style="padding-left: 8px;">templates</div>
  9. <div class="panel-body" style="padding-left: 8px;">
  10. <span class="green">{{ group.grp_name }}</span>
  11. binding
  12. <span class="glyphicon glyphicon-pushpin"></span>
  13. </div>
  14. <!-- Table -->
  15. <table class="table table-hover table-bordered table-striped" style="margin-bottom: 0px; margin-top: 0px;">
  16. <thead>
  17. <tr>
  18. <th>template</th>
  19. <th>creator</th>
  20. <th>operation</th>
  21. </tr>
  22. </thead>
  23. <tbody>
  24. {% for v in ts %}
  25. <tr>
  26. <td>
  27. <a href="/portal/template/view/{{ v.id }}">{{ v.tpl_name }}</a>
  28. </td>
  29. <td>
  30. <a href="/user/about/{{ v.create_user }}">{{ v.create_user }}</a>
  31. </td>
  32. <td>
  33. <a href="javascript:tpl_unbind_group('{{ v.id }}', '{{ group.id }}');"
  34. style="text-decoration: none;">
  35. <span class="glyphicon glyphicon-trash orange"></span>
  36. </a>
  37. </td>
  38. </tr>
  39. {% else %}
  40. <tr>
  41. <td colspan="3">no records</td>
  42. </tr>
  43. {% endfor %}
  44. </tbody>
  45. </table>
  46. </div>
  47. <div class="form-inline mb20" role="form">
  48. <div class="form-group">
  49. <input type="text" style="width: 400px;" placeholder="input template name" class="form-control" id="tpl_id">
  50. </div>
  51. <div class="form-group">
  52. <button type="button" onclick="bind_template('{{ group.id }}');" class="btn btn-default">
  53. <span class="glyphicon glyphicon-plus"></span>
  54. Bind
  55. </button>
  56. <button type="button" onclick="history.go(-1);" class="btn btn-default">
  57. <span class="glyphicon glyphicon-arrow-left"></span>
  58. Back
  59. </button>
  60. </div>
  61. </div>
  62. <script>
  63. $(function () {
  64. make_select2_for_template("#tpl_id");
  65. });
  66. </script>
  67. {% endblock %}