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.

177 lines
6.7 KiB

7 years ago
  1. {% extends "base.html" %}
  2. {% load compress humanize static hc_extras %}
  3. {% block title %}Add Pushover - {% site_name %}{% endblock %}
  4. {% block content %}
  5. <div class="row">
  6. <div class="col-sm-12">
  7. <h1>Pushbover</h1>
  8. <div class="jumbotron">
  9. {% if request.user.is_authenticated %}
  10. <p>
  11. <a href="https://www.pushover.net/">Pushover</a> delivers
  12. real-time notifications on your Android, iPhone, iPad, Desktop,
  13. Android Wear and Apple Watch. You can set up {% site_name %} to
  14. receive Pushover notifications in a few simple steps.
  15. </p>
  16. {% else %}
  17. <p>
  18. {% site_name %} is a <strong>free</strong> and
  19. <a href="https://github.com/healthchecks/healthchecks">open source</a>
  20. service for monitoring your cron jobs, background processes and
  21. scheduled tasks. Before adding Pushover integration, please log into
  22. {% site_name %}:</p>
  23. <div class="text-center">
  24. <a href="{% url 'hc-login' %}?next={% url 'hc-add-pushover' %}"
  25. class="btn btn-primary btn-lg">Sign In</a>
  26. </div>
  27. {% endif %}
  28. </div>
  29. {% if not request.user.is_authenticated %}
  30. <h2>Setup Guide</h2>
  31. <div class="row ai-step">
  32. <div class="col-sm-6">
  33. <span class="step-no">1</span>
  34. <p>
  35. After logging in, go to "Integrations &rarr; Add Pushover".
  36. Pushover supports different notification priorities from
  37. silent to "Emergency". Select your preferred priorities
  38. and click "Subscribe with Pushover".
  39. </p>
  40. </div>
  41. <div class="col-sm-6">
  42. <img
  43. class="ai-guide-screenshot"
  44. alt="Screenshot"
  45. src="{% static 'img/integrations/setup_pushover_1.png' %}">
  46. </div>
  47. </div>
  48. <div class="row ai-step">
  49. <div class="col-sm-6">
  50. <span class="step-no">2</span>
  51. <p>
  52. You will be redirected to
  53. <a href="https://pushover.net">pushover.net</a> and
  54. asked to confirm a subscription. Review the subscription
  55. details and click "Subscribe Me".
  56. </p>
  57. </div>
  58. <div class="col-sm-6">
  59. <img
  60. class="ai-guide-screenshot"
  61. alt="Screenshot"
  62. src="{% static 'img/integrations/setup_pushover_2.png' %}">
  63. </div>
  64. </div>
  65. <div class="row ai-step">
  66. <div class="col-sm-6">
  67. <span class="step-no">3</span>
  68. <p>
  69. That is all! You will now be redirected back to
  70. "Integrations" page on {% site_name %} and see
  71. the new integration!
  72. </p>
  73. </div>
  74. <div class="col-sm-6">
  75. <img
  76. class="ai-guide-screenshot"
  77. alt="Screenshot"
  78. src="{% static 'img/integrations/setup_pushover_3.png' %}">
  79. </div>
  80. </div>
  81. {% else %}
  82. <h2>Integration Settings</h2>
  83. <form id="add-pushover" method="post" class="form-horizontal" action="{% url 'hc-add-pushover' %}">
  84. {% csrf_token %}
  85. <div class="form-group">
  86. <label class="col-sm-3 control-label">Priority for "down" events</label>
  87. <div class="col-sm-8">
  88. <select name="po_priority" class="selectpicker form-control">
  89. <option
  90. value="-2"
  91. data-content="Lowest Priority. <span class='help'>Generates no notification on your device.</span>">
  92. Lowest Priority
  93. </option>
  94. <option
  95. value="-1"
  96. data-content="Low Priority. <span class='help'>Sends a quiet notification.</span>">
  97. Low Priority
  98. </option>
  99. <option value="0" selected="selected">
  100. Normal Priority
  101. </option>
  102. <option
  103. value="1"
  104. data-content="High Priority. <span class='help'>Bypasses user's quiet hours.</span>">
  105. High Priority
  106. </option>
  107. <option
  108. value="2"
  109. data-content="Emergency Priority. <span class='help'>Repeated every {{po_retry_delay|hc_duration }} for at most {{ po_expiration|hc_duration }} until you acknowledge them.</span>">
  110. Emergency Priority
  111. </option>
  112. </select>
  113. </div>
  114. </div>
  115. <div class="form-group">
  116. <label class="col-sm-3 control-label">Priority for "up" events</label>
  117. <div class="col-sm-8">
  118. <select name="po_priority_up" class="selectpicker form-control">
  119. <option
  120. value="-2"
  121. data-content="Lowest Priority. <span class='help'>Generates no notification on your device.</span>">
  122. Lowest Priority
  123. </option>
  124. <option
  125. value="-1"
  126. data-content="Low Priority. <span class='help'>Sends a quiet notification.</span>">
  127. Low Priority
  128. </option>
  129. <option value="0" selected="selected">
  130. Normal Priority
  131. </option>
  132. <option
  133. value="1"
  134. data-content="High Priority. <span class='help'>Bypasses user's quiet hours.</span>">
  135. High Priority
  136. </option>
  137. <option
  138. value="2"
  139. data-content="Emergency Priority. <span class='help'>Repeated every {{po_retry_delay|hc_duration }} for at most {{ po_expiration|hc_duration }} until you acknowledge them.</span>">
  140. Emergency Priority
  141. </option>
  142. </select>
  143. </div>
  144. </div>
  145. <div class="form-group">
  146. <div class="col-sm-offset-3 col-sm-8">
  147. <button type="submit" class="btn btn-default">
  148. <img class="ai-icon" src="{% static 'img/integrations/po.png' %}" alt="Pushover" />
  149. Subscribe with Pushover
  150. </button>
  151. </div>
  152. </div>
  153. </form>
  154. {% endif %}
  155. </div>
  156. </div>
  157. {% endblock %}
  158. {% block scripts %}
  159. {% compress js %}
  160. <script src="{% static 'js/jquery-2.1.4.min.js' %}"></script>
  161. <script src="{% static 'js/bootstrap.min.js' %}"></script>
  162. <script src="{% static 'js/bootstrap-select.min.js' %}"></script>
  163. {% endcompress %}
  164. {% endblock %}