global-notification-detail.html 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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/update' %}
  35. {% else %}
  36. {% set actionPath = '/admin/global-notification/create' %}
  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><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 %}>
  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 %}>
  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. <label for="notificationGlobal[toEmail]"class="control-label">Email</label><br />
  63. <input class="form-control" type="text" name="notificationGlobal[toEmail]" value="{{ setting.toEmail || '' }}">
  64. </div>
  65. <!-- <div class="form-group notify-to-option {% if setting.__t != 'slack' %}d-none{% endif %}" id="slack-input">
  66. <label for="notificationGlobal[slackChannels]"class="control-label">Slack Channels</label><br />
  67. <input class="form-control" type="text" name="notificationGlobal[slackChannels]" value="{{ setting.slackChannels || '' }}">
  68. </div> -->
  69. </fieldset>
  70. <fieldset class="col-sm-offset-1 col-sm-4">
  71. <div class="form-group">
  72. <label for="triggerEvent"class="control-label">トリガーイベント</label><br />
  73. <div class="checkbox checkbox-info">
  74. <input type="checkbox" id="trigger-event-pageCreate" name="notificationGlobal[triggerEvent:pageCreate]" value="pageCreate"
  75. {% if setting && (setting.triggerEvents.indexOf('pageCreate') != -1) %}checked{% endif %} />
  76. <label for="trigger-event-pageCreate">
  77. <span class="label label-info"><i class="icon-doc"></i> CREATE</span> - When New Page is Created
  78. </label>
  79. </div>
  80. <div class="checkbox checkbox-info">
  81. <input type="checkbox" id="trigger-event-pageEdit" name="notificationGlobal[triggerEvent:pageEdit]" value="pageEdit"
  82. {% if setting && (setting.triggerEvents.indexOf('pageEdit') != -1) %}checked{% endif %} />
  83. <label for="trigger-event-pageEdit">
  84. <span class="label label-info"><i class="icon-doc"></i> EDIT</span> - When Page is Edited
  85. </label>
  86. </div>
  87. <div class="checkbox checkbox-info">
  88. <input type="checkbox" id="trigger-event-pageDelete" name="notificationGlobal[triggerEvent:pageDelete]" value="pageDelete"
  89. {% if setting && (setting.triggerEvents.indexOf('pageDelete') != -1) %}checked{% endif %} />
  90. <label for="trigger-event-pageDelete">
  91. <span class="label label-info"><i class="icon-doc"></i> DELETE</span> - When is Deleted
  92. </label>
  93. </div>
  94. <div class="checkbox checkbox-info">
  95. <input type="checkbox" id="trigger-event-pageMove" name="notificationGlobal[triggerEvent:pageMove]" value="pageMove"
  96. {% if setting && (setting.triggerEvents.indexOf('pageMove') != -1) %}checked{% endif %} />
  97. <label for="trigger-event-pageMove">
  98. <span class="label label-info"><i class="icon-doc"></i> MOVE</span> - When Page is Moved (Renamed)
  99. </label>
  100. </div>
  101. <div class="checkbox checkbox-info">
  102. <input type="checkbox" id="trigger-event-pageLike" name="notificationGlobal[triggerEvent:pageLike]" value="pageLike"
  103. {% if setting && (setting.triggerEvents.indexOf('pageLike') != -1) %}checked{% endif %} />
  104. <label for="trigger-event-pageLike">
  105. <span class="label label-info"><i class="icon-doc"></i> LIKE</span> - When Someone Likes Page
  106. </label>
  107. </div>
  108. <div class="checkbox checkbox-info">
  109. <input type="checkbox" id="trigger-event-comment" name="notificationGlobal[triggerEvent:comment]" value="comment"
  110. {% if setting && (setting.triggerEvents.indexOf('comment') != -1) %}checked{% endif %} />
  111. <label for="trigger-event-comment">
  112. <span class="label label-info"><i class="icon-fw icon-bubbles"></i> POST</span> - When Someone Comments on Page
  113. </label>
  114. </div>
  115. </div>
  116. </fieldset>
  117. <div class="col-sm-offset-5 col-sm-12 m-t-20">
  118. <input type="hidden" name="notificationGlobal[id]" value="{{ setting.id }}">
  119. <input type="hidden" name="_csrf" value="{{ csrf() }}">
  120. <button type="submit" class="btn btn-primary">{{ t('Update') }}</button>
  121. </div>
  122. </form>
  123. </div>
  124. </div>
  125. </div>
  126. </div>
  127. <script>
  128. $('input[name="notificationGlobal[notifyToType]"]').change(function() {
  129. var val = $(this).val();
  130. $('.notify-to-option').addClass('d-none');
  131. $('#' + val + '-input').removeClass('d-none');
  132. });
  133. $('button#global-notificatin-delete').submit(function() {
  134. alert(123)
  135. });
  136. </script>
  137. {% endblock content_main %}
  138. {% block content_footer %}
  139. {% endblock content_footer %}