Check if etherpad is enabled with the get_opt_features helper

Instead of stashing the value
master
Daniel Berteaud 9 years ago
parent 52596a8b03
commit 4fb913d0f1
  1. 4
      templates/default/index.html.ep
  2. 6
      templates/default/join.html.ep
  3. 4
      vroom.pl

@ -66,7 +66,7 @@
<li data-target="#carouselIndex" data-slide-to="4"></li> <li data-target="#carouselIndex" data-slide-to="4"></li>
<li data-target="#carouselIndex" data-slide-to="5"></li> <li data-target="#carouselIndex" data-slide-to="5"></li>
<li data-target="#carouselIndex" data-slide-to="6"></li> <li data-target="#carouselIndex" data-slide-to="6"></li>
<% if ($etherpad eq 'true'){ %> <% if ($self->get_opt_features->{etherpad}){ %>
<li data-target="#carouselIndex" data-slide-to="7"></li> <li data-target="#carouselIndex" data-slide-to="7"></li>
<% } %> <% } %>
</ol> </ol>
@ -148,7 +148,7 @@
</h2> </h2>
</div> </div>
</div> </div>
<% if ($etherpad eq 'true') { %> <% if ($self->get_opt_features->{etherpad}) { %>
<div class="item carouselIndexItem col-xs-10 col-xs-offset-1"> <div class="item carouselIndexItem col-xs-10 col-xs-offset-1">
%= image '/img/note.png', alt => $self->l('COLLABORATIVE_NOTETAKING'), class => "img-responsive carouselLogo" %= image '/img/note.png', alt => $self->l('COLLABORATIVE_NOTETAKING'), class => "img-responsive carouselLogo"
<p> <p>

@ -51,7 +51,7 @@
0 0
</span> </span>
</button> </button>
<% if ($etherpad eq 'true'){ %> <% if ($self->get_opt_features->{etherpad}){ %>
<button class="btn btn-lg btn-default help btn-etherpad" data-toggle="tooltip" data-placement="bottom" title="<%=l 'OPEN_ETHERPAD' %>"> <button class="btn btn-lg btn-default help btn-etherpad" data-toggle="tooltip" data-placement="bottom" title="<%=l 'OPEN_ETHERPAD' %>">
<span class="glyphicon glyphicon-pencil"> <span class="glyphicon glyphicon-pencil">
</span> </span>
@ -368,7 +368,7 @@
</div> </div>
</div> </div>
<div id="mainView" class="col-xs-12 col-sm-8"> <div id="mainView" class="col-xs-12 col-sm-8">
<% if ($etherpad eq 'true'){ %> <% if ($self->get_opt_features->{etherpad}){ %>
<div id="etherpadContainer" class="hidden-xs"></div> <div id="etherpadContainer" class="hidden-xs"></div>
<% } %> <% } %>
<div id="mainVideo"> <div id="mainVideo">
@ -386,7 +386,7 @@
var roomName = '<%= $room %>'; var roomName = '<%= $room %>';
$( document ).ready(function() { $( document ).ready(function() {
etherpad = { etherpad = {
enabled: <%= $etherpad %>, enabled: <%= $self->get_opt_features->{etherpad} ? 'true' : 'false' %>,
<% <%
my $ethuri = Mojo::URL->new($config->{'etherpad.uri'}); my $ethuri = Mojo::URL->new($config->{'etherpad.uri'});
%> %>

@ -1492,8 +1492,7 @@ get '/' => sub {
my $self = shift; my $self = shift;
$self->login; $self->login;
$self->stash( $self->stash(
page => 'index', page => 'index'
etherpad => ($optf->{etherpad}) ? 'true' : 'false'
); );
} => 'index'; } => 'index';
@ -2400,7 +2399,6 @@ get '/:room' => sub {
page => 'room', page => 'room',
moh => $self->choose_moh(), moh => $self->choose_moh(),
video => $video, video => $video,
etherpad => ($optf->{etherpad}) ? 'true' : 'false',
etherpadGroup => $data->{etherpad_group}, etherpadGroup => $data->{etherpad_group},
ua => $self->req->headers->user_agent ua => $self->req->headers->user_agent
); );

Loading…
Cancel
Save