diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/stylesheets/main.scss | 31 | ||||
-rw-r--r-- | app/assets/stylesheets/responsive/_new_request_layout.scss | 38 | ||||
-rw-r--r-- | app/assets/stylesheets/responsive/_new_request_style.scss | 7 | ||||
-rw-r--r-- | app/controllers/help_controller.rb | 4 | ||||
-rw-r--r-- | app/models/incoming_message.rb | 6 | ||||
-rw-r--r-- | app/views/public_body/_search_ahead.html.erb | 4 | ||||
-rw-r--r-- | app/views/request/new.html.erb | 2 | ||||
-rw-r--r-- | app/views/request/select_authority.html.erb | 90 |
8 files changed, 79 insertions, 103 deletions
diff --git a/app/assets/stylesheets/main.scss b/app/assets/stylesheets/main.scss index 8aa8010ae..b063b0d77 100644 --- a/app/assets/stylesheets/main.scss +++ b/app/assets/stylesheets/main.scss @@ -586,26 +586,22 @@ width:40%; width:26em; } -#authority_preview { -width:45%; -float:right; -background-color:#FFFFE0; -padding-left:1em; -padding-right:1em; -overflow:hidden; -margin-top:-67px; -} - -#authority_preview #header_left,#authority_preview.request_left,#authority_preview #stepwise_make_request { -width:95%; -} - #request_advice { float:right; width:250px; margin-top:1em; } +#select_authority_help { +background-color: #FEF1F6; +float: right; +margin-top: 31px; +overflow: hidden; +padding-left: 1em; +padding-right: 1em; +width: 45%; +} + #request_advice ul { margin:0 auto; } @@ -1717,16 +1713,11 @@ width:575px; padding-right:50px; } -#authority_preview .request_left, -#authority_preview #header_left { - width: 100%; -} - #request_sidebar h2,.list-filter-item { margin-bottom:10px; } -div.ff-icon-printfix,.comment_in_request_text img.comment_quote,body.front #other-country-notice,#other-country-notice,#authority_preview .public-body-name-prefix,#authority_preview #list-filter,#authority_preview h2.foi_results,div#show_response_view p.event_actions, div.batch_public_body_toggle { +div.ff-icon-printfix,.comment_in_request_text img.comment_quote,body.front #other-country-notice,#other-country-notice,div#show_response_view p.event_actions, div.batch_public_body_toggle { display:none; } diff --git a/app/assets/stylesheets/responsive/_new_request_layout.scss b/app/assets/stylesheets/responsive/_new_request_layout.scss index aba4ffc29..a2ab23060 100644 --- a/app/assets/stylesheets/responsive/_new_request_layout.scss +++ b/app/assets/stylesheets/responsive/_new_request_layout.scss @@ -11,6 +11,9 @@ @include lte-ie7 { width: 27.125em; } + #query { + width: 80%; + } } } @@ -18,46 +21,19 @@ @include grid-row($behavior: nest); } -#authority_preview { +#select_authority_help { @include grid-column(12); - @include respond-min( $main_menu-mobile_menu_cutoff ){ + @include respond-min( $main_menu-mobile_menu_cutoff ) { @include grid-column(6); - margin-top:-67px; - @include ie8{ + @include ie8 { padding-right: 0.9375em; } @include lte-ie7 { width: 26.188em; } - /* Don't nest public body grid row in this context */ - #public_body_show { - @include grid-row(); - } - - } - - /* Hide some elements of the public body that aren't appropriate in this - context */ - #list-filter, h2.foi_results, .public-body-name-prefix { - display: none; } - - /* Compact request list for viewing in authority preview column */ - .request_left, #header_left { - @include grid-column(12, $collapse: true); - } - - .request_right { - @include grid-column(12, $collapse: true); - } - - span.desc { - background:none; - line-height:18px; - padding: 0; - } - } + /* /new/[body_name] page */ #request_header { @include grid-row; diff --git a/app/assets/stylesheets/responsive/_new_request_style.scss b/app/assets/stylesheets/responsive/_new_request_style.scss index ab144b39f..86e17cbfe 100644 --- a/app/assets/stylesheets/responsive/_new_request_style.scss +++ b/app/assets/stylesheets/responsive/_new_request_style.scss @@ -1,5 +1,12 @@ /* Styles for pages in making a new request */ +/* /select_authority page */ +#select_authority_help { + .info { + font-style: italic; + } +} + /* /new/[body_name] page */ .new_info_request { label { diff --git a/app/controllers/help_controller.rb b/app/controllers/help_controller.rb index 9033198a0..93215ccad 100644 --- a/app/controllers/help_controller.rb +++ b/app/controllers/help_controller.rb @@ -11,6 +11,10 @@ class HelpController < ApplicationController before_filter :long_cache before_filter :catch_spam, :only => [:contact] + def index + redirect_to help_about_path + end + def unhappy @info_request = nil if params[:url_title] diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb index 135a6bdaf..db6722976 100644 --- a/app/models/incoming_message.rb +++ b/app/models/incoming_message.rb @@ -693,8 +693,10 @@ class IncomingMessage < ActiveRecord::Base self.reload # get the main body part from the set of attachments we just created, - # not from the self.foi_attachments association - some of the total set of - # self.foi_attachments may now be obsolete + # not from the self.foi_attachments association - some of the total set + # of self.foi_attachments may now be obsolete. Sometimes (e.g. when + # parsing mail from Apple Mail) we can end up with less attachments + # because the hexdigest of an attachment is identical. main_part = get_main_body_text_part(attachments) # we don't use get_main_body_text_internal, as we want to avoid charset # conversions, since /usr/bin/uudecode needs to deal with those. diff --git a/app/views/public_body/_search_ahead.html.erb b/app/views/public_body/_search_ahead.html.erb index 2de638034..b5632bccd 100644 --- a/app/views/public_body/_search_ahead.html.erb +++ b/app/views/public_body/_search_ahead.html.erb @@ -2,9 +2,6 @@ <% if !@xapian_requests.nil? %> <% if @xapian_requests.results.size > 0 %> <h3><%= _('Top search results:') %></h3> - <p> - <%= _('Select one to see more information about the authority.')%> - </p> <% else %> <h3><%= _('No results found.') %></h3> <% end %> @@ -14,5 +11,4 @@ <% end %> </div> <%= will_paginate WillPaginate::Collection.new(@page, @per_page, @xapian_requests.matches_estimated), :params => {:controller=>"request", :action => "select_authority"} %> - <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 %> diff --git a/app/views/request/new.html.erb b/app/views/request/new.html.erb index 7f1332464..79b4f8548 100644 --- a/app/views/request/new.html.erb +++ b/app/views/request/new.html.erb @@ -22,7 +22,7 @@ <% else %> <% @title = _("Make an {{law_used_short}} request to '{{public_body_name}}'",:law_used_short=>h(@info_request.law_used_short),:public_body_name=>h(@info_request.public_body.name)) %> <% end %> - <h1><%= _('2. Ask for Information') %></h1> + <h1><%= _('Ask for Information') %></h1> <% if @existing_request %> <div class="errorExplanation" id="errorExplanation"><ul> diff --git a/app/views/request/select_authority.html.erb b/app/views/request/select_authority.html.erb index ed072cf64..731049d69 100644 --- a/app/views/request/select_authority.html.erb +++ b/app/views/request/select_authority.html.erb @@ -1,60 +1,60 @@ <script type="text/javascript"> - $(document).ready(function(){ - $("#authority_preview").hide(); - - // Avoid triggering too often (on each keystroke) by using the debounce jQuery plugin: + $(document).ready(function() { + // Avoid triggering too often (on each keystroke) by using the debounce + // jQuery plugin: // http://benalman.com/projects/jquery-throttle-debounce-plugin/ $("#query").keypress($.debounce( 300, function() { // Do a type ahead search and display results - $("#typeahead_response").load("<%=search_ahead_bodies_url%>?query="+encodeURI(this.value), function() { - $("#authority_preview").hide(); // Hide the preview, since results have changed - - }); + $("#typeahead_response").load("<%= search_ahead_bodies_url %>?query="+encodeURI(this.value)); })); - // We're using the existing body list: we intercept the clicks on the titles to - // display a preview on the right hand side of the screen - $("#typeahead_response .head a").live('click', function() { - $("#authority_preview").load(this.href+" #public_body_show", function() { - $("#authority_preview").show(); - $(window).scrollTop($("#banner").height()); - $("#authority_preview #header_right").hide(); - location.hash = '#header_left'; - }); - return false; - }); }); </script> <% @title = _("Select the authority to write to") %> - <h1 style="clear: left"><%= _('1. Select an authority') %></h1> - - <div id="authority_selection"> - <%= form_tag({:controller => "request", :action => "select_authority"}, {:id => "search_form", :method => "get"}) do %> - <div> - <p> - <%= _('First, type in the <strong>name of the UK public authority</strong> you\'d - like information from. <strong>By law, they have to respond</strong> - (<a href="{{url}}">why?</a>).', :url => (help_about_path + "#whybother_them").html_safe) %> - </p> - <%= text_field_tag 'query', params[:query], { :size => 30, :title => "type your search term here" } %> - <%= hidden_field_tag 'bodies', 1 %> - <%= submit_tag _('Search') %> - </div> - <% if AlaveteliConfiguration.allow_batch_requests && @user && @user.can_make_batch_requests? %> - <div id="batch_request_link"> - <p> - <%= _('Or make a <a href="{{url}}">batch request</a> to <strong>multiple authorities</strong> at once.', :url => select_authorities_path) %> - </p> - </div> - <% end %> +<h1 style="clear: left"><%= _('Select an authority') %></h1> + +<div id="authority_selection"> + <%= form_tag select_authority_path, { :id => 'search_form', :method => 'get' } do %> + <div> + <p> + <%= _(%Q(First, type in the <strong>name of the UK public authority</strong> you'd + like information from. <strong>By law, they have to respond</strong> + (<a href="{{url}}">why?</a>).), :url => (help_about_path(:anchor => 'whybother_them')).html_safe) %> + </p> + + <%= text_field_tag :query, + params[:query], + { :size => 30, + :title => _('type your search term here'), + :placeholder => _('e.g. Ministry of Defence') } %> + <%= hidden_field_tag :bodies, 1 %> + <%= submit_tag _('Search') %> + </div> + + <% if AlaveteliConfiguration.allow_batch_requests && @user && @user.can_make_batch_requests? %> + <div id="batch_request_link"> + <p> + <%= _('Or make a <a href="{{url}}">batch request</a> to <strong>multiple authorities</strong> at once.', + :url => select_authorities_path) %> + </p> + </div> <% end %> + <% end %> - <div id="typeahead_response"> - <%= render :partial => 'public_body/search_ahead' %> - </div> + <div id="typeahead_response"> + <%= render :partial => 'public_body/search_ahead' %> </div> - <div id="authority_preview"> - </div> +</div> + +<div id="select_authority_help"> + <p class="info"><%= _("Can’t find an authority?") %></p> + <p class="actions"> + <%= 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(:anchor => 'missing_body') + ).html_safe %> + </p> +</div> |