diff options
author | morkt <> | 2015-02-16 17:22:24 +0100 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2015-02-16 17:22:24 +0100 |
commit | 4b1b212bd1f9b01ed101795c93f20a6c6c6eb78b (patch) | |
tree | a29c7680146d08315937fb688b5269e618174725 /lib | |
parent | 430e17b85c65b54d5a24292a7182701b232574bf (diff) |
Various staff improvements
(Quoting mail:)
- character list is sorted by name in cast edit form (managing of the
huge lists like v6458 becomes slightly easier);
- display number of characters voiced on seiyuu page;
- display a notice in staff edit form when primary name could be
changed.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/VNDB/DB/Staff.pm | 3 | ||||
-rw-r--r-- | lib/VNDB/Handler/Staff.pm | 5 |
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/VNDB/DB/Staff.pm b/lib/VNDB/DB/Staff.pm index 73be2f41..1b9a10da 100644 --- a/lib/VNDB/DB/Staff.pm +++ b/lib/VNDB/DB/Staff.pm @@ -7,7 +7,7 @@ use Exporter 'import'; our @EXPORT = qw|dbStaffGet dbStaffRevisionInsert dbStaffAliasIds|; -# options: results, page, id, aid, search, rev, truename, role, gender +# options: results, page, id, aid, search, exact, rev, truename, role, gender # what: extended changes roles aliases sub dbStaffGet { my $self = shift; @@ -42,6 +42,7 @@ sub dbStaffGet { $seiyuu ? ( 'EXISTS(SELECT 1 FROM vn_seiyuu vsy JOIN vn v ON v.latest = vsy.vid WHERE vsy.aid = sa.id AND NOT v.hidden)' ) : () ).')' => ( @roles ? [ \@roles ] : 1 ), ) : (), + $o{exact} ? ( '(sa.name = ? OR sa.original = ?)' => [ ($o{exact}) x 2 ] ) : (), $o{search} ? $o{search} =~ /[\x{3000}-\x{9fff}\x{ff00}-\x{ff9f}]/ ? # match against 'original' column only if search string contains any diff --git a/lib/VNDB/Handler/Staff.pm b/lib/VNDB/Handler/Staff.pm index b697af53..bab324b6 100644 --- a/lib/VNDB/Handler/Staff.pm +++ b/lib/VNDB/Handler/Staff.pm @@ -159,7 +159,7 @@ sub page { br; } if (@{$s->{cast}}) { - h2 mt '_staff_voiced'; + h2 mt('_staff_voiced', scalar @{$s->{cast}}); my $has_notes = first { $_->{note} || $_->{name} ne $s->{name} } @{$s->{cast}}; table class => 'stripe staffroles'; thead; @@ -287,6 +287,8 @@ sub edit { [ hidden => short => 'original' ], [ hidden => short => 'primary' ], [ hidden => short => 'aliases' ], + $sid && @{$s->{aliases}} ? + [ static => content => mt('_staffe_form_different') ] : (), [ static => label => mt('_staffe_form_names'), content => sub { table id => 'names'; thead; Tr; @@ -401,6 +403,7 @@ sub staffxml { my($list, $np) = $self->dbStaffGet( @{$q->{s}} ? (id => $q->{s}) : @{$q->{a}} ? (aid => $q->{a}) : + $q->{q} =~ /^=(.+)/ ? (exact => $1) : $q->{q} =~ /^s([1-9]\d*)/ ? (id => $1) : (search => $q->{q}), results => 10, |