Commit 28e72be7ab
Verified · cmc ci/build: success ci/quality: success ci/test: success
Changed files (16)
- internal/web/templates/accountdelete.html +3 −1
- internal/web/templates/blame.html +4 −1
- internal/web/templates/fork.html +24 −9
- internal/web/templates/landing.html +4 −4
- internal/web/templates/log.html +10 −7
- internal/web/templates/login.html +12 −6
- internal/web/templates/logout.html +3 −1
- internal/web/templates/mrrangediff.html +6 −2
- internal/web/templates/queries.html +14 −5
- internal/web/templates/register.html +8 −2
- internal/web/templates/registered.html +5 −1
- internal/web/templates/search.html +5 −1
- internal/web/templates/snippet.html +28 −17
- internal/web/templates/snippetnew.html +16 −10
- internal/web/templates/symbols.html +5 −1
- internal/web/templates/wiki.html +2 −2
internal/web/templates/accountdelete.html +3 −1 · view
| @@ -1,6 +1,7 @@ | ||
| 1 | 1 | {{define "width"}}bounded{{end}} |
| 2 | 2 | {{define "title"}}delete account · {{.Site}}{{end}} |
| 3 | 3 | {{define "content"}} |
| 4 | <section class="setcard setcard-danger"> | |
| 4 | 5 | {{if .Scheduled}} |
| 5 | 6 | <h1>Deletion scheduled</h1> |
| 6 | 7 | <p>{{.User}} is disabled and will be deleted at {{when .Scheduled}}.</p> |
| @@ -13,11 +14,12 @@ its repositories, snippets, keys and addresses go, and what it wrote on | ||
| 13 | 14 | other people's repositories stays under the name <code>ghost</code>. |
| 14 | 15 | Signing in during those seven days cancels.</p> |
| 15 | 16 | <form method="post"> |
| 16 | <p class="btngroup"><button type="submit" class="danger">Delete {{.User}}</button> <a href="/">Cancel</a></p> | |
| 17 | <p class="btngroup"><button type="submit" class="danger">Delete {{.User}}</button> <a class="button btn" href="/">Cancel</a></p> | |
| 17 | 18 | </form> |
| 18 | 19 | {{else}} |
| 19 | 20 | <h1>Link not valid</h1> |
| 20 | 21 | <p class="meta">This deletion link has expired or was already used. Nothing |
| 21 | 22 | has changed. Request a new one from <a href="/settings#delete">settings</a>.</p> |
| 22 | 23 | {{end}} |
| 24 | </section> | |
| 23 | 25 | {{end}} |
internal/web/templates/blame.html +4 −1 · view
| @@ -9,7 +9,10 @@ | ||
| 9 | 9 | <span class="refchip">{{template "branchicon"}} {{.Ref}}</span> |
| 10 | 10 | <span class="crumbs"><a href="/{{.Repo.OwnerName}}/{{.Repo.Name}}">{{.Repo.Name}}</a>/{{range .Crumbs}}<a href="{{.URL}}">{{.Name}}</a>/{{end}}<strong>{{.Base}}</strong></span> |
| 11 | 11 | <span class="spacer"></span> |
| 12 | <span class="actions"><a href="/{{.Repo.OwnerName}}/{{.Repo.Name}}/blob/{{.Ref}}/{{.Path}}">view</a> · <a href="/{{.Repo.OwnerName}}/{{.Repo.Name}}/raw/{{.Ref}}/{{.Path}}">raw</a></span> | |
| 12 | <div class="btngroup"> | |
| 13 | <a class="button btn" href="/{{.Repo.OwnerName}}/{{.Repo.Name}}/blob/{{.Ref}}/{{.Path}}">view</a> | |
| 14 | <a class="button btn" href="/{{.Repo.OwnerName}}/{{.Repo.Name}}/raw/{{.Ref}}/{{.Path}}">raw</a> | |
| 15 | </div> | |
| 13 | 16 | </div> |
| 14 | 17 | {{if .Binary}}<p class="empty-note">binary file — blame unavailable</p> |
| 15 | 18 | {{else}} |
internal/web/templates/fork.html +24 −9 · view
| @@ -1,18 +1,33 @@ | ||
| 1 | 1 | {{define "width"}}bounded{{end}} |
| 2 | 2 | {{define "title"}}fork {{.Repo.OwnerName}}/{{.Repo.Name}} · {{.Site}}{{end}} |
| 3 | 3 | {{define "content"}} |
| 4 | <h1>Fork {{.Repo.OwnerName}}/{{.Repo.Name}}</h1> | |
| 4 | <div class="pagehead"> | |
| 5 | <h1>Fork {{.Repo.OwnerName}}/{{.Repo.Name}}</h1> | |
| 6 | <span class="grow"></span> | |
| 7 | <a class="button btn" href="/{{.Repo.OwnerName}}/{{.Repo.Name}}">Back to repository</a> | |
| 8 | </div> | |
| 5 | 9 | {{if .Error}}<p class="error" role="alert">{{.Error}}</p>{{end}} |
| 10 | <section class="setcard"> | |
| 6 | 11 | <p class="meta">A fork is a copy of every branch, owned by you or by an |
| 7 | 12 | organization you administer. Its issues, merge requests and settings are its |
| 8 | 13 | own.</p> |
| 9 | <form method="post" action="/{{.Repo.OwnerName}}/{{.Repo.Name}}/fork"> | |
| 10 | <p><label>Owner <select name="owner"> | |
| 11 | <option value="{{.Viewer}}">{{.Viewer}}</option> | |
| 12 | {{range .Orgs}}<option value="{{.}}"{{if eq . $.Owner}} selected{{end}}>{{.}}</option>{{end}} | |
| 13 | </select></label> | |
| 14 | <label>/ Name <input name="name" required maxlength="63" pattern="[a-z0-9][a-z0-9._\-]{0,62}" value="{{.Name}}" aria-describedby="forkhint" autocomplete="off" spellcheck="false"></label> | |
| 15 | <span class="hint" id="forkhint">Defaults to the source name; change it to fork twice into the same owner.</span></p> | |
| 16 | <p><button type="submit">Create fork</button></p> | |
| 14 | <form method="post" action="/{{.Repo.OwnerName}}/{{.Repo.Name}}/fork" class="setform stack"> | |
| 15 | <div class="ownername"> | |
| 16 | <div class="ownerpick"> | |
| 17 | <label for="fork-owner">Owner</label> | |
| 18 | <select id="fork-owner" name="owner"> | |
| 19 | <option value="{{.Viewer}}">{{.Viewer}}</option> | |
| 20 | {{range .Orgs}}<option value="{{.}}"{{if eq . $.Owner}} selected{{end}}>{{.}}</option>{{end}} | |
| 21 | </select> | |
| 22 | </div> | |
| 23 | <span class="slash" aria-hidden="true">/</span> | |
| 24 | <div class="namepick"> | |
| 25 | <label for="fork-name">Repository name</label> | |
| 26 | <input id="fork-name" name="name" required maxlength="63" pattern="[a-z0-9][a-z0-9._\-]{0,62}" value="{{.Name}}" aria-describedby="forkhint" autocomplete="off" spellcheck="false"> | |
| 27 | </div> | |
| 28 | </div> | |
| 29 | <p class="hint" id="forkhint">Defaults to the source name; change it to fork twice into the same owner.</p> | |
| 30 | <span class="btngroup"><button type="submit">Create fork</button></span> | |
| 17 | 31 | </form> |
| 32 | </section> | |
| 18 | 33 | {{end}} |
internal/web/templates/landing.html +4 −4 · view
| @@ -4,7 +4,7 @@ | ||
| 4 | 4 | <div class="landing"> |
| 5 | 5 | <h1>{{template "mark"}}{{.Site}}</h1> |
| 6 | 6 | <p class="lede">A git forge you drive from the terminal. Repositories, issues, merge requests and CI over SSH, with a fast, readable web view of the same state.</p> |
| 7 | <pre class="quickstart" tabindex="0">ssh git@{{.Host}} help | |
| 7 | <pre class="quickstart copyable" tabindex="0">ssh git@{{.Host}} help | |
| 8 | 8 | git clone ssh://git@{{.Host}}/owner/repo.git</pre> |
| 9 | 9 | <div class="routes"><a class="button primary" href="/explore">Explore repositories</a>{{if .Signup}}<a class="button btn" href="/register">Create an account</a>{{end}}</div> |
| 10 | 10 | <figure class="shot"><video autoplay muted loop playsinline controls width="1248" height="688" aria-describedby="demo-caption"> |
| @@ -14,9 +14,9 @@ git clone ssh://git@{{.Host}}/owner/repo.git</pre> | ||
| 14 | 14 | <figcaption id="demo-caption">Signup to release on gitbay.org from a terminal: register an SSH key, verify the mailed code, create a repository and push, file an issue, open and merge a request that closes it, then tag and publish a release.</figcaption> |
| 15 | 15 | </figure> |
| 16 | 16 | <div class="facets"> |
| 17 | <section><h2>Read</h2><p>Browse and clone any public repository over HTTPS or <code>git://</code>, no account. Every commit shows whether its signature verified.</p></section> | |
| 18 | <section><h2>Write</h2><p>Push over SSH with the key you already have. Create a repository, file an issue, open and merge a request, all as commands.</p></section> | |
| 19 | <section><h2>Review</h2><p>Read a diff, comment on a line, approve, merge, in the browser or the terminal.</p></section> | |
| 17 | <section class="setcard"><h2>Read</h2><p>Browse and clone any public repository over HTTPS or <code>git://</code>, no account. Every commit shows whether its signature verified.</p></section> | |
| 18 | <section class="setcard"><h2>Write</h2><p>Push over SSH with the key you already have. Create a repository, file an issue, open and merge a request, all as commands.</p></section> | |
| 19 | <section class="setcard"><h2>Review</h2><p>Read a diff, comment on a line, approve, merge, in the browser or the terminal.</p></section> | |
| 20 | 20 | </div> |
| 21 | 21 | {{if .Accounts}}<p class="meta">Have an account? {{if .EmailLogin}}<a href="/login">Sign in with an emailed link</a>, or run{{else}}Run{{end}} <code>ssh git@{{.Host}} web login</code>.</p>{{end}} |
| 22 | 22 | </div> |
internal/web/templates/log.html +10 −7 · view
| @@ -1,13 +1,16 @@ | ||
| 1 | 1 | {{define "width"}}wide{{end}} |
| 2 | 2 | {{define "title"}}log · {{.Repo.OwnerName}}/{{.Repo.Name}}{{end}} |
| 3 | 3 | {{define "content"}} |
| 4 | <h1 class="vh">Commits</h1> | |
| 5 | <form method="get" class="logfilter" action="/{{.Repo.OwnerName}}/{{.Repo.Name}}/log/{{.Ref}}"> | |
| 6 | <label for="path">Path</label> | |
| 7 | <input type="text" id="path" name="path" value="{{.FilePath}}" placeholder="filter to a file or directory"> | |
| 8 | <button type="submit" class="btn">Filter</button> | |
| 9 | {{if .FilePath}}<a class="act" href="/{{.Repo.OwnerName}}/{{.Repo.Name}}/log/{{.Ref}}">Clear</a>{{end}} | |
| 10 | </form> | |
| 4 | <div class="pagehead"> | |
| 5 | <h1>Commits <span class="refchip">{{.Ref}}</span></h1> | |
| 6 | <span class="grow"></span> | |
| 7 | <form method="get" class="logfilter" action="/{{.Repo.OwnerName}}/{{.Repo.Name}}/log/{{.Ref}}"> | |
| 8 | <label for="path" class="vh">Path</label> | |
| 9 | <input type="text" id="path" name="path" value="{{.FilePath}}" placeholder="filter to a file or directory"> | |
| 10 | <button type="submit" class="btn">Filter</button> | |
| 11 | {{if .FilePath}}<a class="button btn" href="/{{.Repo.OwnerName}}/{{.Repo.Name}}/log/{{.Ref}}">Clear</a>{{end}} | |
| 12 | </form> | |
| 13 | </div> | |
| 11 | 14 | {{if .FilePath}}<p class="meta">history of <a href="/{{.Repo.OwnerName}}/{{.Repo.Name}}/blob/{{.Ref}}/{{.FilePath}}"><code>{{.FilePath}}</code></a></p>{{end}} |
| 12 | 15 | <ul class="loglist"> |
| 13 | 16 | {{range .Commits}}{{$c := .}}<li> |
internal/web/templates/login.html +12 −6 · view
| @@ -1,9 +1,12 @@ | ||
| 1 | 1 | {{define "width"}}bounded{{end}} |
| 2 | 2 | {{define "title"}}login · {{.Site}}{{end}} |
| 3 | 3 | {{define "content"}} |
| 4 | <h1>Sign in</h1> | |
| 4 | <div class="pagehead"> | |
| 5 | <h1>Sign in</h1> | |
| 6 | </div> | |
| 5 | 7 | {{if .Next}}<p class="meta">Sign in to continue to <code>{{.Next}}</code>.</p>{{end}} |
| 6 | 8 | {{if .Error}}<p class="error" role="alert">{{.Error}}</p>{{end}} |
| 9 | <section class="setcard"> | |
| 7 | 10 | {{if .Sent}} |
| 8 | 11 | <p>If that account exists, a login link is on its way. It works once and |
| 9 | 12 | expires in fifteen minutes.</p> |
| @@ -14,21 +17,24 @@ expires in fifteen minutes.</p> | ||
| 14 | 17 | <input type="text" id="identifier" name="identifier" autocomplete="username" autocapitalize="none" spellcheck="false" required></div> |
| 15 | 18 | <button type="submit">Email me a link</button> |
| 16 | 19 | </form> |
| 17 | <p>Or, from a machine with your registered key:</p> | |
| 20 | <p class="meta">Or, from a machine with your registered key:</p> | |
| 18 | 21 | {{else}} |
| 19 | 22 | <p>Browser sessions are minted over SSH — there is no password. From a machine |
| 20 | 23 | with your registered key:</p> |
| 21 | 24 | {{end}} |
| 22 | <pre class="message" tabindex="0">ssh git@{{.Host}} web login</pre> | |
| 23 | <p>then open the printed URL within five minutes.</p> | |
| 25 | <pre class="message copyable" tabindex="0">ssh git@{{.Host}} web login</pre> | |
| 26 | <p class="meta">Then open the printed URL within five minutes.</p> | |
| 24 | 27 | {{end}} |
| 28 | </section> | |
| 29 | <section class="setcard"> | |
| 25 | 30 | <h2>New here?</h2> |
| 26 | 31 | {{if eq .Mode "open"}}<p><a href="/register">Create an account</a> — pick a username, paste your SSH |
| 27 | 32 | public key, verify your email. Or from the terminal:</p> |
| 28 | <pre class="message" tabindex="0">ssh git@{{.Host}} register --username you --email you@example.org</pre> | |
| 33 | <pre class="message copyable" tabindex="0">ssh git@{{.Host}} register --username you --email you@example.org</pre> | |
| 29 | 34 | {{else if eq .Mode "invite"}}<p>This instance is invite-only. With a code from an admin, |
| 30 | 35 | <a href="/register">create an account</a> — pick a username, paste your SSH public key. Or from |
| 31 | 36 | the terminal:</p> |
| 32 | <pre class="message" tabindex="0">ssh git@{{.Host}} register --username you --invite <code></pre> | |
| 37 | <pre class="message copyable" tabindex="0">ssh git@{{.Host}} register --username you --invite <code></pre> | |
| 33 | 38 | {{else}}<p>This instance is not accepting new accounts.</p>{{end}} |
| 39 | </section> | |
| 34 | 40 | {{end}} |
internal/web/templates/logout.html +3 −1 · view
| @@ -1,9 +1,11 @@ | ||
| 1 | 1 | {{define "width"}}bounded{{end}} |
| 2 | 2 | {{define "title"}}log out · {{.Site}}{{end}} |
| 3 | 3 | {{define "content"}} |
| 4 | <section class="setcard"> | |
| 4 | 5 | <h1>Log out</h1> |
| 5 | 6 | <p class="meta">Ends this browser's session as <a href="/{{.Viewer}}">{{.Viewer}}</a>. Keys and tokens are untouched.</p> |
| 6 | 7 | <form method="post" action="/logout"> |
| 7 | <p class="btngroup"><button type="submit" class="danger">Log out</button> <a href="/">Cancel</a></p> | |
| 8 | <p class="btngroup"><button type="submit" class="danger">Log out</button> <a class="button btn" href="/">Cancel</a></p> | |
| 8 | 9 | </form> |
| 10 | </section> | |
| 9 | 11 | {{end}} |
internal/web/templates/mrrangediff.html +6 −2 · view
| @@ -1,8 +1,12 @@ | ||
| 1 | 1 | {{define "width"}}wide{{end}} |
| 2 | 2 | {{define "title"}}range-diff · !{{.MR.Number}} · {{.Repo.OwnerName}}/{{.Repo.Name}}{{end}} |
| 3 | 3 | {{define "content"}} |
| 4 | <h1>Range-diff <span class="issuenumber">!{{.MR.Number}}</span></h1> | |
| 5 | <p class="meta"><a href="/{{.Repo.OwnerName}}/{{.Repo.Name}}/mrs/{{.MR.Number}}">back to !{{.MR.Number}} {{.MR.Title}}</a></p> | |
| 4 | <div class="pagehead"> | |
| 5 | <h1>Range-diff <span class="issuenumber">!{{.MR.Number}}</span></h1> | |
| 6 | <span class="grow"></span> | |
| 7 | <a class="button btn" href="/{{.Repo.OwnerName}}/{{.Repo.Name}}/mrs/{{.MR.Number}}">Back to !{{.MR.Number}}</a> | |
| 8 | </div> | |
| 9 | <p class="meta">{{.MR.Title}}</p> | |
| 6 | 10 | {{if .Error}}<p class="error" role="alert">{{.Error}}</p> |
| 7 | 11 | {{else if .Diff}}<pre class="code buildlog" tabindex="0">{{.Diff}}</pre> |
| 8 | 12 | {{else}}<p class="empty-note">Nothing to compare: this merge request has one revision.</p>{{end}} |
internal/web/templates/queries.html +14 −5 · view
| @@ -2,10 +2,14 @@ | ||
| 2 | 2 | {{define "title"}}{{if .Query.Name}}{{.Query.Name}} · {{end}}queries · {{.Site}}{{end}} |
| 3 | 3 | {{define "content"}} |
| 4 | 4 | {{if .Query.Name}} |
| 5 | <div class="listhead"> | |
| 5 | <div id="query-root"> | |
| 6 | <div class="pagehead"> | |
| 6 | 7 | <h1>{{.Query.Name}} <span class="count">{{.Count}}</span></h1> |
| 7 | <span class="spacer"></span> | |
| 8 | <p class="meta"><a href="/{{.Viewer}}/-/queries">saved queries</a></p> | |
| 8 | <span class="grow"></span> | |
| 9 | <div class="btngroup"> | |
| 10 | <button type="button" class="btn" data-refresh="self" data-refresh-target="query-root">Refresh</button> | |
| 11 | <a class="button btn" href="/{{.Viewer}}/-/queries">Saved queries</a> | |
| 12 | </div> | |
| 9 | 13 | </div> |
| 10 | 14 | <p class="meta"><code>{{.Query.Query}}</code> · the same read as <code>gitbay query run {{.Query.Name}}</code></p> |
| 11 | 15 | <ul class="issuelist rows"> |
| @@ -19,10 +23,15 @@ | ||
| 19 | 23 | {{else}}<li class="empty">nothing matches</li>{{end}} |
| 20 | 24 | </ul> |
| 21 | 25 | {{if .Next}}<p class="pager"><a href="{{.Next}}">older →</a></p>{{end}} |
| 26 | </div> | |
| 22 | 27 | {{else}} |
| 23 | <h1>Saved queries</h1> | |
| 28 | <div class="pagehead"> | |
| 29 | <h1>Saved queries</h1> | |
| 30 | <span class="grow"></span> | |
| 31 | {{if .Saved}}<input type="search" class="tablefilter" placeholder="Filter queries…" aria-label="Filter queries" data-filter-list="saved-queries">{{end}} | |
| 32 | </div> | |
| 24 | 33 | <p class="meta">Saved with <code>gitbay query save <name> <query></code>; <code>gitbay query pin <name></code> puts one on the dashboard.</p> |
| 25 | <ul class="issuelist rows"> | |
| 34 | <ul class="issuelist rows" id="saved-queries"> | |
| 26 | 35 | {{range .Saved}}<li> |
| 27 | 36 | <div class="issuemain"> |
| 28 | 37 | <p class="title"><a href="/{{$.Viewer}}/-/queries/{{.Name}}">{{.Name}}</a>{{if .Pinned}} <span class="chip">pinned</span>{{end}}</p> |
internal/web/templates/register.html +8 −2 · view
| @@ -1,10 +1,15 @@ | ||
| 1 | 1 | {{define "title"}}register · {{.Site}}{{end}} |
| 2 | 2 | {{define "width"}}bounded{{end}} |
| 3 | 3 | {{define "content"}} |
| 4 | <h1>Create an account</h1> | |
| 4 | <div class="pagehead"> | |
| 5 | <h1>Create an account</h1> | |
| 6 | <span class="grow"></span> | |
| 7 | <a class="button btn" href="/login">Sign in</a> | |
| 8 | </div> | |
| 5 | 9 | {{if eq .Mode "invite"}}<p class="lede">This instance is invite-only. You need an invite code from an admin.</p> |
| 6 | 10 | {{else}}<p class="lede">Open registration. Your account activates once you verify your email.</p>{{end}} |
| 7 | 11 | {{if .Error}}<p class="error" role="alert">{{.Error}}</p>{{end}} |
| 12 | <section class="setcard"> | |
| 8 | 13 | <form method="post" action="/register" class="signupform"> |
| 9 | 14 | <div class="field"><label for="username">Username</label><input type="text" id="username" name="username" value="{{.Username}}" required autocomplete="username" autocapitalize="none" spellcheck="false"></div> |
| 10 | 15 | {{if eq .Mode "invite"}}<div class="field"><label for="invite">Invite code</label><input type="text" id="invite" name="invite" required autocomplete="off" spellcheck="false"></div> |
| @@ -16,11 +21,12 @@ | ||
| 16 | 21 | back to it. */}} |
| 17 | 22 | <details class="editbox"><summary>No key yet?</summary> |
| 18 | 23 | <p class="meta">Run this, take the default path, and paste what the second line prints.</p> |
| 19 | <pre class="code" tabindex="0">ssh-keygen -t ed25519 | |
| 24 | <pre class="code copyable" tabindex="0">ssh-keygen -t ed25519 | |
| 20 | 25 | cat ~/.ssh/id_ed25519.pub</pre> |
| 21 | 26 | </details> |
| 22 | 27 | <textarea id="key" name="key" rows="3" required spellcheck="false" placeholder="ssh-ed25519 AAAA… you@host"></textarea></div> |
| 23 | 28 | <p><button type="submit">Create account</button></p> |
| 24 | 29 | </form> |
| 30 | </section> | |
| 25 | 31 | <p class="meta">Prefer the terminal? <code>ssh git@{{.Host}} register --username you {{if eq .Mode "invite"}}--invite <code>{{else}}--email you@example.org{{end}}</code></p> |
| 26 | 32 | {{end}} |
internal/web/templates/registered.html +5 −1 · view
| @@ -4,6 +4,7 @@ | ||
| 4 | 4 | <div class="landing"> |
| 5 | 5 | <h1>Welcome, {{.Username}}</h1> |
| 6 | 6 | <pre class="quickstart" tabindex="0">{{.Message}}</pre> |
| 7 | <section class="setcard"> | |
| 7 | 8 | <h2>On the web</h2> |
| 8 | 9 | <ol> |
| 9 | 10 | <li>Copy the verification code from the mail you were just sent.</li> |
| @@ -12,9 +13,12 @@ | ||
| 12 | 13 | </ol> |
| 13 | 14 | <p>Then + creates your first repository. Using the iOS app? Create a |
| 14 | 15 | token in <a href="/settings#tokens">Settings → API tokens</a>.</p> |
| 16 | </section> | |
| 17 | <section class="setcard"> | |
| 15 | 18 | <h2>From the terminal</h2> |
| 16 | <pre class="quickstart" tabindex="0">ssh git@{{.Host}} whoami | |
| 19 | <pre class="quickstart copyable" tabindex="0">ssh git@{{.Host}} whoami | |
| 17 | 20 | ssh git@{{.Host}} repo create {{.Username}}/hello |
| 18 | 21 | gitbay web login # mints a browser session from your terminal</pre> |
| 22 | </section> | |
| 19 | 23 | </div> |
| 20 | 24 | {{end}} |
internal/web/templates/search.html +5 −1 · view
| @@ -1,7 +1,11 @@ | ||
| 1 | 1 | {{define "width"}}wide{{end}} |
| 2 | 2 | {{define "title"}}search · {{.Repo.OwnerName}}/{{.Repo.Name}}{{end}} |
| 3 | 3 | {{define "content"}} |
| 4 | <h1>Search</h1> | |
| 4 | <div class="pagehead"> | |
| 5 | <h1>Search code</h1> | |
| 6 | <span class="grow"></span> | |
| 7 | <a class="button btn" href="/{{.Repo.OwnerName}}/{{.Repo.Name}}/symbols">Symbols</a> | |
| 8 | </div> | |
| 5 | 9 | <form method="get" action="/{{.Repo.OwnerName}}/{{.Repo.Name}}/search" class="searchform"> |
| 6 | 10 | <input type="search" name="q" aria-label="Search file contents" value="{{.Query}}" placeholder="search file contents on {{.Ref}}"> |
| 7 | 11 | <button type="submit" class="btn">Search</button> |
internal/web/templates/snippet.html +28 −17 · view
| @@ -1,47 +1,58 @@ | ||
| 1 | 1 | {{define "title"}}{{if .Snippet.Description}}{{.Snippet.Description}}{{else}}{{.Snippet.PublicID}}{{end}} · {{.Owner}}{{end}} |
| 2 | 2 | {{define "content"}} |
| 3 | <h1><a href="/{{.Owner}}">{{.Owner}}</a> / <a href="/{{.Owner}}/-/snippets">snippets</a> / {{.Snippet.PublicID}}</h1> | |
| 3 | <div class="pagehead"> | |
| 4 | <h1><a href="/{{.Owner}}">{{.Owner}}</a> / <a href="/{{.Owner}}/-/snippets">snippets</a> / {{.Snippet.PublicID}}</h1> | |
| 5 | <span class="grow"></span> | |
| 6 | <button type="button" class="btn" data-copy="gitbay snippet show {{.Snippet.PublicID}}">Copy CLI</button> | |
| 7 | </div> | |
| 4 | 8 | {{if .Snippet.Description}}<p class="desc lede">{{.Snippet.Description}}</p>{{end}} |
| 5 | 9 | <p class="meta"><span class="chip chip-neutral">{{.Snippet.Visibility}}</span> · updated {{when .Snippet.UpdatedAt}} · <code>gitbay snippet show {{.Snippet.PublicID}}</code></p> |
| 6 | 10 | {{if .Notice}}<p class="error" role="alert">{{.Notice}}</p>{{end}} |
| 7 | 11 | {{range .Files}} |
| 8 | <section class="snippetfile" id="file-{{.Name}}"> | |
| 12 | <section class="snippetfile setcard" id="file-{{.Name}}"> | |
| 9 | 13 | <div class="pathbar"> |
| 10 | 14 | <span class="crumbs"><strong>{{.Name}}</strong></span> |
| 11 | 15 | <span class="spacer"></span> |
| 12 | <span class="actions"><a href="/{{$.Owner}}/-/snippets/{{$.Snippet.PublicID}}/raw/{{.Name}}">raw</a></span> | |
| 16 | <div class="btngroup"> | |
| 17 | <a class="button btn" href="/{{$.Owner}}/-/snippets/{{$.Snippet.PublicID}}/raw/{{.Name}}">raw</a> | |
| 18 | {{if $.CanWrite}}<details class="popover"><summary class="popbtn popbtn-danger">Remove</summary><div class="popmenu"> | |
| 19 | <form method="post" action="/{{$.Owner}}/-/snippets/{{$.Snippet.PublicID}}/file/remove" class="popform popform-stack"> | |
| 20 | <input type="hidden" name="name" value="{{.Name}}"> | |
| 21 | {{template "confirmfield" .Name}} | |
| 22 | <button type="submit" class="danger">Remove {{.Name}}</button> | |
| 23 | </form> | |
| 24 | </div></details>{{end}} | |
| 25 | </div> | |
| 13 | 26 | </div> |
| 14 | 27 | <p class="filefacts">{{.Lines}} lines · {{.Size}} bytes</p> |
| 15 | 28 | {{if .TooLarge}}<p class="empty-note">too large to render here — <a href="/{{$.Owner}}/-/snippets/{{$.Snippet.PublicID}}/raw/{{.Name}}">raw</a></p>{{else}}<div class="code">{{.HTML}}</div>{{end}} |
| 16 | {{if $.CanWrite}}<details class="editbox"><summary>edit {{.Name}}</summary> | |
| 29 | {{if $.CanWrite}}<details class="editbox"><summary>Edit {{.Name}}</summary> | |
| 17 | 30 | <form method="post" action="/{{$.Owner}}/-/snippets/{{$.Snippet.PublicID}}/file" class="commentform"> |
| 18 | 31 | <input type="hidden" name="name" value="{{.Name}}"> |
| 19 | 32 | <p><textarea name="content" aria-label="Content of {{.Name}}" rows="12">{{.Content}}</textarea></p> |
| 20 | <p><button type="submit" class="btn">Save</button></p> | |
| 21 | </form> | |
| 22 | <form method="post" action="/{{$.Owner}}/-/snippets/{{$.Snippet.PublicID}}/file/remove"> | |
| 23 | <input type="hidden" name="name" value="{{.Name}}"> | |
| 24 | <p>{{template "confirmfield" .Name}} <button type="submit" class="danger">Remove {{.Name}}</button></p> | |
| 33 | <p class="btngroup"><button type="submit">Save</button> <span class="meta">⌘↵ to save</span></p> | |
| 25 | 34 | </form> |
| 26 | 35 | </details>{{end}} |
| 27 | 36 | </section> |
| 28 | 37 | {{end}} |
| 29 | 38 | {{if .CanWrite}} |
| 30 | <details class="editbox"><summary>add a file</summary> | |
| 39 | <details class="editbox"><summary>Add a file</summary> | |
| 31 | 40 | <form method="post" action="/{{.Owner}}/-/snippets/{{.Snippet.PublicID}}/file" class="commentform"> |
| 32 | 41 | <p><input type="text" name="name" aria-label="File name" placeholder="filename" required autocomplete="off" spellcheck="false"></p> |
| 33 | 42 | <p><textarea name="content" aria-label="Content" rows="12" required></textarea></p> |
| 34 | <p><button type="submit" class="btn">Add file</button></p> | |
| 43 | <p><button type="submit">Add file</button></p> | |
| 35 | 44 | </form></details> |
| 36 | <details class="editbox"><summary>settings</summary> | |
| 37 | <form method="post" action="/{{.Owner}}/-/snippets/{{.Snippet.PublicID}}/edit"> | |
| 38 | <p><input type="text" name="description" aria-label="Description" value="{{.Snippet.Description}}" placeholder="description"></p> | |
| 39 | <p><select name="visibility" aria-label="Visibility"> | |
| 45 | <details class="editbox"><summary>Settings</summary> | |
| 46 | <form method="post" action="/{{.Owner}}/-/snippets/{{.Snippet.PublicID}}/edit" class="setform stack"> | |
| 47 | <label for="snip-desc">Description</label> | |
| 48 | <input type="text" id="snip-desc" name="description" aria-label="Description" value="{{.Snippet.Description}}" placeholder="description"> | |
| 49 | <label for="snip-vis">Visibility</label> | |
| 50 | <select id="snip-vis" name="visibility" aria-label="Visibility"> | |
| 40 | 51 | <option value="public"{{if eq .Snippet.Visibility "public"}} selected{{end}}>public</option> |
| 41 | 52 | <option value="unlisted"{{if eq .Snippet.Visibility "unlisted"}} selected{{end}}>unlisted</option> |
| 42 | 53 | <option value="private"{{if eq .Snippet.Visibility "private"}} selected{{end}}>private</option> |
| 43 | </select></p> | |
| 44 | <p><button type="submit" class="btn">Save</button></p> | |
| 54 | </select> | |
| 55 | <span class="btngroup"><button type="submit">Save</button></span> | |
| 45 | 56 | </form> |
| 46 | 57 | <form method="post" action="/{{.Owner}}/-/snippets/{{.Snippet.PublicID}}/delete"> |
| 47 | 58 | <p>{{template "confirmfield" .Snippet.PublicID}} <button type="submit" class="danger">Delete snippet</button></p> |
internal/web/templates/snippetnew.html +16 −10 · view
| @@ -1,17 +1,23 @@ | ||
| 1 | 1 | {{define "width"}}bounded{{end}} |
| 2 | 2 | {{define "title"}}new snippet · {{.Owner}}{{end}} |
| 3 | 3 | {{define "content"}} |
| 4 | <h1>New snippet</h1> | |
| 4 | <div class="pagehead"> | |
| 5 | <h1>New snippet</h1> | |
| 6 | <span class="grow"></span> | |
| 7 | <a class="button btn" href="/{{.Owner}}/-/snippets">Back to snippets</a> | |
| 8 | </div> | |
| 5 | 9 | {{if .Error}}<p class="error" role="alert">{{.Error}}</p>{{end}} |
| 10 | <section class="setcard"> | |
| 6 | 11 | <form method="post" action="/{{.Owner}}/-/snippets/new" class="commentform"> |
| 7 | <p><input type="text" name="name" aria-label="File name" placeholder="filename" value="{{.Name}}" required autocomplete="off" spellcheck="false"></p> | |
| 8 | <p><input type="text" name="description" aria-label="Description" placeholder="description" value="{{.Description}}"></p> | |
| 9 | <p><select name="visibility" aria-label="Visibility"> | |
| 10 | <option value="unlisted"{{if or (eq .Visibility "unlisted") (eq .Visibility "")}} selected{{end}}>unlisted</option> | |
| 11 | <option value="public"{{if eq .Visibility "public"}} selected{{end}}>public</option> | |
| 12 | <option value="private"{{if eq .Visibility "private"}} selected{{end}}>private</option> | |
| 13 | </select></p> | |
| 14 | <p><textarea name="content" aria-label="Content" rows="16" required>{{.Content}}</textarea></p> | |
| 15 | <p><button type="submit">Create snippet</button></p> | |
| 12 | <p><input type="text" name="name" aria-label="File name" placeholder="filename" value="{{.Name}}" required autocomplete="off" spellcheck="false"></p> | |
| 13 | <p><input type="text" name="description" aria-label="Description" placeholder="description" value="{{.Description}}"></p> | |
| 14 | <p><select name="visibility" aria-label="Visibility"> | |
| 15 | <option value="unlisted"{{if or (eq .Visibility "unlisted") (eq .Visibility "")}} selected{{end}}>unlisted</option> | |
| 16 | <option value="public"{{if eq .Visibility "public"}} selected{{end}}>public</option> | |
| 17 | <option value="private"{{if eq .Visibility "private"}} selected{{end}}>private</option> | |
| 18 | </select></p> | |
| 19 | <p><textarea name="content" aria-label="Content" rows="16" required>{{.Content}}</textarea></p> | |
| 20 | <p class="btngroup"><button type="submit">Create snippet</button> <span class="meta">⌘↵ to create</span></p> | |
| 16 | 21 | </form> |
| 22 | </section> | |
| 17 | 23 | {{end}} |
internal/web/templates/symbols.html +5 −1 · view
| @@ -1,7 +1,11 @@ | ||
| 1 | 1 | {{define "width"}}wide{{end}} |
| 2 | 2 | {{define "title"}}symbols · {{.Repo.OwnerName}}/{{.Repo.Name}}{{end}} |
| 3 | 3 | {{define "content"}} |
| 4 | <h1>Symbols</h1> | |
| 4 | <div class="pagehead"> | |
| 5 | <h1>Symbols</h1> | |
| 6 | <span class="grow"></span> | |
| 7 | <a class="button btn" href="/{{.Repo.OwnerName}}/{{.Repo.Name}}/search">Search code</a> | |
| 8 | </div> | |
| 5 | 9 | <form method="get" action="/{{.Repo.OwnerName}}/{{.Repo.Name}}/symbols" class="searchform"> |
| 6 | 10 | <input type="search" name="q" aria-label="Find a definition" value="{{.Query}}" placeholder="a name or its start, on {{.Repo.DefaultBranch}}"> |
| 7 | 11 | <select name="kind" aria-label="Kind"> |
internal/web/templates/wiki.html +2 −2 · view
| @@ -11,8 +11,8 @@ push <code>.gitbay/wiki/Home.md</code> (or .org).</p> | ||
| 11 | 11 | <div class="rendered">{{.PageHTML}}</div> |
| 12 | 12 | </section> |
| 13 | 13 | </div> |
| 14 | <nav class="wikinav"> | |
| 15 | <p class="meta">pages</p> | |
| 14 | <nav class="wikinav setcard"> | |
| 15 | <h2 class="colhead">Pages</h2> | |
| 16 | 16 | {{range .Nav}}{{if .Dir}}<p class="meta wikidir">{{.Dir}}</p>{{end}} |
| 17 | 17 | <ul>{{range .Pages}}<li><a {{if eq .Name $.Page}}class="active" {{end}}href="/{{$.Repo.OwnerName}}/{{$.Repo.Name}}/wiki/{{.Name}}">{{.Label}}</a></li>{{end}}</ul>{{end}} |
| 18 | 18 | <p class="meta">edit under <code>.gitbay/wiki/</code> by push.</p> |