Mirror of @tangled.org/core. Running on a Raspberry Pi Zero 2 (Please be gentle).
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

add repoBase layout

Akshay 50abf96a 6b7a02a4

+77 -51
+9 -4
appview/pages/pages.go
··· 68 68 return p.t[name].ExecuteTemplate(w, "layouts/base", params) 69 69 } 70 70 71 + func (p *Pages) executeRepo(name string, w io.Writer, params any) error { 72 + return p.t[name].ExecuteTemplate(w, "layouts/repoBase", params) 73 + } 74 + 71 75 func (p *Pages) Login(w io.Writer, params LoginParams) error { 72 76 return p.execute("user/login", w, params) 73 77 } ··· 136 132 Name string 137 133 OwnerDid string 138 134 OwnerHandle string 135 + Description string 139 136 } 140 137 141 138 func (r RepoInfo) OwnerWithAt() string { ··· 159 154 160 155 func (p *Pages) RepoIndexPage(w io.Writer, params RepoIndexParams) error { 161 156 162 - return p.execute("repo/index", w, params) 157 + return p.executeRepo("repo/index", w, params) 163 158 } 164 159 165 160 type RepoLogParams struct { ··· 179 174 } 180 175 181 176 func (p *Pages) RepoCommit(w io.Writer, params RepoCommitParams) error { 182 - return p.execute("repo/commit", w, params) 177 + return p.executeRepo("repo/commit", w, params) 183 178 } 184 179 185 180 type RepoTreeParams struct { ··· 199 194 } 200 195 201 196 func (p *Pages) RepoBranches(w io.Writer, params RepoBranchesParams) error { 202 - return p.execute("repo/branches", w, params) 197 + return p.executeRepo("repo/branches", w, params) 203 198 } 204 199 205 200 type RepoTagsParams struct { ··· 209 204 } 210 205 211 206 func (p *Pages) RepoTags(w io.Writer, params RepoTagsParams) error { 212 - return p.execute("repo/tags", w, params) 207 + return p.executeRepo("repo/tags", w, params) 213 208 }
+32
appview/pages/templates/layouts/repoBase.html
··· 1 + {{define "title"}} {{ .RepoInfo.FullName }} {{ end}} 2 + 3 + {{ define "content" }} 4 + 5 + <div id="repo-header"> 6 + <h1>{{ .RepoInfo.FullName }}</h1> 7 + {{ if .RepoInfo.Description }} 8 + <h3 class="desc">{{ .RepoInfo.Description }}</h3> 9 + {{ else }} 10 + <em>this repo has no description</em> 11 + </div> 12 + 13 + <div id="repo-links"> 14 + <nav> 15 + <a href="/{{ .RepoInfo.FullName }}">summary</a>&nbsp;· 16 + <a href="/{{ .RepoInfo.FullName }}/branches">branches</a>&nbsp;· 17 + <a href="/{{ .RepoInfo.FullName }}/tags">tags</a> 18 + </nav> 19 + <div> 20 + 21 + {{ end }} 22 + 23 + {{ block "repoContent" . }} {{ end }} 24 + 25 + {{ end }} 26 + 27 + {{ define "layouts/repoBase" }} 28 + 29 + {{ template "layouts/base" . }} 30 + 31 + {{ end }} 32 +
+1 -5
appview/pages/templates/repo/branches.html
··· 1 - {{ define "title" }} 2 - branches | {{ .RepoInfo.FullName }} 3 - {{ end }} 4 - 5 - {{ define "content" }} 1 + {{ define "repoContent" }} 6 2 {{ $name := .RepoInfo.Name }} 7 3 <h3>branches</h3> 8 4 <div class="refs">
+1 -1
appview/pages/templates/repo/commit.html
··· 1 1 {{ define "title" }} commit {{ .Diff.Commit.This }} {{ end }} 2 2 3 - {{ define "content" }} 3 + {{ define "repoContent" }} 4 4 5 5 {{ $repo := .RepoInfo.FullName }} 6 6 {{ $commit := .Diff.Commit }}
+30 -35
appview/pages/templates/repo/index.html
··· 1 - {{define "title"}} {{ .RepoInfo.FullName }} {{ end}} 1 + {{define "repoContent"}} 2 2 3 - {{define "content"}} 3 + <main> 4 + {{- if .IsEmpty }} 5 + this repo is empty 6 + {{ else }} 7 + <div class="log"> 8 + {{ range .Commits }} 9 + <div> 10 + <div><a href="/{{ $.RepoInfo.FullName }}/commit/{{ .Hash.String }}" class="commit-hash">{{ slice .Hash.String 0 8 }}</a></div> 11 + <pre>{{ .Message }}</pre> 12 + </div> 13 + <div class="commit-info"> 14 + {{ .Author.Name }} <a href="mailto:{{ .Author.Email }}" class="commit-email">{{ .Author.Email }}</a> 15 + <div>{{ .Author.When.Format "Mon, 02 Jan 2006 15:04:05 -0700" }}</div> 16 + </div> 17 + <hr /> 18 + {{ end }} 19 + </div> 20 + {{- if .Readme }} 21 + <article class="readme"> 22 + {{- .Readme -}} 23 + </article> 24 + {{- end -}} 25 + {{- end -}} 4 26 5 - <h1> 6 - {{ .RepoInfo.FullName }} 7 - </h1> 8 - <main> 9 - {{- if .IsEmpty }} 10 - this repo is empty 11 - {{ else }} 12 - <div class="log"> 13 - {{ range .Commits }} 14 - <div> 15 - <div><a href="/{{ $.RepoInfo.FullName }}/commit/{{ .Hash.String }}" class="commit-hash">{{ slice .Hash.String 0 8 }}</a></div> 16 - <pre>{{ .Message }}</pre> 17 - </div> 18 - <div class="commit-info"> 19 - {{ .Author.Name }} <a href="mailto:{{ .Author.Email }}" class="commit-email">{{ .Author.Email }}</a> 20 - <div>{{ .Author.When.Format "Mon, 02 Jan 2006 15:04:05 -0700" }}</div> 21 - </div> 22 - <hr /> 23 - {{ end }} 24 - </div> 25 - {{- if .Readme }} 26 - <article class="readme"> 27 - {{- .Readme -}} 28 - </article> 29 - {{- end -}} 30 - {{- end -}} 31 - 32 - <div class="clone-url"> 33 - <strong>clone</strong> 34 - <pre> 27 + <div class="clone-url"> 28 + <strong>clone</strong> 29 + <pre> 35 30 git clone https://tangled.sh/{{ .RepoInfo.OwnerWithAt }}/{{ .RepoInfo.Name }} 36 - </pre> 37 - </div> 38 - </main> 31 + </pre> 32 + </div> 33 + </main> 39 34 {{end}} 40 35
+1 -6
appview/pages/templates/repo/tags.html
··· 1 - {{ define "title" }} 2 - tags | {{ .RepoInfo.OwnerWithAt }} / 3 - {{ .RepoInfo.Name }} 4 - {{ end }} 5 - 6 - {{ define "content" }} 1 + {{ define "repoContent" }} 7 2 {{ $name := .RepoInfo.Name }} 8 3 <h3>tags</h3> 9 4 <div class="refs">
+3
appview/state/repo.go
··· 48 48 OwnerDid: id.DID.String(), 49 49 OwnerHandle: id.Handle.String(), 50 50 Name: repoName, 51 + Description: result.Description, 51 52 }, 52 53 RepoIndexResponse: result, 53 54 }) ··· 89 88 OwnerDid: id.DID.String(), 90 89 OwnerHandle: id.Handle.String(), 91 90 Name: repoName, 91 + Description: result.Description, 92 92 }, 93 93 RepoLogResponse: result, 94 94 }) ··· 171 169 OwnerDid: id.DID.String(), 172 170 OwnerHandle: id.Handle.String(), 173 171 Name: repoName, 172 + Description: result.Description, 174 173 }, 175 174 RepoTreeResponse: result, 176 175 })