feat(basin): sourcehut event markup for repo lists
4 files changed, +8 −10
- static/style.css modified +5 −7
- templates/index.html modified +1 −1
- templates/log.html modified +1 −1
- templates/user.html modified +1 −1
static/style.css modified
| @@ -59,11 +59,10 @@ main{padding-bottom:3rem} | ||
| 59 | 59 | .btn.primary{background:var(--primary);color:#fff;border-color:var(--primary)} |
| 60 | 60 | .btn.primary:hover{background:#0535bd} |
| 61 | 61 | .btn.danger{background:#fff;color:var(--del);border-color:var(--del)} |
| 62 | -.repos{display:flex;flex-direction:column;gap:.5rem} | |
| 63 | -.repo{border:1px solid var(--line);background:#fff;padding:.2rem .6rem .3rem;line-height:1.4} | |
| 64 | -.repo>a{display:block;font-size:1rem} | |
| 65 | -.repo>div{font-size:.92rem} | |
| 66 | -.repo .tag{margin-left:.3rem} | |
| 62 | +.events .event{background:var(--soft);padding:.25rem .5rem .4rem;margin-bottom:.6rem;border-bottom:0} | |
| 63 | +.event h4{font-size:1rem;font-weight:400;margin:0 0 .2rem;padding-bottom:.15rem;border-bottom:1px solid var(--line)} | |
| 64 | +.event h4 a{color:var(--link)} | |
| 65 | +.event p{margin:0;font-size:.95rem} | |
| 67 | 66 | .columns{display:grid;grid-template-columns:minmax(0,1fr) 18rem;gap:2.5rem;align-items:start} |
| 68 | 67 | .columns.user{grid-template-columns:280px minmax(0,1fr);gap:2rem} |
| 69 | 68 | .userhead{display:flex;align-items:flex-end;gap:1.2rem;border-bottom:1px solid var(--bar);margin:-1rem 0 1rem;padding:0} |
| @@ -87,8 +86,7 @@ dl.clone dd{margin:0 0 .4rem;overflow-wrap:anywhere} | ||
| 87 | 86 | dl.meta{display:grid;grid-template-columns:6em 1fr;gap:.15rem .5rem;margin:0 0 .8rem} |
| 88 | 87 | dl.meta dt{color:var(--muted)} |
| 89 | 88 | dl.meta dd{margin:0;overflow-wrap:anywhere} |
| 90 | -.events{display:flex;flex-direction:column} | |
| 91 | -.event{padding:.5rem 0;border-bottom:1px solid var(--line)} | |
| 89 | +.log .event{padding:.5rem 0;border-bottom:1px solid var(--line)} | |
| 92 | 90 | .event .subject{color:var(--fg)} |
| 93 | 91 | .event pre.body{margin:.4rem 0 0} |
| 94 | 92 | .filebar{display:flex;gap:1.2rem;align-items:baseline;border-bottom:1px solid var(--line);padding:0 0 .3rem;margin-bottom:.6rem;flex-wrap:wrap} |
templates/index.html modified
| @@ -25,5 +25,5 @@ | ||
| 25 | 25 | </section> |
| 26 | 26 | {{end}} |
| 27 | 27 | {{define "repolist"}} |
| 28 | -{{if .}}<div class="repos">{{range .}}<div class="repo"><a href="/{{.Path}}">{{.Path}}{{if .Private}} <span class="tag">private</span>{{end}}</a>{{if .Description}}<div>{{.Description}}</div>{{end}}</div>{{end}}</div>{{else}}<p class="muted">Nothing here yet.</p>{{end}} | |
| 28 | +{{if .}}<div class="events">{{range .}}<div class="event"><h4><a href="/{{.Path}}">{{.Path}}</a>{{if .Private}} <span class="tag">private</span>{{end}}</h4>{{if .Description}}<p>{{.Description}}</p>{{end}}</div>{{end}}</div>{{else}}<p class="muted">Nothing here yet.</p>{{end}} | |
| 29 | 29 | {{end}} |
templates/log.html modified
| @@ -2,7 +2,7 @@ | ||
| 2 | 2 | {{$p := .Data.Page}} |
| 3 | 3 | {{if .Data.Path}}<p class="muted">History of <a href="/{{$p.Repo.Path}}/tree/{{$p.Ref}}/{{.Data.Path}}">{{.Data.Path}}</a> on {{$p.Ref}}</p>{{end}} |
| 4 | 4 | {{if $p.Empty}}<p class="muted">No commits.</p>{{else}} |
| 5 | -<div class="events">{{range .Data.Commits}}<div class="event"><div><a class="hash" href="/{{$p.Repo.Path}}/commit/{{.Hash}}">{{short .Hash}}</a> <a class="subject" href="/{{$p.Repo.Path}}/commit/{{.Hash}}">{{.Subject}}</a></div><div class="muted small">{{.Author}} · <span title="{{date .Time}}">{{ago .Time}}</span></div>{{if .Body}}<pre class="body">{{.Body}}</pre>{{end}}</div>{{end}}</div> | |
| 5 | +<div class="log">{{range .Data.Commits}}<div class="event"><div><a class="hash" href="/{{$p.Repo.Path}}/commit/{{.Hash}}">{{short .Hash}}</a> <a class="subject" href="/{{$p.Repo.Path}}/commit/{{.Hash}}">{{.Subject}}</a></div><div class="muted small">{{.Author}} · <span title="{{date .Time}}">{{ago .Time}}</span></div>{{if .Body}}<pre class="body">{{.Body}}</pre>{{end}}</div>{{end}}</div> | |
| 6 | 6 | {{with .Data.Next}}<p><a class="btn" href="?from={{.}}{{if $.Data.Path}}&path={{$.Data.Path}}{{end}}">Older ▸</a></p>{{end}} |
| 7 | 7 | {{end}} |
| 8 | 8 | {{end}} |
templates/user.html modified
| @@ -16,7 +16,7 @@ | ||
| 16 | 16 | {{if $own}}<a class="btn primary block" href="/create">Create a new repository ▸</a><a class="btn block" href="/settings">Edit your profile ▸</a>{{end}} |
| 17 | 17 | </aside> |
| 18 | 18 | <div class="main"> |
| 19 | -{{if .Data.Repos}}<div class="repos">{{range .Data.Repos}}<div class="repo"><a href="/{{.Path}}">{{.Name}}{{if .Private}} <span class="tag">private</span>{{end}}</a>{{if .Description}}<div>{{.Description}}</div>{{end}}</div>{{end}}</div>{{else}}<p class="info">This user does not have any repositories.</p>{{end}} | |
| 19 | +{{if .Data.Repos}}<div class="events">{{range .Data.Repos}}<div class="event"><h4><a href="/{{.Path}}">{{.Name}}</a>{{if .Private}} <span class="tag">private</span>{{end}}</h4>{{if .Description}}<p>{{.Description}}</p>{{end}}</div>{{end}}</div>{{else}}<p class="info">This user does not have any repositories.</p>{{end}} | |
| 20 | 20 | </div> |
| 21 | 21 | </div> |
| 22 | 22 | {{end}} |