diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/stylesheets/main.scss | 4 | ||||
-rw-r--r-- | app/assets/stylesheets/responsive/_utils.scss (renamed from app/assets/stylesheets/responsive/_utils.css) | 0 | ||||
-rw-r--r-- | app/assets/stylesheets/responsive/all.scss (renamed from app/assets/stylesheets/responsive/all.css) | 0 | ||||
-rw-r--r-- | app/assets/stylesheets/responsive/custom.scss (renamed from app/assets/stylesheets/responsive/custom.css) | 0 | ||||
-rw-r--r-- | app/controllers/public_body_controller.rb | 48 | ||||
-rw-r--r-- | app/helpers/track_helper.rb | 48 | ||||
-rw-r--r-- | app/views/general/_locale_switcher.html.erb | 4 | ||||
-rw-r--r-- | app/views/request/upload_response.html.erb | 6 |
8 files changed, 58 insertions, 52 deletions
diff --git a/app/assets/stylesheets/main.scss b/app/assets/stylesheets/main.scss index 3118eab3d..8aa8010ae 100644 --- a/app/assets/stylesheets/main.scss +++ b/app/assets/stylesheets/main.scss @@ -134,6 +134,10 @@ overflow:visible; margin:0; } +#wrapper_google_embed iframe { +min-height: 800px; +} + #content { position:relative; width:875px; diff --git a/app/assets/stylesheets/responsive/_utils.css b/app/assets/stylesheets/responsive/_utils.scss index 68884fa7a..68884fa7a 100644 --- a/app/assets/stylesheets/responsive/_utils.css +++ b/app/assets/stylesheets/responsive/_utils.scss diff --git a/app/assets/stylesheets/responsive/all.css b/app/assets/stylesheets/responsive/all.scss index 4c935bed3..4c935bed3 100644 --- a/app/assets/stylesheets/responsive/all.css +++ b/app/assets/stylesheets/responsive/all.scss diff --git a/app/assets/stylesheets/responsive/custom.css b/app/assets/stylesheets/responsive/custom.scss index e69de29bb..e69de29bb 100644 --- a/app/assets/stylesheets/responsive/custom.css +++ b/app/assets/stylesheets/responsive/custom.scss diff --git a/app/controllers/public_body_controller.rb b/app/controllers/public_body_controller.rb index 862f4b318..96e69d333 100644 --- a/app/controllers/public_body_controller.rb +++ b/app/controllers/public_body_controller.rb @@ -109,17 +109,17 @@ class PublicBodyController < ApplicationController # Restrict the public bodies shown according to the tag # parameter supplied in the URL: - if @tag.nil? or @tag == "all" - @tag = "all" + if @tag.nil? || @tag == 'all' + @tag = 'all' elsif @tag == 'other' - category_list = PublicBodyCategories::get().tags().map{|c| "'"+c+"'"}.join(",") + category_list = PublicBodyCategories.get.tags.map{ |c| %Q('#{ c }') }.join(",") where_condition += base_tag_condition + " AND has_tag_string_tags.name in (#{category_list})) = 0" elsif @tag.scan(/./mu).size == 1 - @tag = Unicode.upcase @tag + @tag = Unicode.upcase(@tag) # The first letter queries have to be done on # translations, so just indicate to add that later: first_letter = true - elsif @tag.include?(":") + elsif @tag.include?(':') name, value = HasTagString::HasTagStringTag.split_tag_into_name_value(@tag) where_condition += base_tag_condition + " AND has_tag_string_tags.name = ? AND has_tag_string_tags.value = ?) > 0" where_parameters.concat [name, value] @@ -128,16 +128,16 @@ class PublicBodyController < ApplicationController where_parameters.concat [@tag] end - if @tag == "all" - @description = "" + if @tag == 'all' + @description = '' elsif @tag.size == 1 - @description = _("beginning with ‘{{first_letter}}’", :first_letter=>@tag) + @description = _("beginning with ‘{{first_letter}}’", :first_letter => @tag) else - category_name = PublicBodyCategories::get().by_tag()[@tag] + category_name = PublicBodyCategories.get.by_tag[@tag] if category_name.nil? - @description = _("matching the tag ‘{{tag_name}}’", :tag_name=>@tag) + @description = _("matching the tag ‘{{tag_name}}’", :tag_name => @tag) else - @description = _("in the category ‘{{category_name}}’", :category_name=>category_name) + @description = _("in the category ‘{{category_name}}’", :category_name => category_name) end end @@ -151,15 +151,15 @@ class PublicBodyController < ApplicationController FROM public_bodies LEFT OUTER JOIN public_body_translations as current_locale ON (public_bodies.id = current_locale.public_body_id - AND current_locale.locale = ? AND #{get_public_body_list_translated_condition 'current_locale', first_letter}) + AND current_locale.locale = ? AND #{ get_public_body_list_translated_condition('current_locale', first_letter) }) LEFT OUTER JOIN public_body_translations as default_locale ON (public_bodies.id = default_locale.public_body_id - AND default_locale.locale = ? AND #{get_public_body_list_translated_condition 'default_locale', first_letter}) - WHERE #{where_condition} AND COALESCE(current_locale.name, default_locale.name) IS NOT NULL + AND default_locale.locale = ? AND #{ get_public_body_list_translated_condition('default_locale', first_letter) }) + WHERE #{ where_condition } AND COALESCE(current_locale.name, default_locale.name) IS NOT NULL ORDER BY display_name} - sql = [query, underscore_locale, like_query, like_query] + sql = [query, underscore_locale, like_query, like_query, like_query] sql.push @tag if first_letter - sql += [underscore_default_locale, like_query, like_query] + sql += [underscore_default_locale, like_query, like_query, like_query] sql.push @tag if first_letter sql += where_parameters @public_bodies = PublicBody.paginate_by_sql( @@ -170,17 +170,17 @@ class PublicBodyController < ApplicationController # The simpler case where we're just searching in the current locale: where_condition = get_public_body_list_translated_condition('public_body_translations', first_letter, true) + ' AND ' + where_condition - where_sql = [where_condition, like_query, like_query] + where_sql = [where_condition, like_query, like_query, like_query] where_sql.push @tag if first_letter where_sql += [underscore_locale] + where_parameters - @public_bodies = PublicBody.where(where_sql) \ - .joins(:translations) \ - .order("public_body_translations.name") \ - .paginate(:page => params[:page], :per_page => 100) + @public_bodies = PublicBody.where(where_sql). + joins(:translations). + order("public_body_translations.name"). + paginate(:page => params[:page], :per_page => 100) end respond_to do |format| - format.html { render :template => "public_body/list" } + format.html { render :template => 'public_body/list' } end end end @@ -344,9 +344,11 @@ class PublicBodyController < ApplicationController end private + def get_public_body_list_translated_condition(table, first_letter=false, locale=nil) result = "(upper(#{table}.name) LIKE upper(?)" \ - " OR upper(#{table}.notes) LIKE upper (?))" + " OR upper(#{table}.notes) LIKE upper(?)" \ + " OR upper(#{table}.short_name) LIKE upper(?))" if first_letter result += " AND #{table}.first_letter = ?" end diff --git a/app/helpers/track_helper.rb b/app/helpers/track_helper.rb index 7bd0fa55d..ca698926c 100644 --- a/app/helpers/track_helper.rb +++ b/app/helpers/track_helper.rb @@ -3,22 +3,22 @@ module TrackHelper def already_subscribed_notice(track_thing) case track_thing.track_type when 'request_updates' - _("You are already subscribed to '{{link_to_request}}', a request", + _("You are already subscribed to '{{link_to_request}}', a request.", :link_to_request => request_link(track_thing.info_request)) when 'all_new_requests' - _('You are already subscribed to any <a href="{{new_requests_url}}">new requests</a>', + _('You are already subscribed to any <a href="{{new_requests_url}}">new requests</a>.', :new_requests_url => request_list_path) when 'all_successful_requests' - _('You are already subscribed to any <a href="{{successful_requests_url}}">successful requests</a>', + _('You are already subscribed to any <a href="{{successful_requests_url}}">successful requests</a>.', :successful_requests_url => request_list_successful_path ) when 'public_body_updates' - _("You are already subscribed to '{{link_to_authority}}', a public authority", + _("You are already subscribed to '{{link_to_authority}}', a public authority.", :link_to_authority => public_body_link(track_thing.public_body)) when 'user_updates' - _("You are already subscribed to '{{link_to_user}}', a person", + _("You are already subscribed to '{{link_to_user}}', a person.", :link_to_user => user_link(track_thing.tracked_user)) when 'search_query' - _('You are already subscribed to <a href="{{search_url}}">this search</a>', + _('You are already subscribed to <a href="{{search_url}}">this search</a>.', :search_url => search_path([track_thing.track_query, 'newest', 'advanced'])) end end @@ -26,22 +26,22 @@ module TrackHelper def subscribe_email_notice(track_thing) case track_thing.track_type when 'request_updates' - _("You will now be emailed updates about '{{link_to_request}}', a request", + _("You will now be emailed updates about '{{link_to_request}}', a request.", :link_to_request => request_link(track_thing.info_request)) when 'all_new_requests' - _('You will now be emailed updates about any <a href="{{new_requests_url}}">new requests</a>', + _('You will now be emailed updates about any <a href="{{new_requests_url}}">new requests</a>.', :new_requests_url => request_list_path) when 'all_successful_requests' - _('You will now be emailed updates about <a href="{{successful_requests_url}}">successful requests</a>', + _('You will now be emailed updates about <a href="{{successful_requests_url}}">successful requests</a>.', :successful_requests_url => request_list_successful_path ) when 'public_body_updates' - _("You will now be emailed updates about '{{link_to_authority}}', a public authority", + _("You will now be emailed updates about '{{link_to_authority}}', a public authority.", :link_to_authority => public_body_link(track_thing.public_body)) when 'user_updates' - _("You will now be emailed updates about '{{link_to_user}}', a person", + _("You will now be emailed updates about '{{link_to_user}}', a person.", :link_to_user => user_link(track_thing.tracked_user)) when 'search_query' - _("You will now be emailed updates about <a href=\"{{search_url}}\">this search</a>", + _("You will now be emailed updates about <a href=\"{{search_url}}\">this search</a>.", :search_url => search_path([track_thing.track_query, 'newest', 'advanced'])) end end @@ -50,27 +50,27 @@ module TrackHelper wall_url_user = show_user_wall_path(:url_name => track_thing.tracking_user.url_name) case track_thing.track_type when 'request_updates' - _('You are now <a href="{{wall_url_user}}">following</a> updates about \'{{link_to_request}}\', a request', + _('You are now <a href="{{wall_url_user}}">following</a> updates about \'{{link_to_request}}\', a request.', :link_to_request => request_link(track_thing.info_request), :wall_url_user => wall_url_user) when 'all_new_requests' - _('You are now <a href="{{wall_url_user}}">following</a> updates about <a href="{{new_requests_url}}">new requests</a>', + _('You are now <a href="{{wall_url_user}}">following</a> updates about <a href="{{new_requests_url}}">new requests</a>.', :new_requests_url => request_list_path, :wall_url_user => wall_url_user) when 'all_successful_requests' - _('You are now <a href="{{wall_url_user}}">following</a> updates about <a href="{{successful_requests_url}}">successful requests</a>', + _('You are now <a href="{{wall_url_user}}">following</a> updates about <a href="{{successful_requests_url}}">successful requests</a>.', :successful_requests_url => request_list_successful_path, :wall_url_user => wall_url_user) when 'public_body_updates' - _('You are now <a href="{{wall_url_user}}">following</a> updates about \'{{link_to_authority}}\', a public authority', + _('You are now <a href="{{wall_url_user}}">following</a> updates about \'{{link_to_authority}}\', a public authority.', :wall_url_user => wall_url_user, :link_to_authority => public_body_link(track_thing.public_body)) when 'user_updates' - _('You are now <a href="{{wall_url_user}}">following</a> updates about \'{{link_to_user}}\', a person', + _('You are now <a href="{{wall_url_user}}">following</a> updates about \'{{link_to_user}}\', a person.', :wall_url_user => wall_url_user, :link_to_user => user_link(track_thing.tracked_user)) when 'search_query' - _('You are now <a href="{{wall_url_user}}">following</a> updates about <a href="{{search_url}}">this search</a>', + _('You are now <a href="{{wall_url_user}}">following</a> updates about <a href="{{search_url}}">this search</a>.', :wall_url_user => wall_url_user, :search_url => search_path([track_thing.track_query, 'newest', 'advanced'])) end @@ -79,22 +79,22 @@ module TrackHelper def unsubscribe_notice(track_thing) case track_thing.track_type when 'request_updates' - _("You are no longer following '{{link_to_request}}', a request", + _("You are no longer following '{{link_to_request}}', a request.", :link_to_request => request_link(track_thing.info_request)) when 'all_new_requests' - _('You are no longer following <a href="{{new_requests_url}}">new requests</a>', + _('You are no longer following <a href="{{new_requests_url}}">new requests</a>.', :new_requests_url => request_list_path) when 'all_successful_requests' - _('You are no longer following <a href="{{successful_requests_url}}">successful requests</a>', + _('You are no longer following <a href="{{successful_requests_url}}">successful requests</a>.', :successful_requests_url => request_list_successful_path ) when 'public_body_updates' - _("You are no longer following '{{link_to_authority}}', a public authority", + _("You are no longer following '{{link_to_authority}}', a public authority.", :link_to_authority => public_body_link(track_thing.public_body)) when 'user_updates' - _("You are no longer following '{{link_to_user}}', a person", + _("You are no longer following '{{link_to_user}}', a person.", :link_to_user => user_link(track_thing.tracked_user)) when 'search_query' - _('You are no longer following <a href="{{search_url}}">this search</a>', + _('You are no longer following <a href="{{search_url}}">this search</a>.', :search_url => search_path([track_thing.track_query, 'newest', 'advanced'])) end end diff --git a/app/views/general/_locale_switcher.html.erb b/app/views/general/_locale_switcher.html.erb index a318f61f3..7d64c9069 100644 --- a/app/views/general/_locale_switcher.html.erb +++ b/app/views/general/_locale_switcher.html.erb @@ -1,7 +1,7 @@ - <% if FastGettext.default_available_locales.length > 1 && !params.empty? %> + <% if FastGettext.default_available_locales.any? && !params.empty? %> <div id="user_locale_switcher"> <div class="btn-group"> - <% for possible_locale in FastGettext.default_available_locales %> + <% FastGettext.default_available_locales.each do |possible_locale| %> <% if possible_locale == FastGettext.locale %> <a href="#" class="btn disabled"><%= locale_name(possible_locale) %></a> <% else %> diff --git a/app/views/request/upload_response.html.erb b/app/views/request/upload_response.html.erb index f5fd6f000..f07af34d5 100644 --- a/app/views/request/upload_response.html.erb +++ b/app/views/request/upload_response.html.erb @@ -9,7 +9,9 @@ <%= foi_error_messages_for :comment %> - <h1><%= _('Respond to the FOI request')%> '<%=request_link(@info_request)%>'<% _(' made by ')%><%=user_link(@info_request.user) %></h1> + <h1><%= _("Respond to the FOI request '{{request}}' made by {{user}}", + :request => request_link(@info_request), + :user => user_link(@info_request.user)) %></h1> <p> <%= raw(_('Your response will <strong>appear on the Internet</strong>, <a href="{{url}}">read why</a> and answers to other questions.', :url => help_officers_path.html_safe)) %> @@ -48,5 +50,3 @@ </p> <% end %> <% end %> - - |