arnaucube
arnaucube/gitviewPublic Self-hosted repository
gitview/templates/components.html
templates/components.htmlRaw
 1{{ define "i-repo" }}<svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 3h13v18H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2Zm0 14h13M6 6v7"/></svg>{{ end }}
 2{{ define "i-code" }}<svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m8 6-6 6 6 6m8-12 6 6-6 6m-3-15-2 18"/></svg>{{ end }}
 3{{ define "i-branch" }}<svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 3v12a4 4 0 0 0 4 4h6M6 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6Zm12 14a3 3 0 1 0 0-6 3 3 0 0 0 0 6Zm0-14a3 3 0 1 0 0-6 3 3 0 0 0 0 6ZM6 13c0-5 12 0 12-5"/></svg>{{ end }}
 4{{ define "i-search" }}<svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m21 21-5-5M18 10a8 8 0 1 1-16 0 8 8 0 0 1 16 0Z"/></svg>{{ end }}
 5{{ define "i-folder" }}<svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2 6h8l2 2h10v12H2ZM2 6V4h7l2 2"/></svg>{{ end }}
 6{{ define "i-file" }}<svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 2h9l5 5v15H5Zm9 0v6h5"/></svg>{{ end }}
 7{{ define "i-clock" }}<svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 7v5l3 2m7-2a10 10 0 1 1-20 0 10 10 0 0 1 20 0Z"/></svg>{{ end }}
 8{{ define "i-tag" }}<svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 3h8l10 10-8 8L3 11ZM7 7h.01"/></svg>{{ end }}
 9{{ define "i-arrow" }}<svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m9 5 7 7-7 7"/></svg>{{ end }}
10{{ define "i-sun" }}<svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 2v2m0 16v2M2 12h2m16 0h2M5 5l2 2m10 10 2 2M5 19l2-2M17 7l2-2M17 12a5 5 0 1 1-10 0 5 5 0 0 1 10 0Z"/></svg>{{ end }}
11{{ define "i-download" }}<svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 3v12m-5-5 5 5 5-5M4 16v5h16v-5"/></svg>{{ end }}
12{{ define "i-copy" }}<svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 8h13v13H8ZM16 8V2H2v14h6"/></svg>{{ end }}
13{{ define "i-book" }}<svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 5v16M2 3c4-1 7 0 10 2 3-2 6-3 10-2v15c-4-1-7 0-10 2-3-2-6-3-10-2Z"/></svg>{{ end }}
14{{ define "i-grid" }}<svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 3h7v7H3Zm11 0h7v7h-7ZM3 14h7v7H3Zm11 0h7v7h-7Z"/></svg>{{ end }}
15{{ define "i-check" }}<svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m5 12 4 4L19 6"/></svg>{{ end }}
16{{ define "i-external" }}<svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M14 3h7v7m0-7L10 14M10 3H3v18h18v-7"/></svg>{{ end }}
17{{ define "i-terminal" }}<svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m4 7 5 5-5 5m9 0h7"/></svg>{{ end }}
18{{ define "topbar" }}
19<header class="topbar"><a href="/" class="brand"><img class="brand-mark" src="{{ if .meta.FaviconHref }}{{ .meta.FaviconHref }}{{ else }}/static/favicon.svg{{ end }}" alt="" width="34" height="34"><span class="brand-name">{{ if .meta.Username }}{{ .meta.Username }}{{ else }}gitview{{ end }}</span></a><div class="top-right"><label class="global-search">{{ template "i-search" }}<input id="global-search" placeholder="Search repositories…" aria-label="Search repositories"><kbd>/</kbd></label><span class="top-separator"></span><button class="icon-button" id="theme-toggle" aria-label="Switch color theme" title="Switch color theme">{{ template "i-sun" }}</button></div></header>
20{{ end }}
21{{ define "footer" }}<footer><span class="footer-brand">{{ template "i-code" }} Gitview</span><span>Your code. Your home.</span><span class="footer-end">Built with Go <span class="status-dot"></span> Self-hosted</span></footer><div id="toast" role="status"></div>{{ end }}
22{{ define "filetable" }}
23<div class="file-table panel">
24{{ if .commits }}{{ with index .commits 0 }}<div class="latest-commit"><span class="avatar tiny">{{ printf "%.1s" .Commit.Author.Name }}</span><strong>{{ .Commit.Author.Name }}</strong><a class="commit-subject" href="/{{ $.name }}/commit/{{ .Commit.Hash.String }}">{{ .Commit.Message }}</a><a class="hash" href="/{{ $.name }}/commit/{{ .Commit.Hash.String }}">{{ slice .Commit.Hash.String 0 7 }}</a><span class="muted commit-date">{{ .Commit.Author.When.Format "Jan 2, 2006" }}</span></div>{{ end }}{{ end }}
25{{ if .parent }}<a class="file-row" href="/{{ .name }}/tree/{{ .ref }}/{{ .dotdot }}">{{ template "i-folder" }}<strong>..</strong></a>{{ end }}
26{{ range .files }}{{ if not .IsFile }}<a class="file-row" href="/{{ $.name }}/tree/{{ $.ref }}/{{ if $.parent }}{{ $.parent }}/{{ end }}{{ .Name }}">{{ template "i-folder" }}<span>{{ .Name }}</span><span class="file-kind">Directory</span><span class="file-size">{{ .Mode }}</span></a>{{ end }}{{ end }}
27{{ range .files }}{{ if .IsFile }}<a class="file-row" href="/{{ $.name }}/blob/{{ $.ref }}/{{ if $.parent }}{{ $.parent }}/{{ end }}{{ .Name }}">{{ template "i-file" }}<span>{{ .Name }}</span><span class="file-kind">{{ .Mode }}</span><span class="file-size">{{ .Size }} B</span></a>{{ end }}{{ end }}
28</div>{{ end }}
29{{ define "toolbar" }}<div class="repo-toolbar"><details class="dropdown"><summary class="button">{{ template "i-branch" }}{{ .ref }}<span class="chevron">⌄</span></summary><div class="dropdown-menu"><div class="menu-title">Switch branches</div>{{ range .branches }}<a href="/{{ $.name }}/tree/{{ .Name.Short }}/">{{ template "i-branch" }}{{ .Name.Short }}</a>{{ else }}<a href="/{{ .name }}/refs/">View branches and tags</a>{{ end }}</div></details><a class="muted toolbar-link" href="/{{ .name }}/refs/">{{ template "i-branch" }} <strong>{{ len .branches }}</strong> branches</a><div class="toolbar-spacer"></div><a class="button" href="/{{ .name }}/log/{{ .ref }}">{{ template "i-clock" }}History</a><details class="dropdown clone-dropdown"><summary class="button primary">{{ template "i-code" }}Code<span class="chevron">⌄</span></summary><div class="dropdown-menu clone-menu"><div class="menu-title">{{ template "i-terminal" }} Clone repository</div><p>Get a local copy of this repository.</p><label class="field-label" for="clone-url">HTTPS</label><div class="copy-field"><input id="clone-url" readonly data-clone="/{{ .name }}" aria-label="Clone URL"><button class="icon-button" data-copy="clone-url" aria-label="Copy clone URL">{{ template "i-copy" }}</button></div><a href="/{{ .name }}/archive/{{ .ref }}.tar.gz">{{ template "i-download" }}Download tar.gz</a></div></details></div>{{ end }}