| 1 | <div class="gl-issue"> |
| 2 | <div class="gl-thread"> |
| 3 | <div class="gl-comment" id="c0"> |
| 4 | <div class="gl-comment-head"> |
| 5 | {@ if ($who['icon'] !== '') @} |
| 6 | <img src="{{ $who['icon'] }}" alt="" class="gl-av" /> |
| 7 | {@ endif @} |
| 8 | <a href="{{ $who['url'] }}"><b>{{ $who['name'] }}</b></a>{{{ $who['remote'] ? ' <span class="gl-badge">Fediverse</span>' : '' }}} |
| 9 | <small>{{ $date }}{{ !empty($issue['edited']) ? '(編集済み)' : '' }}</small> |
| 10 | </div> |
| 11 | <div class="gl-comment-body">{{{ $bodyHtml }}}</div> |
| 12 | </div> |
| 13 | {@ foreach ($timeline as $t) @} |
| 14 | {@ if ($t['kind'] === 'event') @} |
| 15 | <div class="gl-event">{{{ $t['html'] }}} <small>{{ $t['date'] }}</small></div> |
| 16 | {@ elif ($t['kind'] === 'review') @} |
| 17 | <div class="gl-comment gl-review gl-review-{{ $t['state'] }}" id="r{{ $t['id'] }}"> |
| 18 | <div class="gl-comment-head"> |
| 19 | {@ if ($t['who']['icon'] !== '') @} |
| 20 | <img src="{{ $t['who']['icon'] }}" alt="" class="gl-av" /> |
| 21 | {@ endif @} |
| 22 | <a href="{{ $t['who']['url'] }}"><b>{{ $t['who']['name'] }}</b></a>が{{ $t['stateText'] }} |
| 23 | <small><a href="#r{{ $t['id'] }}">{{ $t['date'] }}</a></small> |
| 24 | </div> |
| 25 | {@ if ($t['html'] !== '') @} |
| 26 | <div class="gl-comment-body">{{{ $t['html'] }}}</div> |
| 27 | {@ endif @} |
| 28 | {@ foreach ($t['comments'] as $ic) @} |
| 29 | {@ include(gitler/inline) @} |
| 30 | {@ endforeach @} |
| 31 | </div> |
| 32 | {@ elif ($t['kind'] === 'inline') @} |
| 33 | {$ $ic = $t['c'] $} |
| 34 | {@ include(gitler/inline) @} |
| 35 | {@ else @} |
| 36 | <div class="gl-comment" id="c{{ $t['id'] }}"> |
| 37 | <div class="gl-comment-head"> |
| 38 | {@ if ($t['who']['icon'] !== '') @} |
| 39 | <img src="{{ $t['who']['icon'] }}" alt="" class="gl-av" /> |
| 40 | {@ endif @} |
| 41 | <a href="{{ $t['who']['url'] }}"><b>{{ $t['who']['name'] }}</b></a> |
| 42 | {@ if ($t['who']['remote']) @} |
| 43 | <span class="gl-muted">{{ $t['who']['handle'] }}</span> <span class="gl-badge">Fediverse</span> |
| 44 | {@ endif @} |
| 45 | <small><a href="#c{{ $t['id'] }}">{{ $t['date'] }}</a>{{ $t['edited'] ? '(編集済み)' : '' }}</small> |
| 46 | {@ if ($t['remote'] !== '') @} |
| 47 | <small><a href="{{ $t['remote'] }}" rel="nofollow noopener noreferrer">元の投稿</a></small> |
| 48 | {@ endif @} |
| 49 | </div> |
| 50 | <div class="gl-comment-body">{{{ $t['html'] }}}</div> |
| 51 | {@ if ($t['canEdit'] || $t['canDelete'] || ($canAdmin && $t['actor'] !== '')) @} |
| 52 | <div class="gl-row gl-comment-tools"> |
| 53 | {@ if ($t['canEdit']) @} |
| 54 | <details class="gl-edit"> |
| 55 | <summary>編集</summary> |
| 56 | <form method="post" action="{{ $issueUrl }}" class="gl-form"> |
| 57 | <input type="hidden" name="csrf_token" value="{{ $csrf }}" /> |
| 58 | <input type="hidden" name="id" value="{{ $t['id'] }}" /> |
| 59 | <textarea name="body" rows="6">{{ $t['body'] }}</textarea> |
| 60 | <button name="do" value="editComment">保存</button> |
| 61 | </form> |
| 62 | </details> |
| 63 | {@ endif @} |
| 64 | {@ if ($t['canDelete']) @} |
| 65 | <form method="post" action="{{ $issueUrl }}"> |
| 66 | <input type="hidden" name="csrf_token" value="{{ $csrf }}" /> |
| 67 | <input type="hidden" name="id" value="{{ $t['id'] }}" /> |
| 68 | <button name="do" value="deleteComment" class="danger">削除</button> |
| 69 | </form> |
| 70 | {@ endif @} |
| 71 | {@ if ($canAdmin && $t['actor'] !== '') @} |
| 72 | <form method="post" action="{{ $issueUrl }}"> |
| 73 | <input type="hidden" name="csrf_token" value="{{ $csrf }}" /> |
| 74 | <input type="hidden" name="actor" value="{{ $t['actor'] }}" /> |
| 75 | <button name="do" value="block" class="danger">この人をブロック</button> |
| 76 | </form> |
| 77 | {@ endif @} |
| 78 | </div> |
| 79 | {@ endif @} |
| 80 | </div> |
| 81 | {@ endif @} |
| 82 | {@ endforeach @} |
| 83 | {@ if (isset($merge)) @} |
| 84 | {@ include(gitler/mergebox) @} |
| 85 | {@ endif @} |
| 86 | {@ if ($canIssue) @} |
| 87 | <form method="post" action="{{ $issueUrl }}" class="gl-form gl-issueform"> |
| 88 | <input type="hidden" name="csrf_token" value="{{ $csrf }}" /> |
| 89 | <textarea name="body" rows="6" placeholder="コメント(Markdown)"></textarea> |
| 90 | <div class="gl-row"> |
| 91 | <button name="do" value="comment">コメント</button> |
| 92 | {@ if ($canClose) @} |
| 93 | {@ if ($issue['state'] === 'open') @} |
| 94 | <button name="do" value="commentClose">閉じる</button> |
| 95 | {@ else @} |
| 96 | <button name="do" value="commentReopen">開き直す</button> |
| 97 | {@ endif @} |
| 98 | {@ endif @} |
| 99 | </div> |
| 100 | <small>Markdownが使えます。「#3」で他のイシューにリンクします。コメントを書いて閉じると、コメントしてから閉じます。</small> |
| 101 | </form> |
| 102 | {@ elif (!$user) @} |
| 103 | <p class="paragraph"><a href="/login">ログイン</a>するとコメント出来ます。</p> |
| 104 | {@ endif @} |
| 105 | {@ if ($fedi) @} |
| 106 | <p class="gl-muted gl-fedi">Fediverseから:Mastodon等で<code>{{ $fediUrl }}</code>を検索して返信するとコメントになります。<code>{{ $fediHandle }}</code>をフォローすると新しいイシューが届きます。</p> |
| 107 | {@ endif @} |
| 108 | </div> |
| 109 | <aside class="gl-side"> |
| 110 | <h3>ラベル</h3> |
| 111 | <p> |
| 112 | {@ foreach ($issueLabels as $l) @} |
| 113 | <a href="{{ $repoUrl }}/issues?label={{ $l['id'] }}" class="gl-label" style="background-color: {{ $l['color'] }}; color: {{ $l['fg'] }};" title="{{ $l['description'] }}">{{ $l['name'] }}</a> |
| 114 | {@ endforeach @} |
| 115 | {@ if (empty($issueLabels)) @} |
| 116 | <span class="gl-muted">無し</span> |
| 117 | {@ endif @} |
| 118 | </p> |
| 119 | <h3>担当者</h3> |
| 120 | <p>{{ !empty($issue['assignees']) ? implode('、', $issue['assignees']) : '無し' }}</p> |
| 121 | <h3>マイルストーン</h3> |
| 122 | <p>{{ $milestone !== '' ? $milestone : '無し' }}</p> |
| 123 | {@ if ($user) @} |
| 124 | <h3>通知</h3> |
| 125 | <form method="post" action="{{ $issueUrl }}"> |
| 126 | <input type="hidden" name="csrf_token" value="{{ $csrf }}" /> |
| 127 | <p><small>{{ $subscribeNote }}</small></p> |
| 128 | <button name="do" value="{{ $subscribed ? 'unsubscribe' : 'subscribe' }}">{{ $subscribed ? '通知を止める' : '通知を受け取る' }}</button> |
| 129 | </form> |
| 130 | {@ endif @} |
| 131 | {@ if ($canTriage) @} |
| 132 | <details class="gl-edit"> |
| 133 | <summary>変える</summary> |
| 134 | <form method="post" action="{{ $issueUrl }}" class="gl-form"> |
| 135 | <input type="hidden" name="csrf_token" value="{{ $csrf }}" /> |
| 136 | {@ if (!empty($labels)) @} |
| 137 | <fieldset class="gl-checks"> |
| 138 | <legend>ラベル</legend> |
| 139 | {@ foreach ($labels as $l) @} |
| 140 | <label><input type="checkbox" name="labels[]" value="{{ $l['id'] }}"{{{ $l['checked'] ? ' checked="checked"' : '' }}} /> <span class="gl-label" style="background-color: {{ $l['color'] }}; color: {{ $l['fg'] }};">{{ $l['name'] }}</span></label> |
| 141 | {@ endforeach @} |
| 142 | </fieldset> |
| 143 | {@ endif @} |
| 144 | <fieldset class="gl-checks"> |
| 145 | <legend>担当者</legend> |
| 146 | {@ foreach ($people as $p) @} |
| 147 | <label><input type="checkbox" name="assignees[]" value="{{ $p['name'] }}"{{{ $p['checked'] ? ' checked="checked"' : '' }}} /> {{ $p['name'] }}</label> |
| 148 | {@ endforeach @} |
| 149 | </fieldset> |
| 150 | <label>マイルストーン: |
| 151 | <select name="milestone"> |
| 152 | <option value="0">無し</option> |
| 153 | {@ foreach ($milestones as $id => $m) @} |
| 154 | <option value="{{ $id }}"{{{ $id === $issue['milestone'] ? ' selected="selected"' : '' }}}>{{ $m['title'] }}{{ $m['state'] === 'closed' ? '(終了)' : '' }}</option> |
| 155 | {@ endforeach @} |
| 156 | </select> |
| 157 | </label> |
| 158 | <button name="do" value="triage">保存</button> |
| 159 | </form> |
| 160 | </details> |
| 161 | {@ endif @} |
| 162 | {@ if ($canAdmin) @} |
| 163 | <form method="post" action="{{ $issueUrl }}" class="gl-delete"> |
| 164 | <input type="hidden" name="csrf_token" value="{{ $csrf }}" /> |
| 165 | <label><input type="checkbox" name="confirm" value="1" required="required" /> 元に戻せません</label> |
| 166 | <button name="do" value="delete" class="danger">{{ isset($pull) ? 'プルリクエスト' : 'イシュー' }}を削除</button> |
| 167 | </form> |
| 168 | {@ endif @} |
| 169 | </aside> |
| 170 | </div> |