From 67d874e66ee41af584714de5d702ed78f3c8b7c4 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Mon, 19 May 2014 11:37:40 +0200 Subject: [PATCH] Add a new button to create the room if it doesn't exist Fix #39 --- public/vroom.pl | 1 + templates/default/error.html.ep | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/public/vroom.pl b/public/vroom.pl index 4d09a01..5b257a0 100755 --- a/public/vroom.pl +++ b/public/vroom.pl @@ -594,6 +594,7 @@ post '/action' => sub { return $self->render( json => { msg => sprintf ($self->l("ERROR_ROOM_s_DOESNT_EXIST"), $room), + err => 'ERROR_ROOM_s_DOESNT_EXIST', status => 'error' }, ) unless ($data); diff --git a/templates/default/error.html.ep b/templates/default/error.html.ep index ab78f0b..9152809 100644 --- a/templates/default/error.html.ep +++ b/templates/default/error.html.ep @@ -3,7 +3,7 @@ %= include 'public_toolbar'
- +

<%=l 'ERROR_OCCURED' %>

<%= $msg %>

<%=l 'BACK_TO_MAIN_MENU' %> @@ -11,10 +11,17 @@ <%=l 'JOIN_THIS_ROOM' %> <% } elsif ($err eq 'WRONG_PASSWORD'){ %> <%=l 'TRY_AGAIN' %> - <% } elsif ($err eq 'ERROR_ROOM_s_LOCKED' && $ownerPass){ %> + <% } elsif ($err eq 'ERROR_ROOM_s_LOCKED' && stash 'ownerPass'){ %> <%=l 'AUTH_IF_OWNER' %> + <% } elsif ($err eq 'ERROR_ROOM_s_DOESNT_EXIST'){ %> + <% } %>
+ <% if ($err eq 'ERROR_ROOM_s_DOESNT_EXIST'){ %> +
+ +
+ <% } %>
%= include 'js_common'