list.html 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. {% extends "portal/layout.html" %}
  2. {% block content %}
  3. <div class="form-inline" role="form">
  4. <div class="form-group">
  5. <input type="text" value="{{ data.query }}" class="form-control" id="query"
  6. placeholder="search..." onkeydown="if(event.keyCode==13)query_expression()">
  7. </div>
  8. <button type="button" onclick="query_expression();" class="btn btn-default">
  9. <span class="glyphicon glyphicon-search"></span>
  10. </button>
  11. <input type="checkbox" name="mine" id="mine" {% if data.mine == '1' %}checked="checked"{% endif %}>
  12. <span>mine</span>
  13. <div class="pull-right">
  14. <a href="{{ url_for('expression_add_get') }}" class="btn btn-default">
  15. <span class="glyphicon glyphicon-plus"></span>
  16. </a>
  17. </div>
  18. </div>
  19. <div>
  20. {% set left = '{' %}
  21. {% set right = '}' %}
  22. {% for v in data.vs %}
  23. <hr>
  24. <div class="">{{ v.expression }}</div>
  25. <div class="mt10">
  26. <span class="gray">if {{ v.func }}{{ v.op }}{{ v.right_value }}
  27. {{ left }}{{ v.action.html()|safe }}{{ right }}</span>
  28. {% if v.writable(g.user) %}
  29. <div class="pull-right">
  30. <button onclick="pause_expression('{{v.id}}')" class="btn btn-default">
  31. <span id="i-{{v.id}}" class="glyphicon glyphicon-{% if v.pause %}play{% else %}pause{% endif %} orange"></span>
  32. </button>
  33. <a href="{{ url_for('expression_add_get', id=v.id) }}" class="btn btn-default"
  34. style="text-decoration: none;">
  35. <span class="glyphicon glyphicon-edit orange"></span>
  36. </a>
  37. <button onclick="delete_expression('{{ v.id }}');" class="btn btn-default">
  38. <span class="glyphicon glyphicon-trash orange"></span>
  39. </button>
  40. </div>
  41. {% endif %}
  42. </div>
  43. <div class="mt10 gray">
  44. note: {{ v.note }} (Max:{{ v.max_step }}, P{{ v.priority }})
  45. by {{ v.create_user }}
  46. </div>
  47. {% else %}
  48. <hr>
  49. no records
  50. {% endfor %}
  51. </div>
  52. {% import "portal/blocks.html" as blocks %}
  53. {{ blocks.pager('/portal/expression?q='+data.query+'&mine='+data.mine, data.total, data.limit, data.page) }}
  54. <br/>
  55. <br/>
  56. <br/>
  57. <br/>
  58. <script>
  59. $(function () {
  60. $("#mine").click(query_expression);
  61. });
  62. </script>
  63. {% endblock %}