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.

195 lines
6.5 KiB

  1. {% extends "base.html" %}
  2. {% load compress humanize static hc_extras %}
  3. {% block title %}Zulip Integration for {{ site_name }}{% endblock %}
  4. {% block content %}
  5. <div class="row">
  6. <div class="col-sm-12">
  7. <h1>Zulip</h1>
  8. <p>
  9. <a href="https://zulipchat.com/">Zulip</a> is an open-source group chat app
  10. with an email threading model. If you use or plan on using Zulip,
  11. you can can integrate it
  12. with your {{ site_name }} account in few simple steps.
  13. </p>
  14. <h2>Setup Guide</h2>
  15. <div class="row ai-step">
  16. <div class="col-sm-6">
  17. <span class="step-no"></span>
  18. <p>
  19. Log into your Zulip account,
  20. click on the <strong>gear icon</strong> in the upper right corner,
  21. and select <strong>Settings</strong>.
  22. </p>
  23. </div>
  24. <div class="col-sm-6">
  25. <img
  26. class="ai-guide-screenshot"
  27. alt="Screenshot"
  28. src="{% static 'img/integrations/setup_zulip_1.png' %}">
  29. </div>
  30. </div>
  31. <div class="row ai-step">
  32. <div class="col-sm-6">
  33. <span class="step-no"></span>
  34. <p>
  35. Got to <strong>Your bots › Add a new bot </strong> and fill
  36. out the fields.
  37. </p>
  38. <p>
  39. For <strong>Bot Type</strong>,
  40. select "Incoming webhook". You can choose your own preferred values
  41. for bot's name and email.
  42. </p>
  43. <p>
  44. For the profile picture, feel free to use the {{ site_name }} logo:
  45. </p>
  46. <p>
  47. <img src="{% static 'img/logo.png'%}" alt="{{ site_name }} logo">
  48. </p>
  49. <p>
  50. After you have filled out the values,
  51. click on <strong>Create Bot</strong>.
  52. </p>
  53. </div>
  54. <div class="col-sm-6">
  55. <img
  56. class="ai-guide-screenshot"
  57. alt="Screenshot"
  58. src="{% static 'img/integrations/setup_zulip_2.png' %}">
  59. </div>
  60. </div>
  61. <div class="row ai-step">
  62. <div class="col-sm-6">
  63. <span class="step-no"></span>
  64. <p>
  65. Copy the displayed bot's credentials into the form below.
  66. Also specify the stream or the private user you want {{ site_name }}
  67. to post notifications to.
  68. </p>
  69. <p>
  70. Save the integration and you are done!
  71. </p>
  72. </div>
  73. <div class="col-sm-6">
  74. <img
  75. class="ai-guide-screenshot"
  76. alt="Screenshot"
  77. src="{% static 'img/integrations/setup_zulip_3.png' %}">
  78. </div>
  79. </div>
  80. <h2>Integration Settings</h2>
  81. <form method="post" class="form-horizontal">
  82. {% csrf_token %}
  83. <div class="form-group {{ form.bot_email.css_classes }}">
  84. <label for="bot-email" class="col-sm-2 control-label">Bot Email</label>
  85. <div class="col-sm-4">
  86. <input
  87. id="bot-email"
  88. type="text"
  89. class="form-control"
  90. name="bot_email"
  91. value="{{ form.bot_email.value|default:"" }}">
  92. <div class="help-block">
  93. {% if form.bot_email.errors %}
  94. {{ form.bot_email.errors|join:"" }}
  95. {% else %}
  96. Example: [email protected]
  97. {% endif %}
  98. </div>
  99. </div>
  100. </div>
  101. <div class="form-group {{ form.api_key.css_classes }}">
  102. <label for="api-key" class="col-sm-2 control-label">API Key</label>
  103. <div class="col-sm-4">
  104. <input
  105. id="api-key"
  106. type="text"
  107. class="form-control"
  108. name="api_key"
  109. value="{{ form.api_key.value|default:"" }}">
  110. {% if form.api_key.errors %}
  111. <div class="help-block">
  112. {{ form.api_key.errors|join:"" }}
  113. </div>
  114. {% endif %}
  115. </div>
  116. </div>
  117. <div id="z-mtype-group" class="form-group {{ form.mtype.css_classes }}">
  118. <label class="col-sm-2 control-label">Post To</label>
  119. <div class="col-sm-4">
  120. <label class="radio-container">
  121. <input
  122. type="radio"
  123. name="mtype"
  124. value="stream"
  125. {% if form.mtype.value != "private" %} checked {% endif %}>
  126. <span class="radiomark"></span>
  127. Stream
  128. </label>
  129. <label class="radio-container">
  130. <input
  131. type="radio"
  132. name="mtype"
  133. value="private"
  134. {% if form.mtype.value == "private" %} checked {% endif %}>
  135. <span class="radiomark"></span>
  136. Private user
  137. </label>
  138. </div>
  139. </div>
  140. <div class="form-group {{ form.to.css_classes }}">
  141. <label id="z-to-label" for="z-to" class="col-sm-2 control-label">
  142. {% if form.mtype.value == "private" %}
  143. User's Email
  144. {% else %}
  145. Stream Name
  146. {% endif %}
  147. </label>
  148. <div class="col-sm-4">
  149. <input
  150. id="z-to"
  151. type="text"
  152. class="form-control"
  153. name="to"
  154. value="{{ form.to.value|default:"" }}">
  155. <div id="z-to-help" class="help-block">
  156. {% if form.to.errors %}
  157. {{ form.to.errors|join:"" }}
  158. {% else %}
  159. Example: "{% if form.mtype.value == "private" %}[email protected]{% else %}general{% endif%}"
  160. {% endif %}
  161. </div>
  162. </div>
  163. </div>
  164. <div class="form-group">
  165. <div class="col-sm-offset-2 col-sm-10">
  166. <button type="submit" class="btn btn-primary">Save Integration</button>
  167. </div>
  168. </div>
  169. </form>
  170. </div>
  171. </div>
  172. {% endblock %}
  173. {% block scripts %}
  174. {% compress js %}
  175. <script src="{% static 'js/jquery-2.1.4.min.js' %}"></script>
  176. <script src="{% static 'js/bootstrap.min.js' %}"></script>
  177. <script src="{% static 'js/add_zulip.js' %}"></script>
  178. {% endcompress %}
  179. {% endblock %}