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.

120 lines
4.0 KiB

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