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.

178 lines
6.3 KiB

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