Skip to content

Commit

Permalink
Remove authority preview from /select_authority
Browse files Browse the repository at this point in the history
Clicking a search result now takes the user directly to the authority
show page.

Removes the step numbers from the headers as the show page interrupts
the flow and seems pointless to add workarounds in public_body/show just
for this.
  • Loading branch information
garethrees committed Oct 30, 2014
1 parent 331ed72 commit 8a21f27
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 88 deletions.
21 changes: 1 addition & 20 deletions app/assets/stylesheets/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -586,20 +586,6 @@ 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;
Expand Down Expand Up @@ -1717,16 +1703,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;
}

Expand Down
40 changes: 0 additions & 40 deletions app/assets/stylesheets/responsive/_new_request_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,46 +18,6 @@
@include grid-row($behavior: nest);
}

#authority_preview {
@include grid-column(12);
@include respond-min( $main_menu-mobile_menu_cutoff ){
@include grid-column(6);
margin-top:-67px;
@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;
Expand Down
3 changes: 0 additions & 3 deletions app/views/public_body/_search_ahead.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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 %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/request/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
29 changes: 5 additions & 24 deletions app/views/request/select_authority.html.erb
Original file line number Diff line number Diff line change
@@ -1,33 +1,18 @@
<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>
<h1 style="clear: left"><%= _('Select an authority') %></h1>

<div id="authority_selection">
<%= form_tag({:controller => "request", :action => "select_authority"}, {:id => "search_form", :method => "get"}) do %>
Expand All @@ -54,7 +39,3 @@
<%= render :partial => 'public_body/search_ahead' %>
</div>
</div>

<div id="authority_preview">
</div>

0 comments on commit 8a21f27

Please sign in to comment.