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.

118 lines
4.0 KiB

  1. {% extends "base.html" %}
  2. {% load humanize static hc_extras %}
  3. {% block title %}
  4. {% if is_new %}
  5. Add SMS Integration - {% site_name %}
  6. {% else %}
  7. SMS Settings - {% site_name %}
  8. {% endif %}
  9. {% endblock %}
  10. {% block content %}
  11. <div class="row">
  12. <div class="col-sm-12">
  13. <h1>SMS</h1>
  14. <p>
  15. Get a SMS message to the specified phone number when a
  16. check goes down.
  17. </p>
  18. {% if show_pricing and profile.sms_limit == 0 %}
  19. <p class="alert alert-info">
  20. <strong>Paid plan required.</strong>
  21. SMS messaging is not available on the free plan–sending the messages
  22. cost too much! Please upgrade to a
  23. <a href="{% url 'hc-billing' %}">paid plan</a> to enable SMS messaging.
  24. </p>
  25. {% endif %}
  26. <h2>Integration Settings</h2>
  27. <form method="post" class="form-horizontal">
  28. {% csrf_token %}
  29. <div class="form-group {{ form.label.css_classes }}">
  30. <label for="id_label" class="col-sm-2 control-label">Label</label>
  31. <div class="col-sm-6">
  32. <input
  33. id="id_label"
  34. type="text"
  35. class="form-control"
  36. name="label"
  37. placeholder="Alice's Phone"
  38. value="{{ form.label.value|default:"" }}">
  39. {% if form.label.errors %}
  40. <div class="help-block">
  41. {{ form.label.errors|join:"" }}
  42. </div>
  43. {% else %}
  44. <span class="help-block">
  45. Optional. If you add multiple phone numbers,
  46. the labels will help you tell them apart.
  47. </span>
  48. {% endif %}
  49. </div>
  50. </div>
  51. <div class="form-group {{ form.phone.css_classes }}">
  52. <label for="id_number" class="col-sm-2 control-label">Phone Number</label>
  53. <div class="col-sm-3">
  54. <input
  55. id="id_number"
  56. type="tel"
  57. class="form-control"
  58. name="phone"
  59. placeholder="+1234567890"
  60. value="{{ form.phone.value|default:"" }}">
  61. {% if form.phone.errors %}
  62. <div class="help-block">
  63. {{ form.phone.errors|join:"" }}
  64. </div>
  65. {% else %}
  66. <span class="help-block">
  67. Make sure the phone number starts with "+" and has the
  68. country code.
  69. </span>
  70. {% endif %}
  71. </div>
  72. </div>
  73. <div class="form-group {{ form.down.css_classes }}">
  74. <label class="col-sm-2 control-label">Notify When</label>
  75. <div class="col-sm-10">
  76. <label class="checkbox-container">
  77. <input
  78. type="checkbox"
  79. name="down"
  80. value="true"
  81. {% if form.down.value %} checked {% endif %}>
  82. <span class="checkmark"></span>
  83. A check goes <strong>down</strong>
  84. </label>
  85. <label class="checkbox-container">
  86. <input
  87. type="checkbox"
  88. name="up"
  89. value="true"
  90. {% if form.up.value %} checked {% endif %}>
  91. <span class="checkmark"></span>
  92. A check goes <strong>up</strong>
  93. {% if form.down.errors %}
  94. <div class="help-block">
  95. {{ form.down.errors|join:"" }}
  96. </div>
  97. {% endif %}
  98. </label>
  99. </div>
  100. </div>
  101. <div class="form-group">
  102. <div class="col-sm-offset-2 col-sm-10">
  103. <button type="submit" class="btn btn-primary">Save Integration</button>
  104. </div>
  105. </div>
  106. </form>
  107. </div>
  108. </div>
  109. {% endblock %}