Move comment templates to a subfolder

This commit is contained in:
Frédéric Guillot
2014-11-25 21:28:29 -05:00
parent cdfd6a8abe
commit 5fb686dd9c
9 changed files with 49 additions and 57 deletions

View File

@@ -0,0 +1,36 @@
<div class="page-header">
<h2><?= t('Add a comment') ?></h2>
</div>
<form method="post" action="<?= Helper\u('comment', 'save', array('task_id' => $task['id'])) ?>" autocomplete="off">
<?= Helper\form_csrf() ?>
<?= Helper\form_hidden('task_id', $values) ?>
<?= Helper\form_hidden('user_id', $values) ?>
<div class="form-tabs">
<ul class="form-tabs-nav">
<li class="form-tab form-tab-selected">
<i class="fa fa-pencil-square-o fa-fw"></i><a id="markdown-write" href="#"><?= t('Write') ?></a>
</li>
<li class="form-tab">
<a id="markdown-preview" href="#"><i class="fa fa-eye fa-fw"></i><?= t('Preview') ?></a>
</li>
</ul>
<div class="write-area">
<?= Helper\form_textarea('comment', $values, $errors, array(! isset($skip_cancel) ? 'autofocus' : '', 'required', 'placeholder="'.t('Leave a comment').'"'), 'comment-textarea') ?>
</div>
<div class="preview-area">
<div class="markdown"></div>
</div>
</div>
<div class="form-help"><a href="http://kanboard.net/documentation/syntax-guide" target="_blank" rel="noreferrer"><?= t('Write your text in Markdown') ?></a></div>
<div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
<?php if (! isset($skip_cancel)): ?>
<?= t('or') ?>
<?= Helper\a(t('cancel'), 'task', 'show', array('task_id' => $task['id'])) ?>
<?php endif ?>
</div>
</form>

View File

@@ -0,0 +1,35 @@
<div class="page-header">
<h2><?= t('Edit a comment') ?></h2>
</div>
<form method="post" action="<?= Helper\u('comment', 'update', array('task_id' => $task['id'], 'comment_id' => $comment['id'])) ?>" autocomplete="off">
<?= Helper\form_csrf() ?>
<?= Helper\form_hidden('id', $values) ?>
<?= Helper\form_hidden('task_id', $values) ?>
<div class="form-tabs">
<ul class="form-tabs-nav">
<li class="form-tab form-tab-selected">
<i class="fa fa-pencil-square-o fa-fw"></i><a id="markdown-write" href="#"><?= t('Write') ?></a>
</li>
<li class="form-tab">
<a id="markdown-preview" href="#"><i class="fa fa-eye fa-fw"></i><?= t('Preview') ?></a>
</li>
</ul>
<div class="write-area">
<?= Helper\form_textarea('comment', $values, $errors, array('autofocus', 'required', 'placeholder="'.t('Leave a comment').'"'), 'comment-textarea') ?>
</div>
<div class="preview-area">
<div class="markdown"></div>
</div>
</div>
<div class="form-help"><a href="http://kanboard.net/documentation/syntax-guide" target="_blank" rel="noreferrer"><?= t('Write your text in Markdown') ?></a></div>
<div class="form-actions">
<input type="submit" value="<?= t('Update') ?>" class="btn btn-blue"/>
<?= t('or') ?>
<?= Helper\a(t('cancel'), 'task', 'show', array('task_id' => $task['id'])) ?>
</div>
</form>

View File

@@ -0,0 +1,7 @@
<div class="page-header">
<h2><?= t('Forbidden') ?></h2>
</div>
<p class="alert alert-error">
<?= t('Only administrators or the creator of the comment can access to this page.') ?>
</p>

View File

@@ -0,0 +1,17 @@
<div class="page-header">
<h2><?= t('Remove a comment') ?></h2>
</div>
<div class="confirm">
<p class="alert alert-info">
<?= t('Do you really want to remove this comment?') ?>
</p>
<?= Helper\template('comment/show', array('comment' => $comment, 'task' => $task, 'preview' => true)) ?>
<div class="form-actions">
<?= Helper\a(t('Yes'), 'comment', 'remove', array('task_id' => $task['id'], 'comment_id' => $comment['id']), true, 'btn btn-red') ?>
<?= t('or') ?>
<?= Helper\a(t('cancel'), 'task', 'show', array('task_id' => $task['id'])) ?>
</div>
</div>

View File

@@ -0,0 +1,41 @@
<div class="comment <?= isset($preview) ? 'comment-preview' : '' ?>" id="comment-<?= $comment['id'] ?>">
<p class="comment-title">
<span class="comment-username"><?= Helper\escape($comment['name'] ?: $comment['username']) ?></span> @ <span class="comment-date"><?= dt('%B %e, %Y at %k:%M %p', $comment['date']) ?></span>
</p>
<div class="comment-inner">
<?php if (! isset($preview)): ?>
<ul class="comment-actions">
<li><a href="#comment-<?= $comment['id'] ?>"><?= t('link') ?></a></li>
<?php if ((! isset($not_editable) || ! $not_editable) && (Helper\is_admin() || Helper\is_current_user($comment['user_id']))): ?>
<li>
<?= Helper\a(t('remove'), 'comment', 'confirm', array('task_id' => $task['id'], 'comment_id' => $comment['id'])) ?>
</li>
<li>
<?= Helper\a(t('edit'), 'comment', 'edit', array('task_id' => $task['id'], 'comment_id' => $comment['id'])) ?>
</li>
<?php endif ?>
</ul>
<?php endif ?>
<div class="markdown">
<?php if (isset($is_public) && $is_public): ?>
<?= Helper\markdown(
$comment['comment'],
array(
'controller' => 'task',
'action' => 'readonly',
'params' => array(
'token' => $project['token']
)
)
) ?>
<?php else: ?>
<?= Helper\markdown($comment['comment']) ?>
<?php endif ?>
</div>
</div>
</div>