diff options
Diffstat (limited to 'app')
26 files changed, 287 insertions, 296 deletions
diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 655670b5a..0bfbcd3d1 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -45,13 +45,17 @@ class AdminController < ApplicationController end end private + def authenticate - username = MySociety::Config.get('ADMIN_USERNAME', '') - password = MySociety::Config.get('ADMIN_PASSWORD', '') - if !username.empty? && !password.empty? + config_username = MySociety::Config.get('ADMIN_USERNAME', '') + config_password = MySociety::Config.get('ADMIN_PASSWORD', '') + if !config_username.empty? && !config_password.empty? authenticate_or_request_with_http_basic do |user_name, password| - user_name == username && password == password - session[:using_admin] = 1 + if user_name == config_username && password == config_password + session[:using_admin] = 1 + else + request_http_basic_authentication + end end else session[:using_admin] = 1 diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 239145944..b7457c48e 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -488,20 +488,6 @@ class ApplicationController < ActionController::Base # Site-wide access to configuration settings include ConfigHelper - - # XXX: patch to improve usability of gettext's _(), which by default accepts only - # one parameter. This is normally done in a monkey patch file named 'i18n_fixes.rb'. - # For some reason - and only when running in production -, after adding a new controller - # in a theme, the monkey patch in 'i18n_fixes.rb' doesn't seem to take effect. - # But it works just fine in the views. - # It's probably related to the loading order of classes, but including the - # monkey patch before or after the theme makes no difference. Even more bizarrely, - # require'ing or load'ing the patch file here doesn't work (!?), I need to redefine - # the method explicitely. I'm going crazy... - def _(key, options = {}) - translation = FastGettext._(key) || key - gettext_interpolate(translation, options) - end end diff --git a/app/controllers/general_controller.rb b/app/controllers/general_controller.rb index 55abea3b7..194a1cec0 100644 --- a/app/controllers/general_controller.rb +++ b/app/controllers/general_controller.rb @@ -70,13 +70,13 @@ class GeneralController < ApplicationController def blog medium_cache @feed_autodetect = [] - feed_url = MySociety::Config.get('BLOG_FEED', '') - if not feed_url.empty? - content = open(feed_url).read + @feed_url = "#{MySociety::Config.get('BLOG_FEED', '')}?lang=#{self.locale_from_params()}" + if not @feed_url.empty? + content = open(@feed_url).read @data = XmlSimple.xml_in(content) @channel = @data['channel'][0] @blog_items = @channel['item'] - @feed_autodetect = [{:url => feed_url, :title => "#{site_name} blog"}] + @feed_autodetect = [{:url => @feed_url, :title => "#{site_name} blog"}] else @blog_items = [] end diff --git a/app/controllers/public_body_controller.rb b/app/controllers/public_body_controller.rb index e4f8753af..251ab5efe 100644 --- a/app/controllers/public_body_controller.rb +++ b/app/controllers/public_body_controller.rb @@ -19,7 +19,7 @@ class PublicBodyController < ApplicationController @locale = self.locale_from_params() PublicBody.with_locale(@locale) do @public_body = PublicBody.find_by_url_name_with_historic(params[:url_name]) - raise ActiveRecord::RecordNotFound.new("None found") if @public_body.nil? # XXX proper 404 + raise ActiveRecord::RecordNotFound.new("None found") if @public_body.nil? if @public_body.url_name.nil? redirect_to :back return @@ -69,8 +69,9 @@ class PublicBodyController < ApplicationController end def view_email - @public_bodies = PublicBody.find(:all, :conditions => [ "url_name = ?", params[:url_name] ]) - @public_body = @public_bodies[0] + @public_body = PublicBody.find_by_url_name_with_historic(params[:url_name]) + raise ActiveRecord::RecordNotFound.new("None found") if @public_body.nil? + PublicBody.with_locale(self.locale_from_params()) do if params[:submitted_view_email] if verify_recaptcha @@ -187,7 +188,7 @@ class PublicBodyController < ApplicationController query = params[:q] + '*' query = query.split(' ').join(' OR ') # XXX: HACK for OR instead of default AND! - @xapian_requests = perform_search([PublicBody], query, 'relevant', 'request_collapse', 5) + @xapian_requests = perform_search([PublicBody], query, 'relevant', nil, 5) render :partial => "public_body/search_ahead" end diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb index 06d8f15f4..4b7884065 100644 --- a/app/controllers/request_controller.rb +++ b/app/controllers/request_controller.rb @@ -39,7 +39,7 @@ class RequestController < ApplicationController if !params[:query].nil? query = params[:query] + '*' query = query.split(' ').join(' OR ') # XXX: HACK for OR instead of default AND! - @xapian_requests = perform_search([PublicBody], query, 'relevant', 'request_collapse', 5) + @xapian_requests = perform_search([PublicBody], query, 'relevant', nil, 5) end medium_cache end @@ -314,10 +314,11 @@ class RequestController < ApplicationController # XXX send_message needs the database id, so we send after saving, which isn't ideal if the request broke here. @outgoing_message.send_message flash[:notice] = _("<p>Your {{law_used_full}} request has been <strong>sent on its way</strong>!</p> - <p><strong>We will email you</strong> when there is a response, or after 20 working days if the authority still hasn't + <p><strong>We will email you</strong> when there is a response, or after {{late_number_of_days}} working days if the authority still hasn't replied by then.</p> <p>If you write about this request (for example in a forum or a blog) please link to this page, and add an - annotation below telling people about your writing.</p>",:law_used_full=>@info_request.law_used_full) + annotation below telling people about your writing.</p>",:law_used_full=>@info_request.law_used_full, + :late_number_of_days => MySociety::Config.get('REPLY_LATE_AFTER_DAYS', 20)) redirect_to show_new_request_path(:url_title => @info_request.url_title) end diff --git a/app/models/exim_log.rb b/app/models/exim_log.rb index 80535ab41..83f031a92 100644 --- a/app/models/exim_log.rb +++ b/app/models/exim_log.rb @@ -108,10 +108,10 @@ class EximLog < ActiveRecord::Base # be sure we are parsing the exim line right) envelope_from = " from <" + ir.incoming_email + "> " if !exim_log.line.include?(envelope_from) - raise "unexpected parsing of exim line" + $stderr.puts("unexpected parsing of exim line: [#{exim_log.line.chomp}]") + else + found = true end - - found = true end end if !found diff --git a/app/models/public_body.rb b/app/models/public_body.rb index 311e19001..ab836657b 100644 --- a/app/models/public_body.rb +++ b/app/models/public_body.rb @@ -378,7 +378,7 @@ class PublicBody < ActiveRecord::Base next if name.nil? name.strip! - email.strip! + email.strip! unless email.nil? if !email.nil? && !email.empty? && !MySociety::Validate.is_valid_email(email) errors.push "error: line #{line.to_s}: invalid email '#{email}' for authority '#{name}'" @@ -392,7 +392,7 @@ class PublicBody < ActiveRecord::Base PublicBody.with_locale(locale) do changed = {} field_list.each do |field_name| - localized_field_name = (locale === I18n.default_locale) ? field_name : "#{field_name}.#{locale}" + localized_field_name = (locale.to_s == I18n.default_locale.to_s) ? field_name : "#{field_name}.#{locale}" localized_value = field_names[localized_field_name] && row[field_names[localized_field_name]] # Tags are a special case, as we support adding to the field, not just setting a new value @@ -422,12 +422,12 @@ class PublicBody < ActiveRecord::Base end end else # New public body - public_body = PublicBody.new(:name=>name, :short_name=>"", :request_email=>"") + public_body = PublicBody.new(:name=>"", :short_name=>"", :request_email=>"") available_locales.each do |locale| PublicBody.with_locale(locale) do changed = {} field_list.each do |field_name| - localized_field_name = (locale === I18n.default_locale) ? field_name : "#{field_name}.#{locale}" + localized_field_name = (locale.to_s == I18n.default_locale.to_s) ? field_name : "#{field_name}.#{locale}" localized_value = field_names[localized_field_name] && row[field_names[localized_field_name]] if localized_field_name == 'tag_string' and tag_behaviour == 'add' diff --git a/app/models/request_mailer.rb b/app/models/request_mailer.rb index f46ce33c5..75dc58447 100644 --- a/app/models/request_mailer.rb +++ b/app/models/request_mailer.rb @@ -47,7 +47,7 @@ class RequestMailer < ApplicationMailer def requires_admin(info_request) @from = info_request.user.name_and_email @recipients = contact_from_name_and_email - @subject = "FOI response requires admin - " + info_request.title + @subject = _("FOI response requires admin - ") + info_request.title url = main_url(request_url(info_request)) admin_url = request_admin_url(info_request) @body = {:info_request => info_request, :url => url, :admin_url => admin_url } @@ -64,7 +64,7 @@ class RequestMailer < ApplicationMailer 'Auto-Submitted' => 'auto-generated', # http://tools.ietf.org/html/rfc3834 'X-Auto-Response-Suppress' => 'OOF' @recipients = info_request.user.name_and_email - @subject = "New response to your FOI request - " + info_request.title + @subject = _("New response to your FOI request - ") + info_request.title @body = { :incoming_message => incoming_message, :info_request => info_request, :url => url } end @@ -83,7 +83,7 @@ class RequestMailer < ApplicationMailer 'Auto-Submitted' => 'auto-generated', # http://tools.ietf.org/html/rfc3834 'X-Auto-Response-Suppress' => 'OOF' @recipients = user.name_and_email - @subject = "Delayed response to your FOI request - " + info_request.title + @subject = _("Delayed response to your FOI request - ") + info_request.title @body = { :info_request => info_request, :url => url } end @@ -102,7 +102,7 @@ class RequestMailer < ApplicationMailer 'Auto-Submitted' => 'auto-generated', # http://tools.ietf.org/html/rfc3834 'X-Auto-Response-Suppress' => 'OOF' @recipients = user.name_and_email - @subject = "You're long overdue a response to your FOI request - " + info_request.title + @subject = _("You're long overdue a response to your FOI request - ") + info_request.title @body = { :info_request => info_request, :url => url } end @@ -122,7 +122,7 @@ class RequestMailer < ApplicationMailer 'Auto-Submitted' => 'auto-generated', # http://tools.ietf.org/html/rfc3834 'X-Auto-Response-Suppress' => 'OOF' @recipients = info_request.user.name_and_email - @subject = "Was the response you got to your FOI request any good?" + @subject = _("Was the response you got to your FOI request any good?") @body = { :incoming_message => incoming_message, :info_request => info_request, :url => url } end @@ -165,7 +165,7 @@ class RequestMailer < ApplicationMailer 'Auto-Submitted' => 'auto-generated', # http://tools.ietf.org/html/rfc3834 'X-Auto-Response-Suppress' => 'OOF' @recipients = info_request.user.name_and_email - @subject = "Somebody added a note to your FOI request - " + info_request.title + @subject = _("Somebody added a note to your FOI request - ") + info_request.title @body = { :comment => comment, :info_request => info_request, :url => main_url(comment_url(comment)) } end def comment_on_alert_plural(info_request, count, earliest_unalerted_comment) @@ -174,7 +174,7 @@ class RequestMailer < ApplicationMailer 'Auto-Submitted' => 'auto-generated', # http://tools.ietf.org/html/rfc3834 'X-Auto-Response-Suppress' => 'OOF' @recipients = info_request.user.name_and_email - @subject = "Some notes have been added to your FOI request - " + info_request.title + @subject = _("Some notes have been added to your FOI request - ") + info_request.title @body = { :count => count, :info_request => info_request, :url => main_url(comment_url(earliest_unalerted_comment)) } end diff --git a/app/models/track_mailer.rb b/app/models/track_mailer.rb index 85b1fedd8..0c053c4ad 100644 --- a/app/models/track_mailer.rb +++ b/app/models/track_mailer.rb @@ -40,10 +40,11 @@ class TrackMailer < ApplicationMailer # Useful query to run by hand to see how many alerts are due: # User.find(:all, :conditions => [ "last_daily_track_email < ?", Time.now - 1.day ]).size def self.alert_tracks + done_something = false now = Time.now() users = User.find(:all, :conditions => [ "last_daily_track_email < ?", now - 1.day ]) if users.empty? - return false + return done_something end for user in users next if !user.should_be_emailed? @@ -116,8 +117,9 @@ class TrackMailer < ApplicationMailer user.last_daily_track_email = now user.no_xapian_reindex = true user.save! + done_something = true end - return true + return done_something end def self.alert_tracks_loop diff --git a/app/views/general/_advanced_search_tips.rhtml b/app/views/general/_advanced_search_tips.rhtml new file mode 100644 index 000000000..520cce89b --- /dev/null +++ b/app/views/general/_advanced_search_tips.rhtml @@ -0,0 +1,49 @@ +<div id="advanced-search-tips"> + <a name="show-tips"></a> + <h2><%= _("Advanced search tips")%></h2> + <ul> + <li><%= _("Enter words that you want to find separated by spaces, e.g. <strong>climbing lane</strong>") %></li> + <li><%= _('Use OR (in capital letters) where you don\'t mind which word, e.g. <strong><code>commons OR lords</code></strong>') %> + <li><%= _('Use quotes when you want to find an exact phrase, e.g. <strong><code>"Liverpool City Council"</code></strong>') %></li> + <li><%= _('<strong><code>status:</code></strong> to select based on the status or historical status of the request, see the <a href="{{statuses_url}}">table of statuses</a> below.', :statuses_url => "#statuses") %></li> + <li><%= _('<strong><code>variety:</code></strong> to select type of thing to search for, see the <a href="{{varieties_url}}">table of varieties</a> below.', :varieties_url => "#varieties") %></li> + <li><%= _('<strong><code>requested_from:home_office</code></strong> to search requests from the Home Office, typing the name as in the URL.')%></li> + <li><%= _('<strong><code>requested_by:julian_todd</code></strong> to search requests made by Julian Todd, typing the name as in the URL.') %></li> + <li><%= _('<strong><code>commented_by:tony_bowden</code></strong> to search annotations made by Tony Bowden, typing the name as in the URL.')%></li> + <li><%= _('<strong><code>request:</code></strong> to restrict to a specific request, typing the title as in the URL.')%> + <li><%= _('<strong><code>filetype:pdf</code></strong> to find all responses with PDF attachments. Or try these: <code>{{list_of_file_extensions}}</code>', :list_of_file_extensions => IncomingMessage.get_all_file_extensions)%></li> + <li><%= _('Type <strong><code>01/01/2008..14/01/2008</code></strong> to only show things that happened in the first two weeks of January.')%></li> + <li><%= _('<strong><code>tag:charity</code></strong> to find all public bodies or requests with a given tag. You can include multiple tags, + and tag values, e.g. <code>tag:openlylocal AND tag:financial_transaction:335633</code>. Note that by default any of the tags + can be present, you have to put <code>AND</code> explicitly if you only want results them all present.')%></li> + <li><%= _('Read about <a href="{{advanced_search_url}}">advanced search operators</a>, such as proximity and wildcards.', :advanced_search_url => "http://www.xapian.org/docs/queryparser.html") %></li> + </ul> + + <h2 id="statuses"><%= _('Table of statuses') %></h2> + <p><%= _("All the options below can use <strong>status</strong> or <strong>latest_status</strong> before the colon. For example, <strong>status:not_held</strong> will match requests which have <em>ever</em> been marked as not held; <strong>latest_status:not_held</strong> will match only requests that are <em>currently</em> marked as not held.") %></p> + + <table class="status_table"> + <tr><td><strong><%=search_link('status:waiting_response', nil, nil, true)%></strong></td><td><%= _('Waiting for the public authority to reply') %></td></tr> + <tr><td><strong><%=search_link('status:not_held', nil, nil, true)%></strong></td><td><%= _('The public authority does not have the information requested') %></td></tr> + <tr><td><strong><%=search_link('status:rejected', nil, nil, true)%></strong></td><td><%= _('The request was refused by the public authority') %></td></tr> + <tr><td><strong><%=search_link('status:partially_successful', nil, nil, true)%></strong></td><td><%= _('Some of the information requested has been received') %></td></tr> + <tr><td><strong><%=search_link('status:successful', nil, nil, true)%></strong></td><td><%= _('All of the information requested has been received') %></td></tr> + <tr><td><strong><%=search_link('status:waiting_clarification', nil, nil, true)%></strong></td><td><%= _('The public authority would like part of the request explained') %></td></tr> + <tr><td><strong><%=search_link('status:gone_postal', nil, nil, true)%></strong></td><td><%= _('The public authority would like to / has responded by post') %></td></tr> + <tr><td><strong><%=search_link('status:internal_review', nil, nil, true)%></strong></td><td><%= _('Waiting for the public authority to complete an internal review of their handling of the request') %></td></tr> + <tr><td><strong><%=search_link('status:error_message', nil, nil, true)%></strong></td><td><%= _('Received an error message, such as delivery failure.') %></td></tr> + <tr><td><strong><%=search_link('status:requires_admin', nil, nil, true)%></strong></td><td><%= _('A strange reponse, required attention by the {{site_name}} team', :site_name=>site_name) %></td></tr> + <tr><td><strong><%=search_link('status:user_withdrawn', nil, nil, true)%></strong></td><td><%= _('The requester has abandoned this request for some reason') %></td></tr> + </table> + + <h2 id="varieties"><%= _('Table of varieties') %></h2> + <p><%= _("All the options below can use <strong>variety</strong> or <strong>latest_variety</strong> before the colon. For example, <strong>variety:sent</strong> will match requests which have <em>ever</em> been sent; <strong>latest_variety:sent</strong> will match only requests that are <em>currently</em> marked as sent.") %></p> + <table class="status_table"> + <tr><td><strong><%=search_link('variety:sent', nil, nil, true)%></strong></td><td><%= _('Original request sent') %></td></tr> + <tr><td><strong><%=search_link('variety:followup_sent', nil, nil, true)%></strong></td><td><%= _('Follow up message sent by requester') %></td></tr> + <tr><td><strong><%=search_link('variety:response', nil, nil, true)%></strong></td><td><%= _('Response from a public authority') %></td></tr> + <tr><td><strong><%=search_link('variety:comment', nil, nil, true)%></strong></td><td><%= _('Annotation added to request') %></td></tr> + <tr><td><strong><%=search_link('variety:authority', nil, nil, true)%></strong></td><td><%= _('A public authority') %></td></tr> + <tr><td><strong><%=search_link('variety:user', nil, nil, true)%></strong></td><td><%= _('A {{site_name}} user', :site_name=>site_name) %></td></tr> + </table> +</div> diff --git a/app/views/general/blog.rhtml b/app/views/general/blog.rhtml index 834676f82..98636a653 100644 --- a/app/views/general/blog.rhtml +++ b/app/views/general/blog.rhtml @@ -4,8 +4,8 @@ <div id="right_column"> <div class="act_link"> <h2><%= _("Stay up to date") %></h2> - <img src="/images/twitter-16.png" alt="twitter icon" class="twitter-icon"> <a href="http://www.twitter.com/<%= MySociety::Config.get('TWITTER_USERNAME') %>"><%= _("Follow us on twitter") %></a><br/><br/> - <img src="/images/feed-16.png" alt="RSS icon" valign="middle"> <a href="<%= MySociety::Config.get('BLOG_FEED') %>"><%= _("Subscribe to blog") %></a> + <img src="/images/twitter-16.png" alt="twitter icon" class="twitter-icon"> <a href="http://www.twitter.com/<%= @twitter_user %>"><%= _("Follow us on twitter") %></a><br/><br/> + <img src="/images/feed-16.png" alt="RSS icon" valign="middle"> <a href="<%= @feed_url %>"><%= _("Subscribe to blog") %></a> </div> <div id="twitter"> <script src="http://widgets.twimg.com/j/2/widget.js"></script> diff --git a/app/views/general/frontpage.rhtml b/app/views/general/frontpage.rhtml index f71980302..35751b6a4 100644 --- a/app/views/general/frontpage.rhtml +++ b/app/views/general/frontpage.rhtml @@ -1,4 +1,4 @@ -<% view_cache :ttl => 5.minutes, :tag => I18n.locale do %> +<% view_cache :ttl => 5.minutes.to_i, :tag => I18n.locale do %> <div id="frontpage_splash"> <div id="left_column"> <h1> diff --git a/app/views/general/search.rhtml b/app/views/general/search.rhtml index 903eaa414..87a6ab446 100644 --- a/app/views/general/search.rhtml +++ b/app/views/general/search.rhtml @@ -14,130 +14,131 @@ <div id="header_left"> <% if @query.nil? %> - <h1>Search</h1> + <h1><%= _("Search") %></h1> <% else %> - <h1>Search results</h1> + <h1><%= _("Search results") %></h1> <% end%> <% if @advanced %> - <div id="advanced-search"> - <p><%= _('To use the advanced search, combine phrases and labels as described in the search tips below.') %></p> - <% form_tag(advanced_search_url, :method => "get") do %> - <p> - <%= text_field_tag :query, @query, { :size => 60 } %> - <%= hidden_field_tag 'sortby', @inputted_sortby %> - <% if @bodies %> - <%= hidden_field_tag 'bodies', 1 %> - <% end %> - <%= submit_tag _("Search") %> - <%= link_to _('Simple search'), search_redirect_path %> - </p> - <% end %> - </div> + <div id="advanced-search"> + <p><%= _('To use the advanced search, combine phrases and labels as described in the search tips below.') %></p> + <% form_tag(advanced_search_url, :method => "get") do %> + <p> + <%= text_field_tag :query, @query, { :size => 60 } %> + <%= hidden_field_tag 'sortby', @inputted_sortby %> + <% if @bodies %> + <%= hidden_field_tag 'bodies', 1 %> + <% end %> + <%= submit_tag _("Search") %> + <%= link_to _('Simple search'), search_redirect_path %> + </p> + <% end %> + </div> <% else %> <% form_tag(request.url, {:method => "get", :id => "search_form"}) do %> - <p> - <%= text_field_tag 'query', params[:query], { :size => 40 } %> - <%= hidden_field_tag 'sortby', @inputted_sortby %> - <% if @bodies %> - <%= hidden_field_tag 'bodies', 1 %> - <% end %> - <%= submit_tag _("Search") %> + <p> + <%= text_field_tag 'query', params[:query], { :size => 40 } %> + <%= hidden_field_tag 'sortby', @inputted_sortby %> + <% if @bodies %> + <%= hidden_field_tag 'bodies', 1 %> + <% end %> + <%= submit_tag _("Search") %> <%= link_to(_("Advanced search"), advanced_search_url) %> + </p> + <div id="common-subfilters"> + <div id="variety-filter"> + <h3 class="title"><%= _("Showing") %></h3> + <% labels = [ + ["requests", _("requests")], + ["users", _("users")], + ["bodies", _("authorities")], + ["all", _("everything")]]%> + <% for variety, label in labels %> + <% if @variety_postfix != variety %> + <% if variety != "users" %> + <%= link_to label, search_url([params[:query], @common_query], variety, @sort_postfix) %> + <% else %> + <%= link_to label, search_url(params[:query], variety, @sort_postfix) %> + <% end %> + <% else %> + <%= label %> + <% end %> + <%= "|" unless variety == labels.last[0]%> + <% end %> + </div> + + <% if false %> + <%-# Commented out for now as tags are of limited use when users can't see them. This will change in the future! -%> + <% if @variety_postfix != "users" %> + <div> + <%= label_tag(:query, _("Tags (separated by a space):")) %><%= text_field_tag(:tags, params[:tags], { :size => 20 }) %> + <% for tag in InfoRequest.get_tags %> + <%= tag.name_and_value %> + <% end %> + </div> + <% end %> + <% end %> + </div> + + <% if @variety_postfix == "requests" %> + <div id="requests-subfilters"> + <div> + <h3 class="title"><%= _("Restrict to") %></h3> + <% [["successful", _("successful requests")], + ["unsuccessful", _("unsuccessful requests")], + ["awaiting", _("unresolved requests")], + ["internal_review", _("internal reviews")]].each_with_index do |item, index| + status, title = item %> + + <%= check_box_tag "latest_status[]", status, params[:latest_status].nil? ? false : params[:latest_status].include?(status), :id => "latest_status_#{index}" %> + <%= label_tag("latest_status_#{index}", title) %> <br/> + <% end %> + </div> - </p> -<div id="common-subfilters"> - <div id="variety-filter"> - <h3 class="title"><%= _("Showing") %></h3> - <% labels = [ - ["requests", _("requests")], - ["users", _("users")], - ["bodies", _("authorities")], - ["all", _("everything")]]%> - <% for variety, label in labels %> - <% if @variety_postfix != variety %> - <% if variety != "users" %> - <%= link_to label, search_url([params[:query], @common_query], variety, @sort_postfix) %> - <% else %> - <%= link_to label, search_url(params[:query], variety, @sort_postfix) %> - <% end %> - <% else %> - <%= label %> - <% end %> - <%= "|" unless variety == labels.last[0]%> - <% end %> - </div> + <div> + <h3 class="title"><%= _("Search in") %></h3> + <% [["sent", _("messages from users")], + ["response", _("messages from authorities")], + ["comment", _("comments")]].each_with_index do |item, index| + variety, title = item %> -<% if false %> -<%-# Commented out for now as tags are of limited use when users can't see them. This will change in the future! -%> -<% if @variety_postfix != "users" %> - <div> - <%= label_tag(:query, _("Tags (separated by a space):")) %><%= text_field_tag(:tags, params[:tags], { :size => 20 }) %> - <% for tag in InfoRequest.get_tags %> - <%= tag.name_and_value %> - <% end %> - </div> -<% end %> -<% end %> -</div> - -<% if @variety_postfix == "requests" %> -<div id="requests-subfilters"> - <div> - <h3 class="title"><%= _("Restrict to") %></h3> - <% [["successful", _("successful requests")], - ["unsuccessful", _("unsuccessful requests")], - ["awaiting", _("unresolved requests")], - ["internal_review", _("internal reviews")]].each_with_index do |item, index| - status, title = item %> - - <%= check_box_tag "latest_status[]", status, params[:latest_status].nil? ? false : params[:latest_status].include?(status), :id => "latest_status_#{index}" %> - <%= label_tag("latest_status_#{index}", title) %> <br/> - <% end %> - </div> - <div> - <h3 class="title"><%= _("Search in") %></h3> - <% [["sent", _("messages from users")], - ["response", _("messages from authorities")], - ["comment", _("comments")]].each_with_index do |item, index| - variety, title = item %> - - <%= check_box_tag "request_variety[]", variety, params[:request_variety].nil? ? true : params[:request_variety].include?(variety), :id => "request_variety_#{index}" %> - <%= label_tag("request_variety_#{index}", title) %> <br/> - <% end %> - </div> - <div id="date_range"> - <label class="form_label title" for="query">Made between</label> - <%= text_field_tag(:request_date_after, params[:request_date_after], {:class => "use-datepicker", :size => 10}) %> - <label class="form_label" for="query"> and</label> - <%= text_field_tag(:request_date_before, params[:request_date_before], {:class => "use-datepicker", :size => 10}) %> - </div> -</div> -<% end %> -<div> - <%= submit_tag("Filter") if @variety_postfix == "requests"%> -</div> - <% end %> -<% end %> + <%= check_box_tag "request_variety[]", variety, params[:request_variety].nil? ? true : params[:request_variety].include?(variety), :id => "request_variety_#{index}" %> + <%= label_tag("request_variety_#{index}", title) %> <br/> + <% end %> + </div> - + <div id="date_range"> + <label class="form_label title" for="query"><%= _("Made between") %></label> + <%= text_field_tag(:request_date_after, params[:request_date_after], {:class => "use-datepicker", :size => 10}) %> + <label class="form_label" for="query"> <%= _("and") %></label> + <%= text_field_tag(:request_date_before, params[:request_date_before], {:class => "use-datepicker", :size => 10}) %> + </div> + </div> + <% end %> + + <div> + <%= submit_tag _("Filter") if @variety_postfix == "requests"%> + </div> + <% end # Search form%> + + <% end # if @advanced %> <% if !@query.nil? %> - <p id="search_controls"> + <p id="search_controls"> <%=link_to_unless @sortby == 'relevant', _("Show most relevant results first"), search_url(@query, @variety_postfix, 'relevant') %> | <%=link_to_unless @sortby == 'newest', _("Newest results first"), search_url(@query, @variety_postfix, 'newest') %> <% if @sortby == 'described' %> | <%= _('Recently described results first') %> <% end %> - </p> + </p> <% end %> -</div> +</div> <!-- header left --> <% if @track_thing && (@xapian_bodies_hits > 0 || @xapian_users_hits > 0 || @total_hits == 0)%> <div id="header_right"> - <h2>Track this search</h2> + <h2><%= _('Track this search')%></h2> <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'main' } %> </div> <% end %> @@ -151,23 +152,23 @@ <% if not @query.nil? %> <div class="results_section"> <% if @xapian_bodies_hits > 0 %> - <% if @xapian_bodies_hits == 1 && @page == 1 %> - <h2 class="publicbody_results"><%= _('One public authority found') %></h2> - <% else %> - <h2 class="publicbody_results"><%= _('Public authorities {{start_count}} to {{end_count}} of {{total_count}}', :start_count => ((@page-1)*@bodies_per_page+1).to_s, :end_count => [@page*@bodies_per_page, @xapian_bodies.matches_estimated].min.to_s, :total_count => @xapian_bodies.matches_estimated.to_s) %></h2> - <% end %> + <% if @xapian_bodies_hits == 1 && @page == 1 %> + <h2 class="publicbody_results"><%= _('One public authority found') %></h2> + <% else %> + <h2 class="publicbody_results"><%= _('Public authorities {{start_count}} to {{end_count}} of {{total_count}}', :start_count => ((@page-1)*@bodies_per_page+1).to_s, :end_count => [@page*@bodies_per_page, @xapian_bodies.matches_estimated].min.to_s, :total_count => @xapian_bodies.matches_estimated.to_s) %></h2> + <% end %> - <div class="results_block"> - <% for result in @xapian_bodies.results %> - <%= render :partial => 'public_body/body_listing_single', :locals => { :public_body => result[:model] } %> - <% end %> - </div> + <div class="results_block"> + <% for result in @xapian_bodies.results %> + <%= render :partial => 'public_body/body_listing_single', :locals => { :public_body => result[:model] } %> + <% end %> + </div> - <%= will_paginate WillPaginate::Collection.new(@page, @bodies_per_page, @xapian_bodies.matches_estimated) %> + <%= will_paginate WillPaginate::Collection.new(@page, @bodies_per_page, @xapian_bodies.matches_estimated) %> <% elsif @bodies && !@query.nil? && @xapian_bodies.results.size == 0 && @page == 1 %> - <h2 class="publicbody_results"><%= _('No public authorities found') %></h2> + <h2 class="publicbody_results"><%= _('No public authorities found') %></h2> <% if @spelling_correction %> - <p id="did_you_mean"><%= _('Did you mean: {{correction}}', :correction => search_link(@spelling_correction, @postfix)) %></p> + <p id="did_you_mean"><%= _('Did you mean: {{correction}}', :correction => search_link(@spelling_correction, @postfix)) %></p> <% end %> <p><%= _('<a href="%s">Browse all</a> or <a href="%s">ask us to add one</a>.') % [list_public_bodies_default, help_requesting_path + '#missing_body'] %></p> <% end %> @@ -175,95 +176,39 @@ <div class="results_section"> <% if @xapian_users_hits > 0 %> - <% if @xapian_users_hits == 1 && @page == 1 %> - <h2 class="person_results"><%= _("One person found") %></h2> - <% else %> - <h2 class="person_results"><%= _("People {{start_count}} to {{end_count}} of {{total_count}}", :start_count => ((@page-1)*@users_per_page+1).to_s, :end_count => [@page*@users_per_page, @xapian_users.matches_estimated].min.to_s, :total_count => @xapian_users.matches_estimated.to_s) %></h2> - <% end %> + <% if @xapian_users_hits == 1 && @page == 1 %> + <h2 class="person_results"><%= _("One person found") %></h2> + <% else %> + <h2 class="person_results"><%= _("People {{start_count}} to {{end_count}} of {{total_count}}", :start_count => ((@page-1)*@users_per_page+1).to_s, :end_count => [@page*@users_per_page, @xapian_users.matches_estimated].min.to_s, :total_count => @xapian_users.matches_estimated.to_s) %></h2> + <% end %> - <div class="results_block"> - <% for result in @xapian_users.results %> - <%= render :partial => 'user/user_listing_single', :locals => { :display_user => result[:model] } %> - <% end %> - </div> + <div class="results_block"> + <% for result in @xapian_users.results %> + <%= render :partial => 'user/user_listing_single', :locals => { :display_user => result[:model] } %> + <% end %> + </div> + <% end %> + </div> - <% if @xapian_requests_hits > 0 %> + <div class="results_section"> + <% if @xapian_requests_hits > 0 %> <% if @xapian_requests_hits == 1 && @page == 1 %> - <h1><%= _("One FOI request matching your search", :user_search_query => h(@query)) %></h1> + <h2 class="foi_results"><%= _("One FOI request found") %></h2> <% else %> - <h1><%= _("FOI requests {{start_count}} to {{end_count}} of {{total_count}}", :start_count => ((@page-1)*@requests_per_page+1).to_s, :end_count => [@page*@requests_per_page, @xapian_requests.matches_estimated].min.to_s, :total_count => @xapian_requests.matches_estimated.to_s, :user_search_query => h(@query)) %></h1> + <h2 class="foi_results"><%= _("FOI requests {{start_count}} to {{end_count}} of {{total_count}}", :start_count => ((@page-1)*@requests_per_page+1).to_s, :end_count => [@page*@requests_per_page, @xapian_requests.matches_estimated].min.to_s, :total_count => @xapian_requests.matches_estimated.to_s) %></h2> <% end %> - <div class="results_section"> - <% if @xapian_requests_hits > 0 %> - <% if @xapian_requests_hits == 1 && @page == 1 %> - <h2 class="foi_results"><%= _("One FOI request found") %></h2> - <% else %> - <h2 class="foi_results"><%= _("FOI requests {{start_count}} to {{end_count}} of {{total_count}}", :start_count => ((@page-1)*@requests_per_page+1).to_s, :end_count => [@page*@requests_per_page, @xapian_requests.matches_estimated].min.to_s, :total_count => @xapian_requests.matches_estimated.to_s) %></h2> + <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 } %> <% end %> + </div> - <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 } %> - <% end %> - </div> - - <%= will_paginate WillPaginate::Collection.new(@page, @requests_per_page, @xapian_requests.matches_estimated) %> + <%= will_paginate WillPaginate::Collection.new(@page, @requests_per_page, @xapian_requests.matches_estimated) %> <% end %> </div> <% end %> <% if @advanced %> - -<div id="advanced-search-tips"> - <a name="show-tips"></a> - <h2><%= _("Advanced search tips")%></h2> - <ul> - <li><%= _("Enter words that you want to find separated by spaces, e.g. <strong>climbing lane</strong>") %></li> - <li><%= _('Use OR (in capital letters) where you don\'t mind which word, e.g. <strong><code>commons OR lords</code></strong>') %> - <li><%= _('Use quotes when you want to find an exact phrase, e.g. <strong><code>"Liverpool City Council"</code></strong>') %></li> - <li><%= _('<strong><code>status:</code></strong> to select based on the status or historical status of the request, see the <a href="{{statuses_url}}">table of statuses</a> below.', :statuses_url => "#statuses") %></li> - <li><%= _('<strong><code>variety:</code></strong> to select type of thing to search for, see the <a href="{{varieties_url}}">table of varieties</a> below.', :varieties_url => "#varieties") %></li> - <li><%= _('<strong><code>requested_from:home_office</code></strong> to search requests from the Home Office, typing the name as in the URL.')%></li> - <li><%= _('<strong><code>requested_by:julian_todd</code></strong> to search requests made by Julian Todd, typing the name as in the URL.') %></li> - <li><%= _('<strong><code>commented_by:tony_bowden</code></strong> to search annotations made by Tony Bowden, typing the name as in the URL.')%></li> - <li><%= _('<strong><code>request:</code></strong> to restrict to a specific request, typing the title as in the URL.')%> - <li><%= _('<strong><code>filetype:pdf</code></strong> to find all responses with PDF attachments. Or try these: <code>{{list_of_file_extensions}}</code>', :list_of_file_extensions => IncomingMessage.get_all_file_extensions)%></li> - <li><%= _('Type <strong><code>01/01/2008..14/01/2008</code></strong> to only show things that happened in the first two weeks of January.')%></li> - <li><%= _('<strong><code>tag:charity</code></strong> to find all public bodies or requests with a given tag. You can include multiple tags, - and tag values, e.g. <code>tag:openlylocal AND tag:financial_transaction:335633</code>. Note that by default any of the tags - can be present, you have to put <code>AND</code> explicitly if you only want results them all present.')%></li> - <li><%= _('Read about <a href="{{advanced_search_url}}">advanced search operators</a>, such as proximity and wildcards.', :advanced_search_url => "http://www.xapian.org/docs/queryparser.html") %></li> - </ul> - - <h2 id="statuses"><%= _('Table of statuses') %></h2> - <p><%= _("All the options below can use <strong>status</strong> or <strong>latest_status</strong> before the colon. For example, <strong>status:not_held</strong> will match requests which have <em>ever</em> been marked as not held; <strong>latest_status:not_held</strong> will match only requests that are <em>currently</em> marked as not held.") %></p> - - <table class="status_table"> - <tr><td><strong><%=search_link('status:waiting_response', nil, nil, true)%></strong></td><td><%= _('Waiting for the public authority to reply') %></td></tr> - <tr><td><strong><%=search_link('status:not_held', nil, nil, true)%></strong></td><td><%= _('The public authority does not have the information requested') %></td></tr> - <tr><td><strong><%=search_link('status:rejected', nil, nil, true)%></strong></td><td><%= _('The request was refused by the public authority') %></td></tr> - <tr><td><strong><%=search_link('status:partially_successful', nil, nil, true)%></strong></td><td><%= _('Some of the information requested has been received') %></td></tr> - <tr><td><strong><%=search_link('status:successful', nil, nil, true)%></strong></td><td><%= _('All of the information requested has been received') %></td></tr> - <tr><td><strong><%=search_link('status:waiting_clarification', nil, nil, true)%></strong></td><td><%= _('The public authority would like part of the request explained') %></td></tr> - <tr><td><strong><%=search_link('status:gone_postal', nil, nil, true)%></strong></td><td><%= _('The public authority would like to / has responded by post') %></td></tr> - <tr><td><strong><%=search_link('status:internal_review', nil, nil, true)%></strong></td><td><%= _('Waiting for the public authority to complete an internal review of their handling of the request') %></td></tr> - <tr><td><strong><%=search_link('status:error_message', nil, nil, true)%></strong></td><td><%= _('Received an error message, such as delivery failure.') %></td></tr> - <tr><td><strong><%=search_link('status:requires_admin', nil, nil, true)%></strong></td><td><%= _('A strange reponse, required attention by the {{site_name}} team', :site_name=>site_name) %></td></tr> - <tr><td><strong><%=search_link('status:user_withdrawn', nil, nil, true)%></strong></td><td><%= _('The requester has abandoned this request for some reason') %></td></tr> - </table> - - <h2 id="varieties"><%= _('Table of varieties') %></h2> - <p><%= _("All the options below can use <strong>variety</strong> or <strong>latest_variety</strong> before the colon. For example, <strong>variety:sent</strong> will match requests which have <em>ever</em> been sent; <strong>latest_variety:sent</strong> will match only requests that are <em>currently</em> marked as sent.") %></p> - <table class="status_table"> - <tr><td><strong><%=search_link('variety:sent', nil, nil, true)%></strong></td><td><%= _('Original request sent') %></td></tr> - <tr><td><strong><%=search_link('variety:followup_sent', nil, nil, true)%></strong></td><td><%= _('Follow up message sent by requester') %></td></tr> - <tr><td><strong><%=search_link('variety:response', nil, nil, true)%></strong></td><td><%= _('Response from a public authority') %></td></tr> - <tr><td><strong><%=search_link('variety:comment', nil, nil, true)%></strong></td><td><%= _('Annotation added to request') %></td></tr> - <tr><td><strong><%=search_link('variety:authority', nil, nil, true)%></strong></td><td><%= _('A public authority') %></td></tr> - <tr><td><strong><%=search_link('variety:user', nil, nil, true)%></strong></td><td><%= _('A {{site_name}} user', :site_name=>site_name) %></td></tr> - </table> - -</div> - + <%= render :partial => 'general/advanced_search_tips' %> <% end %> diff --git a/app/views/help/about.es.rhtml b/app/views/help/about.es.rhtml deleted file mode 100644 index 721a582aa..000000000 --- a/app/views/help/about.es.rhtml +++ /dev/null @@ -1,10 +0,0 @@ -<% @title = "Sobre" %> - -<%= render :partial => 'sidebar' %> - -<h1>¡Bonjiorno amis!</h1> - -<p>Esta sito tu aidare a faire los requesti a la governmenti Seblano</p> - -<div id="hash_link_padding"></div> - diff --git a/app/views/help/alaveteli.rhtml b/app/views/help/alaveteli.rhtml index 41c75619c..6210f9f24 100644 --- a/app/views/help/alaveteli.rhtml +++ b/app/views/help/alaveteli.rhtml @@ -13,7 +13,7 @@ law.</p> <p>The development of Alaveteli is sponsored and supported by a - number of foundataions and charities who are interested in + number of foundations and charities who are interested in transparency across the world.</p> <p>If you would like to set up an Alaveteli website in your own diff --git a/app/views/layouts/default.rhtml b/app/views/layouts/default.rhtml index abac4139c..2af13f342 100644 --- a/app/views/layouts/default.rhtml +++ b/app/views/layouts/default.rhtml @@ -1,13 +1,6 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html lang="<%= I18n.locale %>"> <head> - <script type="text/javascript" src="/javascripts/jquery.js"></script> - <% if @profile_photo_javascript %> - <script type="text/javascript" src="/javascripts/jquery.Jcrop.js"></script> - <script type="text/javascript" src="/javascripts/profile_photo.js"></script> - <link rel="stylesheet" href="/stylesheets/jquery.Jcrop.css" type="text/css" > - <% end %> - <title> <% if @title %> <%=@title%> - <%= site_name %> @@ -25,6 +18,13 @@ <%= stylesheet_link_tag 'print', :rel => "stylesheet", :media => "all" %> <% end %> <%= javascript_include_tag 'jquery.js', 'jquery-ui.min','jquery.cookie.js', 'general.js' %> + + <% if @profile_photo_javascript %> + <script type="text/javascript" src="/javascripts/jquery.Jcrop.js"></script> + <script type="text/javascript" src="/javascripts/profile_photo.js"></script> + <link rel="stylesheet" href="/stylesheets/jquery.Jcrop.css" type="text/css" > + <% end %> + <%= stylesheet_link_tag 'admin-theme/jquery-ui-1.8.15.custom.css', :rel => 'stylesheet'%> <!--[if LT IE 7]> <style type="text/css">@import url("/stylesheets/ie6.css");</style> @@ -67,10 +67,10 @@ $(document).ready(function() { $("#make-request-link").fancybox({ 'modal': false, - 'width': 900, + 'width': 920, 'height': 400, 'type': 'iframe', - 'href': '/en/profile/sign_in?modal=1', + 'href': '/<%= I18n.locale %>/profile/sign_in?modal=1', 'onClosed': function() { // modal_signin_successful variable set by modal dialog box if (typeof modal_signin_successful != 'undefined' ) { diff --git a/app/views/outgoing_mailer/initial_request.rhtml b/app/views/outgoing_mailer/initial_request.rhtml index 83e5b794b..d537a20bc 100644 --- a/app/views/outgoing_mailer/initial_request.rhtml +++ b/app/views/outgoing_mailer/initial_request.rhtml @@ -6,6 +6,7 @@ <%= @info_request.incoming_email %> <%= _('Is {{email_address}} the wrong address for {{type_of_request}} requests to {{public_body_name}}? If so, please contact us using this form:', :email_address => @info_request.public_body.request_email, :type_of_request => @info_request.law_used_full, :public_body_name => @info_request.public_body.name)%> +<%= help_contact_url %> <%= render :partial => 'followup_footer' %> diff --git a/app/views/public_body/_body_listing_single.rhtml b/app/views/public_body/_body_listing_single.rhtml index 7637a1077..b01d2ebb2 100644 --- a/app/views/public_body/_body_listing_single.rhtml +++ b/app/views/public_body/_body_listing_single.rhtml @@ -23,7 +23,9 @@ <%= link_to _("Make your own request"), public_body_url(public_body) %>. <% end %> <br> - <%= _("Added on {{date}}", :date => simple_date(public_body.created_at)) %>. + <span class="date_added"> + <%= _("Added on {{date}}", :date => simple_date(public_body.created_at)) %>. + </span> </span> </div> diff --git a/app/views/public_body/list.rhtml b/app/views/public_body/list.rhtml index 81593fcc7..af91d8ed2 100644 --- a/app/views/public_body/list.rhtml +++ b/app/views/public_body/list.rhtml @@ -4,8 +4,8 @@ <h3><%=_('Beginning with') %></h3> <ul><li> <%= render :partial => 'alphabet' %> - </li></ul> - + </li> + </ul> <% first_row = true %> <% for row in PublicBodyCategories::get().with_headings() %> <% if row.instance_of?(Array) %> @@ -22,8 +22,9 @@ <ul> <% end %> <% end %> - </ul> - + <% if not first_row %> + </ul> + <% end %> <p> <%= _('<a href="%s">Are we missing a public authority?</a>.') % [help_requesting_path + '#missing_body'] %> </p> diff --git a/app/views/public_body/show.rhtml b/app/views/public_body/show.rhtml index 2436c58b9..7d37a35a7 100644 --- a/app/views/public_body/show.rhtml +++ b/app/views/public_body/show.rhtml @@ -1,4 +1,4 @@ -<% @title = h(@public_body.name) + " - view and make Freedom of Information requests" %> +<% @title = h(@public_body.name) + _(" - view and make Freedom of Information requests") %> <div id="main_content"> <div id="header_right"> <h2><%= _('Follow this authority')%></h2> @@ -67,6 +67,7 @@ </div> </div> + <div id="foi_results_section"> <% if @public_body.info_requests.size == 0 %> <% if @public_body.eir_only? %> <h2><%= _('Environmental Information Regulations requests made using this site') %></h2> @@ -117,5 +118,6 @@ <h2> <%= _('Freedom of Information requests made')%></h2> <% end %> <p> <%= _('The search index is currently offline, so we can\'t show the Freedom of Information requests that have been made to this authority.')%></p> - <% end %> + <% end %> + </div> </div> diff --git a/app/views/request/_sidebar.rhtml b/app/views/request/_sidebar.rhtml index 2a9b5a73f..758387b09 100644 --- a/app/views/request/_sidebar.rhtml +++ b/app/views/request/_sidebar.rhtml @@ -19,7 +19,7 @@ <%= render :partial => 'request/next_actions' %> - <% view_cache :ttl => 1.day, :tag => ['similar', @info_request.id, I18n.locale] do %> + <% view_cache :ttl => 1.day.to_i, :tag => ['similar', @info_request.id, I18n.locale] do %> <% if !@xapian_similar.nil? && @xapian_similar.results.size > 0 %> <h2><%= _('Similar requests')%></h2> <% for result in @xapian_similar.results %> diff --git a/app/views/request/list.rhtml b/app/views/request/list.rhtml index 0137cb6dd..3890fa28b 100644 --- a/app/views/request/list.rhtml +++ b/app/views/request/list.rhtml @@ -14,7 +14,7 @@ <div style="clear:both"></div> <div class="results_section"> - <% view_cache :ttl => 5.minutes, :tag => [@view, @page, I18n.locale] do %> + <% view_cache :ttl => 5.minutes.to_i, :tag => [@view, @page, I18n.locale] do %> <% if @list_results.empty? %> <p> <%= _('No requests of this sort yet.')%></p> <% else %> diff --git a/app/views/request/new.rhtml b/app/views/request/new.rhtml index 355641b63..2e554a20b 100644 --- a/app/views/request/new.rhtml +++ b/app/views/request/new.rhtml @@ -36,7 +36,7 @@ <% form_for(:info_request, @info_request, :html => { :id => 'write_form' } ) do |f| %> <div id="request_header"> - <div> + <div id="request_header_body"> <label class="form_label" for="info_request_public_body_id"><%= _('To:') %></label> <span id="to_public_body"><%=h(@info_request.public_body.name)%></span> <div class="form_item_note"> @@ -46,13 +46,13 @@ <%= _("Browse <a href='{{url}}'>other requests</a> for examples of how to word your request.", :url=>request_list_url) %> <% end %> </div> - </div> - <div id="request_header_text"> - <% if @info_request.public_body.has_notes? %> - <h3><%= _('Special note for this authority!') %></h3> - <p><%= @info_request.public_body.notes_as_html %></p> - <% end %> + <div id="request_header_text"> + <% if @info_request.public_body.has_notes? %> + <h3><%= _('Special note for this authority!') %></h3> + <p><%= @info_request.public_body.notes_as_html %></p> + <% end %> + </div> <% if @info_request.public_body.eir_only? %> <h3><%= _('Please ask for environmental information only') %></h3> @@ -78,19 +78,21 @@ time</strong> or the time of the public authority by requesting unrelated information.') %></p> <% end %> </div> - - <p> - <label class="form_label" for="typeahead_search"><%= _('Summary:') %></label> - <%= f.text_field :title, :size => 50, :id =>"typeahead_search" %> - </p> - <div class="form_item_note"> - (<%= _("a one line summary of the information you are requesting, \n\t\t\te.g.") %> - <% if @info_request.law_used == 'eir' %> - <%= _("'Pollution levels over time for the River Tyne'") %> - <% else %> - <%= _("'Crime statistics by ward level for Wales'") %> - <% end %> - ) + + <div id="request_header_subject"> + <p> + <label class="form_label" for="typeahead_search"><%= _('Summary:') %></label> + <%= f.text_field :title, :size => 50, :id =>"typeahead_search" %> + </p> + <div class="form_item_note"> + (<%= _("a one line summary of the information you are requesting, \n\t\t\te.g.") %> + <% if @info_request.law_used == 'eir' %> + <%= _("'Pollution levels over time for the River Tyne'") %> + <% else %> + <%= _("'Crime statistics by ward level for Wales'") %> + <% end %> + ) + </div> </div> <div id="typeahead_response"> diff --git a/app/views/user/show.rhtml b/app/views/user/show.rhtml index 2ae6e5ed5..baf6621df 100644 --- a/app/views/user/show.rhtml +++ b/app/views/user/show.rhtml @@ -24,7 +24,7 @@ </div> <% end %> -<div> +<div id="user_profile_header"> <div id="header_right"> <h2><%= _('Track this person')%></h2> <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'sidebar' } %> @@ -116,6 +116,8 @@ </div> </div> <div style="clear:both"></div> + +<div id="user_profile_search"> <% form_tag(show_user_url, :method => "get", :id=>"search_form") do %> <div> <%= text_field_tag(:user_query, params[:user_query]) %> @@ -230,3 +232,4 @@ <% end %> <% end %> <% end %> +</div>
\ No newline at end of file diff --git a/app/views/user/sign.rhtml b/app/views/user/sign.rhtml index 76732c09a..afdb90162 100644 --- a/app/views/user/sign.rhtml +++ b/app/views/user/sign.rhtml @@ -1,5 +1,5 @@ <% if @post_redirect.reason_params[:user_name] %> - <% @title = "Sign in" %> + <% @title = _("Sign in") %> <div id="sign_alone"> @@ -30,14 +30,14 @@ </p>--> <div id="left_half"> - <h1>Sign in</h1> + <h1><%= _('Sign in') %></h1> <%= render :partial => 'signin', :locals => { :sign_in_as_existing_user => false } %> </div> <div id="middle_strip"> - - or - + <%= _('- or -') %> </div> <div id="right_half"> - <h1>Sign up</h1> + <h1><%= _('Sign up') %></h1> <%= render :partial => 'signup' %> </div> <div style="clear:both"></div> diff --git a/app/views/user/signin_successful.rhtml b/app/views/user/signin_successful.rhtml index 8c4b2b2d4..675701d74 100644 --- a/app/views/user/signin_successful.rhtml +++ b/app/views/user/signin_successful.rhtml @@ -1,4 +1,6 @@ -<%= _("You're in. <a href=\"#\" id=\"send-request\">Continue sending your request</a>") %> +<div id="signin-successful"> + <%= _("You're in. <a href=\"#\" id=\"send-request\">Continue sending your request</a>") %> +</div> <script type="text/javascript"> parent.modal_signin_successful = true; |