From 4fb913d0f10c14bdedc6989087781833cf77391b Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Fri, 17 Jul 2015 10:07:14 +0200 Subject: [PATCH] Check if etherpad is enabled with the get_opt_features helper Instead of stashing the value --- templates/default/index.html.ep | 4 ++-- templates/default/join.html.ep | 6 +++--- vroom.pl | 4 +--- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/templates/default/index.html.ep b/templates/default/index.html.ep index 0a30fa6..77b3625 100644 --- a/templates/default/index.html.ep +++ b/templates/default/index.html.ep @@ -66,7 +66,7 @@
  • - <% if ($etherpad eq 'true'){ %> + <% if ($self->get_opt_features->{etherpad}){ %>
  • <% } %> @@ -148,7 +148,7 @@ - <% if ($etherpad eq 'true') { %> + <% if ($self->get_opt_features->{etherpad}) { %>
    %= image '/img/note.png', alt => $self->l('COLLABORATIVE_NOTETAKING'), class => "img-responsive carouselLogo"

    diff --git a/templates/default/join.html.ep b/templates/default/join.html.ep index 3679f3e..e294d84 100644 --- a/templates/default/join.html.ep +++ b/templates/default/join.html.ep @@ -51,7 +51,7 @@ 0 - <% if ($etherpad eq 'true'){ %> + <% if ($self->get_opt_features->{etherpad}){ %>

    - <% if ($etherpad eq 'true'){ %> + <% if ($self->get_opt_features->{etherpad}){ %> <% } %>
    @@ -386,7 +386,7 @@ var roomName = '<%= $room %>'; $( document ).ready(function() { etherpad = { - enabled: <%= $etherpad %>, + enabled: <%= $self->get_opt_features->{etherpad} ? 'true' : 'false' %>, <% my $ethuri = Mojo::URL->new($config->{'etherpad.uri'}); %> diff --git a/vroom.pl b/vroom.pl index c7c0b28..91ffe94 100755 --- a/vroom.pl +++ b/vroom.pl @@ -1492,8 +1492,7 @@ get '/' => sub { my $self = shift; $self->login; $self->stash( - page => 'index', - etherpad => ($optf->{etherpad}) ? 'true' : 'false' + page => 'index' ); } => 'index'; @@ -2400,7 +2399,6 @@ get '/:room' => sub { page => 'room', moh => $self->choose_moh(), video => $video, - etherpad => ($optf->{etherpad}) ? 'true' : 'false', etherpadGroup => $data->{etherpad_group}, ua => $self->req->headers->user_agent );