From eb5b1ca4b19ad28c562e1e67e795ef56c55d6ab4 Mon Sep 17 00:00:00 2001 From: Luka Hietala Date: Tue, 16 Dec 2025 18:12:54 +0200 Subject: [PATCH] make ui more compact --- static/styles.css | 13 +++++++++++++ templates/base.html | 2 ++ templates/commit.html | 45 ++++++++++++++++++++----------------------- 3 files changed, 36 insertions(+), 24 deletions(-) create mode 100644 static/styles.css diff --git a/static/styles.css b/static/styles.css new file mode 100644 index 0000000..df33122 --- /dev/null +++ b/static/styles.css @@ -0,0 +1,13 @@ +* { + box-sizing: border-box; +} + +hr { + margin: 10px 0; + border-top: 1px; +} + +h1, h2, h3, h4, h5, h6 { + font-size: 1em; + margin: 0; +} diff --git a/templates/base.html b/templates/base.html index a003975..a4b99b2 100644 --- a/templates/base.html +++ b/templates/base.html @@ -4,6 +4,7 @@ Lipasto + +
{% block content %}{% endblock %}
diff --git a/templates/commit.html b/templates/commit.html index f469375..7407e5a 100644 --- a/templates/commit.html +++ b/templates/commit.html @@ -1,40 +1,37 @@ {% extends "base.html" %} {% block content %} -

commit {{ commit.id }}

- Author: {{ commit.author.name }} <{{ commit.author.email }}>
- Committer: {{ commit.committer.name }} <{{ commit.committer.email }}>
- Date: {{ commit.date | datetime }} - {% if commit.parent_id %}
- Parent: {{ commit.parent_id }} - {% endif %}
- Tree: {{ commit.tree_id }} -
- {{ commit.message }} -
- View Tree +
+ Commit: {{ commit.id }}
+ {% if commit.parent_id %} + Parent: {{ commit.parent_id }}
+ {% endif %} + Author: {{ commit.author.name }} <{{ commit.author.email }}>
+ Committer: {{ commit.committer.name }} <{{ commit.committer.email }}>
+ Date: {{ commit.date | datetime }}
+ Tree: {{ commit.tree_id }} +
+

{{ commit.message }}

{% if commit.diff %} -

Changed Files

+

Diffstat

- - - - - - - - {% for file in commit.changed_files %} + {% set status_letter = {'added':'A','deleted':'D','modified':'M','renamed':'R','copied':'C','typechange':'T'}.get(file.status, '?') %} + {% set total = file.additions + file.deletions %} + {% set plus_len = [file.additions, 40] | min %} + {% set minus_len = [file.deletions, 40] | min %} + - - - + + + {% endfor %}
FileAdditionsDeletionsStatus
{{ status_letter }} {{ file.file }}+{{ file.additions }}-{{ file.deletions }}{{ file.status }}|{{ total }}{{ '+' * plus_len }}{{ '- ' * minus_len }}
+

{{ commit.diff_stats.files_changed }} files changed, {{ commit.diff_stats.insertions }} insertions(+), {{ commit.diff_stats.deletions }} deletions(-)

{% if commit.parent_id %}
View Full Diff | -- 2.47.3