From 9f9b4cc8b56987b487d40d816931bd364ed5cc6f Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Fri, 18 Jul 2014 19:27:21 +0200 Subject: [PATCH] Add a route to manage rooms --- public/vroom.pl | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/public/vroom.pl b/public/vroom.pl index ed6be77..d22c909 100755 --- a/public/vroom.pl +++ b/public/vroom.pl @@ -723,6 +723,19 @@ get '/about' => sub { get '/help' => 'help'; # Route for the admin page +get '/admin/(:room)' => sub { + my $self = shift; + my $room = $self->stash('room'); + my $data = $self->get_room($room); + unless ($data){ + return $self->render('error', + err => 'ERROR_ROOM_s_DOESNT_EXIST', + msg => sprintf ($self->l("ERROR_ROOM_s_DOESNT_EXIST"), $room), + room => $room + ); + } + $self->stash(room => $room); +} => 'manage_room'; get '/admin' => sub { my $self = shift; $self->delete_rooms;