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.

125 lines
4.3 KiB

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