aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--handle_repo_index.go3
-rw-r--r--static/style.css2
-rw-r--r--templates/repo_index.html.tmpl15
3 files changed, 19 insertions, 1 deletions
diff --git a/handle_repo_index.go b/handle_repo_index.go
index c0bef4a..1c03ece 100644
--- a/handle_repo_index.go
+++ b/handle_repo_index.go
@@ -2,6 +2,7 @@ package main
import (
"net/http"
+ "net/url"
)
func handle_repo_index(w http.ResponseWriter, r *http.Request, params map[string]string) {
@@ -40,6 +41,8 @@ func handle_repo_index(w http.ResponseWriter, r *http.Request, params map[string
data["readme_filename"], data["readme"] = render_readme_at_tree(tree)
data["files"] = build_display_git_tree(tree)
+ data["clone_url"] = "ssh://" + r.Host + "/" + url.PathEscape(params["group_name"]) + "/:/repos/" + url.PathEscape(params["repo_name"])
+
err = templates.ExecuteTemplate(w, "repo_index", data)
if err != nil {
_, _ = w.Write([]byte("Error rendering template: " + err.Error()))
diff --git a/static/style.css b/static/style.css
index bd72403..40f130a 100644
--- a/static/style.css
+++ b/static/style.css
@@ -50,7 +50,7 @@ a:link, a:visited {
text-decoration-color: var(--text-decoration-color);
color: var(--link-color);
}
-code:not(pre > code) {
+#readme code:not(pre > code) {
background-color: var(--lighter-box-background-color);
border-radius: 2px;
padding: 2px;
diff --git a/templates/repo_index.html.tmpl b/templates/repo_index.html.tmpl
index de2d1da..6bc3253 100644
--- a/templates/repo_index.html.tmpl
+++ b/templates/repo_index.html.tmpl
@@ -9,6 +9,21 @@
<header>
{{ template "repo_header" . }}
</header>
+ <div class="padding-wrapper">
+ <table id="repo-info-table">
+ <thead>
+ <tr class="title-row">
+ <th colspan="2">Repo Info</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <th scope="row">Clone</th>
+ <td><code>git clone {{ .clone_url }}</code></td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
<div class="padding-wrapper scroll">
<input id="toggle-table-recent-commits" type="checkbox" class="toggle-table-off" />
<table id="recent-commits" class="wide">