Add a new button to create the room if it doesn't exist

Fix #39
master
Daniel Berteaud 11 years ago
parent 1b858a8912
commit 67d874e66e
  1. 1
      public/vroom.pl
  2. 11
      templates/default/error.html.ep

@ -594,6 +594,7 @@ post '/action' => sub {
return $self->render( return $self->render(
json => { json => {
msg => sprintf ($self->l("ERROR_ROOM_s_DOESNT_EXIST"), $room), msg => sprintf ($self->l("ERROR_ROOM_s_DOESNT_EXIST"), $room),
err => 'ERROR_ROOM_s_DOESNT_EXIST',
status => 'error' status => 'error'
}, },
) unless ($data); ) unless ($data);

@ -3,7 +3,7 @@
%= include 'public_toolbar' %= include 'public_toolbar'
<div class="container-fluid"> <div class="container-fluid">
<div class="jumbotron alert-danger"> <div class="jumbotron alert-danger">
<h2<%=l 'ERROR_OCCURED' %></h2> <h2><%=l 'ERROR_OCCURED' %></h2>
<p><%= $msg %></p> <p><%= $msg %></p>
<div class="btn-group"> <div class="btn-group">
<a class="btn btn-primary btn-lg" role="button" href="<%= $self->get_url('/') %>"><%=l 'BACK_TO_MAIN_MENU' %></a> <a class="btn btn-primary btn-lg" role="button" href="<%= $self->get_url('/') %>"><%=l 'BACK_TO_MAIN_MENU' %></a>
@ -11,10 +11,17 @@
<a class="btn btn-default btn-lg" role="button" href="<%= $self->get_url('/') . $room %>"><%=l 'JOIN_THIS_ROOM' %></a> <a class="btn btn-default btn-lg" role="button" href="<%= $self->get_url('/') . $room %>"><%=l 'JOIN_THIS_ROOM' %></a>
<% } elsif ($err eq 'WRONG_PASSWORD'){ %> <% } elsif ($err eq 'WRONG_PASSWORD'){ %>
<a class="btn btn-default btn-lg" role="button" href="<%= $self->get_url('/password') . '/' . $room %>"><%=l 'TRY_AGAIN' %></a> <a class="btn btn-default btn-lg" role="button" href="<%= $self->get_url('/password') . '/' . $room %>"><%=l 'TRY_AGAIN' %></a>
<% } elsif ($err eq 'ERROR_ROOM_s_LOCKED' && $ownerPass){ %> <% } elsif ($err eq 'ERROR_ROOM_s_LOCKED' && stash 'ownerPass'){ %>
<a class="btn btn-default btn-lg" role="button" href="<%= $self->get_url('/password') . '/' . $room %>"><%=l 'AUTH_IF_OWNER' %></a> <a class="btn btn-default btn-lg" role="button" href="<%= $self->get_url('/password') . '/' . $room %>"><%=l 'AUTH_IF_OWNER' %></a>
<% } elsif ($err eq 'ERROR_ROOM_s_DOESNT_EXIST'){ %>
<button class="btn btn-default btn-lg" role="submit" form="createRoomForm"><%=l 'CREATE_THIS_ROOM' %></button>
<% } %> <% } %>
</div> </div>
<% if ($err eq 'ERROR_ROOM_s_DOESNT_EXIST'){ %>
<form id="createRoomForm" action="<%= $self->get_url('/create') %>" method="post">
<input type="text" name="roomName" value="<%= $room %>" hidden/>
</form>
<% } %>
</div> </div>
</div> </div>
%= include 'js_common' %= include 'js_common'

Loading…
Cancel
Save