tracker/templates/task.html
{{define "content"}}{{with .Task}}
{{template "crumbs" $.Crumbs}}
{{if $.Saved}}<p class="notice" role="status">บันทึกผลการรีวิวแล้ว Agent จะอ่านผลนี้จาก <code>tracker/data/milestones.json</code></p>{{end}}
<header class="page-head">
<p class="kicker">{{template "chip" .Status}} <span class="tid">{{.ID}}</span></p>
<h1>{{.Title}}</h1>
<p class="lede">{{template "where" .Where}}</p>
</header>
<dl class="facts">
{{if .Owner}}<div><dt>ผู้รับผิดชอบ</dt><dd>{{.Owner}}</dd></div>{{end}}
{{if .Started}}<div><dt>เริ่ม</dt><dd>{{thaiDate .Started}}</dd></div>{{end}}
{{if .Finished}}<div><dt>เสร็จ</dt><dd>{{thaiDate .Finished}}</dd></div>{{end}}
{{if .Steps}}<div><dt>ขั้นตอน</dt><dd>{{len .Done}}/{{add (len .Done) (len .Left)}}</dd></div>{{end}}
</dl>
{{if .Summary}}<p class="task-summary">{{.Summary}}</p>{{end}}
{{if or .Description .Deliverables .Dependencies .SuggestedOwner}}
<section class="block task-brief" aria-labelledby="h-task-brief"><div class="block-head"><h2 id="h-task-brief">รายละเอียดงาน</h2></div>
{{if .Description}}<div class="md">{{md .Description}}</div>{{end}}
{{if .SuggestedOwner}}<p class="task-proposed-owner"><strong>ผู้รับผิดชอบที่เสนอ:</strong> {{.SuggestedOwner}} <span class="muted">(รอยืนยันผู้รับผิดชอบจริง)</span></p>{{end}}
{{if .Dependencies}}<p><strong>งานที่ใช้ประกอบ:</strong> {{range .Dependencies}}<a class="task-dependency" href="{{taskHref .}}">{{.}}</a> {{end}}</p>{{end}}
{{if .Deliverables}}<h3>ผลลัพธ์ที่ต้องส่งมอบ</h3><ul class="task-deliverables">{{range .Deliverables}}<li>{{.}}</li>{{end}}</ul>{{end}}
</section>{{end}}
{{if .Questions}}<section class="block task-questions" aria-labelledby="h-task-questions"><div class="block-head"><h2 id="h-task-questions">คำถามที่ต้องการข้อมูล</h2><span class="muted">{{len .Questions}} ข้อ</span></div><p class="muted">ระบุรหัสคำถามเมื่อให้ข้อมูล พร้อมแหล่งอ้างอิงหรือผู้ยืนยัน คำถามที่ยังไม่ตอบไม่ใช่ข้อสรุปของโครงการ</p><ol class="task-question-list">{{range .Questions}}<li id="{{.ID}}"><div class="task-question-head"><code>{{.ID}}</code><span class="task-question-state{{if .Answer}} is-answered{{end}}">{{if .Answer}}มีคำตอบแล้ว{{else}}รอข้อมูล{{end}}</span></div><h3>{{.Question}}</h3><p><strong>ผู้ที่ควรตอบ:</strong> {{.AskedOf}}</p><p class="muted"><strong>ข้อมูลนี้ใช้เพื่อ:</strong> {{.Why}}</p>{{if .Answer}}<div class="task-question-answer"><strong>คำตอบ</strong><div class="md">{{md .Answer}}</div><p class="muted">{{.AnsweredBy}}{{if .AnsweredAt}} · {{thaiDate .AnsweredAt}}{{end}}{{if .Source}} · {{.Source}}{{end}}</p></div>{{end}}</li>{{end}}</ol></section>{{end}}
{{if .Review}}
<section class="review-box review-{{.Review.StateOrTodo}}" aria-labelledby="h-review">
<h2 id="h-review">การรีวิว</h2>
{{template "reviewbody" .}}
{{template "reviewform" (reviewForm $ .ID .Review "task")}}
</section>
{{end}}
{{if .Steps}}
<section class="block task-steps" aria-labelledby="h-steps">
<div class="block-head"><h2 id="h-steps">ขั้นตอน</h2></div>
<div class="meter" role="img" aria-label="ทำแล้ว {{len .Done}} จาก {{add (len .Done) (len .Left)}} ขั้น"><span style="width:{{.Percent}}%"></span></div>
<p class="meter-text">ทำแล้ว {{len .Done}} จาก {{add (len .Done) (len .Left)}} ขั้น{{if .Left}} เหลืออีก {{len .Left}} ขั้นก่อนปิด Task{{end}}</p>
<div class="steps">
<div>
<h3>ส่วนที่คืบหน้าแล้ว</h3>
{{if .Done}}<ul class="step-list">{{range .Done}}<li class="step-done">{{.Text}}</li>{{end}}</ul>{{else}}<p class="muted">ยังไม่มีขั้นที่เสร็จ</p>{{end}}
</div>
<div>
<h3>ส่วนที่ยังเหลือก่อนปิด Task</h3>
{{if .Left}}<ul class="step-list">{{range .Left}}<li class="step-left">{{.Text}}</li>{{end}}</ul>{{else}}<p class="muted">ไม่มีขั้นที่เหลือ</p>{{end}}
</div>
</div>
</section>
{{end}}
{{if .Refs}}
<section class="block" aria-labelledby="h-refs">
<div class="block-head"><h2 id="h-refs">เอกสารและไฟล์ที่เกี่ยวข้อง</h2></div>
{{template "refs" .Refs}}
</section>
{{end}}
{{end}}{{end}}