global-notification-detail.html 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. {% extends '../layout/admin.html' %}
  2. {% block html_title %}{{ customTitle(t('Notification settings')) }}{% endblock %}
  3. {% block content_header %}
  4. <div class="header-wrap">
  5. <header id="page-header">
  6. <h1 class="title" id="">{{ t('Notification settings') }}</h1>
  7. </header>
  8. </div>
  9. {% endblock %}
  10. {% block content_main %}
  11. <div class="content-main">
  12. {% set smessage = req.flash('successMessage') %}
  13. {% if smessage.length %}
  14. <div class="alert alert-success">
  15. {{ smessage }}
  16. </div>
  17. {% endif %}
  18. {% set emessage = req.flash('errorMessage') %}
  19. {% if emessage.length %}
  20. <div class="alert alert-danger">
  21. {{ emessage }}
  22. </div>
  23. {% endif %}
  24. <div class="row">
  25. <div class="col-md-3">
  26. {% include './widget/menu.html' with {current: 'notification'} %}
  27. </div>
  28. <div class="col-md-9">
  29. <a href="/admin/notification#global-notification" class="btn btn-default">
  30. <i class="icon-fw ti-arrow-left" aria-hidden="true"></i>
  31. 通知設定一覧に戻る
  32. </a>
  33. {% if setting %}
  34. {% set actionPath = '/admin/global-notification/' + setting.id + '/update' %}
  35. {% else %}
  36. {% set actionPath = '/admin/global-notification/new' %}
  37. {% endif %}
  38. <div class="m-t-20 form-box col-md-11">
  39. <form action="{{ actionPath }}" method="post" class="form-horizontal" role="form">
  40. <legend>通知設定詳細</legend>
  41. <fieldset class="col-sm-offset-1 col-sm-4">
  42. <div class="form-group">
  43. <label for="triggerPath" class="control-label">トリガーパス</label> (expression with <code>*</code> is supported)<br />
  44. <input class="form-control" type="text" name="notificationGlobal[triggerPath]" value="{{ setting.triggerPath || '' }}" required>
  45. </div>
  46. <div class="form-group">
  47. <label for="notificationGlobal[notifyToType]"class="control-label">通知先</label><br />
  48. <div class="radio radio-primary">
  49. <input type="radio" id="mail" name="notificationGlobal[notifyToType]" value="mail" {% if setting.__t == 'mail' %}checked{% endif %} checked>
  50. <label for="mail">
  51. <p class="font-weight-bold">Email</p>
  52. </label>
  53. </div>
  54. <div class="radio radio-primary">
  55. <input type="radio" id="slack" name="notificationGlobal[notifyToType]" value="slack" {% if setting.__t == 'slack' %}checked{% endif %} disabled>
  56. <label for="slack">
  57. <p class="font-weight-bold">Slack</p>
  58. </label>
  59. </div>
  60. </div>
  61. <!-- <div class="form-group notify-to-option {% if setting.__t != 'mail' %}d-none{% endif %}" id="mail-input"> -->
  62. <div class="form-group notify-to-option" id="mail-input">
  63. <label for="notificationGlobal[toEmail]"class="control-label">Email</label><br />
  64. <input class="form-control" type="text" name="notificationGlobal[toEmail]" value="{{ setting.toEmail || '' }}">
  65. </div>
  66. <div class="form-group notify-to-option {% if setting.__t != 'slack' %}d-none{% endif %}" id="slack-input">
  67. <label for="notificationGlobal[slackChannels]"class="control-label">Slack Channels</label><br />
  68. <input class="form-control" type="text" name="notificationGlobal[slackChannels]" value="{{ setting.slackChannels || '' }}" disabled>
  69. </div>
  70. </fieldset>
  71. <fieldset class="col-sm-offset-1 col-sm-4">
  72. <div class="form-group">
  73. <label for="triggerEvent"class="control-label">トリガーイベント</label><br />
  74. <div class="checkbox checkbox-info">
  75. <input type="checkbox" id="trigger-event-pageCreate" name="notificationGlobal[triggerEvent:pageCreate]" value="pageCreate"
  76. {% if setting && (setting.triggerEvents.indexOf('pageCreate') != -1) %}checked{% endif %} />
  77. <label for="trigger-event-pageCreate">
  78. <span class="label label-info"><i class="icon-doc"></i> CREATE</span> - When New Page is Created
  79. </label>
  80. </div>
  81. <div class="checkbox checkbox-info">
  82. <input type="checkbox" id="trigger-event-pageEdit" name="notificationGlobal[triggerEvent:pageEdit]" value="pageEdit"
  83. {% if setting && (setting.triggerEvents.indexOf('pageEdit') != -1) %}checked{% endif %} />
  84. <label for="trigger-event-pageEdit">
  85. <span class="label label-info"><i class="icon-doc"></i> EDIT</span> - When Page is Edited
  86. </label>
  87. </div>
  88. <div class="checkbox checkbox-info">
  89. <input type="checkbox" id="trigger-event-pageDelete" name="notificationGlobal[triggerEvent:pageDelete]" value="pageDelete"
  90. {% if setting && (setting.triggerEvents.indexOf('pageDelete') != -1) %}checked{% endif %} />
  91. <label for="trigger-event-pageDelete">
  92. <span class="label label-info"><i class="icon-doc"></i> DELETE</span> - When is Deleted
  93. </label>
  94. </div>
  95. <div class="checkbox checkbox-info">
  96. <input type="checkbox" id="trigger-event-pageMove" name="notificationGlobal[triggerEvent:pageMove]" value="pageMove"
  97. {% if setting && (setting.triggerEvents.indexOf('pageMove') != -1) %}checked{% endif %} />
  98. <label for="trigger-event-pageMove">
  99. <span class="label label-info"><i class="icon-doc"></i> MOVE</span> - When Page is Moved (Renamed)
  100. </label>
  101. </div>
  102. <div class="checkbox checkbox-info">
  103. <input type="checkbox" id="trigger-event-pageLike" name="notificationGlobal[triggerEvent:pageLike]" value="pageLike"
  104. {% if setting && (setting.triggerEvents.indexOf('pageLike') != -1) %}checked{% endif %} />
  105. <label for="trigger-event-pageLike">
  106. <span class="label label-info"><i class="icon-doc"></i> LIKE</span> - When Someone Likes Page
  107. </label>
  108. </div>
  109. <div class="checkbox checkbox-info">
  110. <input type="checkbox" id="trigger-event-comment" name="notificationGlobal[triggerEvent:comment]" value="comment"
  111. {% if setting && (setting.triggerEvents.indexOf('comment') != -1) %}checked{% endif %} />
  112. <label for="trigger-event-comment">
  113. <span class="label label-info"><i class="icon-fw icon-bubbles"></i> POST</span> - When Someone Comments on Page
  114. </label>
  115. </div>
  116. </div>
  117. </fieldset>
  118. <div class="col-sm-offset-5 col-sm-12 m-t-20">
  119. <input type="hidden" name="notificationGlobal[id]" value="{{ setting.id }}">
  120. <input type="hidden" name="_csrf" value="{{ csrf() }}">
  121. <button type="submit" class="btn btn-primary">
  122. {% if setting %}
  123. {{ t('Update') }}
  124. {% else %}
  125. {{ t('Create') }}
  126. {% endif %}
  127. </button>
  128. </div>
  129. </form>
  130. </div>
  131. </div>
  132. </div>
  133. </div>
  134. <script>
  135. $('input[name="notificationGlobal[notifyToType]"]').change(function() {
  136. var val = $(this).val();
  137. $('.notify-to-option').addClass('d-none');
  138. $('#' + val + '-input').removeClass('d-none');
  139. });
  140. $('button#global-notificatin-delete').submit(function() {
  141. alert(123)
  142. });
  143. </script>
  144. {% endblock content_main %}
  145. {% block content_footer %}
  146. {% endblock content_footer %}