2026-10-02 09:28:07 +08:00
|
|
|
|
<?php
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 任务详情(v12):正文 + 子任务 + 评论(@人)+ 附件 + 共享。
|
|
|
|
|
|
*
|
|
|
|
|
|
* @人:评论里写「@老杨」会高亮(Task::commentHtml),**不会**真的发通知 ——
|
|
|
|
|
|
* 家庭场景下"点名"主要是让人一眼看到在说谁,做通知要先解决推送渠道,先不做。
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param array $t 任务(带 children / comments / attachs / shares)
|
|
|
|
|
|
* @param array $people 名册(负责人 / 共享 / @人 提示)
|
|
|
|
|
|
* @param array $parents 可选的父任务候选(把当前任务挂到别的父任务下)
|
|
|
|
|
|
*/
|
|
|
|
|
|
$canWrite = \App\Auth::canWrite() && \App\Task::canWrite($t, (int)\App\Auth::personId());
|
|
|
|
|
|
$meId = (int)\App\Auth::personId();
|
|
|
|
|
|
$names = [];
|
|
|
|
|
|
foreach ($people as $p) {
|
|
|
|
|
|
$names[] = person_name($p);
|
|
|
|
|
|
$nm = trim((string)($p['name'] ?? ''));
|
|
|
|
|
|
if ($nm !== '') {
|
|
|
|
|
|
$names[] = $nm;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
$names = array_values(array_unique(array_filter($names)));
|
|
|
|
|
|
$isChild = !empty($t['parent_id']);
|
|
|
|
|
|
?>
|
|
|
|
|
|
<div class="page-head">
|
|
|
|
|
|
<h1><?= e((string)$t['title']) ?></h1>
|
|
|
|
|
|
<span class="sub"><?= e(\App\Task::statusWord((string)$t['status'])) ?></span>
|
|
|
|
|
|
<div class="actions">
|
|
|
|
|
|
<?php if ($canWrite): ?>
|
|
|
|
|
|
<form method="post" action="<?= e(url('tasks/move')) ?>" class="res-inline">
|
|
|
|
|
|
<?= csrf_field() ?>
|
|
|
|
|
|
<input type="hidden" name="id" value="<?= (int)$t['id'] ?>">
|
|
|
|
|
|
<?php if ($t['status'] !== 'done'): ?>
|
|
|
|
|
|
<input type="hidden" name="status" value="done">
|
|
|
|
|
|
<button class="btn" type="submit">标记完成</button>
|
|
|
|
|
|
<?php else: ?>
|
|
|
|
|
|
<input type="hidden" name="status" value="doing">
|
|
|
|
|
|
<button class="btn btn-ghost" type="submit">重新打开</button>
|
|
|
|
|
|
<?php endif; ?>
|
|
|
|
|
|
</form>
|
|
|
|
|
|
<?php endif; ?>
|
|
|
|
|
|
<a class="btn btn-ghost" href="<?= e(url('tasks')) ?>">返回任务</a>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="card card-pad">
|
|
|
|
|
|
<dl class="kv">
|
2026-10-05 10:58:17 +08:00
|
|
|
|
<?php /* v24 第 14 批 用户第 2 条:状态要**能选**(不只是"标记完成/重新打开"两档)。
|
|
|
|
|
|
这里给完整的三档下拉,与看板卡片上那个徽标走同一个路由。 */ ?>
|
|
|
|
|
|
<div class="kv-row">
|
|
|
|
|
|
<dt>状态</dt>
|
|
|
|
|
|
<dd>
|
|
|
|
|
|
<?php if ($canWrite): ?>
|
|
|
|
|
|
<form method="post" action="<?= e(url('tasks/status')) ?>" class="res-inline st-form">
|
|
|
|
|
|
<?= csrf_field() ?>
|
|
|
|
|
|
<input type="hidden" name="id" value="<?= (int)$t['id'] ?>">
|
|
|
|
|
|
<input type="hidden" name="back" value="show">
|
|
|
|
|
|
<select class="select" name="status" aria-label="任务状态">
|
|
|
|
|
|
<?php foreach (\App\Task::STATUS as $sk => $sv): ?>
|
|
|
|
|
|
<option value="<?= e($sk) ?>" <?= (string)$t['status'] === $sk ? 'selected' : '' ?>>
|
|
|
|
|
|
<?= e($sv) ?>
|
|
|
|
|
|
</option>
|
|
|
|
|
|
<?php endforeach; ?>
|
|
|
|
|
|
</select>
|
|
|
|
|
|
<button class="btn btn-sm" type="submit">改</button>
|
|
|
|
|
|
</form>
|
|
|
|
|
|
<?php else: ?>
|
|
|
|
|
|
<span class="kb-st is-<?= e((string)$t['status']) ?> is-static">
|
|
|
|
|
|
<?= e(\App\Task::statusWord((string)$t['status'])) ?>
|
|
|
|
|
|
</span>
|
|
|
|
|
|
<?php endif; ?>
|
|
|
|
|
|
</dd>
|
|
|
|
|
|
</div>
|
2026-10-02 09:28:07 +08:00
|
|
|
|
<?php if (($t['due_at'] ?? '') !== ''): ?>
|
|
|
|
|
|
<div class="kv-row"><dt>截止</dt>
|
|
|
|
|
|
<dd class="<?= \App\Task::isOverdue($t['due_at'] ?? null) && $t['status'] !== 'done' ? 'kb-late' : '' ?>">
|
|
|
|
|
|
<?= e((string)$t['due_at']) ?><?= \App\Task::dueWord($t['due_at'] ?? null) !== '' ? '(' . e(\App\Task::dueWord($t['due_at'] ?? null)) . ')' : '' ?>
|
|
|
|
|
|
</dd>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<?php endif; ?>
|
|
|
|
|
|
<?php if (!empty($t['repeat_rule'])): ?>
|
|
|
|
|
|
<div class="kv-row"><dt>循环</dt><dd><?= e(\App\Task::repeatWord($t['repeat_rule'])) ?></dd></div>
|
|
|
|
|
|
<?php endif; ?>
|
|
|
|
|
|
<?php if (!empty($t['assignee_name'])): ?>
|
|
|
|
|
|
<div class="kv-row"><dt>负责人</dt>
|
|
|
|
|
|
<dd><?= e(person_name(['name' => $t['assignee_name'], 'my_nickname' => $t['assignee_nick'] ?? ''])) ?></dd>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<?php endif; ?>
|
|
|
|
|
|
<?php if (!empty($t['creator_name'])): ?>
|
|
|
|
|
|
<div class="kv-row"><dt>谁建的</dt>
|
|
|
|
|
|
<dd><?= e(person_name(['name' => $t['creator_name'], 'my_nickname' => $t['creator_nick'] ?? ''])) ?></dd>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<?php endif; ?>
|
|
|
|
|
|
<?php if ($isChild && !empty($t['parent_title'])): ?>
|
|
|
|
|
|
<div class="kv-row"><dt>属于</dt>
|
|
|
|
|
|
<dd><a href="<?= e(url('tasks/show', ['id' => (int)$t['parent_id']])) ?>"><?= e((string)$t['parent_title']) ?></a></dd>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<?php endif; ?>
|
|
|
|
|
|
<?php if (!empty($t['note'])): ?>
|
|
|
|
|
|
<div class="kv-row"><dt>备注</dt><dd><?= nl2br(e((string)$t['note'])) ?></dd></div>
|
|
|
|
|
|
<?php endif; ?>
|
|
|
|
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
<?php if ($canWrite): ?>
|
|
|
|
|
|
<details class="node-add">
|
|
|
|
|
|
<summary class="link-quiet">编辑这项任务</summary>
|
|
|
|
|
|
<form method="post" action="<?= e(url('tasks/update')) ?>" class="node-form">
|
|
|
|
|
|
<?= csrf_field() ?>
|
|
|
|
|
|
<input type="hidden" name="id" value="<?= (int)$t['id'] ?>">
|
|
|
|
|
|
<div class="nf-grid">
|
|
|
|
|
|
<div class="field full">
|
|
|
|
|
|
<label>标题</label>
|
|
|
|
|
|
<input class="input" name="title" required value="<?= e((string)$t['title']) ?>">
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="field">
|
2026-10-03 08:18:05 +08:00
|
|
|
|
<label>截止时间(留空=不上日历)</label>
|
|
|
|
|
|
<?php $dtName = 'due_at'; $dtValue = $t['due_at'] ?? null;
|
|
|
|
|
|
$dtRequired = false; $dtSeconds = true;
|
|
|
|
|
|
require __DIR__ . '/../_datetime.php'; ?>
|
2026-10-02 09:28:07 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div class="field">
|
|
|
|
|
|
<label>负责人</label>
|
2026-10-03 21:19:34 +08:00
|
|
|
|
<?php /* 第 8 条同一诉求:负责人也是「选人」,人多时用弹窗 + 首字母更快。
|
|
|
|
|
|
保留原下拉的「不指定」(pp-item-none + value=0)。 */ ?>
|
|
|
|
|
|
<?php
|
|
|
|
|
|
$ppName = 'assignee_id';
|
|
|
|
|
|
$ppPeople = $people;
|
|
|
|
|
|
$ppSelected = [(int)($t['assignee_id'] ?? 0)];
|
|
|
|
|
|
$ppMode = 'single';
|
|
|
|
|
|
$ppOpenBtn = '更换负责人';
|
|
|
|
|
|
$ppTitle = '谁负责这件事';
|
|
|
|
|
|
$ppEmptyText = '不指定';
|
|
|
|
|
|
$ppAllowEmpty = true;
|
|
|
|
|
|
require __DIR__ . '/../_person_picker.php';
|
|
|
|
|
|
?>
|
2026-10-02 09:28:07 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div class="field">
|
|
|
|
|
|
<label>循环</label>
|
|
|
|
|
|
<select class="select" name="repeat_rule">
|
|
|
|
|
|
<?php foreach (\App\Task::REPEAT as $rk => $rv): ?>
|
|
|
|
|
|
<option value="<?= e($rk) ?>"<?= (string)($t['repeat_rule'] ?? '') === (string)$rk ? ' selected' : '' ?>>
|
|
|
|
|
|
<?= e($rv) ?>
|
|
|
|
|
|
</option>
|
|
|
|
|
|
<?php endforeach; ?>
|
|
|
|
|
|
</select>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="field">
|
|
|
|
|
|
<label>挂到哪个父任务下</label>
|
|
|
|
|
|
<select class="select" name="parent_id">
|
|
|
|
|
|
<option value="0">(这是一项独立的任务)</option>
|
|
|
|
|
|
<?php foreach ($parents as $p): ?>
|
|
|
|
|
|
<option value="<?= (int)$p['id'] ?>"<?= (int)($t['parent_id'] ?? 0) === (int)$p['id'] ? ' selected' : '' ?>>
|
|
|
|
|
|
<?= e((string)$p['title']) ?>
|
|
|
|
|
|
</option>
|
|
|
|
|
|
<?php endforeach; ?>
|
|
|
|
|
|
</select>
|
|
|
|
|
|
</div>
|
2026-10-03 08:18:05 +08:00
|
|
|
|
<?php /* v24 第 9、10 条:分类与看板(看板把任务放到哪一块,分类是标签) */ ?>
|
|
|
|
|
|
<div class="field">
|
|
|
|
|
|
<label>分类</label>
|
|
|
|
|
|
<select class="select" name="category_id">
|
|
|
|
|
|
<option value="0">未分类</option>
|
|
|
|
|
|
<?php foreach (($categories ?? []) as $c): ?>
|
|
|
|
|
|
<option value="<?= (int)$c['id'] ?>"<?= (int)($t['category_id'] ?? 0) === (int)$c['id'] ? ' selected' : '' ?>>
|
|
|
|
|
|
<?= e((string)$c['name']) ?>
|
|
|
|
|
|
</option>
|
|
|
|
|
|
<?php endforeach; ?>
|
|
|
|
|
|
</select>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="field">
|
|
|
|
|
|
<label>看板</label>
|
|
|
|
|
|
<select class="select" name="board_id">
|
|
|
|
|
|
<?php foreach (($boards ?? []) as $b): ?>
|
|
|
|
|
|
<option value="<?= (int)$b['id'] ?>"<?= (int)($t['board_id'] ?? 0) === (int)$b['id'] ? ' selected' : '' ?>>
|
|
|
|
|
|
<?= e((string)$b['name']) ?>
|
|
|
|
|
|
</option>
|
|
|
|
|
|
<?php endforeach; ?>
|
|
|
|
|
|
</select>
|
|
|
|
|
|
</div>
|
2026-10-02 09:28:07 +08:00
|
|
|
|
<div class="field full">
|
|
|
|
|
|
<label>备注</label>
|
|
|
|
|
|
<textarea class="input" name="note" rows="2"><?= e((string)($t['note'] ?? '')) ?></textarea>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="btn-row"><button class="btn btn-sm" type="submit">保存</button></div>
|
|
|
|
|
|
</form>
|
|
|
|
|
|
</details>
|
|
|
|
|
|
<?php endif; ?>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<?php /* ---- 子任务 ---- */ ?>
|
|
|
|
|
|
<?php if (!$isChild): ?>
|
|
|
|
|
|
<div class="card card-pad">
|
|
|
|
|
|
<h2 class="cinema-h2">子任务 <span class="group-n"><?= count($t['children']) ?> 项</span></h2>
|
|
|
|
|
|
<?php if (!$t['children']): ?>
|
|
|
|
|
|
<p class="empty-hint">还没有子任务。把一件大事拆成几件小事,进度才看得见。</p>
|
|
|
|
|
|
<?php else: ?>
|
|
|
|
|
|
<ul class="sub-list">
|
|
|
|
|
|
<?php foreach ($t['children'] as $c): ?>
|
|
|
|
|
|
<li class="sub-row<?= $c['status'] === 'done' ? ' is-done' : '' ?>">
|
|
|
|
|
|
<?php if ($canWrite): ?>
|
|
|
|
|
|
<form method="post" action="<?= e(url('tasks/move')) ?>" class="res-inline">
|
|
|
|
|
|
<?= csrf_field() ?>
|
|
|
|
|
|
<input type="hidden" name="id" value="<?= (int)$c['id'] ?>">
|
|
|
|
|
|
<input type="hidden" name="status" value="<?= $c['status'] === 'done' ? 'todo' : 'done' ?>">
|
|
|
|
|
|
<button class="sub-check" type="submit" title="<?= $c['status'] === 'done' ? '取消完成' : '标记完成' ?>">
|
|
|
|
|
|
<?= $c['status'] === 'done' ? '☑' : '☐' ?>
|
|
|
|
|
|
</button>
|
|
|
|
|
|
</form>
|
|
|
|
|
|
<?php else: ?>
|
|
|
|
|
|
<span class="sub-check is-static"><?= $c['status'] === 'done' ? '☑' : '☐' ?></span>
|
|
|
|
|
|
<?php endif; ?>
|
|
|
|
|
|
<a class="sub-title" href="<?= e(url('tasks/show', ['id' => (int)$c['id']])) ?>">
|
|
|
|
|
|
<?= e((string)$c['title']) ?>
|
|
|
|
|
|
</a>
|
|
|
|
|
|
<?php if (($c['due_at'] ?? '') !== ''): ?>
|
|
|
|
|
|
<span class="node-time<?= \App\Task::isOverdue($c['due_at'] ?? null) && $c['status'] !== 'done' ? ' kb-late' : '' ?>">
|
|
|
|
|
|
<?= e(\App\Task::dueWord($c['due_at'] ?? null)) ?>
|
|
|
|
|
|
</span>
|
|
|
|
|
|
<?php endif; ?>
|
|
|
|
|
|
</li>
|
|
|
|
|
|
<?php endforeach; ?>
|
|
|
|
|
|
</ul>
|
|
|
|
|
|
<?php endif; ?>
|
|
|
|
|
|
<?php if ($canWrite): ?>
|
|
|
|
|
|
<details class="node-add">
|
|
|
|
|
|
<summary class="link-quiet">+ 加一项子任务</summary>
|
|
|
|
|
|
<form method="post" action="<?= e(url('tasks/create')) ?>" class="inline-form">
|
|
|
|
|
|
<?= csrf_field() ?>
|
|
|
|
|
|
<input type="hidden" name="parent_id" value="<?= (int)$t['id'] ?>">
|
|
|
|
|
|
<input class="input" name="title" required placeholder="如:擦玻璃">
|
2026-10-03 08:18:05 +08:00
|
|
|
|
<?php $dtName = 'due_at'; $dtValue = null; $dtRequired = false; $dtSeconds = true;
|
|
|
|
|
|
require __DIR__ . '/../_datetime.php'; ?>
|
2026-10-02 09:28:07 +08:00
|
|
|
|
<button class="btn btn-sm" type="submit">加上</button>
|
|
|
|
|
|
</form>
|
|
|
|
|
|
</details>
|
|
|
|
|
|
<?php endif; ?>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<?php endif; ?>
|
|
|
|
|
|
|
|
|
|
|
|
<?php /* ---- 附件 ---- */ ?>
|
|
|
|
|
|
<div class="card card-pad">
|
|
|
|
|
|
<h2 class="cinema-h2">附件</h2>
|
|
|
|
|
|
<?php if (!$t['attachs']): ?>
|
|
|
|
|
|
<p class="empty-hint">还没有附件。</p>
|
|
|
|
|
|
<?php else: ?>
|
2026-10-03 08:18:05 +08:00
|
|
|
|
<?php
|
|
|
|
|
|
$attRows = $t['attachs'];
|
|
|
|
|
|
$attCanEdit = $canWrite;
|
|
|
|
|
|
$attDelUrl = 'tasks/attach_del';
|
|
|
|
|
|
$attDelField = 'id';
|
|
|
|
|
|
$attExtra = [];
|
|
|
|
|
|
require __DIR__ . '/../_attachments.php';
|
|
|
|
|
|
?>
|
2026-10-02 09:28:07 +08:00
|
|
|
|
<?php endif; ?>
|
|
|
|
|
|
<?php if ($canWrite): ?>
|
|
|
|
|
|
<form class="inline-form" method="post" enctype="multipart/form-data" action="<?= e(url('tasks/attach_add')) ?>">
|
|
|
|
|
|
<?= csrf_field() ?>
|
|
|
|
|
|
<input type="hidden" name="id" value="<?= (int)$t['id'] ?>">
|
|
|
|
|
|
<input type="file" name="attach[]" multiple required>
|
|
|
|
|
|
<button class="btn btn-sm" type="submit">上传附件</button>
|
2026-10-06 03:14:18 +08:00
|
|
|
|
<?php $sdSlot = 'photo'; $sdHint = '也可以把文件直接拖到这里 —— 拖一个就开始上传,可以接着再拖,最后点「上传附件」一起记下。'; require __DIR__ . '/../_stage_drop.php'; ?>
|
2026-10-02 09:28:07 +08:00
|
|
|
|
</form>
|
|
|
|
|
|
<?php endif; ?>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<?php /* ---- 共享 ---- */ ?>
|
|
|
|
|
|
<div class="card card-pad">
|
|
|
|
|
|
<h2 class="cinema-h2">共享</h2>
|
|
|
|
|
|
<?php if (!$t['shares']): ?>
|
|
|
|
|
|
<p class="empty-hint">还没共享给别人。共享之后,任何一个人完成都算完成。</p>
|
|
|
|
|
|
<?php else: ?>
|
|
|
|
|
|
<div class="res-shares">
|
|
|
|
|
|
<?php foreach ($t['shares'] as $s): ?>
|
|
|
|
|
|
<?= person_chip($s) ?>
|
|
|
|
|
|
<span class="node-badge"><?= ($s['perm'] ?? '') === 'write' ? '可写' : '只读' ?></span>
|
|
|
|
|
|
<?php if ($canWrite): ?>
|
|
|
|
|
|
<form method="post" action="<?= e(url('tasks/unshare')) ?>" class="res-inline">
|
|
|
|
|
|
<?= csrf_field() ?>
|
|
|
|
|
|
<input type="hidden" name="id" value="<?= (int)$t['id'] ?>">
|
|
|
|
|
|
<input type="hidden" name="person_id" value="<?= (int)$s['person_id'] ?>">
|
|
|
|
|
|
<button class="btn btn-ghost btn-sm" type="submit">取消</button>
|
|
|
|
|
|
</form>
|
|
|
|
|
|
<?php endif; ?>
|
|
|
|
|
|
<?php endforeach; ?>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<?php endif; ?>
|
|
|
|
|
|
<?php if ($canWrite): ?>
|
|
|
|
|
|
<form class="inline-form" method="post" action="<?= e(url('tasks/share')) ?>">
|
|
|
|
|
|
<?= csrf_field() ?>
|
|
|
|
|
|
<input type="hidden" name="id" value="<?= (int)$t['id'] ?>">
|
2026-10-03 08:18:05 +08:00
|
|
|
|
<?php
|
|
|
|
|
|
$ppName = 'person_id';
|
|
|
|
|
|
$ppPeople = array_values(array_filter($people, fn($p) => (int)$p['id'] !== $meId));
|
|
|
|
|
|
$ppSelected = [];
|
|
|
|
|
|
$ppMode = 'single';
|
|
|
|
|
|
$ppOpenBtn = '选择要共享给谁';
|
|
|
|
|
|
$ppTitle = '共享给谁';
|
|
|
|
|
|
$ppEmptyText = '未选择';
|
|
|
|
|
|
require __DIR__ . '/../_person_picker.php';
|
|
|
|
|
|
?>
|
2026-10-02 09:28:07 +08:00
|
|
|
|
<select class="select" name="perm">
|
|
|
|
|
|
<option value="write">可写</option>
|
|
|
|
|
|
<option value="read">只读</option>
|
|
|
|
|
|
</select>
|
|
|
|
|
|
<button class="btn btn-sm" type="submit">共享</button>
|
|
|
|
|
|
</form>
|
|
|
|
|
|
<?php endif; ?>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<?php /* ---- 评论 ---- */ ?>
|
|
|
|
|
|
<div class="card card-pad">
|
|
|
|
|
|
<h2 class="cinema-h2">讨论 <span class="group-n"><?= count($t['comments']) ?> 条</span></h2>
|
|
|
|
|
|
<?php if (!$t['comments']): ?>
|
|
|
|
|
|
<p class="empty-hint">还没有留言。写 @名字 可以点名。</p>
|
|
|
|
|
|
<?php else: ?>
|
|
|
|
|
|
<ul class="cmt-list">
|
|
|
|
|
|
<?php foreach ($t['comments'] as $c): ?>
|
|
|
|
|
|
<li class="cmt-row">
|
|
|
|
|
|
<div class="cmt-who">
|
|
|
|
|
|
<?= person_chip($c) ?>
|
|
|
|
|
|
<span class="cmt-time"><?= e((string)$c['created_at']) ?></span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="cmt-body"><?= \App\Task::commentHtml((string)$c['content'], $names) ?></div>
|
|
|
|
|
|
<?php if ((int)$c['person_id'] === $meId): ?>
|
|
|
|
|
|
<form method="post" action="<?= e(url('tasks/comment_del')) ?>" class="res-inline">
|
|
|
|
|
|
<?= csrf_field() ?>
|
|
|
|
|
|
<input type="hidden" name="id" value="<?= (int)$c['id'] ?>">
|
|
|
|
|
|
<input type="hidden" name="task_id" value="<?= (int)$t['id'] ?>">
|
|
|
|
|
|
<button class="btn btn-ghost btn-sm" type="submit" onclick="return confirm('删掉这条留言?')">删除</button>
|
|
|
|
|
|
</form>
|
|
|
|
|
|
<?php endif; ?>
|
|
|
|
|
|
</li>
|
|
|
|
|
|
<?php endforeach; ?>
|
|
|
|
|
|
</ul>
|
|
|
|
|
|
<?php endif; ?>
|
|
|
|
|
|
<?php if ($canWrite): ?>
|
|
|
|
|
|
<form method="post" action="<?= e(url('tasks/comment_add')) ?>" class="cmt-form">
|
|
|
|
|
|
<?= csrf_field() ?>
|
|
|
|
|
|
<input type="hidden" name="id" value="<?= (int)$t['id'] ?>">
|
|
|
|
|
|
<textarea class="input" name="content" rows="2" required
|
|
|
|
|
|
placeholder="说点什么… 写 @名字 可以点名"><?= e(old('content', '')) ?></textarea>
|
|
|
|
|
|
<div class="btn-row"><button class="btn btn-sm" type="submit">发表</button></div>
|
|
|
|
|
|
</form>
|
|
|
|
|
|
<?php endif; ?>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<?php if ($canWrite): ?>
|
|
|
|
|
|
<div class="task-danger">
|
|
|
|
|
|
<form method="post" action="<?= e(url('tasks/destroy')) ?>"
|
|
|
|
|
|
onsubmit="return confirm('删除「<?= e((string)$t['title']) ?>」?子任务、附件与留言会一起删掉。')">
|
|
|
|
|
|
<?= csrf_field() ?>
|
|
|
|
|
|
<input type="hidden" name="id" value="<?= (int)$t['id'] ?>">
|
|
|
|
|
|
<button class="btn btn-danger btn-sm" type="submit">删除这项任务</button>
|
|
|
|
|
|
</form>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<?php endif; ?>
|