forked from 2sys/shoutdotdev
62 lines
2.2 KiB
HTML
62 lines
2.2 KiB
HTML
{% extends "channel-base.html" %}
|
|
|
|
{% block extra_config %}
|
|
<hr>
|
|
{% if let BackendConfig::Slack(slack_data) = channel.backend_config %}
|
|
{% if slack_data.oauth_tokens.is_none() %}
|
|
<section class="mb-4">
|
|
<form
|
|
method="post"
|
|
action="{{ breadcrumbs.join("slack-auth/login") }}"
|
|
>
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
|
|
<button class="btn btn-primary" type="submit">Link to Slack</button>
|
|
</form>
|
|
</section>
|
|
{% else %}
|
|
<section class="mb-4">
|
|
<form method="post" action="{{ breadcrumbs.join("update-slack-conversation") }}">
|
|
<div class="mb-3">
|
|
<label for="channel-conversation-input" class="form-label">
|
|
Slack Channel
|
|
</label>
|
|
<select class="form-select" id="channel-conversation-input" name="conversation_id">
|
|
<option
|
|
disabled=""
|
|
{% if slack_data.conversation_id.is_none() %}selected=""{% endif %}
|
|
>
|
|
Select a channel
|
|
</option>
|
|
{% for conversation in slack_channels %}
|
|
{% if let slack_utils::Conversation::Channel(slack_channel) = conversation %}
|
|
<option
|
|
value="{{ slack_channel.id }}"
|
|
{% if slack_data.conversation_id == Some(slack_channel.id.to_owned()) %}
|
|
selected=""
|
|
{% endif %}
|
|
>
|
|
#{{ slack_channel.name }}
|
|
</option>
|
|
{% endif %}
|
|
{% endfor %}
|
|
</select>
|
|
</div>
|
|
<div class="mb-3">
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
|
|
<button class="btn btn-primary" type="submit">Save</button>
|
|
</div>
|
|
</form>
|
|
</section>
|
|
<hr>
|
|
<section class="mb-4">
|
|
<form
|
|
method="post"
|
|
action="{{ breadcrumbs.join("slack-auth/revoke") }}"
|
|
>
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
|
|
<button class="btn btn-danger" type="submit">Revoke Slack Access</button>
|
|
</form>
|
|
</section>
|
|
{% endif %}
|
|
{% endif %}
|
|
{% endblock %}
|