From 3f0342fcbf5aafc13b3fce58c077d86275e3781d Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Tue, 11 Feb 2025 20:24:30 +0800 Subject: repo_index.html, style.css: CSS state machines --- static/style.css | 21 +++++++++++++++++++++ templates/repo_index.html.tmpl | 21 ++++++--------------- templates/repo_raw_dir.html.tmpl | 5 ----- templates/repo_tree_dir.html.tmpl | 5 ----- 4 files changed, 27 insertions(+), 25 deletions(-) diff --git a/static/style.css b/static/style.css index 9d90dca..af5a9b3 100644 --- a/static/style.css +++ b/static/style.css @@ -91,3 +91,24 @@ td#readme > *:first-child { pre, .scroll { overflow-x: auto; } +.toggle-table-off, .toggle-table-on { + display: none; +} +.toggle-table-off + table > thead > tr > th, .toggle-table-on + table > thead > tr > th { + padding: 0; +} +.toggle-table-off + table > thead > tr > th > label, .toggle-table-on + table > thead > tr > th > label { + width: 100%; + display: inline-block; + padding: 3px 1px; + cursor: pointer; +} +.toggle-table-off:checked + table > tbody { + display: none; +} +.toggle-table-on + table > tbody { + display: none; +} +.toggle-table-on:checked + table > tbody { + display: table-row-group; +} diff --git a/templates/repo_index.html.tmpl b/templates/repo_index.html.tmpl index 84ce662..c3b4759 100644 --- a/templates/repo_index.html.tmpl +++ b/templates/repo_index.html.tmpl @@ -7,15 +7,11 @@
+ - - - - - - + @@ -34,15 +30,11 @@
Recent Commits (see all)
TitleAuthorTime
+ - - - - - - + @@ -63,12 +55,11 @@
{{ if .readme }} +
/ on {{ .ref }}
ModeNameSize
- + diff --git a/templates/repo_raw_dir.html.tmpl b/templates/repo_raw_dir.html.tmpl index 3dcb8a6..f55d8c8 100644 --- a/templates/repo_raw_dir.html.tmpl +++ b/templates/repo_raw_dir.html.tmpl @@ -14,11 +14,6 @@ (Raw) /{{ .path_spec }}{{ if ne .path_spec "" }}/{{ end }} on {{ .ref }} - - - - - {{- $path_spec := .path_spec }} diff --git a/templates/repo_tree_dir.html.tmpl b/templates/repo_tree_dir.html.tmpl index 7db2035..aa457c4 100644 --- a/templates/repo_tree_dir.html.tmpl +++ b/templates/repo_tree_dir.html.tmpl @@ -14,11 +14,6 @@ /{{ .path_spec }}{{ if ne .path_spec "" }}/{{ end }} on {{ .ref }} - - - - - {{- $path_spec := .path_spec }} -- cgit v1.2.3
- README.md -
ModeNameSize
ModeNameSize