diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/repo-header.html | 35 | ||||
-rw-r--r-- | templates/repo-nav.html | 30 | ||||
-rw-r--r-- | templates/repo.html | 138 | ||||
-rw-r--r-- | templates/repo_old.html | 35 |
4 files changed, 199 insertions, 39 deletions
diff --git a/templates/repo-header.html b/templates/repo-header.html index 38be1cc..3135983 100644 --- a/templates/repo-header.html +++ b/templates/repo-header.html @@ -1,12 +1,27 @@ {{ define "repoheader" }} -<header> - <h2> - <a href="/">all repos</a> - — {{ .name }} - {{ if .ref }} - <span class="ref">@ {{ .ref }}</span> - {{ end }} - </h2> - <h3 class="desc">{{ .desc }}</h3> -</header> +<table id='header'> + <tr> + <td class='logo' rowspan='2'> + <a href='/'> + <img src='/legitrx.png' alt='legitrx logo'/> + </a> + </td> + <td class='main'> + <a href='/'>index</a> : + <a href='/{{ .name }}'>{{ .name }}</a> + </td> + <td class='form'> + <form method='get'> + <select name='h' onchange='this.form.submit();'> + <option value='{{ .ref }}' selected='selected'>{{ .ref }}</option><!-- TODO: Make this actually work --> + </select> + <input type='submit' value='switch'/> + </form> + </td> + </tr> + <tr> + <td class='sub'>{{ .desc }}</td> + <!-- <td class='sub right'></td> TODO: Author --> + </tr> +</table> {{ end }} diff --git a/templates/repo-nav.html b/templates/repo-nav.html new file mode 100644 index 0000000..0903dce --- /dev/null +++ b/templates/repo-nav.html @@ -0,0 +1,30 @@ +{{ define "reponav" }} +<table class='tabs'> + <tr> + <td> + <!-- <a href='/pub/scm/linux/kernel/git/torvalds/linux.git/about/'>about</a> --> + <a class='active' href='/{{ .name }}'>summary</a> + <a href='/{{ .name }}/refs'>refs</a> + {{ if .ref }} + <a href='/{{ .name }}/log/{{ .ref }}'>log</a> + <a href='/{{ .name }}/tree/{{ .ref }}'>tree</a> + <!-- <a href='/pub/scm/linux/kernel/git/torvalds/linux.git/commit/'>commit</a> + <a href='/pub/scm/linux/kernel/git/torvalds/linux.git/diff/'>diff</a> + <a href='/pub/scm/linux/kernel/git/torvalds/linux.git/stats/'>stats</a> --> + {{ end }} + </td> + <td class='form'> + <form class='right' method='get' action='/{{ .name }}/log'> <!-- TODO: Also the Mux is broken --> + <select name='qt'> + <option value='grep'>log msg</option> + <option value='author'>author</option> + <option value='committer'>committer</option> + <option value='range'>range</option> + </select> + <input class='txt' type='search' size='10' name='q' value=''/> + <input type='submit' value='search'/> + </form> + </td> + </tr> +</table> +{{ end }} diff --git a/templates/repo.html b/templates/repo.html index b813c05..c87f25f 100644 --- a/templates/repo.html +++ b/templates/repo.html @@ -1,35 +1,115 @@ {{ define "repo" }} <!DOCTYPE html> -<html id="legit"> +<html> {{ template "head" . }} - <body> - {{ template "repoheader" . }} - {{ template "nav" . }} - <main> - {{ $repo := .name }} - <div class="log"> - {{ range .commits }} - <div> - <div><a href="/{{ $repo }}/commit/{{ .Hash.String }}" class="commit-hash">{{ slice .Hash.String 0 8 }}</a></div> - <pre>{{ .Message }}</pre> - </div> - <div class="commit-info"> - {{ .Author.Name }} <a href="mailto:{{ .Author.Email }}" class="commit-email">{{ .Author.Email }}</a> - <div>{{ .Author.When.Format "Mon, 02 Jan 2006 15:04:05 -0700" }}</div> - </div> - {{ end }} - </div> -{{- if .readme }} - <article class="readme"> - {{- .readme -}} - </article> -{{- end -}} - <div class="clone-url"> - <strong>clone</strong> - <pre>git clone https://{{ .servername }}/{{ .name }}</pre> - </div> +<body> +<main id='legitrx'> +{{ template "repoheader" . }} +{{ template "reponav" . }} +<div class='content'> + <table summary='repository info' class='list nowrap'> + <tr class='nohover'> + <th class='left'>Branch</th> + <th class='left'>Commit message</th> + <th class='left'>Author</th> + <th class='left' colspan='2'>Age</th> + </tr> + <tr> + <td> + <a href='/{{ .name }}/log/{{ .ref }}'>{{ .ref }}</a> + </td> + <td> + <a href='/{{ .name }}/commit/{{ (index .commits 0).Hash.String }}'>{{ (index .commits 0).Message }}</a> + </td> + <td>{{ (index .commits 0).Author.Name }}</td> + <td colspan='2'> + <span>{{ (index .commits 0).Author.When.Format "Mon, 02 Jan 2006 15:04:05 -0700" }}</span><!-- TODO: Age --> + <!-- <span class='age-hours' data-ut='1718478212' title='2024-06-15 12:03:32 -0700'>14 hours</span> --> + </td> + </tr> + <!-- TODO: other refs --> + <!-- TODO: tags and past commits here? --> + {{/* + <tr class='nohover'> + <td colspan='5'> </td> + </tr> + <tr class='nohover'> + <th class='left'>Tag</th> + <th class='left'>Download</th> + <th class='left'>Author</th> + <th class='left' colspan='2'>Age</th> + </tr> + <tr> + <td> + <a href='/pub/scm/linux/kernel/git/torvalds/linux.git/tag/?h=v6.10-rc3'>v6.10-rc3</a> + </td> + <td> + <a href='/pub/scm/linux/kernel/git/torvalds/linux.git/snapshot/linux-6.10-rc3.tar.gz'>linux-6.10-rc3.tar.gz</a> + </td> + <td>Linus Torvalds</td> + <td colspan='2'> + <span class='age-days' data-ut='1717967983' title='2024-06-09 14:19:43 -0700'>7 days</span> + </td> + </tr> + <tr class='nohover'> + <td colspan='5'> + <a href='/pub/scm/linux/kernel/git/torvalds/linux.git/refs/tags'>[...]</a> + </td> + </tr> + <tr class='nohover'> + <td colspan='5'> </td> + </tr> + <tr class='nohover'> + <th class='left'>Age</th> + <th class='left'>Commit message</th> + <th class='left'>Author</th> + <th class='left'>Files</th> + <th class='left'>Lines</th> + </tr> + <tr> + <td> + <span class='age-hours' data-ut='1718478212' title='2024-06-15 12:03:32 -0700'>14 hours</span> + </td> + <td> + <a href='/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a3e18a540541325a8c8848171f71e0d45ad30b2c'>Merge tag 'xfs-6.10-fixes-3' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux</a> + <span class='decoration'> + <a class='deco' href='/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a3e18a540541325a8c8848171f71e0d45ad30b2c'>HEAD</a> + <a class='branch-deco' href='/pub/scm/linux/kernel/git/torvalds/linux.git/log/'>master</a> + </span> + </td> + <td>Linus Torvalds</td> + <td>1</td> + <td> + <span class='deletions'>-3</span>/ + <span class='insertions'>+4</span> + </td> + </tr> + <tr class='nohover'> + <td colspan='5'> + <a href='/pub/scm/linux/kernel/git/torvalds/linux.git/log/'>[...]</a> + </td> + </tr> + */}} + <tr class='nohover'> + <td colspan='5'> </td> + </tr> + </table> + <article class="readme"> + {{- .readme -}} + </article> + <table summary="clone info" class="list nowrap"> + <tr class='nohover'> + <th class='left' colspan='1'>Clone</th> + </tr> + <tr> + <td colspan='1'> + <a rel='vcs-git' href='https://{{ .servername }}/{{ .name }}' title='{{ .name }} repo'>https://{{ .servername }}/{{ .name }}</a> + </td> + </tr> + </table> +</div> {{ template "foot" . }} - </main> - </body> +</main> +</body> </html> {{ end }} diff --git a/templates/repo_old.html b/templates/repo_old.html new file mode 100644 index 0000000..e19f0e0 --- /dev/null +++ b/templates/repo_old.html @@ -0,0 +1,35 @@ +{{ define "repo_old" }} +<!DOCTYPE html> +<html id="legit"> +{{ template "head" . }} + <body> + {{ template "repoheader" . }} + {{ template "nav" . }} + <main> + {{ $repo := .name }} + <div class="log"> + {{ range .commits }} + <div> + <div><a href="/{{ $repo }}/commit/{{ .Hash.String }}" class="commit-hash">{{ slice .Hash.String 0 8 }}</a></div> + <pre>{{ .Message }}</pre> + </div> + <div class="commit-info"> + {{ .Author.Name }} <a href="mailto:{{ .Author.Email }}" class="commit-email">{{ .Author.Email }}</a> + <div>{{ .Author.When.Format "Mon, 02 Jan 2006 15:04:05 -0700" }}</div> + </div> + {{ end }} + </div> +{{- if .readme }} + <article class="readme"> + {{- .readme -}} + </article> +{{- end -}} + <div class="clone-url"> + <strong>clone</strong> + <pre>git clone https://{{ .servername }}/{{ .name }}</pre> + </div> +{{ template "foot" . }} + </main> + </body> +</html> +{{ end }} |