list.html 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. {% extends "user/base.html" %}
  2. {%block head_js%}
  3. {{super()}}
  4. <script>
  5. $(function() {
  6. $("#query").keypress(function(e) {
  7. var key = e.which;
  8. if (key == 13) {
  9. query_user();
  10. }
  11. });
  12. });
  13. </script>
  14. {%endblock%}
  15. {% block container_outer %}
  16. <div id="container" class="container-fluid">
  17. <div class="row">
  18. <div class="col-md-12">
  19. <div style="margin: 0 auto; max-width: 400px;">
  20. <ol class="breadcrumb">
  21. <li class="active">通讯录</li>
  22. </ol>
  23. <div class="form-inline mb20" role="form">
  24. <div class="form-group">
  25. <input type="text" value="{{query_term}}" class="form-control" id="query"
  26. placeholder="name or email">
  27. </div>
  28. <button type="button" onclick="query_user();" class="btn btn-default">
  29. <span class="glyphicon glyphicon-search"></span>
  30. Search
  31. </button>
  32. {%if g.user.is_admin() or g.user.is_root()%}
  33. <a href="/user/create" class="btn btn-default pull-right">
  34. <span class="glyphicon glyphicon-plus"></span>
  35. Add
  36. </a>
  37. {%endif%}
  38. </div>
  39. <div class="us">
  40. {%for user in users%}
  41. <div class="u">
  42. {%if g.user.is_root() %}
  43. <div class="pull-right">
  44. {%if user.is_root()%}
  45. root
  46. {%elif user.is_admin()%}
  47. <input type="checkbox" checked="checked" onclick="set_role('{{user.id}}', this);">
  48. 管理员
  49. {%else%}
  50. <input type="checkbox" onclick="set_role('{{user.id}}', this);">
  51. 管理员
  52. {%endif%}
  53. </div>
  54. {%endif%}
  55. 登录账号:{{user.name}}, 中文名:{{user.cnname}}
  56. <a href="/user/about/{{user.id}}" style="text-decoration:none;">
  57. <span class="glyphicon glyphicon-qrcode"></span>
  58. </a>
  59. <br>
  60. 邮箱: {{user.email}}<br>
  61. 手机: {{user.phone}}<br>
  62. IM:{{user.im}}, QQ:{{user.qq}}
  63. {%if g.user.is_root() or g.user.is_admin() %}
  64. <div class="pull-right">
  65. <a href="/admin/user/{{user.id}}/edit" class="orange" style="text-decoration:none;">
  66. <span class="glyphicon glyphicon-edit"></span>
  67. </a>
  68. <span class="cut-line">¦</span>
  69. <a href="javascript:delete_user('{{user.id}}');" class="orange" style="text-decoration:none;">
  70. <span class="glyphicon glyphicon-trash"></span>
  71. </a>
  72. </div>
  73. {%endif%}
  74. <hr>
  75. </div>
  76. {%endfor%}
  77. </div>
  78. </div>
  79. </div>
  80. </div>
  81. </div>
  82. {%endblock%}