2017-05-30 16:23:38 +03:00
<section class="gh-canvas">
2019-06-18 13:47:21 +03:00
<GhCanvasHeader class="gh-canvas-header">
2017-05-30 16:23:38 +03:00
<h2 class="gh-canvas-title" data-test-screen-title>
2019-06-18 13:47:21 +03:00
{{ # link-to "settings.integrations" data-test-link = "integrations-back" }} Integrations {{ / link-to }}
2018-03-19 12:57:31 +03:00
<span> {{ svg-jar "arrow-right" }} </span>
2017-05-30 16:23:38 +03:00
Slack
</h2>
<section class="view-actions">
2019-12-13 17:20:29 +03:00
{{ gh-task-button task = this .save class = "gh-btn gh-btn-blue gh-btn-icon" data-test-save-button = true }}
2017-05-30 16:23:38 +03:00
</section>
2019-06-18 13:47:21 +03:00
</GhCanvasHeader>
2017-05-30 16:23:38 +03:00
2019-12-13 17:20:29 +03:00
{{ # if this .showLeaveSettingsModal }}
2017-10-31 18:27:25 +03:00
{{ gh-fullscreen-modal "leave-settings"
confirm=(action "leaveSettings")
close=(action "toggleLeaveSettingsModal")
modifier="action wide"}}
{{ / if }}
2019-06-18 13:47:21 +03:00
<section class="view-container bt b--lightgrey-d1 pt5">
2016-03-29 11:40:44 +03:00
<section class="app-grid">
<div class="app-cell">
2019-06-18 13:47:21 +03:00
<div class="bg-white mr3 display flex items-center justify-center br-pill shadow-1 pa3">
<img class="app-icon" src="assets/img/slackicon.png" />
</div>
2016-03-29 11:40:44 +03:00
</div>
<div class="app-cell">
<h3>Slack</h3>
<p>A messaging app for teams</p>
</div>
</section>
<form class="app-config-form" id="slack-settings" novalidate="novalidate" {{ action "save" on = "submit" }} >
2019-06-18 13:47:21 +03:00
<div class="gh-setting-header gh-first-header">Slack configuration</div>
<div class="flex flex-column br4 shadow-1 bg-grouped-table pa8 mt2">
<div class="gh-setting-first">
<div class="gh-setting-content gh-setting-content--no-action">
<div class="gh-setting-title">Webhook URL</div>
<div class="gh-setting-desc">Automatically send newly published posts to a channel in Slack or any Slack-compatible service like Discord or Mattermost.</div>
<div class="gh-setting-content-extended">
2019-12-13 17:20:29 +03:00
{{ # gh-form-group errors = this .slackSettings .errors hasValidated = this .slackSettings .hasValidated property = "url" }}
2019-06-18 13:47:21 +03:00
{{ gh-text-input
placeholder="https://hooks.slack.com/services/..."
name="slack[url]"
2019-12-13 17:20:29 +03:00
value=(readonly this.slackSettings.url)
2019-06-18 13:47:21 +03:00
input=(action "updateURL" value="target.value")
keyEvents=(hash
Enter=(action "save")
)
focus-out=(action "triggerDirtyState")
data-test-slack-url-input=true
}}
2019-12-13 17:20:29 +03:00
{{ # unless this .slackSettings .errors .url }}
2019-06-18 13:47:21 +03:00
<p>Set up a new incoming webhook <a href="https://my.slack.com/apps/new/A0F7XDUAZ-incoming-webhooks" target="_blank">here</a>, and grab the URL.</p>
{{ else }}
2019-12-13 19:11:49 +03:00
<GhErrorMessage @errors= {{ this .slackSettings .errors }} @property="url" data-test-error="slack-url" />
2019-06-18 13:47:21 +03:00
{{ / unless }}
{{ / gh-form-group }}
</div>
2017-05-30 16:23:38 +03:00
</div>
</div>
2019-06-18 13:47:21 +03:00
<div class="gh-setting">
<div class="gh-setting-content gh-setting-content--no-action">
<div class="gh-setting-title">Username</div>
<div class="gh-setting-desc">The username to display messages from</div>
<div class="gh-setting-content-extended">
2019-12-13 17:20:29 +03:00
{{ # gh-form-group errors = this .slackSettings .errors hasValidated = this .slackSettings .hasValidated property = "username" }}
2019-06-18 13:47:21 +03:00
{{ gh-text-input
placeholder="Ghost"
name="slack[username]"
2019-12-13 17:20:29 +03:00
value=(readonly this.slackSettings.username)
2019-06-18 13:47:21 +03:00
input=(action "updateUsername" value="target.value")
keyEvents=(hash
Enter=(action "save")
)
focus-out=(action "triggerDirtyState")
data-test-slack-username-input=true
}}
2019-12-13 17:20:29 +03:00
{{ # if this .slackSettings .errors .username }}
2019-12-13 19:11:49 +03:00
<GhErrorMessage @errors= {{ this .slackSettings .errors }} @property="username" />
2019-06-18 13:47:21 +03:00
{{ / if }}
{{ / gh-form-group }}
</div>
2019-12-13 17:20:29 +03:00
{{ gh-task-button "Send test notification" task = this .sendTestNotification successText = "Sent" class = "gh-btn gh-btn-green gh-btn-icon" disabled = this .testNotificationDisabled data-test-send-notification-button = true }}
2019-01-21 15:26:21 +03:00
</div>
</div>
</div>
2016-03-29 11:40:44 +03:00
</form>
</section>
</section>