summaryrefslogtreecommitdiff
path: root/app/Template/comment
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2017-01-02 17:01:27 -0500
committerFrederic Guillot <fred@kanboard.net>2017-01-02 17:01:27 -0500
commit3833c12ccce59bcc49c4cfa892401973558f604d (patch)
treeb67b0e10cdc3d42e5626f728206138a444a40ed0 /app/Template/comment
parentd49ce63e51f596ad3bf0d02b689aea673cf544f8 (diff)
Refactoring/rewrite of modal boxes handling
Diffstat (limited to 'app/Template/comment')
-rw-r--r--app/Template/comment/create.php8
-rw-r--r--app/Template/comment/edit.php8
-rw-r--r--app/Template/comment/remove.php10
-rw-r--r--app/Template/comment/show.php6
4 files changed, 11 insertions, 21 deletions
diff --git a/app/Template/comment/create.php b/app/Template/comment/create.php
index 02cb48eb..8a421759 100644
--- a/app/Template/comment/create.php
+++ b/app/Template/comment/create.php
@@ -1,16 +1,12 @@
<div class="page-header">
<h2><?= t('Add a comment') ?></h2>
</div>
-<form class="popover-form" method="post" action="<?= $this->url->href('CommentController', 'save', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off">
+<form method="post" action="<?= $this->url->href('CommentController', '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->textEditor('comment', $values, $errors, array('autofocus' => true, 'required' => true)) ?>
- <div class="form-actions">
- <button type="submit" class="btn btn-blue"><?= t('Save') ?></button>
- <?= t('or') ?>
- <?= $this->url->link(t('cancel'), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'close-popover') ?>
- </div>
+ <?= $this->modal->submitButtons() ?>
</form>
diff --git a/app/Template/comment/edit.php b/app/Template/comment/edit.php
index f295c8a7..04f6ffd4 100644
--- a/app/Template/comment/edit.php
+++ b/app/Template/comment/edit.php
@@ -2,7 +2,7 @@
<h2><?= t('Edit a comment') ?></h2>
</div>
-<form class="popover-form" method="post" action="<?= $this->url->href('CommentController', 'update', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'comment_id' => $comment['id'])) ?>" autocomplete="off">
+<form method="post" action="<?= $this->url->href('CommentController', 'update', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'comment_id' => $comment['id'])) ?>" autocomplete="off">
<?= $this->form->csrf() ?>
<?= $this->form->hidden('id', $values) ?>
<?= $this->form->hidden('task_id', $values) ?>
@@ -10,9 +10,5 @@
<?= $this->form->textEditor('comment', $values, $errors, array('autofocus' => true, 'required' => true)) ?>
- <div class="form-actions">
- <button type="submit" class="btn btn-blue"><?= t('Save') ?></button>
- <?= t('or') ?>
- <?= $this->url->link(t('cancel'), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'close-popover') ?>
- </div>
+ <?= $this->modal->submitButtons() ?>
</form>
diff --git a/app/Template/comment/remove.php b/app/Template/comment/remove.php
index 55587b67..03f16e00 100644
--- a/app/Template/comment/remove.php
+++ b/app/Template/comment/remove.php
@@ -13,9 +13,9 @@
'hide_actions' => true
)) ?>
- <div class="form-actions">
- <?= $this->url->link(t('Yes'), 'CommentController', 'remove', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'comment_id' => $comment['id']), true, 'btn btn-red') ?>
- <?= t('or') ?>
- <?= $this->url->link(t('cancel'), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'close-popover') ?>
- </div>
+ <?= $this->modal->confirmButtons(
+ 'CommentController',
+ 'remove',
+ array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'comment_id' => $comment['id'])
+ ) ?>
</div>
diff --git a/app/Template/comment/show.php b/app/Template/comment/show.php
index 16a807bc..caf28c3c 100644
--- a/app/Template/comment/show.php
+++ b/app/Template/comment/show.php
@@ -25,12 +25,10 @@
</li>
<?php if ($editable && ($this->user->isAdmin() || $this->user->isCurrentUser($comment['user_id']))): ?>
<li>
- <i class="fa fa-remove fa-fw"></i>
- <?= $this->url->link(t('remove'), 'CommentController', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'comment_id' => $comment['id']), false, 'popover') ?>
+ <?= $this->modal->medium('edit', t('edit'), 'CommentController', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'comment_id' => $comment['id'])) ?>
</li>
<li>
- <i class="fa fa-edit fa-fw"></i>
- <?= $this->url->link(t('edit'), 'CommentController', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'comment_id' => $comment['id']), false, 'popover') ?>
+ <?= $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>