BioTorrents.de’s version of Gazelle
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

notification.twig 7.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. {% from 'macro/form.twig' import checked, selected %}
  2. {% macro check_popup(name, value) %}
  3. <label>
  4. <input type="checkbox" name="notifications_{{ name }}_popup" id="notifications_{{ name }}_popup"{{ checked(value in [
  5. constant('\\Gazelle\\Manager\\Notification::OPT_POPUP'),
  6. constant('\\Gazelle\\Manager\\Notification::OPT_POPUP_PUSH'),
  7. ]) }} /> Pop-up
  8. </label>
  9. {% endmacro %}
  10. {% macro check_push(name, value) %}
  11. <label>
  12. <input type="checkbox" name="notifications_{{ name }}_push" id="notifications_{{ name }}_push"{{ checked(value in [
  13. constant('\\Gazelle\\Manager\\Notification::OPT_PUSH'),
  14. constant('\\Gazelle\\Manager\\Notification::OPT_POPUP_PUSH'),
  15. constant('\\Gazelle\\Manager\\Notification::OPT_TRADITIONAL_PUSH'),
  16. ]) }} /> Push
  17. </label>
  18. {% endmacro %}
  19. {% macro check_trad(name, value) %}
  20. <label>
  21. <input type="checkbox" name="notifications_{{ name }}_traditional" id="notifications_{{ name }}_traditional"{{ checked(value in [
  22. constant('\\Gazelle\\Manager\\Notification::OPT_TRADITIONAL'),
  23. constant('\\Gazelle\\Manager\\Notification::OPT_TRADITIONAL_PUSH'),
  24. ]) }} /> Traditional
  25. </label>
  26. {% endmacro %}
  27. <table cellpadding="6" cellspacing="1" border="0" width="100%" class="layout border user_options" id="notification_settings">
  28. <tr class="colhead_dark">
  29. <td colspan="2">
  30. <strong>Notification Settings</strong>
  31. </td>
  32. </tr>
  33. <tr id="notif_autosubscribe_tr">
  34. <td class="label tooltip" title="Enabling this will automatically subscribe you to any thread you post in.">
  35. <strong>Automatic thread subscriptions</strong>
  36. </td>
  37. <td>
  38. <input type="checkbox" name="autosubscribe" id="autosubscribe"{{ checked(notify.autosub) }} />
  39. <label for="autosubscribe">Enable automatic thread subscriptions</label>
  40. </td>
  41. </tr>
  42. <tr id="notif_notifyondeleteseeding_tr">
  43. <td class="label tooltip" title="Enabling this will send you a PM alert whenever a torrent you're seeding is deleted.">
  44. <strong>Deleted seeding torrent alerts</strong>
  45. </td>
  46. <td>
  47. <input type="checkbox" name="notifyondeleteseeding" id="notifyondeleteseeding"{{ checked(notify.seeded) }} />
  48. <label for="notifyondeleteseeding">Enable PM notification for deleted seeding torrents</label>
  49. </td>
  50. </tr>
  51. <tr id="notif_notifyondeletesnatched_tr">
  52. <td class="label tooltip" title="Enabling this will send you a PM alert whenever a torrent you've snatched is deleted.">
  53. <strong>Deleted snatched torrent alerts</strong>
  54. </td>
  55. <td>
  56. <input type="checkbox" name="notifyondeletesnatched" id="notifyondeletesnatched"{{ checked(notify.snatched) }} />
  57. <label for="notifyondeletesnatched">Enable PM notification for deleted snatched torrents</label>
  58. </td>
  59. </tr>
  60. <tr id="notif_notifyondeletedownloaded_tr">
  61. <td class="label tooltip" title="Enabling this will send you a PM alert whenever a torrent you've downloaded is deleted.">
  62. <strong>Deleted downloaded torrent alerts</strong>
  63. </td>
  64. <td>
  65. <input type="checkbox" name="notifyondeletedownloaded" id="notifyondeletedownloaded"{{ checked(notify.downloaded) }} />
  66. <label for="notifyondeletedownloaded">Enable PM notification for deleted downloaded torrents</label>
  67. </td>
  68. </tr>
  69. <tr id="notif_unseeded_tr">
  70. <td class="label tooltip" title="Enabling this will send you a PM alert before your uploads are deleted for being unseeded.">
  71. <strong>Unseeded torrent alerts</strong>
  72. </td>
  73. <td>
  74. <input type="checkbox" name="unseededalerts" id="unseededalerts"{{ checked(notify.unseeded) }} />
  75. <label for="unseededalerts">Enable unseeded torrent alerts</label>
  76. </td>
  77. </tr>
  78. <tr>
  79. <td class="label"><strong>Push notifications</strong></td>
  80. <td>
  81. <select name="pushservice" id="pushservice">
  82. <option value="0"{{ selected(service is empty or service == 0) }}>No push notifications</option>
  83. <!-- RIP Notify My Android -->
  84. <option value="2"{{ selected(service == 2) }}>Prowl</option>
  85. <!-- RIP notifo -->
  86. <option value="4"{{ selected(service == 4) }}>Super Toasty</option>
  87. <option value="5"{{ selected(service == 5) }}>Pushover</option>
  88. <option value="6"{{ selected(service == 6) }}>PushBullet</option>
  89. </select>
  90. <div id="pushsettings" style="display: none;">
  91. <label id="pushservice_title" for="pushkey">API key</label>
  92. <input type="text" size="50" name="pushkey" id="pushkey" value="{{ option.PushKey }}" />
  93. <label class="pushdeviceid" id="pushservice_device" for="pushdevice">Device ID</label>
  94. <select class="pushdeviceid" name="pushdevice" id="pushdevice">
  95. <option value="{{ option.PushDevice }}" selected="selected">{{ option.PushDevice }}</option>
  96. </select>
  97. <br />
  98. <a href="user.php?action=take_push&amp;push=1&amp;userid={{ logged_user }}&amp;auth={{ auth }}" class="brackets">Test push</a>
  99. <a href="wiki.php?action=article&amp;id=113" class="brackets">View wiki guide</a>
  100. </div>
  101. </td>
  102. </tr>
  103. <tr>
  104. <td class="label">
  105. <strong>News announcements</strong>
  106. </td>
  107. <td>
  108. {{ _self.check_popup("News", settings.News) }}
  109. {{ _self.check_push("News", settings.News) }}
  110. </td>
  111. </tr>
  112. <tr>
  113. <td class="label">
  114. <strong>Blog announcements</strong>
  115. </td>
  116. <td>
  117. {{ _self.check_popup("Blog", settings.Blog) }}
  118. {{ _self.check_push("Blog", settings.Blog) }}
  119. </td>
  120. </tr>
  121. <tr>
  122. <td class="label">
  123. <strong>Inbox messages</strong>
  124. </td>
  125. <td>
  126. {{ _self.check_popup("Inbox", settings.Inbox) }}
  127. {{ _self.check_trad("Inbox", settings.Inbox) }}
  128. {{ _self.check_push("Inbox", settings.Inbox) }}
  129. </td>
  130. </tr>
  131. <tr>
  132. <td class="label tooltip" title="Enabling this will give you a notification when you receive a new private message from a member of {{ constant('SITE_NAME') }} staff.">
  133. <strong>Staff messages</strong>
  134. </td>
  135. <td>
  136. {{ _self.check_popup("StaffPM", settings.StaffPM) }}
  137. </td>
  138. </tr>
  139. <tr>
  140. <td class="label">
  141. <strong>Thread subscriptions</strong>
  142. </td>
  143. <td>
  144. {{ _self.check_popup("Subscriptions", settings.Subscriptions) }}
  145. </td>
  146. </tr>
  147. <tr>
  148. <td class="label tooltip" title="Enabling this will give you a notification whenever someone quotes you in the forums.">
  149. <strong>Quote notifications</strong>
  150. </td>
  151. <td>
  152. {{ _self.check_popup("Quotes", settings.Quotes) }}
  153. {{ _self.check_push("Quotes", settings.Quotes) }}
  154. </td>
  155. </tr>
  156. {% if torrent_notify %}
  157. <tr>
  158. <td class="label tooltip" title="Enabling this will give you a notification when the torrent notification filters you have established are triggered.">
  159. <strong>Torrent notifications</strong>
  160. </td>
  161. <td>
  162. {{ _self.check_popup("Torrents", settings.Torrents) }}
  163. {{ _self.check_trad("Torrents", settings.Torrents) }}
  164. </td>
  165. </tr>
  166. {% endif %}
  167. <tr>
  168. <td class="label tooltip" title="Enabling this will give you a notification when a torrent is added to a collage you are subscribed to.">
  169. <strong>Collage subscriptions</strong>
  170. </td>
  171. <td>
  172. {{ _self.check_popup("Collages", settings.Collages) }}
  173. </td>
  174. </tr>
  175. {% if request_notify %}
  176. {# TODO #}
  177. {% endif %}
  178. </table>