global-notification.html 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <a href="/admin/global-notification/detail">
  2. <p data-toggle="collapse" class="btn btn-default">通知設定の追加</p>
  3. </a>
  4. <h2>通知設定一覧</h2>
  5. <table class="table table-bordered">
  6. <thead>
  7. <th>ON/OFF</th>
  8. <th>Pattern</th>
  9. <th>Triggers</th>
  10. <th>Notify To</th>
  11. </thead>
  12. <tbody class="admin-notif-list">
  13. <form id="">
  14. <tr>
  15. <td></td>
  16. <td>
  17. <input class="form-control" type="text" placeholder="e.g. /projects/xxx/MTG/*">
  18. <p class="help-block">
  19. Path Pattern of wiki. Expression with <code>*</code> is supported.
  20. </p>
  21. </td>
  22. <td>
  23. <table>
  24. <tr>
  25. <td><i class="icon-note"></i></td>
  26. <td><i class="icon-note"></i></td>
  27. <td><i class="icon-note"></i></td>
  28. <td><i class="icon-note"></i></td>
  29. <td><i class="icon-note"></i></td>
  30. <td><i class="icon-note"></i></td>
  31. <td><i class="icon-note"></i><span style="padding-right: 50px;"></span></td>
  32. </tr>
  33. <tr>
  34. <td><input type="checkbox" value="1" checked=""></td>
  35. <td><input type="checkbox" value="1" checked=""></td>
  36. <td><input type="checkbox" value="1" checked=""></td>
  37. <td><input type="checkbox" value="1" checked=""></td>
  38. <td><input type="checkbox" value="1" checked=""></td>
  39. <td><input type="checkbox" value="1" checked=""></td>
  40. <td><input type="checkbox" value="1" checked=""></td>
  41. </tr>
  42. </table>
  43. </td>
  44. <td>
  45. <input class="form-control" type="text" placeholder="e.g. xxx@example.com">
  46. <p class="help-block">
  47. Notifications are sent to this email.
  48. </p>
  49. </td>
  50. </tr>
  51. </form>
  52. {% for setting in settings %}
  53. {% set detailPageUrl = '/admin/global-notification/detail' %}
  54. <tr class="clickable-row" data-href="{{ detailPageUrl }}" data-updatepost-id="{{ notif._id.toString() }}">
  55. <td class="unclickable">
  56. <label class="switch">
  57. <input type="checkbox">
  58. <span class="slider round"></span>
  59. </label>
  60. </td>
  61. <td>
  62. {{ setting.pathPattern }}
  63. </td>
  64. <td>
  65. <table>
  66. <tr>
  67. <td><i class="icon-note"></i></td>
  68. <td><i class="icon-note"></i></td>
  69. <td><i class="icon-note"></i></td>
  70. <td><i class="icon-note"></i></td>
  71. <td><i class="icon-note"></i></td>
  72. <td><i class="icon-note"></i></td>
  73. <td><i class="icon-note"></i></td>
  74. </tr>
  75. </table>
  76. </td>
  77. <td>
  78. {{ setting.channel }}
  79. </td>
  80. </tr>
  81. {% endfor %}
  82. </tbody>
  83. </table>
  84. <style>
  85. /* The switch - the box around the slider */
  86. .switch {
  87. position: relative;
  88. display: inline-block;
  89. width: 30px;
  90. height: 17px;
  91. }
  92. /* Hide default HTML checkbox */
  93. .switch input {display:none;}
  94. /* The slider */
  95. .slider {
  96. position: absolute;
  97. cursor: pointer;
  98. top: 0;
  99. left: 0;
  100. right: 0;
  101. bottom: 0;
  102. background-color: #ccc;
  103. -webkit-transition: .4s;
  104. transition: .4s;
  105. }
  106. .slider:before {
  107. position: absolute;
  108. content: "";
  109. height: 13px;
  110. width: 13px;
  111. left: 2px;
  112. bottom: 2px;
  113. background-color: white;
  114. -webkit-transition: .4s;
  115. transition: .4s;
  116. }
  117. input:checked + .slider {
  118. background-color: #2196F3;
  119. }
  120. input:focus + .slider {
  121. box-shadow: 0 0 1px #2196F3;
  122. }
  123. input:checked + .slider:before {
  124. -webkit-transform: translateX(13px);
  125. -ms-transform: translateX(13px);
  126. transform: translateX(13px);
  127. }
  128. /* Rounded sliders */
  129. .slider.round {
  130. border-radius: 34px;
  131. }
  132. .slider.round:before {
  133. border-radius: 50%;
  134. }
  135. </style>
  136. <script>
  137. $(".clickable-row > :not('.unclickable')").click(function(event) {
  138. window.location = $(event.currentTarget).parent().data("href")
  139. });
  140. </script>