| 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">@{pr.formatted_title()} <span class="pr-header__num">#@pr.id</span></h1> |
| 14 | <div class="pr-header__meta"> |
| 15 | @if pr.is_open() |
| 16 | <span class="pr-status-badge pr-status--open">%pr_status_open</span> |
| 17 | @else if pr.is_merged() |
| 18 | <span class="pr-status-badge pr-status--merged">%pr_status_merged</span> |
| 19 | @else |
| 20 | <span class="pr-status-badge pr-status--closed">%pr_status_closed</span> |
| 21 | @end |
| 22 | <a class="issue-row__author" href="/@author.username">@author.username</a> |
| 23 | <code>@pr.head_branch</code> |
| 24 | <span>→</span> |
| 25 | <code>@pr.base_branch</code> |
| 26 | </div> |
| 27 | <div class="pr-header__actions"> |
| 28 | <a class="pr-tab-link" href="/@repo.user_name/@repo.name/pull/@pr.id">%pr_conversation</a> |
| 29 | <a class="pr-tab-link pr-tab-link--active" href="/@repo.user_name/@repo.name/pull/@pr.id/files">%pr_files_changed</a> |
| 30 | </div> |
| 31 | </div> |
| 32 | |
| 33 | @if file_diffs.len == 0 |
| 34 | <div class="issues-empty">%pr_no_file_changes</div> |
| 35 | @else |
| 36 | @if ctx.logged_in |
| 37 | <form method='post' class='pr-review-form' action='/@repo.user_name/@repo.name/pull/@pr.id/review'> |
| 38 | @end |
| 39 | |
| 40 | @for fd in file_diffs |
| 41 | <div class='pr-diff' id='[email protected]'> |
| 42 | <div class='pr-diff__header'> |
| 43 | <span class='pr-diff__path'>@fd.path</span> |
| 44 | <span class='pr-diff__counts'> |
| 45 | <span class='pr-diff__add'>[email protected]</span> |
| 46 | <span class='pr-diff__del'>[email protected]</span> |
| 47 | </span> |
| 48 | </div> |
| 49 | @if fd.is_binary |
| 50 | <div class='pr-diff__binary'>%pr_binary_file</div> |
| 51 | @else |
| 52 | <table class='pr-diff__table'> |
| 53 | @for hunk in fd.hunks |
| 54 | <tr class='pr-diff__hunk-header'> |
| 55 | <td colspan='4'><code>@hunk.header</code></td> |
| 56 | </tr> |
| 57 | @for dline in hunk.lines |
| 58 | <tr class='pr-diff__row [email protected]'> |
| 59 | <td class='pr-diff__lineno'>@{dline.old_line_str()}</td> |
| 60 | <td class='pr-diff__lineno'>@{dline.new_line_str()}</td> |
| 61 | <td class='pr-diff__sign'>@{dline.sign()}</td> |
| 62 | <td class='pr-diff__content'><pre>@{render_diff_line(dline.content, fd.path)}</pre></td> |
| 63 | </tr> |
| 64 | @{render_inline_comments(fd.path, dline, comments_by_key)} |
| 65 | @if ctx.logged_in && pr.is_open() && dline.kind != 'context' |
| 66 | <tr class='pr-diff__commentrow'> |
| 67 | <td colspan='4'> |
| 68 | <textarea name='@{dline.comment_field_name(fd.path)}' placeholder='%pr_line_comment_placeholder' rows='2' class='pr-diff__commentbox'></textarea> |
| 69 | </td> |
| 70 | </tr> |
| 71 | @end |
| 72 | @end |
| 73 | @end |
| 74 | </table> |
| 75 | @end |
| 76 | </div> |
| 77 | @end |
| 78 | |
| 79 | @if ctx.logged_in |
| 80 | <div class='pr-review-submit'> |
| 81 | <textarea name='body' placeholder='%pr_overall_review_placeholder' rows='3'></textarea> |
| 82 | <div class='pr-review-actions'> |
| 83 | <label><input type='radio' name='state' value='comment' checked> %pr_review_action_comment</label> |
| 84 | <label><input type='radio' name='state' value='approved'> %pr_review_action_approve</label> |
| 85 | <label><input type='radio' name='state' value='changes_requested'> %pr_review_action_request_changes</label> |
| 86 | <button type='submit' class='pr-action pr-action--review'>%pr_submit_review</button> |
| 87 | </div> |
| 88 | </div> |
| 89 | </form> |
| 90 | @end |
| 91 | @end |
| 92 | </div> |
| 93 | |
| 94 | @include 'layout/footer.html' |
| 95 | </body> |
| 96 | </html> |
| 97 | |