| 1 | {{ define "page" -}} |
| 2 | <div class="shithub-settings-page"> |
| 3 | {{ template "repo-settings-nav" . }} |
| 4 | <div class="shithub-settings-content"> |
| 5 | <h1>General</h1> |
| 6 | {{ with .Notice }}<p class="shithub-flash shithub-flash-notice" role="status">{{ . }}</p>{{ end }} |
| 7 | {{ with .Error }}<p class="shithub-flash shithub-flash-error" role="alert">{{ . }}</p>{{ end }} |
| 8 | |
| 9 | <section class="shithub-settings-section"> |
| 10 | <h2>Repository details</h2> |
| 11 | <form method="POST" action="/{{ .Owner }}/{{ .Repo.Name }}/settings/general"> |
| 12 | <input type="hidden" name="csrf_token" value="{{ .CSRFToken }}"> |
| 13 | <label> |
| 14 | <span>Description</span> |
| 15 | <input type="text" name="description" maxlength="200" value="{{ .Repo.Description }}"> |
| 16 | </label> |
| 17 | <label> |
| 18 | <span>Topics</span> |
| 19 | <input type="text" name="topics" value="{{ .TopicsCSV }}" placeholder="go, postgres, web"> |
| 20 | <small>Comma-separated. Lowercase letters, digits, hyphens; max 20 topics, 50 chars each.</small> |
| 21 | </label> |
| 22 | <fieldset class="shithub-settings-fieldset"> |
| 23 | <legend>Features</legend> |
| 24 | <label class="shithub-settings-checkbox"> |
| 25 | <input type="checkbox" name="has_issues" {{ if .Repo.HasIssues }}checked{{ end }}> |
| 26 | <span>Issues</span> |
| 27 | </label> |
| 28 | <label class="shithub-settings-checkbox"> |
| 29 | <input type="checkbox" name="has_pulls" {{ if .Repo.HasPulls }}checked{{ end }}> |
| 30 | <span>Pull requests</span> |
| 31 | </label> |
| 32 | </fieldset> |
| 33 | <button type="submit" class="shithub-button shithub-button-primary">Save</button> |
| 34 | </form> |
| 35 | </section> |
| 36 | |
| 37 | <section class="shithub-settings-section"> |
| 38 | <h2>Source remote</h2> |
| 39 | <form method="POST" action="/{{ .Owner }}/{{ .Repo.Name }}/settings/source-remote"> |
| 40 | <input type="hidden" name="csrf_token" value="{{ .CSRFToken }}"> |
| 41 | <label> |
| 42 | <span>Public Git remote URL</span> |
| 43 | <input type="url" name="source_remote_url" maxlength="2048" placeholder="https://github.com/OWNER/REPO.git" value="{{ .SourceRemote.RemoteUrl }}"> |
| 44 | <small>Used to fetch this repository's upstream refs and to resolve pinned submodule commits.</small> |
| 45 | </label> |
| 46 | {{ if .SourceRemote.LastFetchedAt.Valid }} |
| 47 | <p class="shithub-muted">Last fetched <time datetime="{{ .SourceRemote.LastFetchedAt.Time.Format "2006-01-02T15:04:05Z" }}">{{ relativeTime .SourceRemote.LastFetchedAt.Time }}</time>.</p> |
| 48 | {{ end }} |
| 49 | {{ if .SourceRemote.LastError.Valid }} |
| 50 | <p class="shithub-flash shithub-flash-error" role="status">{{ .SourceRemote.LastError.String }}</p> |
| 51 | {{ end }} |
| 52 | <button type="submit" class="shithub-button shithub-button-primary">Save and fetch</button> |
| 53 | {{ if .SourceRemote.RemoteUrl }}<button type="submit" class="shithub-button" name="clear_source_remote" value="1">Clear</button>{{ end }} |
| 54 | </form> |
| 55 | </section> |
| 56 | |
| 57 | <section class="shithub-settings-section"> |
| 58 | <h2>Pull request merges</h2> |
| 59 | <form method="POST" action="/{{ .Owner }}/{{ .Repo.Name }}/settings/merges"> |
| 60 | <input type="hidden" name="csrf_token" value="{{ .CSRFToken }}"> |
| 61 | <fieldset class="shithub-settings-fieldset"> |
| 62 | <legend>Allowed merge methods</legend> |
| 63 | <label class="shithub-settings-checkbox"> |
| 64 | <input type="checkbox" name="allow_merge_commit" {{ if .Repo.AllowMergeCommit }}checked{{ end }}> |
| 65 | <span>Merge commit</span> |
| 66 | </label> |
| 67 | <label class="shithub-settings-checkbox"> |
| 68 | <input type="checkbox" name="allow_squash_merge" {{ if .Repo.AllowSquashMerge }}checked{{ end }}> |
| 69 | <span>Squash and merge</span> |
| 70 | </label> |
| 71 | <label class="shithub-settings-checkbox"> |
| 72 | <input type="checkbox" name="allow_rebase_merge" {{ if .Repo.AllowRebaseMerge }}checked{{ end }}> |
| 73 | <span>Rebase and merge</span> |
| 74 | </label> |
| 75 | </fieldset> |
| 76 | <label> |
| 77 | <span>Default merge method</span> |
| 78 | <select name="default_merge_method"> |
| 79 | <option value="merge" {{ if eq (printf "%s" .Repo.DefaultMergeMethod) "merge" }}selected{{ end }}>Merge commit</option> |
| 80 | <option value="squash" {{ if eq (printf "%s" .Repo.DefaultMergeMethod) "squash" }}selected{{ end }}>Squash and merge</option> |
| 81 | <option value="rebase" {{ if eq (printf "%s" .Repo.DefaultMergeMethod) "rebase" }}selected{{ end }}>Rebase and merge</option> |
| 82 | </select> |
| 83 | </label> |
| 84 | <button type="submit" class="shithub-button shithub-button-primary">Save</button> |
| 85 | </form> |
| 86 | </section> |
| 87 | </div> |
| 88 | </div> |
| 89 | {{- end }} |