Some essential fixes in admin area

master
Daniel Berteaud 10 years ago
parent 45794f4127
commit 5d7005d1fd
  1. 5
      templates/default/admin.html.ep
  2. 2
      templates/default/manage_room.html.ep
  3. 15
      vroom.pl

@ -20,9 +20,8 @@
</thead> </thead>
<tbody> <tbody>
<% <%
my @rooms = $self->get_all_rooms(); my $rooms = $self->get_room_list();
foreach my $room (@rooms){ foreach my $room (keys %{$rooms}){
my $data = $self->get_room($room);
%> %>
<tr> <tr>
<td> <td>

@ -37,7 +37,7 @@
<div class="panel-heading"> <div class="panel-heading">
<%=l 'ROOM_DETAILS' %> <%=l 'ROOM_DETAILS' %>
</div> </div>
<% my $data = $self->get_room($room); %> <% my $data = $self->get_room_by_name($room); %>
<table class="table table-hover"> <table class="table table-hover">
<tbody> <tbody>
<tr> <tr>

@ -312,12 +312,12 @@ helper get_participants_list => sub {
return 0; return 0;
} }
my $sth = eval { my $sth = eval {
$self->db->prepare('SELECT `participant` $self->db->prepare('SELECT `participant`,`room_id`
FROM `room_participants` FROM `room_participants`
WHERE `room_id`=?'); WHERE `room_id`=?');
}; };
$sth->execute($room->{id}); $sth->execute($room->{id});
return $sth->fetchall_hashref('room_id')->{$room->{id}}; return $sth->fetchall_hashref('room_id');
}; };
# Set the role of a peer # Set the role of a peer
@ -495,19 +495,14 @@ helper delete_room => sub {
}; };
# Retrieve the list of rooms # Retrieve the list of rooms
# TODO: rewrite to return a hashref with full room data helper get_room_list => sub {
helper get_all_rooms => sub {
my $self = shift; my $self = shift;
my @rooms;
my $sth = eval { my $sth = eval {
$self->db->prepare('SELECT `name` $self->db->prepare('SELECT *
FROM `rooms`'); FROM `rooms`');
}; };
$sth->execute; $sth->execute;
while (my $name = $sth->fetchrow_array){ return $sth->fetchall_hashref('name');
push @rooms, $name;
}
return @rooms;
}; };
# Just update the activity timestamp # Just update the activity timestamp

Loading…
Cancel
Save