From b3b20d8a773abc19ddf9f6208b79b8a48d4c99bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ondr=CC=8Cej=20Ny=CC=81vlt?= Date: Thu, 17 Aug 2023 16:54:52 +0200 Subject: [PATCH] Improve diff display --- view/static/main.css | 28 ++++++++++++++++++---------- view/templates/article_detail.html | 17 ++++++++++++++++- view/templates/index.html | 25 ++++++++++--------------- 3 files changed, 44 insertions(+), 26 deletions(-) diff --git a/view/static/main.css b/view/static/main.css index 581b0c2..343f396 100644 --- a/view/static/main.css +++ b/view/static/main.css @@ -99,6 +99,14 @@ del { text-decoration-color: hsl(0 50% 40% / 50%); } +.diff-before ins { + display: none; +} + +.diff-after del { + display: none; +} + code { font-size: inherit; } @@ -128,6 +136,8 @@ details[open] summary::before { transform: rotate(90deg); } +/* Layout */ + .header { padding-top: 1rem; padding-bottom: 1rem; @@ -218,12 +228,20 @@ details[open] summary::before { margin: 0 0.25rem; } +/* Utils & components */ + .container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; } +.inline-icon { + display: inline-block; + fill: currentColor; + width: 1.25em; +} + .input { border-radius: var(--radius-s); border: 1px solid var(--border-color); @@ -389,16 +407,6 @@ details[open] summary::before { font-size: var(--font-size-l); } -.inline-icon { - display: inline-block; - fill: currentColor; - width: 1.25em; -} - -.changeset details[open] summary { - margin-bottom: 1rem; -} - .changeset table th { font-size: var(--font-size-s); font-weight: 500; diff --git a/view/templates/article_detail.html b/view/templates/article_detail.html index 82367d0..bf9b5f7 100644 --- a/view/templates/article_detail.html +++ b/view/templates/article_detail.html @@ -16,6 +16,10 @@ padding: 0.5rem 0.75rem; } +.diff-table td:last-child { + width: 100%; +} + .diff-table th { font-size: var(--font-size-xs); color: var(--color-muted); @@ -38,7 +42,18 @@ {% for diff in diffs %} {{ diff.diff_time }} - {{ diff.diff_html|safe }} + + + + + + + + + + +
Before{{ diff.diff_html|safe }}
After{{ diff.diff_html|safe }}
+ {% endfor %} diff --git a/view/templates/index.html b/view/templates/index.html index 4912c05..ffc712c 100644 --- a/view/templates/index.html +++ b/view/templates/index.html @@ -40,21 +40,16 @@ Show change history

-
- -

{{ diff.diff_html|safe }}

-
- - - - - - - - - -
Old{{ diff.title_orig }}
New{{ diff.title_new }}
-
+ + + + + + + + + +
Before{{ diff.diff_html|safe }}
After{{ diff.diff_html|safe }}
{% endfor %}