summaryrefslogtreecommitdiff
path: root/app/Template
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-03-28 21:37:53 -0400
committerFrederic Guillot <fred@kanboard.net>2015-03-28 21:37:53 -0400
commit5536f6c6ce591ba05a169d2e33b6fb240378d8a4 (patch)
treebac0cb1563d8258965384b97be8d425578f71ef6 /app/Template
parentf9891a966fb87d2112f174b7c3a1b3a705b73bdd (diff)
Add Slack integration
Diffstat (limited to 'app/Template')
-rw-r--r--app/Template/config/integrations.php22
-rw-r--r--app/Template/config/sidebar.php3
-rw-r--r--app/Template/event/task_assignee_change.php16
3 files changed, 36 insertions, 5 deletions
diff --git a/app/Template/config/integrations.php b/app/Template/config/integrations.php
new file mode 100644
index 00000000..104ebc16
--- /dev/null
+++ b/app/Template/config/integrations.php
@@ -0,0 +1,22 @@
+<div class="page-header">
+ <h2><?= t('Integration with third-party services') ?></h2>
+</div>
+
+<form method="post" action="<?= $this->u('config', 'integrations') ?>" autocomplete="off">
+
+ <?= $this->formCsrf() ?>
+
+ <h3><i class="fa fa-slack fa-fw"></i>&nbsp;<?= t('Slack') ?></h3>
+ <div class="listing">
+ <?= $this->formCheckbox('integration_slack_webhook', t('Send notifications to a Slack channel'), 1, $values['integration_slack_webhook'] == 1) ?>
+
+ <?= $this->formLabel(t('Webhook URL'), 'integration_slack_webhook_url') ?>
+ <?= $this->formText('integration_slack_webhook_url', $values, $errors) ?>
+
+ <p class="form-help"><a href="http://kanboard.net/documentation/slack" target="_blank"><?= t('Help on Slack integration') ?></a></p>
+ </div>
+
+ <div class="form-actions">
+ <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
+ </div>
+</form> \ No newline at end of file
diff --git a/app/Template/config/sidebar.php b/app/Template/config/sidebar.php
index 2e81d48a..a4f9d8e3 100644
--- a/app/Template/config/sidebar.php
+++ b/app/Template/config/sidebar.php
@@ -17,6 +17,9 @@
<?= $this->a(t('Currency rates'), 'currency', 'index') ?>
</li>
<li>
+ <?= $this->a(t('Integrations'), 'config', 'integrations') ?>
+ </li>
+ <li>
<?= $this->a(t('Webhooks'), 'config', 'webhook') ?>
</li>
<li>
diff --git a/app/Template/event/task_assignee_change.php b/app/Template/event/task_assignee_change.php
index 6eac412b..22ed936b 100644
--- a/app/Template/event/task_assignee_change.php
+++ b/app/Template/event/task_assignee_change.php
@@ -1,9 +1,15 @@
<p class="activity-title">
- <?= e('%s changed the assignee of the task %s to %s',
- $this->e($author),
- $this->a(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])),
- $this->e($task['assignee_name'] ?: $task['assignee_username'])
- ) ?>
+ <?php $assignee = $task['assignee_name'] ?: $task['assignee_username'] ?>
+
+ <?php if (! empty($assignee)): ?>
+ <?= e('%s changed the assignee of the task %s to %s',
+ $this->e($author),
+ $this->a(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])),
+ $this->e($assignee)
+ ) ?>
+ <?php else: ?>
+ <?= e('%s remove the assignee of the task %s', $this->e($author), $this->a(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']))) ?>
+ <?php endif ?>
</p>
<p class="activity-description">
<em><?= $this->e($task['title']) ?></em>