Mark active page as such in the toolbar

master
Daniel Berteaud 10 years ago
parent 6af9ae7e4b
commit f8257889b3
  1. 3
      public/js/vroom.js
  2. 1
      templates/default/js_common.html.ep
  3. 10
      templates/default/public_toolbar.html.ep
  4. 24
      vroom.pl

@ -32,6 +32,9 @@ var itemPerPage = 20;
// Will store the global webrtc object
var webrtc = undefined;
// Mark current page link as active
$('#lnk_' + page).addClass('active');
// Localize the strings we need
$.ajax({
url: rootUrl + 'localize/' + currentLang,

@ -4,6 +4,7 @@
var rootUrl = '<%= $url %>';
var currentLang = '<%= $self->languages %>';
var api_key = '<%= ($self->session('key')) ? $self->session('key') : '' %>';
var page = '<%= stash('page') ? stash('page') : "" %>';
var roomName;
</script>
<%

@ -11,20 +11,20 @@
</div>
<div class="collapse navbar-collapse" id="toolbar">
<ul class="nav navbar-nav navbar-right">
<li>
<li id='lnk_index'>
<a href="<%= $self->url_for('/') %>"><%=l 'HOME' %></a>
</li>
<li>
<li id='lnk_help'>
<a href="<%= $self->url_for('/help') %>"><%=l 'HELP' %></a>
</li>
<li>
<li id='lnk_about'>
<a href="<%= $self->url_for('/about') %>"><%=l 'ABOUT' %></a>
</li>
<li>
<li id='lnk_feedback'>
<a href="<%= $self->url_for('/feedback') %>"><%=l 'FEEDBACK' %></a>
</li>
<% if ($config->{'interface.demo'}){ %>
<li>
<li id='lnk_documentation'>
<a href="<%= $self->url_for('/documentation') %>"><%=l 'DOCUMENTATION' %></a>
</li>
<% } %>

@ -1173,6 +1173,7 @@ Mojo::IOLoop->recurring( 3 => sub {
get '/' => sub {
my $self = shift;
$self->stash(
page => 'index',
etherpad => ($ec) ? 'true' : 'false'
);
} => 'index';
@ -1181,20 +1182,37 @@ get '/' => sub {
get '/about' => sub {
my $self = shift;
$self->stash(
page => 'about',
components => COMPONENTS,
musics => MOH
);
} => 'about';
# Documentation
get '/documentation' => 'documentation';
get '/documentation' => sub {
my $self = shift;
$self->stash(
page => 'documentation'
);
} => 'documentation';
# Route for the help page
get '/help' => 'help';
get '/help' => sub {
my $self = shift;
$self->stash(
page => 'help'
);
} => 'help';
# Routes for feedback. One get to display the form
# and one post to get data from it
get '/feedback' => 'feedback';
get '/feedback' => sub {
my $self = shift;
$self->stash(
page => 'feedback'
);
} => 'feedback';
post '/feedback' => sub {
my $self = shift;
my $email = $self->param('email') || '';

Loading…
Cancel
Save