Display the number of participants in the management page

master
Daniel Berteaud 11 years ago
parent 819ac83f63
commit f2db6be49e
  1. 1
      lib/Vroom/I18N/en.pm
  2. 1
      lib/Vroom/I18N/fr.pm
  3. 7
      public/vroom.pl
  4. 8
      templates/default/manage_room.html.ep

@ -164,6 +164,7 @@ our %Lexicon = (
"ROOM_ID" => "ID", "ROOM_ID" => "ID",
"CREATION_DATE" => "Creation date", "CREATION_DATE" => "Creation date",
"LAST_ACTIVITY" => "Last activity", "LAST_ACTIVITY" => "Last activity",
"NUMBER_OF_PARTICIPANTS" => "Number of participants",
"LOCKED" => "Locked", "LOCKED" => "Locked",
"ASK_FOR_NAME" => "Require to enter a name", "ASK_FOR_NAME" => "Require to enter a name",
"PASSWORD_PROTECTED" => "Password protection", "PASSWORD_PROTECTED" => "Password protection",

@ -171,6 +171,7 @@ our %Lexicon = (
"ROOM_ID" => "Identifiant", "ROOM_ID" => "Identifiant",
"CREATION_DATE" => "Date de création", "CREATION_DATE" => "Date de création",
"LAST_ACTIVITY" => "Dernière activité", "LAST_ACTIVITY" => "Dernière activité",
"NUMBER_OF_PARTICIPANTS" => "Nombre de participants",
"LOCKED" => "Verrouillé", "LOCKED" => "Verrouillé",
"ASK_FOR_NAME" => "Exige de saisir un nom", "ASK_FOR_NAME" => "Exige de saisir un nom",
"PASSWORD_PROTECTED" => "Protection par mot de passe", "PASSWORD_PROTECTED" => "Protection par mot de passe",

@ -802,6 +802,7 @@ get '/help' => 'help';
get '/admin/(:room)' => sub { get '/admin/(:room)' => sub {
my $self = shift; my $self = shift;
my $room = $self->stash('room'); my $room = $self->stash('room');
$self->delete_participants;
my $data = $self->get_room($room); my $data = $self->get_room($room);
unless ($data){ unless ($data){
return $self->render('error', return $self->render('error',
@ -810,7 +811,11 @@ get '/admin/(:room)' => sub {
room => $room room => $room
); );
} }
$self->stash(room => $room); my $num = scalar $self->get_participants($room);
$self->stash(
room => $room,
participants => $num
);
} => 'manage_room'; } => 'manage_room';
# And this one displays the list of existing rooms # And this one displays the list of existing rooms
get '/admin' => sub { get '/admin' => sub {

@ -65,6 +65,14 @@
</tr> </tr>
<tr> <tr>
<th> <th>
<%=l 'NUMBER_OF_PARTICIPANTS' %>
</th>
<th>
<%= $participants %>
</th>
</tr>
<tr>
<th>
<%=l 'LOCKED' %> <%=l 'LOCKED' %>
</th> </th>
<th> <th>

Loading…
Cancel
Save