From 22a1b02971ef147afd1afb729b4e4466da6724f8 Mon Sep 17 00:00:00 2001 From: Lukas Stabe Date: Fri, 21 Aug 2020 03:27:58 +0200 Subject: [PATCH] set size and date column to smaller, fixed sizes --- src/renderer.rs | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/renderer.rs b/src/renderer.rs index a01b0a121..17e011950 100644 --- a/src/renderer.rs +++ b/src/renderer.rs @@ -76,9 +76,9 @@ pub fn page( } table { thead { - th { (build_link("name", "Name", sort_method, sort_order, color_scheme, default_color_scheme)) } - th { (build_link("size", "Size", sort_method, sort_order, color_scheme, default_color_scheme)) } - th { (build_link("date", "Last modification", sort_method, sort_order, color_scheme, default_color_scheme)) } + th.name { (build_link("name", "Name", sort_method, sort_order, color_scheme, default_color_scheme)) } + th.size { (build_link("size", "Size", sort_method, sort_order, color_scheme, default_color_scheme)) } + th.date { (build_link("date", "Last modification", sort_method, sort_order, color_scheme, default_color_scheme)) } } tbody { @if !is_root { @@ -353,7 +353,7 @@ fn entry_row( } } } - td { + td.size-cell { @if let Some(size) = entry.size { (size) } @@ -534,12 +534,17 @@ fn css(color_scheme: ColorScheme) -> Markup { color: {table_text_color}; text-align: left; line-height: 1.125rem; - width: 33.333%; }} table thead tr th {{ padding: 0.5rem 0.625rem 0.625rem; font-weight: bold; }} + table thead th.size {{ + width: 6em; + }} + table thead th.date {{ + width: 15em; + }} table tbody tr:nth-child(odd) {{ background: {odd_row_background}; }} @@ -552,9 +557,11 @@ fn css(color_scheme: ColorScheme) -> Markup { table tbody tr:hover {{ background: {active_row_color}; }} + td.size-cell {{ + text-align: right; + }} td.date-cell {{ display: flex; - width: calc(100% - 1.25rem); justify-content: space-between; }} .at {{