mygit

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

commit 2cddb99e36bff63cb6d639c206d2cf238690fcd9
parent c6315c2682da8bdfc8048739339f0dc125cee675
Author: Johann150 <johann@qwertqwefsday.eu>
Date:   Wed, 31 Mar 2021 19:55:43 +0200

improve commit page

- link to own not parent's tree
- get rid of inline display rule by using spans instead of divs
- render multiline commit messages correctly by using pre

Diffstat:
Mtemplates/commit.html | 8+++-----
Mtemplates/log.html | 2+-
Mtemplates/static/style.css | 4----
3 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/templates/commit.html b/templates/commit.html @@ -2,9 +2,9 @@ {% block content %} {% include "repo-navbar.html" %} - <b>Commit:</b> <div class="commit-hash">{{commit.id()}}</div> (<a href="/{{repo|repo_name|urlencode_strict}}/tree/{{parent.id()}}">tree</a>) + <b>Commit:</b> <span class="commit-hash">{{commit.id()}}</span> (<a href="/{{repo|repo_name|urlencode_strict}}/tree/{{commit.id()}}">tree</a>) <br> - <b>Parent:</b> <a href="/{{repo|repo_name|urlencode_strict}}/commit/{{parent.id()}}"><div class="commit-hash">{{parent.id()}}</div></a> (<a href="/{{repo|repo_name|urlencode_strict}}/tree/{{parent.id()}}">tree</a>) + <b>Parent:</b> <a href="/{{repo|repo_name|urlencode_strict}}/commit/{{parent.id()}}" class="commit-hash">{{parent.id()}}</a> (<a href="/{{repo|repo_name|urlencode_strict}}/tree/{{parent.id()}}">tree</a>) <br> <b>Author:</b> {{commit.author().name().unwrap()}} &lt;<a href="mailto:{{commit.author().email().unwrap()}}">{{commit.author().email().unwrap()}}</a>&gt; <br> @@ -12,7 +12,5 @@ <br> {% let stats = diff.stats().unwrap() %} {{stats.files_changed()}} files changed; {{stats.insertions()}} insertions {{stats.deletions()}} deletions - <div class="commit-message"> - {{commit.message().unwrap()}} - </div> + <pre class="commit-message">{{commit.message().unwrap()}}</pre> {% endblock %} diff --git a/templates/log.html b/templates/log.html @@ -6,7 +6,7 @@ <table> {% for commit in commits %} <tr> - <td class="commit-hash"><a href="/{{repo|repo_name|urlencode_strict}}/commit/{{commit.id()}}">{{commit.id().to_string()[..7]}}</a></td> + <td><a href="/{{repo|repo_name|urlencode_strict}}/commit/{{commit.id()}}" class="commit-hash">{{commit.id().to_string()[..7]}}</a></td> {% let summary = commit.summary().unwrap_or("")|truncate(72) %} <td class="commit-summary">{{summary}}</td> <td class="commit-author-email"><a href="mailto:{{commit.author().email().unwrap_or("")}}">{{commit.author().name().unwrap_or(commit.author().email().unwrap_or(""))}}</a></td> diff --git a/templates/static/style.css b/templates/static/style.css @@ -24,10 +24,6 @@ body { text-align: right; } -.commit-hash { - display: inline -} - .footer { text-align: center; font-style: italic;