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 // Will store the global webrtc object
var webrtc = undefined; var webrtc = undefined;
// Mark current page link as active
$('#lnk_' + page).addClass('active');
// Localize the strings we need // Localize the strings we need
$.ajax({ $.ajax({
url: rootUrl + 'localize/' + currentLang, url: rootUrl + 'localize/' + currentLang,

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

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

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

Loading…
Cancel
Save