diff --git a/lib/Vroom/I18N/en.pm b/lib/Vroom/I18N/en.pm
index 33758e8..b7266fd 100644
--- a/lib/Vroom/I18N/en.pm
+++ b/lib/Vroom/I18N/en.pm
@@ -144,7 +144,7 @@ our %Lexicon = (
"AUTH_IF_OWNER" => "Authenticate if you are the room owner",
"CREATE_THIS_ROOM" => "Create this room",
"ADMINISTRATION" => "Administration",
- "EXISTING_ROOMS" => "Existing rooms",
+ "ROOM_MANAGEMENT" => "Room management",
"MANAGE" => "Manage",
"ROOM_DETAILS" => "Room details",
"ROOM_ID" => "ID",
diff --git a/lib/Vroom/I18N/fr.pm b/lib/Vroom/I18N/fr.pm
index 7d6b142..075e305 100644
--- a/lib/Vroom/I18N/fr.pm
+++ b/lib/Vroom/I18N/fr.pm
@@ -150,7 +150,7 @@ our %Lexicon = (
"AUTH_IF_OWNER" => "Authentifiez-vous si vous êtes le propriétaire du salon",
"CREATE_THIS_ROOM" => "Créez ce salon",
"ADMINISTRATION" => "Administration",
- "EXISTING_ROOMS" => "Salons existants",
+ "ROOM_MANAGEMENT" => "Gestion des salons",
"MANAGE" => "Gérer",
"ROOM_DETAILS" => "Détails du salon",
"ROOM_ID" => "Identifiant",
diff --git a/public/js/vroom.js b/public/js/vroom.js
index fe19770..cb55053 100644
--- a/public/js/vroom.js
+++ b/public/js/vroom.js
@@ -400,8 +400,8 @@ function initIndex(){
});
}
-// Used on the admin page
-function initAdmin(){
+// Used on the room admin page
+function initAdminRooms(){
var roomList = {};
var matches = 0;
diff --git a/templates/default/admin.html.ep b/templates/default/admin.html.ep
index f5943be..c05e2e1 100644
--- a/templates/default/admin.html.ep
+++ b/templates/default/admin.html.ep
@@ -1,55 +1,12 @@
-% title $self->l('ADMINISTRATION');
-%=include 'header'
-%=include 'public_toolbar'
-
-%= include 'noscript'
-%= include 'configure_modal'
-%= include 'delete_room_modal'
-
-
-
-
-
-
-
-
- <%=l 'ROOM_NAME' %>
- |
-
- <%=l 'CREATION_DATE' %>
- |
-
- <%=l 'LAST_ACTIVITY' %>
- |
-
- <%=l 'MANAGE' %>
- |
-
-
-
-
-
-
-
+% title l('ADMINISTRATION');
+%= include 'header'
+%= include 'public_toolbar'
+
+
-%=include 'js_common'
-
-%=include 'footer'
+%= include 'js_common'
+%= include 'footer'
diff --git a/templates/default/admin_manage_rooms.html.ep b/templates/default/admin_manage_rooms.html.ep
new file mode 100644
index 0000000..c8c6985
--- /dev/null
+++ b/templates/default/admin_manage_rooms.html.ep
@@ -0,0 +1,55 @@
+% title $self->l('ROOM_MANAGEMENT');
+%=include 'header'
+%=include 'public_toolbar'
+
+%= include 'noscript'
+%= include 'configure_modal'
+%= include 'delete_room_modal'
+
+
+
+
+
+
+
+
+ <%=l 'ROOM_NAME' %>
+ |
+
+ <%=l 'CREATION_DATE' %>
+ |
+
+ <%=l 'LAST_ACTIVITY' %>
+ |
+
+ <%=l 'MANAGE' %>
+ |
+
+
+
+
+
+
+
+
+
+%=include 'js_common'
+
+%=include 'footer'
diff --git a/vroom.pl b/vroom.pl
index b951c4a..5cb2c80 100755
--- a/vroom.pl
+++ b/vroom.pl
@@ -1038,19 +1038,6 @@ get '/about' => sub {
# Route for the help page
get '/help' => 'help';
-# Route for the admin pages
-get '/admin' => sub {
- my $self = shift;
- # Someone accessing /admin is considered an admin
- # For now, the auth is handled outside of VROOM itself
- $self->login;
- $self->make_key_admin($self->session('key'));
- $self->purge_rooms;
- return $self->render('admin',
- admin => 1
- );
-};
-
# Routes for feedback. One get to display the form
# and one post to get data from it
get '/feedback' => 'feedback';
@@ -1836,6 +1823,33 @@ any '/api' => sub {
}
};
+group {
+ under '/admin' => sub {
+ my $self = shift;
+ # For now, lets just pretend that anyone able to access
+ # /admin is already logged in (auth is managed outside of VROOM)
+ # TODO: support several auth method, including an internal one where user are managed
+ # in our DB, and another where auth is handled by the web server
+ $self->login;
+ $self->make_key_admin($self->session('key'));
+ $self->purge_rooms;
+ $self->stash(admin => 1);
+ return 1;
+ };
+
+ # Admin index
+ get '/' => sub {
+ my $self = shift;
+ return $self->render('admin');
+ };
+
+ # Room management
+ get '/rooms' => sub {
+ my $self = shift;
+ return $self->render('admin_manage_rooms');
+ };
+};
+
# Catch all route: if nothing else match, it's the name of a room
get '/:room' => sub {
my $self = shift;