From: Matthew Horsfall (alh) Date: Wed, 5 Oct 2011 17:58:03 +0000 (-0400) Subject: Minor fixes to make updating actually work. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=alh_admin_ui;p=catagits%2FApp-IdiotBox.git Minor fixes to make updating actually work. Note that updating a video doesn't yet work. Needs sql work. --- diff --git a/lib/App/IdiotBox.pm b/lib/App/IdiotBox.pm index 4895302..e9aa7fe 100644 --- a/lib/App/IdiotBox.pm +++ b/lib/App/IdiotBox.pm @@ -70,7 +70,7 @@ sub dispatch_request { return $self->show_edit_video_page($video, message => $err) if $err; - $self->videos->replace($video, $uv); + $bucket->videos->replace($video, $uv); $self->show_edit_video_page($video, message => "Video updated"); }, @@ -79,11 +79,10 @@ sub dispatch_request { }, sub (POST + %edit_bucket=&*) { - my ($self, $new_name) = @_; - die "WTF"; - my ($ub, $err) = $bucket->update( - name => $new_name, - ); + my ($self, undef, $args) = @_; + delete $args->{edit_bucket}; + + my ($ub, $err) = $bucket->update(%$args); return $self->show_admin_page(message => $err) if $err; diff --git a/lib/App/IdiotBox/Video.pm b/lib/App/IdiotBox/Video.pm index cd12c20..e02fd89 100644 --- a/lib/App/IdiotBox/Video.pm +++ b/lib/App/IdiotBox/Video.pm @@ -4,6 +4,10 @@ use Moo; sub fields { return qw(slug bucket_slug name author details announcement_id) } +with 'App::IdiotBox::Clonable'; + +sub announcement_id { shift->{announcement_id} } +sub bucket_slug { shift->{bucket_slug} } sub slug { shift->{slug} } sub name { shift->{name} } sub author { shift->{author} } diff --git a/share/html/deleted.html b/share/html/deleted.html index 41acd38..50913fe 100644 --- a/share/html/deleted.html +++ b/share/html/deleted.html @@ -2,7 +2,7 @@

- The bucket was deleted. Say good by to THIS IZ MAI BUKKIT + The bucket was deleted. Say good bye to THIS IZ MAI BUKKIT

diff --git a/share/html/edit.html b/share/html/edit.html index 8a11a37..c37b3fe 100644 --- a/share/html/edit.html +++ b/share/html/edit.html @@ -8,7 +8,7 @@
--> - +

- +