summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/style.css12
-rw-r--r--lib/VNWeb/Misc/History.pm28
2 files changed, 20 insertions, 20 deletions
diff --git a/data/style.css b/data/style.css
index b15cea69..4d678084 100644
--- a/data/style.css
+++ b/data/style.css
@@ -42,7 +42,7 @@ table.stripe tbody tr:nth-child(odd):not(.nostripe),
#debug h2 { color: #f00!important; font-size: 20px; }
#debug, #debug a { color: #fff!important; }
-.visuallyhidden, p.linkradio input {
+.visuallyhidden, .linkradio input {
position: absolute !important;
left: 0;
height: 1px; width: 1px;
@@ -153,10 +153,12 @@ table.formtable td { padding: 0; }
table.formtable tr.newfield td { padding-top: 5px; }
table.formtable tr.newpart td { padding-top: 20px; font-weight: bold; }
-p.linkradio { padding: 2px }
-p.linkradio label { color: $link$; cursor: pointer }
-p.linkradio input:checked + label { color: $maintext$ }
-p.linkradio em { font-weight: normal; font-style: normal; color: $grayedout$ }
+.linkradio { padding: 2px }
+.linkradio label { color: $link$; cursor: pointer }
+.linkradio label:before { content: '✗' }
+.linkradio input:checked + label { color: $maintext$ }
+.linkradio input:checked + label:before { content: '✓' }
+.linkradio em { font-weight: normal; font-style: normal; color: $grayedout$ }
div.spinner { content: ''; border: 3px solid #9eaebd; border-bottom-color: transparent; border-radius: 100%; animation: spin 1s infinite linear; width: 14px; height: 14px; display: inline-block; margin: auto }
@keyframes spin { from { transform:rotate(0deg); } to { transform:rotate(360deg); } }
diff --git a/lib/VNWeb/Misc/History.pm b/lib/VNWeb/Misc/History.pm
index 07166328..933933cf 100644
--- a/lib/VNWeb/Misc/History.pm
+++ b/lib/VNWeb/Misc/History.pm
@@ -124,9 +124,9 @@ sub filters_ {
delete $filt->{r} if $type ne 'v';
my sub opt_ {
- my($key, $val, $label) = @_;
- input_ type => 'radio', name => $key, id => "form_${key}{$val}", value => $val,
- $filt->{$key} eq $val ? (checked => 'checked') : ();
+ my($type, $key, $val, $label, $checked) = @_;
+ input_ type => $type, name => $key, id => "form_${key}{$val}", value => $val,
+ $checked // $filt->{$key} eq $val ? (checked => 'checked') : ();
label_ for => "form_${key}{$val}", $label;
};
@@ -135,30 +135,28 @@ sub filters_ {
td_ style => 'padding: 10px', sub {
p_ class => 'linkradio', sub {
join_ \&br_, sub {
- input_ type => 'checkbox', name => 't', value => $_->[0], id => "form_t$_->[0]", $t{$_->[0]}? (checked => 'checked') : ();
- label_ for => "form_t$_->[0]", ' '.$_->[1]
+ opt_ checkbox => t => $_->[0], $_->[1], $t{$_->[0]}||0;
}, @types;
}
} if exists $filt->{t};
td_ style => 'padding: 10px', sub {
p_ class => 'linkradio', sub {
- opt_ e => 0, 'All'; em_ ' | ';
- opt_ e => 1, 'Only changes to existing items'; em_ ' | ';
- opt_ e =>-1, 'Only newly created items';
+ opt_ radio => e => 0, 'All'; em_ ' | ';
+ opt_ radio => e => 1, 'Only changes to existing items'; em_ ' | ';
+ opt_ radio => e =>-1, 'Only newly created items';
} if exists $filt->{e};
p_ class => 'linkradio', sub {
- opt_ h => 0, 'All'; em_ ' | ';
- opt_ h => 1, 'Only non-deleted items'; em_ ' | ';
- opt_ h =>-1, 'Only deleted';
+ opt_ radio => h => 0, 'All'; em_ ' | ';
+ opt_ radio => h => 1, 'Only non-deleted items'; em_ ' | ';
+ opt_ radio => h =>-1, 'Only deleted';
} if exists $filt->{h};
p_ class => 'linkradio', sub {
- opt_ m => 0, 'Show'; em_ ' | ';
- opt_ m => 1, 'Hide'; txt_ ' automated edits';
+ opt_ checkbox => m => 0, 'Show automated edits' if !$type;
+ opt_ checkbox => m => 1, 'Hide automated edits' if $type;
} if exists $filt->{m};
p_ class => 'linkradio', sub {
- opt_ r => 0, 'Exclude'; em_ ' | ';
- opt_ r => 1, 'Include'; txt_ ' releases';
+ opt_ checkbox => r => 1, 'Include releases'
} if exists $filt->{r};
input_ type => 'submit', class => 'submit', value => 'Update';
debug_ $filt;