vole
Clone
Read only, no credentials:
https://rodent.software/vole.git
Write over SSH with a registered key:
git clone ssh://git@rodent.software:2222/vole.git
A free and open-source forge that lives in your Git repo.
Simplify the home page around the instance introduction
ff9870f1a26a17d54c21d411000a6c7d58ab5c0d · Keenan Nemetz · 1d ago · parent 6ce635a8
Simplify the home page around the instance introduction Drop the page header and its hero actions. The instance name and sign-in links already live in the top bar, and the introduction is the place to say what the forge is. Move New repository into the Repositories heading, where it sits with the list it creates. Remove the introduction card header and its in-page editor. The introduction is profile/README.md in the instance repository, so it is read and pushed like every other customization. The POST / handler and its editor code go with it; an instance admin without an instance repository still gets the setup hint.
server/web/templates/home.html +8−37
| @@ -1,17 +1,5 @@ | |||
| 1 | 1 | {{define "index"}} | |
| 2 | 2 | {{template "header" .}} | |
| 3 | <section class="hero"> | ||
| 4 | <div class="hero-main"> | ||
| 5 | <h1>{{.InstanceName}}</h1> | ||
| 6 | </div> | ||
| 7 | <div class="hero-actions"> | ||
| 8 | {{if and .InstanceAdmin .Cards}}<a class="button" href="/repos/new">{{icon "plus"}}New repository</a>{{end}} | ||
| 9 | {{if not .LoggedIn}} | ||
| 10 | <a class="button secondary" href="/login">{{icon "user"}}Sign in</a> | ||
| 11 | {{if .OpenRegistration}}<a class="button secondary" href="/register">{{icon "user"}}Create an account</a>{{end}} | ||
| 12 | {{end}} | ||
| 13 | </div> | ||
| 14 | </section> | ||
| 15 | 3 | ||
| 16 | 4 | {{if not .Query}}{{template "home_readme" .}}{{end}} | |
| 17 | 5 | ||
| @@ -20,7 +8,10 @@ | |||
| 20 | 8 | <section class="home-main"> | |
| 21 | 9 | <div class="section-head"> | |
| 22 | 10 | <h2>{{if .Query}}Results{{else}}Repositories{{end}}</h2> | |
| 23 | {{if .Query}}<a class="more" href="/">clear search</a>{{end}} | ||
| 11 | <div class="section-actions"> | ||
| 12 | {{if .Query}}<a class="more" href="/">clear search</a>{{end}} | ||
| 13 | {{if .InstanceAdmin}}<a class="button secondary" href="/repos/new">{{icon "plus"}}New repository</a>{{end}} | ||
| 14 | </div> | ||
| 24 | 15 | </div> | |
| 25 | 16 | <div class="repo-grid"> | |
| 26 | 17 | {{range .Cards}}{{template "repo_card" .}}{{end}} | |
| @@ -71,33 +62,13 @@ | |||
| 71 | 62 | {{end}} | |
| 72 | 63 | ||
| 73 | 64 | {{define "home_readme"}} | |
| 74 | {{if or .Intro .Editing .InstanceAdmin}} | ||
| 65 | {{if .Intro}} | ||
| 75 | 66 | <section class="panel readme-card" id="readme"> | |
| 76 | <div class="readme-head"> | ||
| 77 | <span class="readme-name">{{icon "book-open"}}Introduction</span> | ||
| 78 | {{if and .InstanceAdmin (not .Editing) .RepoReady}} | ||
| 79 | <a class="readme-edit" href="/?edit=1#readme" title="Edit the introduction" aria-label="Edit the introduction">{{icon "pencil"}}</a> | ||
| 80 | {{end}} | ||
| 81 | </div> | ||
| 82 | {{if .Editing}} | ||
| 83 | <form method="post" action="/" class="readme-form"> | ||
| 84 | <input type="hidden" name="csrf" value="{{.CSRF}}"> | ||
| 85 | <textarea name="intro" rows="14" maxlength="20000" placeholder="What this forge is for, who it belongs to, and how to get started.">{{.IntroText}}</textarea> | ||
| 86 | <span class="field-hint">Markdown. It is rendered and sanitized, and shown here on the home page.</span> | ||
| 87 | <div class="form-actions"> | ||
| 88 | <button type="submit">{{icon "check"}}Save</button> | ||
| 89 | <a class="button secondary" href="/">Cancel</a> | ||
| 90 | </div> | ||
| 91 | </form> | ||
| 92 | {{else if .Intro}} | ||
| 93 | 67 | <div class="md readme-body">{{.Intro}}</div> | |
| 94 | {{else if .RepoReady}} | ||
| 95 | <p class="readme-empty">This forge has no introduction yet. <a href="/?edit=1#readme">Write one</a> to tell people what it is for.</p> | ||
| 96 | {{else}} | ||
| 97 | <p class="readme-empty">This instance has no repository for customization yet. Create it on the | ||
| 98 | <a href="/admin?tab=configuration">Admin Configuration</a> page to customize this introduction, the styles, and the assets.</p> | ||
| 99 | {{end}} | ||
| 100 | 68 | </section> | |
| 69 | {{else if and .InstanceAdmin (not .RepoReady)}} | ||
| 70 | <p class="readme-empty">This instance has no repository for customization yet. Create it on the | ||
| 71 | <a href="/admin?tab=configuration">Admin Configuration</a> page to customize this introduction, the styles, and the assets.</p> | ||
| 101 | 72 | {{end}} | |
| 102 | 73 | {{end}} | |
| 103 | 74 | ||