diff options
Diffstat (limited to 'app/views/general')
-rw-r--r-- | app/views/general/_responsive_credits.html.erb | 2 | ||||
-rw-r--r-- | app/views/general/_responsive_footer.html.erb | 15 | ||||
-rw-r--r-- | app/views/general/_responsive_header.html.erb | 31 | ||||
-rw-r--r-- | app/views/general/_responsive_stylesheets.html.erb | 11 | ||||
-rw-r--r-- | app/views/general/_responsive_topnav.html.erb | 32 | ||||
-rw-r--r-- | app/views/general/_stylesheet_includes.html.erb | 56 | ||||
-rw-r--r-- | app/views/general/blog.html.erb | 31 | ||||
-rw-r--r-- | app/views/general/search.html.erb | 34 |
8 files changed, 162 insertions, 50 deletions
diff --git a/app/views/general/_responsive_credits.html.erb b/app/views/general/_responsive_credits.html.erb new file mode 100644 index 000000000..01a5df13a --- /dev/null +++ b/app/views/general/_responsive_credits.html.erb @@ -0,0 +1,2 @@ +<li><%= _('Powered by <a href="http://www.alaveteli.org/">Alaveteli</a>') %> +</li> diff --git a/app/views/general/_responsive_footer.html.erb b/app/views/general/_responsive_footer.html.erb new file mode 100644 index 000000000..2967872f1 --- /dev/null +++ b/app/views/general/_responsive_footer.html.erb @@ -0,0 +1,15 @@ +<div class="footer" id="footer"> + <div id="footer-nav"> + <ul> + <li><%= link_to image_tag('logo.png'), frontpage_path, :id => 'logo' %></li> + <li><%= link_to _("Contact {{site_name}}", :site_name => site_name), help_contact_path %></li> + <% unless AlaveteliConfiguration::twitter_username.blank? %> + <li><a href="https://twitter.com/<%= AlaveteliConfiguration::twitter_username %>"><%= _("Follow us on twitter") %></a></li> + <% end %> + + <%= render :partial => 'general/responsive_credits' %> + + </ul> + + </div> +</div> diff --git a/app/views/general/_responsive_header.html.erb b/app/views/general/_responsive_header.html.erb new file mode 100644 index 000000000..3a2994b4d --- /dev/null +++ b/app/views/general/_responsive_header.html.erb @@ -0,0 +1,31 @@ +<div id="banner"> + <div id="banner_inner"> + <div id="banner_content"> + <div id="logo_wrapper"> + <%= link_to image_tag('logo.png'), frontpage_path, :id => 'logo' %> + </div> + <div class="rsp_menu_button"> + <a href="#banner" class="open"> <i class="icon-menu"></i> Menu </a> + <a href="#" class="close"> <i class="icon-menu"></i> Close </a> + </div> + <%= render :partial => 'general/locale_switcher' %> + <% if ! (controller.action_name == 'signin' or controller.action_name == 'signup') %> + <div id="logged_in_bar"> + <div id="logged_in_links"> + <% if @user %> + <span class="greeting"><%= _('Hello, {{username}}!', :username => @user.name) %></span> + <%=link_to _("My requests"), show_user_requests_path(:url_name => @user.url_name) %> + <%=link_to _("My profile"), show_user_profile_path(:url_name => @user.url_name) %> + <%=link_to _("My wall"), show_user_wall_path(:url_name => @user.url_name) %> + <%= link_to _("Sign out"), signout_path(:r => request.fullpath) %> + <% else %> + <%= link_to _("Sign in or sign up"), signin_path(:r => request.fullpath) %> + <% end %> + </div> + </div> + <% end %> + </div> + <%= render :partial => 'general/responsive_topnav' %> + </div> +</div> + diff --git a/app/views/general/_responsive_stylesheets.html.erb b/app/views/general/_responsive_stylesheets.html.erb new file mode 100644 index 000000000..e3c3660c4 --- /dev/null +++ b/app/views/general/_responsive_stylesheets.html.erb @@ -0,0 +1,11 @@ +<!--[if LTE IE 7]> +<%= stylesheet_link_tag 'responsive/application-lte-ie7', :title => "Main", :rel => "stylesheet", :media => "all" %> +<![endif]--> + +<!--[if IE 8]> +<%= stylesheet_link_tag 'responsive/application-ie8', :title => "Main", :rel => "stylesheet", :media => "all" %> +<![endif]--> + +<!--[if GT IE 8]><!--> +<%= stylesheet_link_tag 'responsive/application', :title => "Main", :rel => "stylesheet", :media => "all" %> +<!--<![endif]--> diff --git a/app/views/general/_responsive_topnav.html.erb b/app/views/general/_responsive_topnav.html.erb new file mode 100644 index 000000000..e726c17f4 --- /dev/null +++ b/app/views/general/_responsive_topnav.html.erb @@ -0,0 +1,32 @@ +<div id="topnav"> + <ul id="navigation"> + + <li class="<%= 'selected' if params[:controller] == 'request' and ['new', 'select_authority'].include?(params[:action]) %>"> + <%= link_to _("Make a request"), select_authority_path, :id => 'make-request-link' %> + </li> + + <li class="<%= 'selected' if params[:controller] == 'request' and !['new', 'select_authority'].include?(params[:action]) %>"> + <%= link_to _("View requests"), request_list_successful_path %> + </li> + + <li class="<%= 'selected' if params[:controller] == 'public_body' %>"> + <%= link_to _("View authorities"), list_public_bodies_default_path %> + </li> + + <% unless AlaveteliConfiguration::blog_feed.empty? %> + <li class="<%= 'selected' if params[:controller] == 'general' and params[:action] == 'blog' %>"><%= link_to _("Read blog"), blog_path %></li> + <% end %> + <li class="<%= 'selected' if params[:controller] == 'help' %>"> + <%= link_to _("Help"), help_about_path %> + </li> + + <li id="navigation_search"> + <form id="navigation_search_form" method="post" action="<%= search_redirect_path %>"> + <label for="navigation_search_button"> + <img src="/assets/search.png" alt="Search:"> + </label> + <%= text_field_tag 'query', params[:query], { :id => "navigation_search_button", :title => "type your search term here" } %> + </form> + </li> + </ul> +</div> diff --git a/app/views/general/_stylesheet_includes.html.erb b/app/views/general/_stylesheet_includes.html.erb index 7a1648efd..ac7c37217 100644 --- a/app/views/general/_stylesheet_includes.html.erb +++ b/app/views/general/_stylesheet_includes.html.erb @@ -1,22 +1,40 @@ -<%- if @render_to_file %> - <style> - <%= Rails.application.assets["main.css"].to_s %> - <%= Rails.application.assets["print.css"].to_s %> - </style> -<%- else %> - <%= stylesheet_link_tag 'application', :title => "Main", :rel => "stylesheet", :media => "all" %> - <%= stylesheet_link_tag 'fonts', :rel => "stylesheet", :media => "all" %> - <%= stylesheet_link_tag 'print', :rel => "stylesheet", :media => "print" %> - <% if !params[:print_stylesheet].nil? %> - <%= stylesheet_link_tag 'print', :rel => "stylesheet", :media => "all" %> +<% if AlaveteliConfiguration::responsive_styling || params[:responsive] %> + <%- if @render_to_file %> + <style> + <%= Rails.application.assets["responsive/application.css"].to_s %> + <%= Rails.application.assets["responsive/print.css"].to_s %> + </style> + <%- else %> + <%= render :partial => 'general/responsive_stylesheets' %> + <%= stylesheet_link_tag 'responsive/print', :rel => "stylesheet", :media => "print" %> + <% if !params[:print_stylesheet].nil? %> + <%= stylesheet_link_tag 'responsive/print', :rel => "stylesheet", :media => "all" %> + <% end %> + <% if AlaveteliConfiguration::force_registration_on_new_request %> + <%= stylesheet_link_tag 'fancybox.css', :rel => "stylesheet" %> + <% end %> <% end %> - <!--[if LT IE 7]> - <%= stylesheet_link_tag 'ie6.css' %> - <![endif]--> - <!--[if LT IE 8]> - <%= stylesheet_link_tag 'ie7.css' %> - <![endif]--> - <% if AlaveteliConfiguration::force_registration_on_new_request %> - <%= stylesheet_link_tag 'jquery.fancybox-1.3.4.css', :rel => "stylesheet" %> +<% else %> + <%- if @render_to_file %> + <style> + <%= Rails.application.assets["main.css"].to_s %> + <%= Rails.application.assets["print.css"].to_s %> + </style> + <%- else %> + <%= stylesheet_link_tag 'application', :title => "Main", :rel => "stylesheet", :media => "all" %> + <%= stylesheet_link_tag 'fonts', :rel => "stylesheet", :media => "all" %> + <%= stylesheet_link_tag 'print', :rel => "stylesheet", :media => "print" %> + <% if !params[:print_stylesheet].nil? %> + <%= stylesheet_link_tag 'print', :rel => "stylesheet", :media => "all" %> + <% end %> + <!--[if LT IE 7]> + <%= stylesheet_link_tag 'ie6.css' %> + <![endif]--> + <!--[if LT IE 8]> + <%= stylesheet_link_tag 'ie7.css' %> + <![endif]--> + <% if AlaveteliConfiguration::force_registration_on_new_request %> + <%= stylesheet_link_tag 'fancybox.css', :rel => "stylesheet" %> + <% end %> <% end %> <% end %> diff --git a/app/views/general/blog.html.erb b/app/views/general/blog.html.erb index b81989ca8..5dda7ab74 100644 --- a/app/views/general/blog.html.erb +++ b/app/views/general/blog.html.erb @@ -1,21 +1,5 @@ <% @title = _("{{site_name}} blog and tweets", :site_name => site_name) %> -<% if !@twitter_user.empty? %> -<div id="right_column"> - <div class="act_link"> - <h2><%= _("Stay up to date") %></h2> - <%= image_tag "twitter-16.png", :alt => "twitter icon", :class => "twitter-icon" %> <a href="https://twitter.com/<%= @twitter_user %>"><%= _("Follow us on twitter") %></a><br/><br/> - <%= image_tag "feed-16.png", :alt => "RSS icon" %> <a href="<%= @feed_url %>"><%= _("Subscribe to blog") %></a> - </div> - <% if AlaveteliConfiguration::twitter_widget_id %> - <div id="twitter"> - <a class="twitter-timeline" data-dnt=true href="https://twitter.com/<%= AlaveteliConfiguration::twitter_username %>" data-widget-id="<%= AlaveteliConfiguration::twitter_widget_id %>">Tweets by @<%= AlaveteliConfiguration::twitter_username %></a> - <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script> - </div> - <% end %> -</div> -<% end %> - <div id="left_column"> <h1><%=@title %></h1> @@ -42,3 +26,18 @@ </div> </div> +<% if !@twitter_user.empty? %> +<div id="right_column"> + <div class="act_link"> + <h2><%= _("Stay up to date") %></h2> + <%= image_tag "twitter-16.png", :alt => "twitter icon", :class => "twitter-icon" %> <a href="https://twitter.com/<%= @twitter_user %>"><%= _("Follow us on twitter") %></a><br/><br/> + <%= image_tag "feed-16.png", :alt => "RSS icon" %> <a href="<%= @feed_url %>"><%= _("Subscribe to blog") %></a> + </div> + <% if AlaveteliConfiguration::twitter_widget_id %> + <div id="twitter"> + <a class="twitter-timeline" data-dnt=true href="https://twitter.com/<%= AlaveteliConfiguration::twitter_username %>" data-widget-id="<%= AlaveteliConfiguration::twitter_widget_id %>">Tweets by @<%= AlaveteliConfiguration::twitter_username %></a> + <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script> + </div> + <% end %> +</div> +<% end %> diff --git a/app/views/general/search.html.erb b/app/views/general/search.html.erb index 18f258444..3914a2f30 100644 --- a/app/views/general/search.html.erb +++ b/app/views/general/search.html.erb @@ -136,15 +136,18 @@ <div style="clear:both;"></div> <% if @total_hits == 0 %> + <div class="results_section"> <h2><%=@title %></h2> <% if @spelling_correction %> <p id="did_you_mean"><%= _('Did you mean: {{correction}}', :correction => search_link(@spelling_correction)) %></p> <% end %> + </div> <% end %> <% if not @query.nil? %> - <div class="results_section"> - <% if @xapian_bodies_hits > 0 %> + + <% if @xapian_bodies_hits > 0 %> + <div class="results_section"> <% if @xapian_bodies_hits == 1 && @page == 1 %> <h2 class="publicbody_results"><%= _('One public authority found') %></h2> <% else %> @@ -158,13 +161,13 @@ </div> <%= will_paginate WillPaginate::Collection.new(@page, @bodies_per_page, @xapian_bodies.matches_estimated) %> - <% elsif @variety_postfix == 'bodies' %> - <p><%= raw(_('<a href="{{browse_url}}">Browse all</a> or <a href="{{add_url}}">ask us to add one</a>.', :browse_url => list_public_bodies_default_path.html_safe, :add_url => (help_requesting_path + '#missing_body').html_safe)) %></p> - <% end %> - </div> + </div> + <% elsif @variety_postfix == 'bodies' %> + <p><%= raw(_('<a href="{{browse_url}}">Browse all</a> or <a href="{{add_url}}">ask us to add one</a>.', :browse_url => list_public_bodies_default_path.html_safe, :add_url => (help_requesting_path + '#missing_body').html_safe)) %></p> + <% end %> - <div class="results_section"> - <% if @xapian_users_hits > 0 %> + <% if @xapian_users_hits > 0 %> + <div class="results_section"> <% if @xapian_users_hits == 1 && @page == 1 %> <h2 class="person_results"><%= _("One person found") %></h2> <% else %> @@ -178,11 +181,12 @@ </div> <%= will_paginate WillPaginate::Collection.new(@page, @users_per_page, @xapian_users.matches_estimated) %> - <% end %> - </div> + </div> + <% end %> - <div class="results_section"> - <% if @xapian_requests_hits > 0 %> + + <% if @xapian_requests_hits > 0 %> + <div class="results_section"> <% if @xapian_requests_hits == 1 && @page == 1 %> <h2 class="foi_results"><%= _("One FOI request found") %></h2> <% else %> @@ -191,13 +195,13 @@ <div class="results_block"> <% for result in @xapian_requests.results %> - <%= render :partial => 'request/request_listing_via_event', :locals => { :event => result[:model], :info_request => result[:model].info_request } %> + <%= render :partial => 'request/request_listing_via_event', :locals => { :event => result[:model] } %> <% end %> </div> <%= will_paginate WillPaginate::Collection.new(@page, @requests_per_page, @xapian_requests.matches_estimated) %> - <% end %> - </div> + </div> + <% end %> <% end %> <% if @advanced %> |