summaryrefslogtreecommitdiff
path: root/lib/VNDB/Handler/ULists.pm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2008-12-09 12:14:12 +0100
committerYorhel <git@yorhel.nl>2008-12-09 12:14:12 +0100
commit62ab2e931cf21236e83d4483d8cb4eb773f26a89 (patch)
treea4a6306b569c97485c324045bf6ea9689702f219 /lib/VNDB/Handler/ULists.pm
parent148934c9d29be12fddc4e043fc587cce4f8b47b5 (diff)
Release list editing from release pages
I get the feeling I'm kind of rushing this entire VNlist feature and don't really think about making things look nice... Oh well, as long as it works. Nothing has to be perfect from the start, can always fix things afterwards, etc.
Diffstat (limited to 'lib/VNDB/Handler/ULists.pm')
-rw-r--r--lib/VNDB/Handler/ULists.pm25
1 files changed, 24 insertions, 1 deletions
diff --git a/lib/VNDB/Handler/ULists.pm b/lib/VNDB/Handler/ULists.pm
index 110ded30..b94cd8e6 100644
--- a/lib/VNDB/Handler/ULists.pm
+++ b/lib/VNDB/Handler/ULists.pm
@@ -10,6 +10,7 @@ use VNDB::Func;
YAWF::register(
qr{v([1-9]\d*)/vote}, \&vnvote,
qr{v([1-9]\d*)/wish}, \&vnwish,
+ qr{r([1-9]\d*)/list}, \&rlist,
qr{u([1-9]\d*)/wish}, \&wishlist,
qr{u([1-9]\d*)/list}, \&vnlist,
);
@@ -51,6 +52,28 @@ sub vnwish {
}
+sub rlist {
+ my($self, $id) = @_;
+
+ my $uid = $self->authInfo->{id};
+ return $self->htmlDenied() if !$uid;
+
+ my $f = $self->formValidate(
+ { name => 'e', required => 1, enum => [ 'del', map("r$_", 0..$#{$self->{vn_rstat}}), map("v$_", 0..$#{$self->{vn_vstat}}) ] },
+ );
+ return 404 if $f->{_err};
+
+ $self->dbVNListDel($uid, $id) if $f->{e} eq 'del';
+ $self->dbVNListAdd(
+ rid => $id,
+ uid => $uid,
+ $f->{e} =~ /^([rv])(\d+)$/ && $1 eq 'r' ? (rstat => $2) : (vstat => $2)
+ ) if $f->{e} ne 'del';
+
+ $self->resRedirect('/r'.$id, 'temp');
+}
+
+
sub wishlist {
my($self, $uid) = @_;
@@ -183,7 +206,7 @@ sub vnlist {
}
- my($list, $np) = $self->dbVNListGet(
+ my($list, $np) = $self->dbVNListList(
uid => $uid,
results => 50,
page => $f->{p},