看板初始化提交
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<?php use Kanboard\Core\Security\Role; ?>
|
||||
<div class="page-header">
|
||||
<h2><?= t('Add a comment') ?></h2>
|
||||
<ul>
|
||||
<li>
|
||||
<?= $this->modal->medium('paper-plane', t('Send by email'), 'CommentMailController', 'create', array('task_id' => $task['id'])) ?>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<form method="post" action="<?= $this->url->href('CommentController', 'save', array('task_id' => $task['id'])) ?>" autocomplete="off">
|
||||
<?= $this->form->csrf() ?>
|
||||
|
||||
<?= $this->form->textEditor('comment', $values, $errors, array('autofocus' => true, 'required' => true, 'aria-label' => t('New comment'))) ?>
|
||||
|
||||
<?php
|
||||
$formName = 'visibility';
|
||||
$visibilityOptions['app-user'] = t('Standard users');
|
||||
$attribute[] = ('hidden');
|
||||
?>
|
||||
|
||||
<?php if ($this->user->getRole() !== Role::APP_USER) {
|
||||
echo $this->form->label(t('Visibility:'), $formName);
|
||||
$attribute = [];
|
||||
$visibilityOptions['app-user'] = t('Standard users');
|
||||
$visibilityOptions['app-manager'] = t('Application managers or more');
|
||||
}
|
||||
?>
|
||||
|
||||
<?php if ($this->user->getRole() === Role::APP_ADMIN) {
|
||||
$visibilityOptions['app-admin'] = t('Administrators');
|
||||
}
|
||||
?>
|
||||
|
||||
<?= $this->form->select($formName, $visibilityOptions, array(), array(), $attribute) ?>
|
||||
<?= $this->modal->submitButtons() ?>
|
||||
</form>
|
||||
@@ -0,0 +1,11 @@
|
||||
<div class="page-header">
|
||||
<h2><?= t('Edit a comment') ?></h2>
|
||||
</div>
|
||||
|
||||
<form method="post" action="<?= $this->url->href('CommentController', 'update', array('task_id' => $task['id'], 'comment_id' => $comment['id'])) ?>" autocomplete="off">
|
||||
<?= $this->form->csrf() ?>
|
||||
|
||||
<?= $this->form->textEditor('comment', $values, $errors, array('autofocus' => true, 'required' => true, 'aria-label' => t('Comment'))) ?>
|
||||
|
||||
<?= $this->modal->submitButtons() ?>
|
||||
</form>
|
||||
@@ -0,0 +1,21 @@
|
||||
<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>
|
||||
|
||||
<?= $this->render('comment/show', array(
|
||||
'comment' => $comment,
|
||||
'task' => $task,
|
||||
'hide_actions' => true
|
||||
)) ?>
|
||||
|
||||
<?= $this->modal->confirmButtons(
|
||||
'CommentController',
|
||||
'remove',
|
||||
array('task_id' => $task['id'], 'comment_id' => $comment['id'])
|
||||
) ?>
|
||||
</div>
|
||||
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
|
||||
use Kanboard\Core\Security\Role;
|
||||
|
||||
$userRole = $this->user->getRole();
|
||||
|
||||
if ($userRole === '' && $comment['visibility'] !== Role::APP_USER) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($userRole === Role::APP_MANAGER && $comment['visibility'] === Role::APP_ADMIN) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($userRole === Role::APP_USER && $comment['visibility'] !== Role::APP_USER) {
|
||||
return;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div class="comment <?= isset($preview) ? 'comment-preview' : '' ?>" id="comment-<?= $comment['id'] ?>">
|
||||
|
||||
<?= $this->avatar->render($comment['user_id'], $comment['username'], $comment['name'], $comment['email'], $comment['avatar_path']) ?>
|
||||
|
||||
<div class="comment-title">
|
||||
<?php if (! empty($comment['username'])): ?>
|
||||
<strong class="comment-username"><?= $this->text->e($comment['name'] ?: $comment['username']) ?></strong>
|
||||
<?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-visibility"><?= t('Visibility:') ?>
|
||||
<?php if ($comment['visibility'] === Role::APP_USER): ?>
|
||||
<?= t('Standard users') ?>
|
||||
<?php elseif ($comment['visibility'] === Role::APP_MANAGER): ?>
|
||||
<?= t('Application managers or more') ?>
|
||||
<?php else: ?>
|
||||
<?= t('Administrators') ?>
|
||||
<?php endif ?>
|
||||
</small>
|
||||
</div>
|
||||
|
||||
<?php if (! isset($hide_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>
|
||||
<?= $this->url->icon('link', t('Link'), 'TaskViewController', 'show', array('task_id' => $task['id']), false, '', '', $this->app->isAjax(), 'comment-'.$comment['id']) ?>
|
||||
</li>
|
||||
<li data-comment-id="<?= $comment['id'] ?>">
|
||||
<?= $this->url->icon('reply', t('Reply'), 'TaskViewController', 'show', array('task_id' => $task['id']), false, 'js-reply-to-comment', '', $this->app->isAjax(), 'form-task_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'], 'comment_id' => $comment['id'])) ?>
|
||||
</li>
|
||||
<li>
|
||||
<?= $this->modal->confirm('trash-o', t('Remove'), 'CommentController', 'confirm', array('task_id' => $task['id'], 'comment_id' => $comment['id'])) ?>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
<div class="comment-content">
|
||||
<div class="markdown">
|
||||
<?= $this->text->markdown($comment['comment'], isset($is_public) && $is_public) ?>
|
||||
</div>
|
||||
<template id="comment-reply-content-<?= $comment['id'] ?>">
|
||||
<textarea><?= $this->text->reply($comment['name'] ?: $comment['username'], $comment['comment']) ?></textarea>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user