diff --git a/appview/pages/pages.go b/appview/pages/pages.go
index cc4f8288..c1fef41d 100644
--- a/appview/pages/pages.go
+++ b/appview/pages/pages.go
@@ -68,6 +68,10 @@ func (p *Pages) execute(name string, w io.Writer, params any) error {
return p.t[name].ExecuteTemplate(w, "layouts/base", params)
}
+func (p *Pages) executeRepo(name string, w io.Writer, params any) error {
+ return p.t[name].ExecuteTemplate(w, "layouts/repoBase", params)
+}
+
func (p *Pages) Login(w io.Writer, params LoginParams) error {
return p.execute("user/login", w, params)
}
@@ -132,6 +136,7 @@ type RepoInfo struct {
Name string
OwnerDid string
OwnerHandle string
+ Description string
}
func (r RepoInfo) OwnerWithAt() string {
@@ -154,7 +159,7 @@ type RepoIndexParams struct {
func (p *Pages) RepoIndexPage(w io.Writer, params RepoIndexParams) error {
- return p.execute("repo/index", w, params)
+ return p.executeRepo("repo/index", w, params)
}
type RepoLogParams struct {
@@ -174,7 +179,7 @@ type RepoCommitParams struct {
}
func (p *Pages) RepoCommit(w io.Writer, params RepoCommitParams) error {
- return p.execute("repo/commit", w, params)
+ return p.executeRepo("repo/commit", w, params)
}
type RepoTreeParams struct {
@@ -194,7 +199,7 @@ type RepoBranchesParams struct {
}
func (p *Pages) RepoBranches(w io.Writer, params RepoBranchesParams) error {
- return p.execute("repo/branches", w, params)
+ return p.executeRepo("repo/branches", w, params)
}
type RepoTagsParams struct {
@@ -204,5 +209,5 @@ type RepoTagsParams struct {
}
func (p *Pages) RepoTags(w io.Writer, params RepoTagsParams) error {
- return p.execute("repo/tags", w, params)
+ return p.executeRepo("repo/tags", w, params)
}
diff --git a/appview/pages/templates/layouts/repoBase.html b/appview/pages/templates/layouts/repoBase.html
new file mode 100644
index 00000000..e18ddcf2
--- /dev/null
+++ b/appview/pages/templates/layouts/repoBase.html
@@ -0,0 +1,32 @@
+{{define "title"}} {{ .RepoInfo.FullName }} {{ end}}
+
+{{ define "content" }}
+
+
+
+
+
+
+
+{{ end }}
+
+{{ block "repoContent" . }} {{ end }}
+
+{{ end }}
+
+{{ define "layouts/repoBase" }}
+
+{{ template "layouts/base" . }}
+
+{{ end }}
+
diff --git a/appview/pages/templates/repo/branches.html b/appview/pages/templates/repo/branches.html
index 545cfc6d..1ea6481e 100644
--- a/appview/pages/templates/repo/branches.html
+++ b/appview/pages/templates/repo/branches.html
@@ -1,8 +1,4 @@
-{{ define "title" }}
- branches | {{ .RepoInfo.FullName }}
-{{ end }}
-
-{{ define "content" }}
+{{ define "repoContent" }}
{{ $name := .RepoInfo.Name }}
branches
diff --git a/appview/pages/templates/repo/commit.html b/appview/pages/templates/repo/commit.html
index 8375788e..b00e2bc7 100644
--- a/appview/pages/templates/repo/commit.html
+++ b/appview/pages/templates/repo/commit.html
@@ -1,6 +1,6 @@
{{ define "title" }} commit {{ .Diff.Commit.This }} {{ end }}
-{{ define "content" }}
+{{ define "repoContent" }}
{{ $repo := .RepoInfo.FullName }}
{{ $commit := .Diff.Commit }}
diff --git a/appview/pages/templates/repo/index.html b/appview/pages/templates/repo/index.html
index 22807492..c840c79a 100644
--- a/appview/pages/templates/repo/index.html
+++ b/appview/pages/templates/repo/index.html
@@ -1,40 +1,35 @@
-{{define "title"}} {{ .RepoInfo.FullName }} {{ end}}
+{{define "repoContent"}}
-{{define "content"}}
+
+ {{- if .IsEmpty }}
+ this repo is empty
+ {{ else }}
+
+ {{ range .Commits }}
+
+
+ {{ .Author.Name }}
{{ .Author.Email }}
+
{{ .Author.When.Format "Mon, 02 Jan 2006 15:04:05 -0700" }}
+
+
+ {{ end }}
+
+ {{- if .Readme }}
+
+ {{- .Readme -}}
+
+ {{- end -}}
+ {{- end -}}
-
-{{ .RepoInfo.FullName }}
-
-
-{{- if .IsEmpty }}
-this repo is empty
-{{ else }}
-
- {{ range .Commits }}
-
-
- {{ .Author.Name }}
{{ .Author.Email }}
-
{{ .Author.When.Format "Mon, 02 Jan 2006 15:04:05 -0700" }}
-
-
- {{ end }}
-
-{{- if .Readme }}
-
- {{- .Readme -}}
-
-{{- end -}}
-{{- end -}}
-
-
-
clone
-
+
+
clone
+
git clone https://tangled.sh/{{ .RepoInfo.OwnerWithAt }}/{{ .RepoInfo.Name }}
-
-
-
+
+
+
{{end}}
diff --git a/appview/pages/templates/repo/tags.html b/appview/pages/templates/repo/tags.html
index 3200dc7a..6aba6b76 100644
--- a/appview/pages/templates/repo/tags.html
+++ b/appview/pages/templates/repo/tags.html
@@ -1,9 +1,4 @@
-{{ define "title" }}
- tags | {{ .RepoInfo.OwnerWithAt }} /
- {{ .RepoInfo.Name }}
-{{ end }}
-
-{{ define "content" }}
+{{ define "repoContent" }}
{{ $name := .RepoInfo.Name }}
tags
diff --git a/appview/state/repo.go b/appview/state/repo.go
index a6a77300..bfecd23f 100644
--- a/appview/state/repo.go
+++ b/appview/state/repo.go
@@ -48,6 +48,7 @@ func (s *State) RepoIndex(w http.ResponseWriter, r *http.Request) {
OwnerDid: id.DID.String(),
OwnerHandle: id.Handle.String(),
Name: repoName,
+ Description: result.Description,
},
RepoIndexResponse: result,
})
@@ -88,6 +89,7 @@ func (s *State) RepoLog(w http.ResponseWriter, r *http.Request) {
OwnerDid: id.DID.String(),
OwnerHandle: id.Handle.String(),
Name: repoName,
+ Description: result.Description,
},
RepoLogResponse: result,
})
@@ -169,6 +171,7 @@ func (s *State) RepoTree(w http.ResponseWriter, r *http.Request) {
OwnerDid: id.DID.String(),
OwnerHandle: id.Handle.String(),
Name: repoName,
+ Description: result.Description,
},
RepoTreeResponse: result,
})