summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2009-05-22 17:20:57 +0200
committerYorhel <git@yorhel.nl>2009-05-22 17:20:57 +0200
commit63fb2bab0519357d78846107e6fe3acf42a65122 (patch)
treed0458d6dc2456726f7401d50f0d59e78be0081c4
parent5f0ae1ac7f55b679a7df910d92a9cd1f9b9287ad (diff)
Show comparable CERO ratings on /r+/edit input field
-rw-r--r--ChangeLog1
-rw-r--r--data/global.pl18
-rw-r--r--lib/VNDB/Handler/Releases.pm9
-rw-r--r--lib/VNDB/Handler/VNPage.pm2
4 files changed, 22 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index d3eb5ed4..b706a64d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,7 @@
- Javascript date input
- Resolution field for release entries
- Voiced field for release entries
+ - Show comparable CERO ratings on /r+/edit input field
2.3 - 2009-04-01
- No page reload needed when changing rlist status from vn page
diff --git a/data/global.pl b/data/global.pl
index 60e383cd..332c5d32 100644
--- a/data/global.pl
+++ b/data/global.pl
@@ -150,9 +150,21 @@ our %S = (%S,
[ 'Other', 0 ],
],
age_ratings => {
- -1 => 'Unknown',
- 0 => 'All ages',
- map { $_ => $_.'+' } 6..18
+ -1 => [ 'Unknown' ],
+ 0 => [ 'All ages' ,'CERO A' ],
+ 6 => [ '6+' ],
+ 7 => [ '7+' ],
+ 8 => [ '8+' ],
+ 9 => [ '9+' ],
+ 10 => [ '10+' ],
+ 11 => [ '11+' ],
+ 12 => [ '12+', 'CERO B' ],
+ 13 => [ '13+' ],
+ 14 => [ '14+' ],
+ 15 => [ '15+', 'CERO C' ],
+ 16 => [ '16+' ],
+ 17 => [ '17+', 'CERO D' ],
+ 18 => [ '18+', 'CERO Z' ],
},
release_types => [
'Complete',
diff --git a/lib/VNDB/Handler/Releases.pm b/lib/VNDB/Handler/Releases.pm
index 19de1e4a..501c90e9 100644
--- a/lib/VNDB/Handler/Releases.pm
+++ b/lib/VNDB/Handler/Releases.pm
@@ -175,7 +175,7 @@ sub _infotable {
if($r->{minage} >= 0) {
Tr ++$i % 2 ? (class => 'odd') : ();
td 'Age rating';
- td $self->{age_ratings}{$r->{minage}};
+ td $self->{age_ratings}{$r->{minage}}[0];
end;
}
@@ -357,7 +357,8 @@ sub _form {
[ date => short => 'released', name => 'Release date' ],
[ static => content => 'Leave month or day blank if they are unknown' ],
[ select => short => 'minage', name => 'Age rating',
- options => [ map [ $_, $self->{age_ratings}{$_} ], sort { $a <=> $b } keys %{$self->{age_ratings}} ] ],
+ options => [ map [ $_, $self->{age_ratings}{$_}[0].($self->{age_ratings}{$_}[1]?" (e.g. $self->{age_ratings}{$_}[1])":'') ],
+ sort { $a <=> $b } keys %{$self->{age_ratings}} ] ],
[ select => short => 'resolution', name => 'Resolution', options => [
map [ $_, @{$self->{resolutions}[$_]} ], 0..$#{$self->{resolutions}} ] ],
[ select => short => 'voiced', name => 'Voiced', options => [
@@ -485,7 +486,7 @@ sub browse {
td class => 'tc1';
lit datestr $l->{released};
end;
- td class => 'tc2', $l->{minage} > -1 ? $self->{age_ratings}{$l->{minage}} : '';
+ td class => 'tc2', $l->{minage} > -1 ? $self->{age_ratings}{$l->{minage}}[0] : '';
td class => 'tc3';
$_ ne 'oth' && cssicon $_, $self->{platforms}{$_} for (@{$l->{platforms}});
cssicon "lang $l->{language}", $self->{languages}{$l->{language}};
@@ -534,7 +535,7 @@ sub _filters {
end;
txt ' than or equal to ';
Select id => 'ma_a', name => 'ma_a', style => 'width: 80px; text-align: center';
- $_>=0 && option value => $_, $f->{ma_a} == $_ ? ('selected' => 'selected') : (), $self->{age_ratings}{$_}
+ $_>=0 && option value => $_, $f->{ma_a} == $_ ? ('selected' => 'selected') : (), $self->{age_ratings}{$_}[0]
for (sort { $a <=> $b } keys %{$self->{age_ratings}});
end;
end;
diff --git a/lib/VNDB/Handler/VNPage.pm b/lib/VNDB/Handler/VNPage.pm
index d5d1c0a1..fac6305b 100644
--- a/lib/VNDB/Handler/VNPage.pm
+++ b/lib/VNDB/Handler/VNPage.pm
@@ -422,7 +422,7 @@ sub _releases {
for my $rel (grep $l eq $_->{language}, @$r) {
Tr;
td class => 'tc1'; lit datestr $rel->{released}; end;
- td class => 'tc2', $rel->{minage} < 0 ? '' : $self->{age_ratings}{$rel->{minage}};
+ td class => 'tc2', $rel->{minage} < 0 ? '' : $self->{age_ratings}{$rel->{minage}}[0];
td class => 'tc3';
for (sort @{$rel->{platforms}}) {
next if $_ eq 'oth';