summaryrefslogtreecommitdiff
path: root/app/Template
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2017-02-18 18:25:46 -0500
committerFrederic Guillot <fred@kanboard.net>2017-02-18 18:25:46 -0500
commitb4dc602381a367ce9ed1a1bbe28b7903976fdabe (patch)
tree7edc2532f56abd66ff7f20b8a75dd0268d69310c /app/Template
parent5710bab97198234afced474250f20e24332fd6fc (diff)
Send comments by email
Diffstat (limited to 'app/Template')
-rw-r--r--app/Template/comment/show.php14
-rw-r--r--app/Template/comment_list/show.php25
-rw-r--r--app/Template/comment_mail/create.php21
-rw-r--r--app/Template/comment_mail/email.php1
-rw-r--r--app/Template/task_comments/show.php19
5 files changed, 56 insertions, 24 deletions
diff --git a/app/Template/comment/show.php b/app/Template/comment/show.php
index d8470c24..5f15ffd6 100644
--- a/app/Template/comment/show.php
+++ b/app/Template/comment/show.php
@@ -8,26 +8,28 @@
<?php endif ?>
<small class="comment-date"><?= t('Created at:') ?> <?= $this->dt->datetime($comment['date_creation']) ?></small>
- <small class="comment-date"><?= t('Updated at:')?> <?= $this->dt->datetime($comment['date_modification']) ?></small>
+ <small class="comment-date"><?= t('Updated at:') ?> <?= $this->dt->datetime($comment['date_modification']) ?></small>
</div>
<?php if (! isset($hide_actions)): ?>
- <div class="comment-actions">
+ <div class="comment-actions">
+ <div class="dropdown">
+ <a href="#" class="dropdown-menu dropdown-menu-link-icon"><i class="fa fa-cog"></i><i class="fa fa-caret-down"></i></a>
<ul>
<li>
- <i class="fa fa-link fa-fw"></i>
- <a href="#comment-<?= $comment['id'] ?>"><?= t('link') ?></a>
+ <?= $this->url->icon('link', t('Link'), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', '', $this->app->isAjax(), 'comment-'.$comment['id']) ?>
</li>
<?php if ($editable && ($this->user->isAdmin() || $this->user->isCurrentUser($comment['user_id']))): ?>
<li>
- <?= $this->modal->medium('edit', t('edit'), 'CommentController', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'comment_id' => $comment['id'])) ?>
+ <?= $this->modal->medium('edit', t('Edit'), 'CommentController', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'comment_id' => $comment['id'])) ?>
</li>
<li>
- <?= $this->modal->confirm('trash-o', t('remove'), 'CommentController', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'comment_id' => $comment['id'])) ?>
+ <?= $this->modal->confirm('trash-o', t('Remove'), 'CommentController', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'comment_id' => $comment['id'])) ?>
</li>
<?php endif ?>
</ul>
</div>
+ </div>
<?php endif ?>
<div class="comment-content">
diff --git a/app/Template/comment_list/show.php b/app/Template/comment_list/show.php
index 6e362560..4b6b765d 100644
--- a/app/Template/comment_list/show.php
+++ b/app/Template/comment_list/show.php
@@ -1,20 +1,25 @@
<div class="page-header">
- <h2><?= $this->text->e($task['title']) ?> &gt; <?= t('Comments') ?></h2>
+ <h2><?= $this->text->e($task['title']) ?></h2>
<?php if (!isset($is_public) || !$is_public): ?>
- <div class="comment-sorting">
- <small>
- <?= $this->url->icon('sort', t('change sorting'), 'CommentListController', 'toggleSorting', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'js-modal-replace') ?>
- </small>
- </div>
+ <ul>
+ <li>
+ <?= $this->url->icon('sort', t('Change sorting'), 'CommentListController', 'toggleSorting', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'js-modal-replace') ?>
+ </li>
+ <?php if ($editable): ?>
+ <li>
+ <?= $this->modal->medium('paper-plane', t('Send by email'), 'CommentMailController', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
+ </li>
+ <?php endif ?>
+ </ul>
<?php endif ?>
</div>
<div class="comments">
<?php foreach ($comments as $comment): ?>
<?= $this->render('comment/show', array(
- 'comment' => $comment,
- 'task' => $task,
- 'project' => $project,
- 'editable' => $editable,
+ 'comment' => $comment,
+ 'task' => $task,
+ 'project' => $project,
+ 'editable' => $editable,
'is_public' => isset($is_public) && $is_public,
)) ?>
<?php endforeach ?>
diff --git a/app/Template/comment_mail/create.php b/app/Template/comment_mail/create.php
new file mode 100644
index 00000000..57ddeb39
--- /dev/null
+++ b/app/Template/comment_mail/create.php
@@ -0,0 +1,21 @@
+<div class="page-header">
+ <h2><?= t('Create and send comment by email') ?></h2>
+</div>
+<form method="post" action="<?= $this->url->href('CommentMailController', 'save', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off">
+ <?= $this->form->csrf() ?>
+ <?= $this->form->hidden('task_id', $values) ?>
+ <?= $this->form->hidden('user_id', $values) ?>
+
+ <?= $this->form->label(t('Email'), 'email') ?>
+ <?= $this->form->email('email', $values, $errors, array('autofocus', 'required', 'tabindex="1"')) ?>
+
+ <?= $this->form->label(t('Subject'), 'subject') ?>
+ <?= $this->form->text('subject', $values, $errors, array('required', 'tabindex="2"')) ?>
+
+ <?= $this->form->textEditor('comment', $values, $errors, array('required' => true, 'tabindex' => 3)) ?>
+
+ <?= $this->modal->submitButtons(array(
+ 'submitLabel' => t('Send by email'),
+ 'tabindex' => 4,
+ )) ?>
+</form>
diff --git a/app/Template/comment_mail/email.php b/app/Template/comment_mail/email.php
new file mode 100644
index 00000000..a89284f4
--- /dev/null
+++ b/app/Template/comment_mail/email.php
@@ -0,0 +1 @@
+<?= $this->text->markdown($email['comment'], true) ?>
diff --git a/app/Template/task_comments/show.php b/app/Template/task_comments/show.php
index 18200bc8..d34e5e95 100644
--- a/app/Template/task_comments/show.php
+++ b/app/Template/task_comments/show.php
@@ -6,25 +6,28 @@
<?php if (!isset($is_public) || !$is_public): ?>
<div class="comment-sorting">
<small>
- <?= $this->url->icon('sort', t('change sorting'), 'CommentController', 'toggleSorting', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
+ <?= $this->url->icon('sort', t('Change sorting'), 'CommentController', 'toggleSorting', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
+ <?php if ($editable): ?>
+ <?= $this->modal->medium('paper-plane', t('Send by email'), 'CommentMailController', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
+ <?php endif ?>
</small>
</div>
<?php endif ?>
<?php foreach ($comments as $comment): ?>
<?= $this->render('comment/show', array(
- 'comment' => $comment,
- 'task' => $task,
- 'project' => $project,
- 'editable' => $editable,
+ 'comment' => $comment,
+ 'task' => $task,
+ 'project' => $project,
+ 'editable' => $editable,
'is_public' => isset($is_public) && $is_public,
)) ?>
<?php endforeach ?>
<?php if ($editable): ?>
<?= $this->render('task_comments/create', array(
- 'values' => array(),
- 'errors' => array(),
- 'task' => $task,
+ 'values' => array(),
+ 'errors' => array(),
+ 'task' => $task,
)) ?>
<?php endif ?>
</div>