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.

122 lines
4.1 KiB

  1. {% extends "base.html" %}
  2. {% load compress humanize static hc_extras %}
  3. {% block title %}Telegram Integration for {% site_name %}{% endblock %}
  4. {% block content %}
  5. <div class="row">
  6. <div class="col-sm-12">
  7. <h1>Telegram</h1>
  8. {% if chat_id %}
  9. <div class="jumbotron">
  10. <p>
  11. When a check goes <strong>up</strong> or <strong>down</strong>,
  12. {% site_name %} will send notifications to
  13. {% if chat_type == "private" %}
  14. a Telegram user
  15. {% else %}
  16. a Telegram chat
  17. {% endif %}
  18. named <strong>{{ chat_name }}</strong>.
  19. </p>
  20. </div>
  21. <h2>Integration Settings</h2>
  22. <form id="add-telegram" method="post" class="form-horizontal">
  23. {% csrf_token %}
  24. <div class="form-group">
  25. <label class="col-sm-3 control-label">Project</label>
  26. <div class="col-sm-8">
  27. <select name="project" class="selectpicker">
  28. {% for project in projects %}
  29. <option value="{{ project.code }}">{{ project }}</option>
  30. {% endfor %}
  31. </select>
  32. </div>
  33. </div>
  34. <div class="form-group">
  35. <div class="col-sm-offset-3 col-sm-8">
  36. <button type="submit" class="btn btn-default">
  37. <img class="ai-icon" src="{% static 'img/integrations/telegram.png' %}" alt="Telegram" />
  38. Connect Telegram
  39. </button>
  40. </div>
  41. </div>
  42. </form>
  43. {% else %}
  44. <p>If your team uses <a href="https://telegram.org/">Telegram</a>,
  45. you can set up {% site_name %} to post status updates directly to an
  46. appropriate Telegram chat or user.</p>
  47. <h2>Setup Guide</h2>
  48. <div class="row ai-step">
  49. <div class="col-sm-6">
  50. <span class="step-no"></span>
  51. <p>
  52. From your Telegram client, invite
  53. <strong><a href="https://t.me/{{ bot_name }}">{{ bot_name }}</a></strong>
  54. to a group. It will get added as a member with no access to group
  55. messages.
  56. </p>
  57. <p>
  58. Alternatively, if you want notifications sent to yourself
  59. directly, start a conversation with
  60. <strong>{{ bot_name }}</strong>.
  61. </p>
  62. </div>
  63. <div class="col-sm-6">
  64. <img
  65. class="ai-guide-screenshot"
  66. alt="Screenshot"
  67. src="{% static 'img/integrations/setup_telegram_1.png' %}">
  68. </div>
  69. </div>
  70. <div class="row ai-step">
  71. <div class="col-sm-6">
  72. <span class="step-no"></span>
  73. <p>Type <strong><code>/start</code></strong> command.
  74. If there are multiple bots in the group, type
  75. <strong><code>/start@{{ bot_name }}</code></strong> instead.
  76. </p>
  77. <p>The bot will respond with a confirmation link.</p>
  78. </div>
  79. <div class="col-sm-6">
  80. <img
  81. class="ai-guide-screenshot"
  82. alt="Screenshot"
  83. src="{% static 'img/integrations/setup_telegram_2.png' %}">
  84. </div> </div>
  85. <div class="row ai-step">
  86. <div class="col-sm-6">
  87. <span class="step-no"></span>
  88. <p>Click or tap on the confirmation link, and
  89. {% site_name %} will open in a browser window asking you to
  90. confirm the new integration.</p>
  91. <p>Select the project you want the Telegram integration added to,
  92. click on "Connect Telegram", and it's done!</p>
  93. </div>
  94. <div class="col-sm-6">
  95. <img
  96. class="ai-guide-screenshot"
  97. alt="Screenshot"
  98. src="{% static 'img/integrations/setup_telegram_3.png' %}">
  99. </div>
  100. </div>
  101. {% endif %}
  102. </div>
  103. </div>
  104. {% endblock %}
  105. {% block scripts %}
  106. {% compress js %}
  107. <script src="{% static 'js/jquery-2.1.4.min.js' %}"></script>
  108. <script src="{% static 'js/bootstrap.min.js' %}"></script>
  109. <script src="{% static 'js/bootstrap-select.min.js' %}"></script>
  110. {% endcompress %}
  111. {% endblock %}