cleaner titles

by nilix
This commit is contained in:
Anirudh Oppiliappan 2023-02-18 14:16:43 +05:30
parent d5a33e9150
commit 1574bbecb5
No known key found for this signature in database
GPG Key ID: 8A93F96F78C5D4C4
9 changed files with 36 additions and 41 deletions

View File

@ -190,6 +190,7 @@ func (d *deps) RepoTree(w http.ResponseWriter, r *http.Request) {
data["ref"] = ref data["ref"] = ref
data["parent"] = treePath data["parent"] = treePath
data["desc"] = getDescription(path) data["desc"] = getDescription(path)
data["dotdot"] = filepath.Dir(treePath)
d.listFiles(files, data, w) d.listFiles(files, data, w)
return return
@ -254,7 +255,7 @@ func (d *deps) Log(w http.ResponseWriter, r *http.Request) {
data["name"] = name data["name"] = name
data["ref"] = ref data["ref"] = ref
data["desc"] = getDescription(path) data["desc"] = getDescription(path)
data["dotdot"] = filepath.Dir(path) data["log"] = true
if err := t.ExecuteTemplate(w, "log", data); err != nil { if err := t.ExecuteTemplate(w, "log", data); err != nil {
log.Println(err) log.Println(err)

View File

@ -252,17 +252,18 @@ a:hover {
} }
.file-wrapper { .file-wrapper {
display: flex;
flex-direction: row;
grid-template-columns: 1rem minmax(0, 1fr);
gap: 1rem;
padding: 0.5rem;
background: var(--light-gray); background: var(--light-gray);
display: table;
padding: 0.5rem
width: 100%;
} }
.file-content { .file-content {
background: var(--light-gray); background: var(--light-gray);
overflow-y: hidden; overflow-y: hidden;
overflow-x: auto; overflow-x: auto;
display: block;
} }
.diff-type { .diff-type {

View File

@ -1,29 +1,23 @@
{{ define "file" }} {{ define "file" }}
<html> <html>
{{ template "head" . }} {{ template "head" . }}
<title>{{.name }} &mdash; {{ .path }}</title>
{{ template "repoheader" . }} {{ template "repoheader" . }}
<body> <body>
{{ template "nav" . }} {{ template "nav" . }}
<main> <main>
<p>{{ .path }}</p> <p>{{ .path }}</p>
<table class="file-wrapper"> <div class="file-wrapper">
<tbody><tr> <div class="line-numbers">
<td class="line-numbers">
<pre>
{{- range .linecount }} {{- range .linecount }}
<a id="L{{ . }}" href="#L{{ . }}">{{ . }}</a> <a id="L{{ . }}" href="#L{{ . }}">{{ . }}</a>
{{- end -}} {{- end -}}
</pre> </div>
</td> <div class="file-content">
<td class="file-content"> <span></span>
<pre> <pre>
{{- .content -}} {{- .content -}}
</pre> </pre>
</td> </div>
</tbody></tr>
</table>
</main> </main>
</body> </body>
</html> </html>

View File

@ -5,6 +5,26 @@
<link rel="stylesheet" href="/static/style.css" type="text/css"> <link rel="stylesheet" href="/static/style.css" type="text/css">
<link rel="stylesheet" href="https://cdn.icyphox.sh/fonts/inter.css" type="text/css"> <link rel="stylesheet" href="https://cdn.icyphox.sh/fonts/inter.css" type="text/css">
<link rel="icon" type="image/png" size="32x32" href="/static/legit.png"> <link rel="icon" type="image/png" size="32x32" href="/static/legit.png">
{{ if .parent }}
<title>{{ .meta.Title }} &mdash; {{ .name }} ({{ .ref }}): {{ .parent }}/</title>
{{ else if .path }}
<title>{{ .meta.Title }} &mdash; {{ .name }} ({{ .ref }}): {{ .path }}</title>
{{ else if .files }}
<title>{{ .meta.Title }} &mdash; {{ .name }} ({{ .ref }})</title>
{{ else if .commit }}
<title>{{ .meta.Title }} &mdash; {{ .name }}: {{ .commit.This }}</title>
{{ else if .branches }}
<title>{{ .meta.Title }} &mdash; {{ .name }}: refs</title>
{{ else if .commits }}
{{ if .log }}
<title>{{ .meta.Title }} &mdash; {{ .name }}: log</title>
{{ else }}
<title>{{ .meta.Title }} &mdash; {{ .name }}</title>
{{ end }}
{{ else }}
<title>{{ .meta.Title }}</title>
{{ end }}
{{ if and .servername .gomod }} {{ if and .servername .gomod }}
<meta name="go-import" content="{{ .servername}}/{{ .name }} git https://{{ .servername }}/{{ .name }}"> <meta name="go-import" content="{{ .servername}}/{{ .name }} git https://{{ .servername }}/{{ .name }}">
{{ end }} {{ end }}

View File

@ -2,10 +2,6 @@
<html> <html>
{{ template "head" . }} {{ template "head" . }}
<title>
{{ .meta.Title }}
</title>
<header> <header>
<h1>{{ .meta.Title }}</h1> <h1>{{ .meta.Title }}</h1>
<h2>{{ .meta.Description }}</h2> <h2>{{ .meta.Description }}</h2>

View File

@ -2,10 +2,6 @@
<html> <html>
{{ template "head" . }} {{ template "head" . }}
<title>
{{ .name }} &mdash; log
</title>
{{ template "repoheader" . }} {{ template "repoheader" . }}
<body> <body>
{{ template "nav" . }} {{ template "nav" . }}

View File

@ -2,10 +2,6 @@
<html> <html>
{{ template "head" . }} {{ template "head" . }}
<title>
{{ .name }} &mdash; refs
</title>
{{ template "repoheader" . }} {{ template "repoheader" . }}
<body> <body>
{{ template "nav" . }} {{ template "nav" . }}

View File

@ -1,10 +1,5 @@
{{ define "repo" }} {{ define "repo" }}
<html> <html>
<title>{{ .name }}
{{ if .parent }}
&mdash; {{ .parent }}
{{ end }}
</title>
{{ template "head" . }} {{ template "head" . }}
{{ template "repoheader" . }} {{ template "repoheader" . }}

View File

@ -1,10 +1,6 @@
{{ define "tree" }} {{ define "tree" }}
<html> <html>
<title>{{ .name }}
{{ if .parent }}
&mdash; {{ .parent }}
{{ end }}
</title>
{{ template "head" . }} {{ template "head" . }}
{{ template "repoheader" . }} {{ template "repoheader" . }}