| 1 | <!DOCTYPE html> |
| 2 | <html> |
| 3 | <head> |
| 4 | @include 'layout/head.html' |
| 5 | </head> |
| 6 | <body> |
| 7 | @include 'layout/header.html' |
| 8 | |
| 9 | <div class="content"> |
| 10 | @include 'layout/repo_menu.html' |
| 11 | |
| 12 | <div class="pr-header"> |
| 13 | <h1 class="pr-header__title">@{discussion.formatted_title()} <span class="pr-header__num">#@discussion.id</span></h1> |
| 14 | <div class="pr-header__meta"> |
| 15 | <span class="issue-label">@{discussion.category_label()}</span> |
| 16 | @if discussion.is_answered |
| 17 | <span class="issue-label issue-label--answered">%discussion_answered</span> |
| 18 | @end |
| 19 | @if discussion.is_locked |
| 20 | <span class="issue-label">%discussion_locked</span> |
| 21 | @end |
| 22 | <span>%discussion_opened @{discussion.relative_time()} %pr_by</span> |
| 23 | <a class="issue-row__author" href="/@author.username">@author.username</a> |
| 24 | </div> |
| 25 | </div> |
| 26 | |
| 27 | <div class="pr-body"> |
| 28 | <div class="avatar-with-user-info"> |
| 29 | <img src="@{app.prepare_user_avatar_url(author.avatar)}"> |
| 30 | <span> |
| 31 | <a href="/@author.username"><i>@author.username</i></a> |
| 32 | <p>@discussion.body</p> |
| 33 | </span> |
| 34 | </div> |
| 35 | </div> |
| 36 | |
| 37 | @for c in comments |
| 38 | <div class="avatar-with-user-info issue-comment-post"> |
| 39 | <img src="@{app.prepare_user_avatar_url(c.user.avatar)}"> |
| 40 | <span> |
| 41 | <a href="/@c.user.username"><i>@c.user.username</i></a> <i>@{c.item.relative()}</i> |
| 42 | @if c.item.id == discussion.answer_id |
| 43 | <span class="issue-label issue-label--answered">%discussion_answered</span> |
| 44 | @end |
| 45 | <p>@c.item.text</p> |
| 46 | @if ctx.logged_in && is_owner && discussion.category == 'qa' && c.item.id != discussion.answer_id |
| 47 | <form method="post" action="/@repo.user_name/@repo.name/discussions/@discussion.id/answer/@c.item.id" class="inline-form"> |
| 48 | <button type="submit" class="link-button">%discussion_answer</button> |
| 49 | </form> |
| 50 | @end |
| 51 | </span> |
| 52 | </div> |
| 53 | @end |
| 54 | |
| 55 | @if ctx.logged_in && !discussion.is_locked |
| 56 | <form method="post" class="form vertical-form comment-post-form" action="/@repo.user_name/@repo.name/discussions/@discussion.id/comments"> |
| 57 | <textarea class="input-comment" name="text" placeholder="%discussion_reply_placeholder" required></textarea> |
| 58 | <input type="submit" class="comment-post-submit" name="submit" value="%discussion_reply_button"> |
| 59 | </form> |
| 60 | @end |
| 61 | |
| 62 | @if ctx.logged_in && is_owner |
| 63 | <div class="pr-actions"> |
| 64 | <form method="post" action="/@repo.user_name/@repo.name/discussions/@discussion.id/lock" class="pr-action-form"> |
| 65 | @if discussion.is_locked |
| 66 | <button type="submit" class="pr-action">%discussion_unlock</button> |
| 67 | @else |
| 68 | <button type="submit" class="pr-action">%discussion_lock</button> |
| 69 | @end |
| 70 | </form> |
| 71 | <form method="post" action="/@repo.user_name/@repo.name/discussions/@discussion.id/delete" class="pr-action-form"> |
| 72 | <button type="submit" class="pr-action pr-action--close">%discussion_delete</button> |
| 73 | </form> |
| 74 | </div> |
| 75 | @end |
| 76 | </div> |
| 77 | |
| 78 | @include 'layout/footer.html' |
| 79 | </body> |
| 80 | </html> |
| 81 | |