| 1 | {{ define "page" -}} |
| 2 | <section class="shithub-repo-page"> |
| 3 | {{ template "repo-header" . }} |
| 4 | |
| 5 | <div class="shithub-compare-flow shithub-pull-open-flow"> |
| 6 | <header class="shithub-compare-subhead"> |
| 7 | <h1>Open a pull request</h1> |
| 8 | <p>Create a new pull request by comparing changes across two branches.</p> |
| 9 | </header> |
| 10 | |
| 11 | <div class="shithub-range-editor" aria-label="Choose pull request branches"> |
| 12 | {{ template "compare-ref-menu" (dict "Menu" .BaseMenu) }} |
| 13 | <span class="shithub-range-separator" aria-hidden="true">...</span> |
| 14 | {{ template "compare-ref-menu" (dict "Menu" .HeadMenu) }} |
| 15 | {{ if .MergeState.Label }} |
| 16 | <span class="shithub-range-merge-state shithub-range-merge-{{ .MergeState.State }}"> |
| 17 | {{ if eq .MergeState.State "clean" }}{{ octicon "check" }}{{ else if eq .MergeState.State "conflict" }}{{ octicon "x-circle" }}{{ else }}{{ octicon "git-pull-request" }}{{ end }} |
| 18 | {{ .MergeState.Label }} |
| 19 | </span> |
| 20 | {{ end }} |
| 21 | </div> |
| 22 | |
| 23 | {{ if .Error }}<div class="shithub-error" role="alert">{{ .Error }}</div>{{ end }} |
| 24 | {{ if .NotFound }} |
| 25 | <div class="shithub-compare-flash shithub-compare-flash-danger" role="alert"> |
| 26 | {{ octicon "x-circle" }} |
| 27 | <div> |
| 28 | <strong>There was a problem comparing these refs.</strong> |
| 29 | <p>One or both refs were not found in this repository.</p> |
| 30 | </div> |
| 31 | </div> |
| 32 | {{ else if or .SameRef .NoCommits }} |
| 33 | <div class="shithub-compare-flash shithub-compare-flash-warning"> |
| 34 | {{ octicon "git-pull-request" }} |
| 35 | <div> |
| 36 | <strong>Choose different branches to open a pull request.</strong> |
| 37 | <p><code>{{ .Head }}</code> has no commits ahead of <code>{{ .Base }}</code>.</p> |
| 38 | </div> |
| 39 | </div> |
| 40 | {{ end }} |
| 41 | |
| 42 | <div class="shithub-pull-new-layout"> |
| 43 | <form method="post" action="/{{ .Owner }}/{{ .Repo.Name }}/pulls" class="shithub-pull-new-form" data-comment-editor data-preview-url="/{{ .Owner }}/{{ .Repo.Name }}/markdown-preview" data-preview-ref="{{ .Base }}"> |
| 44 | <input type="hidden" name="csrf_token" value="{{ .CSRFToken }}"> |
| 45 | <input type="hidden" name="base" value="{{ .Base }}"> |
| 46 | <input type="hidden" name="head" value="{{ .Head }}"> |
| 47 | |
| 48 | <div class="shithub-pull-new-title-row"> |
| 49 | <a class="shithub-comment-composer-avatar" href="/{{ .Viewer.Username }}" aria-label="@{{ .Viewer.Username }}"> |
| 50 | <img src="{{ .ViewerAvatarURL }}" alt="" width="40" height="40"> |
| 51 | </a> |
| 52 | <label class="shithub-pull-new-title"> |
| 53 | <span>Add a title <strong>*</strong></span> |
| 54 | <input type="text" name="title" maxlength="256" required value="{{ .FormTitle }}" autofocus> |
| 55 | </label> |
| 56 | </div> |
| 57 | |
| 58 | <div class="shithub-pull-new-description"> |
| 59 | <script type="application/json" data-comment-editor-config>{{ jsField . "CommentEditorConfig" }}</script> |
| 60 | <label class="shithub-pull-new-description-label" for="pull-new-body">Add a description</label> |
| 61 | <div class="shithub-comment-editor-box"> |
| 62 | <div class="shithub-comment-editor-head"> |
| 63 | <div class="shithub-comment-editor-tabs" role="tablist" aria-label="Pull request description tabs"> |
| 64 | <button type="button" class="is-active" role="tab" aria-selected="true" data-comment-tab="write">Write</button> |
| 65 | <button type="button" role="tab" aria-selected="false" data-comment-tab="preview">Preview</button> |
| 66 | </div> |
| 67 | <div class="shithub-comment-toolbar" aria-label="Formatting tools"> |
| 68 | <button type="button" class="shithub-comment-tool" data-comment-action="mention" title="Mention a user">{{ octicon "people" }}</button> |
| 69 | <span class="shithub-comment-toolbar-separator" aria-hidden="true"></span> |
| 70 | <button type="button" class="shithub-comment-tool shithub-comment-tool-text" data-comment-action="heading" title="Add heading">H</button> |
| 71 | <button type="button" class="shithub-comment-tool shithub-comment-tool-text" data-comment-action="bold" title="Add bold text">B</button> |
| 72 | <button type="button" class="shithub-comment-tool shithub-comment-tool-text is-italic" data-comment-action="italic" title="Add italic text">I</button> |
| 73 | <button type="button" class="shithub-comment-tool" data-comment-action="quote" title="Quote text">{{ octicon "comment" }}</button> |
| 74 | <button type="button" class="shithub-comment-tool" data-comment-action="code" title="Add code">{{ octicon "code" }}</button> |
| 75 | <button type="button" class="shithub-comment-tool" data-comment-action="link" title="Add link">{{ octicon "link" }}</button> |
| 76 | <span class="shithub-comment-toolbar-separator" aria-hidden="true"></span> |
| 77 | <button type="button" class="shithub-comment-tool" data-comment-action="list" title="Add unordered list">{{ octicon "list-unordered" }}</button> |
| 78 | <button type="button" class="shithub-comment-tool shithub-comment-tool-text" data-comment-action="ordered-list" title="Add ordered list">1.</button> |
| 79 | <button type="button" class="shithub-comment-tool" data-comment-action="task-list" title="Add task list">{{ octicon "checklist" }}</button> |
| 80 | <span class="shithub-comment-toolbar-separator" aria-hidden="true"></span> |
| 81 | <label class="shithub-comment-tool" title="Attach files"> |
| 82 | {{ octicon "upload" }} |
| 83 | <input type="file" multiple data-comment-file-input> |
| 84 | </label> |
| 85 | <button type="button" class="shithub-comment-tool shithub-comment-tool-text" data-comment-action="reference" title="Reference an issue or pull request">#</button> |
| 86 | <button type="button" class="shithub-comment-tool" data-comment-saved-replies-open title="Saved replies">{{ octicon "comment-discussion" }}</button> |
| 87 | <button type="button" class="shithub-comment-tool" data-comment-action="fullscreen" title="Fullscreen editor">{{ octicon "screen-full" }}</button> |
| 88 | </div> |
| 89 | </div> |
| 90 | <div class="shithub-comment-editor-write" data-comment-write-pane> |
| 91 | <textarea id="pull-new-body" name="body" rows="10" maxlength="65535" placeholder="Add your description here..." data-comment-textarea>{{ .FormBody }}</textarea> |
| 92 | <div class="shithub-comment-suggestions" data-comment-suggestions hidden></div> |
| 93 | </div> |
| 94 | <div class="shithub-comment-editor-preview markdown-body" data-comment-preview-pane hidden> |
| 95 | <p class="shithub-editor-preview-empty">Nothing to preview.</p> |
| 96 | </div> |
| 97 | <div class="shithub-comment-editor-footer"> |
| 98 | <span>{{ octicon "code-square" }} Markdown is supported</span> |
| 99 | <span data-comment-attachment-copy>{{ octicon "file" }} Paste, drop, or click to add files</span> |
| 100 | <span class="shithub-comment-file-list" data-comment-file-list hidden></span> |
| 101 | </div> |
| 102 | </div> |
| 103 | <dialog class="shithub-comment-saved-dialog" data-comment-saved-dialog> |
| 104 | <div class="shithub-comment-saved-head"> |
| 105 | <strong>Select a reply</strong> |
| 106 | <button type="button" class="shithub-icon-button" aria-label="Close" data-comment-saved-close>{{ octicon "x" }}</button> |
| 107 | </div> |
| 108 | <input type="search" placeholder="Search saved replies" data-comment-saved-filter> |
| 109 | <button type="button" class="shithub-comment-saved-item" data-comment-saved-insert="Duplicate of #"> |
| 110 | <strong>Duplicate pull request</strong> |
| 111 | <span>Duplicate of #</span> |
| 112 | <kbd>ctrl 1</kbd> |
| 113 | </button> |
| 114 | <button type="button" class="shithub-comment-saved-create">{{ octicon "plus" }} Create a new saved reply</button> |
| 115 | </dialog> |
| 116 | </div> |
| 117 | |
| 118 | <p class="shithub-comment-policy-note"> |
| 119 | {{ octicon "alert" }} Remember, contributions to this repository should follow its |
| 120 | <a href="/{{ .Owner }}/{{ .Repo.Name }}/blob/{{ .Repo.DefaultBranch }}/CONTRIBUTING.md">contributing guidelines</a>, |
| 121 | <a href="/{{ .Owner }}/{{ .Repo.Name }}/blob/{{ .Repo.DefaultBranch }}/SECURITY.md">security policy</a>, and |
| 122 | <a href="/{{ .Owner }}/{{ .Repo.Name }}/blob/{{ .Repo.DefaultBranch }}/CODE_OF_CONDUCT.md">code of conduct</a>. |
| 123 | </p> |
| 124 | |
| 125 | <div class="shithub-pull-new-actions"> |
| 126 | {{ if .CanCreatePull }} |
| 127 | <button type="submit" class="shithub-button shithub-button-primary">Create pull request</button> |
| 128 | <details class="shithub-pr-submit-menu"> |
| 129 | <summary class="shithub-button shithub-button-primary shithub-button-icon" aria-label="Create options">{{ octicon "triangle-down" }}</summary> |
| 130 | <div class="shithub-pr-submit-menu-popover"> |
| 131 | <button type="submit" class="is-active"> |
| 132 | <strong>{{ octicon "check" }} Create pull request</strong> |
| 133 | <span>Open a pull request that is ready for review</span> |
| 134 | </button> |
| 135 | <button type="submit" name="draft" value="on"> |
| 136 | <strong>Create draft pull request</strong> |
| 137 | <span>Cannot be merged until marked ready for review</span> |
| 138 | </button> |
| 139 | </div> |
| 140 | </details> |
| 141 | {{ else }} |
| 142 | <button type="submit" class="shithub-button shithub-button-primary" disabled>Create pull request</button> |
| 143 | {{ end }} |
| 144 | </div> |
| 145 | </form> |
| 146 | |
| 147 | <aside class="shithub-pull-new-sidebar" aria-label="Pull request metadata"> |
| 148 | <section> |
| 149 | <h2>Reviewers <button type="button" class="shithub-icon-button" aria-label="Edit reviewers">{{ octicon "gear" }}</button></h2> |
| 150 | <p>No reviewers</p> |
| 151 | </section> |
| 152 | <section> |
| 153 | <h2>Assignees <button type="button" class="shithub-icon-button" aria-label="Edit assignees">{{ octicon "gear" }}</button></h2> |
| 154 | <p>No one - <a href="/{{ .Viewer.Username }}">assign yourself</a></p> |
| 155 | </section> |
| 156 | <section> |
| 157 | <h2>Labels <button type="button" class="shithub-icon-button" aria-label="Edit labels">{{ octicon "gear" }}</button></h2> |
| 158 | <p>None yet</p> |
| 159 | </section> |
| 160 | <section> |
| 161 | <h2>Projects <button type="button" class="shithub-icon-button" aria-label="Edit projects">{{ octicon "gear" }}</button></h2> |
| 162 | <p>None yet</p> |
| 163 | </section> |
| 164 | <section> |
| 165 | <h2>Milestone <button type="button" class="shithub-icon-button" aria-label="Edit milestone">{{ octicon "gear" }}</button></h2> |
| 166 | <p>No milestone</p> |
| 167 | </section> |
| 168 | <section> |
| 169 | <h2>Development</h2> |
| 170 | <p>Use closing keywords in the description to automatically close issues</p> |
| 171 | </section> |
| 172 | </aside> |
| 173 | </div> |
| 174 | |
| 175 | {{ if and (not .NotFound) (not .SameRef) }} |
| 176 | <div class="shithub-compare-stats" aria-label="Comparison summary"> |
| 177 | <span>{{ octicon "git-commit" }} {{ .Stats.CommitCount }} {{ pluralize .Stats.CommitCount "commit" "commits" }}</span> |
| 178 | <span>{{ octicon "diff" }} {{ .Stats.FileCount }} {{ pluralize .Stats.FileCount "file changed" "files changed" }}</span> |
| 179 | <span>{{ octicon "person" }} {{ .Stats.ContributorCount }} {{ pluralize .Stats.ContributorCount "contributor" "contributors" }}</span> |
| 180 | </div> |
| 181 | |
| 182 | {{ if .Commits }} |
| 183 | <section class="shithub-compare-commits"> |
| 184 | <h2>Commits on {{ .Head }}</h2> |
| 185 | <ul class="shithub-commits-list"> |
| 186 | {{ range .Commits }} |
| 187 | <li class="shithub-commits-row"> |
| 188 | <div class="shithub-commits-meta"> |
| 189 | <a class="shithub-commits-subject" href="/{{ $.Owner }}/{{ $.Repo.Name }}/commit/{{ .OID }}">{{ .Subject }}</a> |
| 190 | <code class="shithub-commits-sha">{{ .ShortOID }}</code> |
| 191 | <small>{{ .AuthorName }} committed <time datetime="{{ .AuthorWhen.Format "2006-01-02T15:04:05Z" }}">{{ relativeTime .AuthorWhen }}</time></small> |
| 192 | </div> |
| 193 | </li> |
| 194 | {{ end }} |
| 195 | </ul> |
| 196 | </section> |
| 197 | {{ end }} |
| 198 | |
| 199 | {{ if .DiffHTML }} |
| 200 | <section class="shithub-pull-new-diff-section" aria-label="Files changed"> |
| 201 | <header class="shithub-pull-new-diff-head"> |
| 202 | <div> |
| 203 | <h2>Files changed</h2> |
| 204 | <p>Showing {{ .Stats.FileCount }} changed {{ pluralize .Stats.FileCount "file" "files" }} with {{ .Stats.CommitCount }} {{ pluralize .Stats.CommitCount "commit" "commits" }}.</p> |
| 205 | </div> |
| 206 | </header> |
| 207 | <div class="shithub-diff-body shithub-pull-new-diff-body"> |
| 208 | {{ safeHTML .DiffHTML }} |
| 209 | </div> |
| 210 | </section> |
| 211 | {{ end }} |
| 212 | {{ end }} |
| 213 | </div> |
| 214 | </section> |
| 215 | {{- end }} |