diff options
| author | Louise Crow <louise.crow@gmail.com> | 2014-04-17 15:08:20 +0100 |
|---|---|---|
| committer | Louise Crow <louise.crow@gmail.com> | 2014-04-24 15:38:07 +0100 |
| commit | 59884fdf94434920f5cafd9adc4a6e7918656ca9 (patch) | |
| tree | 8f1e165c0ff9ecd6fdbcd6b7337d09a5a272ddb4 | |
| parent | ce5af815b47199fa3d4d27a7c499c1231db8a491 (diff) | |
Add feature flag for responsive styling
Sets viewport, uses responsive header and footer templates.
| -rw-r--r-- | app/views/layouts/default.html.erb | 17 | ||||
| -rw-r--r-- | config/general.yml-example | 3 | ||||
| -rw-r--r-- | lib/configuration.rb | 1 |
3 files changed, 17 insertions, 4 deletions
diff --git a/app/views/layouts/default.html.erb b/app/views/layouts/default.html.erb index 93b3c3698..a6724468e 100644 --- a/app/views/layouts/default.html.erb +++ b/app/views/layouts/default.html.erb @@ -40,7 +40,9 @@ <% if @no_crawl %> <meta name="robots" content="noindex, nofollow"> <% end %> - + <% if AlaveteliConfiguration::responsive_styling || params[:responsive] %> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <% end %> <%= render :partial => 'general/before_head_end' %> </head> <body class="<%= 'front' if params[:action] == 'frontpage' %>"> @@ -84,7 +86,11 @@ </span> <span class="popup-close"><a href="#top" ><%= _('Close') %></a></span> </div> - <%= render :partial => 'general/header' %> + <% if AlaveteliConfiguration::responsive_styling || params[:responsive] %> + <%= render :partial => 'general/responsive_header' %> + <% else %> + <%= render :partial => 'general/header' %> + <% end %> <div id="wrapper"> <div id="content"> <% if flash[:notice] %> @@ -100,8 +106,11 @@ <div style="clear:both"></div> </div> </div> - - <%= render :partial => 'general/footer' %> + <% if AlaveteliConfiguration::responsive_styling || params[:responsive] %> + <%= render :partial => 'general/responsive_footer' %> + <% else %> + <%= render :partial => 'general/footer' %> + <% end %> </div> <div id="link_box"><span class="close-button">X</span> diff --git a/config/general.yml-example b/config/general.yml-example index ec9bdb6b5..6e223406e 100644 --- a/config/general.yml-example +++ b/config/general.yml-example @@ -253,3 +253,6 @@ SHARED_DIRECTORIES: # user via the user admin page. ALLOW_BATCH_REQUESTS: false + +# Should we use the responsive stylesheets? +RESPONSIVE_STYLING: false diff --git a/lib/configuration.rb b/lib/configuration.rb index bd705b777..d525bf712 100644 --- a/lib/configuration.rb +++ b/lib/configuration.rb @@ -58,6 +58,7 @@ module AlaveteliConfiguration :RECAPTCHA_PUBLIC_KEY => 'x', :REPLY_LATE_AFTER_DAYS => 20, :REPLY_VERY_LATE_AFTER_DAYS => 40, + :RESPONSIVE_STYLING => false, :SITE_NAME => 'Alaveteli', :SKIP_ADMIN_AUTH => false, :SPECIAL_REPLY_VERY_LATE_AFTER_DAYS => 60, |
