ggdgsdbsdbbb / templates / new / pull.html
103 lines · 93 sloc · 2.89 KB · afdfff432d46a86efc1c7b2b324448dd946900e2
Raw
1<!DOCTYPE html>
2<html>
3 <head>
4 @include '../layout/head.html'
5 </head>
6 <body>
7 @include '../layout/header.html'
8
9 .form-error {
10 @ctx.form_error
11 }
12
13 <div class="content">
14 @include '../layout/repo_menu.html'
15
16 <h1>%pr_open_title</h1>
17 <p class="pr-compare-desc">%pr_compare_desc</p>
18
19 @if error_msg != ''
20 <div class="form-error">@error_msg</div>
21 @end
22
23 <form method='get' class='pr-compare-form' action='/@repo.user_name/@repo.name/compare'>
24 <label class='pr-compare-label'>
25 %pr_base
26 <select name='base'>
27 @for branch in branches
28 @if branch.name == base
29 <option value='@branch.name' selected>@branch.name</option>
30 @else
31 <option value='@branch.name'>@branch.name</option>
32 @end
33 @end
34 </select>
35 </label>
36 <span class='pr-compare-arrow'>←</span>
37 <label class='pr-compare-label'>
38 %pr_compare
39 <select name='head'>
40 <option value=''>%pr_choose_branch</option>
41 @for branch in branches
42 @if branch.name == head
43 <option value='@branch.name' selected>@branch.name</option>
44 @else
45 <option value='@branch.name'>@branch.name</option>
46 @end
47 @end
48 </select>
49 </label>
50 <button type='submit' class='pr-compare-btn'>%pr_compare_button</button>
51 </form>
52
53 @if has_compare
54 @if commits.len == 0
55 <div class="issues-empty">%pr_no_commits_between</div>
56 @else
57 <div class="pr-compare-summary">
58 <strong>@commits.len</strong> %pr_commits_label ·
59 <strong>@file_diffs.len</strong> %pr_files_changed_label
60 </div>
61
62 <form method='post' class='pr-new-form' action='/@repo.user_name/@repo.name/pulls'>
63 <input type='hidden' name='head' value='@head'>
64 <input type='hidden' name='base' value='@base'>
65 <div class="field">
66 <input type='text' name='title' placeholder='%pr_title_placeholder' value='@suggested_title' required>
67 </div>
68 <div class="field">
69 <textarea name='description' placeholder='%pr_description_placeholder' rows='6'></textarea>
70 </div>
71 <div class="field">
72 <button type='submit' class='pr-new-submit'>%pr_create</button>
73 </div>
74 </form>
75
76 <h3>%pr_commits_heading</h3>
77 <ul class='pr-commits'>
78 @for c in commits
79 <li class='pr-commit'>
80 <code class='pr-commit__hash'>@c.hash</code>
81 <span class='pr-commit__msg'>@c.message</span>
82 <span class='pr-commit__author'>%pr_by @c.author</span>
83 </li>
84 @end
85 </ul>
86
87 <h3>%pr_files_changed</h3>
88 <ul class='pr-files-summary'>
89 @for fd in file_diffs
90 <li class='pr-file-summary'>
91 <a href='#[email protected]'>@fd.path</a>
92 <span class='pr-file-summary__add'>[email protected]</span>
93 <span class='pr-file-summary__del'>[email protected]</span>
94 </li>
95 @end
96 </ul>
97 @end
98 @end
99 </div>
100
101 @include '../layout/footer.html'
102 </body>
103</html>
104