mygit

[UNMAINTAINED] A cgit/webgit alternative, written in Rust
Log | Files | Refs | README | LICENSE

commit 84aa068889e697ec2ce2e13a15fa06fd58c93cca
parent 5b27bc81044d5ae7595614a2284c19fe732637f3
Author: alex wennerberg <alex@alexwennerberg.com>
Date:   Sun, 28 Mar 2021 01:00:42 -0700

Play with style a bit

Diffstat:
Mtemplates/base.html | 1-
Mtemplates/file.html | 2++
Mtemplates/index.html | 2+-
Mtemplates/log.html | 2++
Mtemplates/refs.html | 2++
Mtemplates/repo-navbar.html | 5+++--
Mtemplates/repo.html | 2+-
Mtemplates/static/style.css | 37+++++++++++++++++++++++++++++++------
8 files changed, 42 insertions(+), 11 deletions(-)

diff --git a/templates/base.html b/templates/base.html @@ -13,7 +13,6 @@ <div id="content"> {% block content %}{% endblock %} </div> - <hr class="thin"> <div class="footer"> Server running <a href="https://git.alexwennerberg.com/mygit">mygit</a> </div> diff --git a/templates/file.html b/templates/file.html @@ -2,6 +2,8 @@ {% block content %} {% include "repo-navbar.html" %} + <div class="main"> <h3>{{tree_entry.name().unwrap()}}@<a href="/{{repo|repo_name|urlencode_strict}}/tree/{{spec}}">{{spec}}</a></h3> {{file_text|safe}} + </div> {% endblock %} diff --git a/templates/index.html b/templates/index.html @@ -2,7 +2,7 @@ {% block content %} <div class="page-title"><h1>{{crate::CONFIG.site_name}}</h1></div> - <div> + <div class="main"> <table> {% for repo in repos %} <tr> diff --git a/templates/log.html b/templates/log.html @@ -2,6 +2,7 @@ {% block content %} {% include "repo-navbar.html" %} + <div class="main" <h3>{{branch}}</h3> <table> {% for commit in commits %} @@ -14,5 +15,6 @@ </tr> {% endfor %} </table> + </div> {% endblock %} diff --git a/templates/refs.html b/templates/refs.html @@ -2,6 +2,7 @@ {% block content %} {% include "repo-navbar.html" %} + <div class="main"> <h2>Branches</h2> <table> {% for branch in branches %} @@ -18,4 +19,5 @@ <tr><td class="git-reference"><a href="/{{repo|repo_name|urlencode_strict}}/commit/{{tag.shorthand().unwrap()}}">{{ tag.shorthand().unwrap() }}</a></td></tr> {% endfor %} </table> + </div> {% endblock %} diff --git a/templates/repo-navbar.html b/templates/repo-navbar.html @@ -1,5 +1,6 @@ +<div id="navbar"> <h1><a href="/">index</a>/{{repo|repo_name}}</h1> <div>{{repo|description}}</div> <div class="clone-url">git clone {{crate::CONFIG.clone_base}}/{{repo|repo_name}}</div> -<div class="navbar"><a href="/{{repo|repo_name|urlencode_strict}}">README</a> | <a href="/{{repo|repo_name|urlencode_strict}}/tree">tree</a> | <a href="/{{repo|repo_name|urlencode_strict}}/log">log</a> | <a href="/{{repo|repo_name|urlencode_strict}}/refs">refs</a></div> -<hr class='thin'> +<div class="links"><a href="/{{repo|repo_name|urlencode_strict}}">README</a> | <a href="/{{repo|repo_name|urlencode_strict}}/tree">tree</a> | <a href="/{{repo|repo_name|urlencode_strict}}/log">log</a> | <a href="/{{repo|repo_name|urlencode_strict}}/refs">refs</a></div> +</div> diff --git a/templates/repo.html b/templates/repo.html @@ -2,7 +2,7 @@ {% block content %} {% include "repo-navbar.html" %} - <div class="readme"> + <div class="readme main"> {% if !readme_text.is_empty() -%} {{ readme_text|safe }} {% else -%} diff --git a/templates/static/style.css b/templates/static/style.css @@ -1,8 +1,7 @@ body { - padding: 2ch; - padding-left: 4ch; - padding-right: 4ch; - margin: auto; + padding: 0; + border-top: 3px solid black; + margin: 0; font-family: "Archivo", Helvetica, Arial, Sans-serif; word-wrap: break-word; background-color: white; @@ -37,6 +36,7 @@ a:visited { text-align: center; font-style: italic; font-size: .9rem; + border-top: 1px solid black; } .line { @@ -61,6 +61,10 @@ a:visited { font-family: "Roboto Mono", monospace; -webkit-user-select: all; /* Safari */ user-select: all; /* Standard syntax */ + text-align: right; + padding-left: 2px; + padding-right: 2px; + display:inline-block } hr.thin { @@ -88,6 +92,10 @@ tr:hover { background-color: #f0f0f0; } +a:hover { + text-decoration: none; +} + td { white-space: nowrap; margin: 0px; @@ -99,11 +107,28 @@ table td { padding: 0 0.1em; } -table.core { - width: 100%; +table { border-collapse: collapse; } +#navbar { + /* background-color: #ededed; */ + padding-left: 2ch; + padding-right: 2ch; +} + +.links { + background-color: #e8e8e8; + display: block; + padding-left: 2px; +} + +.main { + padding-left: 2ch; + padding-right: 2ch; +} + + @media only screen and (max-width: 600px) { body { font-size: 16px;