| 1 | <article class="mb-note"> |
| 2 | {@ if ($it['booster']) @} |
| 3 | <p class="mb-small">🔁 <a href="{{ $it['booster']['page'] }}">{{{ $it['booster']['color'] }}}</a>がブースト</p> |
| 4 | {@ endif @} |
| 5 | <div class="mb-author"> |
| 6 | <img src="{{ $it['author']['avatar'] }}" alt="" class="mb-avatar" loading="lazy" /> |
| 7 | <div> |
| 8 | <a href="{{ $it['author']['page'] }}" class="mb-name">{{{ $it['author']['color'] }}}</a> |
| 9 | <span class="mb-handle">{{ $it['author']['handle'] }}</span> |
| 10 | </div> |
| 11 | </div> |
| 12 | {@ if ($it['reply']) @} |
| 13 | <p class="mb-small"><a href="{{ $it['reply'] }}">↩ 返信先</a></p> |
| 14 | {@ endif @} |
| 15 | {@ if ($it['sensitive']) @} |
| 16 | <details class="mb-cw"> |
| 17 | <summary>{{ $it['summary'] !== '' ? $it['summary'] : 'センシティブな内容' }}</summary> |
| 18 | {@ endif @} |
| 19 | <div class="mb-content">{{{ $it['content'] }}}</div> |
| 20 | {@ if (!empty($it['attachments'])) @} |
| 21 | <div class="mb-media"> |
| 22 | {@ foreach ($it['attachments'] as $a) @} |
| 23 | {@ if ($a['kind'] === 'image') @} |
| 24 | <a href="{{ $a['url'] }}"><img src="{{ $a['src'] }}" alt="{{ $a['alt'] }}" title="{{ $a['alt'] }}" loading="lazy" /></a> |
| 25 | {@ elif ($a['kind'] === 'video') @} |
| 26 | <video src="{{ $a['url'] }}" controls="controls" preload="none" title="{{ $a['alt'] }}"></video> |
| 27 | {@ elif ($a['kind'] === 'audio') @} |
| 28 | <audio src="{{ $a['url'] }}" controls="controls" preload="none" title="{{ $a['alt'] }}"></audio> |
| 29 | {@ else @} |
| 30 | <a href="{{ $a['url'] }}">{{ $a['alt'] !== '' ? $a['alt'] : $a['url'] }}</a> |
| 31 | {@ endif @} |
| 32 | {@ endforeach @} |
| 33 | </div> |
| 34 | {@ endif @} |
| 35 | {@ if ($it['sensitive']) @} |
| 36 | </details> |
| 37 | {@ endif @} |
| 38 | <div class="mb-meta"> |
| 39 | <a href="{{ $it['page'] }}">{{ $it['published'] }}</a>{{ $it['edited'] ? '(編集済み)' : '' }} · {{ $it['vis'] }} |
| 40 | {@ if ($it['likes'] !== null) @} |
| 41 | · ☆{{ $it['likes'] }} 🔁{{ $it['boosts'] }} 💬{{ $it['replies'] }} |
| 42 | {@ endif @} |
| 43 | · <a href="{{ $it['original'] }}">元の投稿</a> |
| 44 | </div> |
| 45 | {@ if ($me) @} |
| 46 | <div class="mb-actions"> |
| 47 | <a href="{{ $it['page'] }}#reply" class="mb-button">返信</a> |
| 48 | <form method="post" action="/microblog/action"> |
| 49 | <input type="hidden" name="csrf_token" value="{{ $csrf }}" /> |
| 50 | <input type="hidden" name="back" value="{{ $here }}" /> |
| 51 | <input type="hidden" name="target" value="{{ $it['id'] }}" /> |
| 52 | <button name="do" value="{{ $it['liked'] ? 'unlike' : 'like' }}" class="{{ $it['liked'] ? 'on' : '' }}">{{ $it['liked'] ? '★ いいね済み' : '☆ いいね' }}</button> |
| 53 | {@ if ($it['canBoost']) @} |
| 54 | <button name="do" value="{{ $it['boosted'] ? 'unboost' : 'boost' }}" class="{{ $it['boosted'] ? 'on' : '' }}">{{ $it['boosted'] ? '🔁 ブースト済み' : '🔁 ブースト' }}</button> |
| 55 | {@ endif @} |
| 56 | </form> |
| 57 | {@ if ($it['mine']) @} |
| 58 | {@ if ($it['editUrl']) @} |
| 59 | <a href="{{ $it['editUrl'] }}" class="mb-button">編集</a> |
| 60 | {@ endif @} |
| 61 | <details class="mb-confirm"> |
| 62 | <summary>削除</summary> |
| 63 | <form method="post" action="/microblog/action"> |
| 64 | <input type="hidden" name="csrf_token" value="{{ $csrf }}" /> |
| 65 | <input type="hidden" name="back" value="{{ $here }}" /> |
| 66 | <input type="hidden" name="target" value="{{ $it['id'] }}" /> |
| 67 | <button name="do" value="delete" class="danger">本当に削除する</button> |
| 68 | </form> |
| 69 | </details> |
| 70 | {@ endif @} |
| 71 | </div> |
| 72 | {@ endif @} |
| 73 | </article> |