summaryrefslogtreecommitdiff
path: root/lib/VNDB/Handler/Producers.pm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2009-04-01 08:49:59 +0200
committerYorhel <git@yorhel.nl>2009-04-01 08:49:59 +0200
commit33c6bd207473e8ce6ddfc0d19b34ccb139aa8521 (patch)
treed5714b79b3e02c77d78f43a1f4b34f7194068b14 /lib/VNDB/Handler/Producers.pm
parent61c4d04980dc0376cf0032364a5952f8d828837f (diff)
parentf35175b04fc9f54680ad2578a994177e4d280b09 (diff)
Merge branch 'beta'2.3
Conflicts: data/docs/4
Diffstat (limited to 'lib/VNDB/Handler/Producers.pm')
-rw-r--r--lib/VNDB/Handler/Producers.pm15
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/VNDB/Handler/Producers.pm b/lib/VNDB/Handler/Producers.pm
index 0efd2f47..7f43dd78 100644
--- a/lib/VNDB/Handler/Producers.pm
+++ b/lib/VNDB/Handler/Producers.pm
@@ -21,7 +21,7 @@ sub page {
my $p = $self->dbProducerGet(
id => $pid,
- what => 'vn'.($rev ? ' changes' : ''),
+ what => 'vn extended'.($rev ? ' changes' : ''),
$rev ? ( rev => $rev ) : ()
)->[0];
return 404 if !$p->{id};
@@ -31,11 +31,12 @@ sub page {
return if $self->htmlHiddenMessage('p', $p);
if($rev) {
- my $prev = $rev && $rev > 1 && $self->dbProducerGet(id => $pid, rev => $rev-1, what => 'changes')->[0];
+ my $prev = $rev && $rev > 1 && $self->dbProducerGet(id => $pid, rev => $rev-1, what => 'changes extended')->[0];
$self->htmlRevision('p', $prev, $p,
[ type => 'Type', serialize => sub { $self->{producer_types}{$_[0]} } ],
[ name => 'Name (romaji)', diff => 1 ],
[ original => 'Original name', diff => 1 ],
+ [ alias => 'Aliases', diff => 1 ],
[ lang => 'Language', serialize => sub { "$_[0] ($self->{languages}{$_[0]})" } ],
[ website => 'Website', diff => 1 ],
[ desc => 'Description', diff => 1 ],
@@ -48,6 +49,7 @@ sub page {
h2 class => 'alttitle', $p->{original} if $p->{original};
p class => 'center';
txt "$self->{languages}{$p->{lang}} \L$self->{producer_types}{$p->{type}}";
+ txt "\na.k.a. $p->{alias}" if $p->{alias};
if($p->{website}) {
txt "\n";
a href => $p->{website}, $p->{website};
@@ -87,14 +89,14 @@ sub page {
sub edit {
my($self, $pid, $rev) = @_;
- my $p = $pid && $self->dbProducerGet(id => $pid, what => 'changes', $rev ? (rev => $rev) : ())->[0];
+ my $p = $pid && $self->dbProducerGet(id => $pid, what => 'changes extended', $rev ? (rev => $rev) : ())->[0];
return 404 if $pid && !$p->{id};
$rev = undef if !$p || $p->{cid} == $p->{latest};
return $self->htmlDenied if !$self->authCan('edit')
|| $pid && ($p->{locked} && !$self->authCan('lock') || $p->{hidden} && !$self->authCan('del'));
- my %b4 = !$pid ? () : map { $_ => $p->{$_} } qw|type name original lang website desc|;
+ my %b4 = !$pid ? () : map { $_ => $p->{$_} } qw|type name original lang website desc alias|;
my $frm;
if($self->reqMethod eq 'POST') {
@@ -102,6 +104,7 @@ sub edit {
{ name => 'type', enum => [ keys %{$self->{producer_types}} ] },
{ name => 'name', maxlength => 200 },
{ name => 'original', required => 0, maxlength => 200, default => '' },
+ { name => 'alias', required => 0, maxlength => 500, default => '' },
{ name => 'lang', enum => [ keys %{$self->{languages}} ] },
{ name => 'website', required => 0, template => 'url', default => '' },
{ name => 'desc', required => 0, maxlength => 5000, default => '' },
@@ -137,6 +140,8 @@ sub edit {
[ input => name => 'Name (romaji)', short => 'name' ],
[ input => name => 'Original name', short => 'original' ],
[ static => content => q|The original name of the producer, leave blank if it is already in the Latin alphabet.| ],
+ [ input => name => 'Aliases', short => 'alias', width => 400 ],
+ [ static => content => q|(Un)official aliases, separated by a comma.| ],
[ select => name => 'Primary language', short => 'lang',
options => [ map [ $_, "$_ ($self->{languages}{$_})" ], sort keys %{$self->{languages}} ] ],
[ input => name => 'Website', short => 'website' ],
@@ -193,7 +198,7 @@ sub list {
for ($perlist*$c..($perlist*($c+1))-1) {
li;
cssicon 'lang '.$list->[$_]{lang}, $self->{languages}{$list->[$_]{lang}};
- a href => "/p$list->[$_]{id}", $list->[$_]{name};
+ a href => "/p$list->[$_]{id}", title => $list->[$_]{original}, $list->[$_]{name};
end;
}
end;