diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/application_controller.rb | 4 | ||||
-rw-r--r-- | app/controllers/public_body_controller.rb | 12 | ||||
-rw-r--r-- | app/controllers/request_controller.rb | 36 | ||||
-rw-r--r-- | app/controllers/user_controller.rb | 18 | ||||
-rw-r--r-- | app/views/layouts/default.rhtml | 9 | ||||
-rw-r--r-- | app/views/layouts/no_chrome.rhtml | 14 | ||||
-rw-r--r-- | app/views/public_body/_search_ahead.rhtml | 18 | ||||
-rw-r--r-- | app/views/public_body/show.rhtml | 3 | ||||
-rw-r--r-- | app/views/request/_search_ahead.rhtml | 13 | ||||
-rw-r--r-- | app/views/request/new.rhtml | 245 | ||||
-rw-r--r-- | app/views/request/preview.rhtml | 10 | ||||
-rw-r--r-- | app/views/request/select_authority.rhtml | 49 | ||||
-rw-r--r-- | app/views/user/_signin.rhtml | 1 | ||||
-rw-r--r-- | app/views/user/_signup.rhtml | 1 | ||||
-rw-r--r-- | app/views/user/signin_successful.rhtml | 7 |
15 files changed, 313 insertions, 127 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 0df3e22da..8ef23f49d 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -192,7 +192,9 @@ class ApplicationController < ActionController::Base post_redirect = PostRedirect.new(:uri => request.request_uri, :post_params => params, :reason_params => reason_params) post_redirect.save! - redirect_to signin_url(:token => post_redirect.token) + # 'modal' controls whether the sign-in form will be displayed in the typical full-blown + # page or on its own, useful for pop-ups + redirect_to signin_url(:token => post_redirect.token, :modal => params[:modal]) return false end return true diff --git a/app/controllers/public_body_controller.rb b/app/controllers/public_body_controller.rb index 05acf4868..ea1ffb619 100644 --- a/app/controllers/public_body_controller.rb +++ b/app/controllers/public_body_controller.rb @@ -168,5 +168,17 @@ class PublicBodyController < ApplicationController :filename => 'all-authorities.csv', :disposition =>'attachment', :encoding => 'utf8') end + + # Type ahead search + def search_typeahead + # Since acts_as_xapian doesn't support the Partial match flag, we work around it + # by making the last work a wildcard, which is quite the same + 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) + + render :partial => "public_body/search_ahead" + end end diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb index 42d54a403..dadbb0cbd 100644 --- a/app/controllers/request_controller.rb +++ b/app/controllers/request_controller.rb @@ -22,6 +22,10 @@ class RequestController < ApplicationController rescue MissingSourceFile, NameError end + def select_authority + medium_cache + end + def show medium_cache @locale = self.locale_from_params() @@ -66,7 +70,7 @@ class RequestController < ApplicationController @last_info_request_event_id = @info_request.last_event_id_needing_description @new_responses_count = @info_request.events_needing_description.select {|i| i.event_type == 'response'}.size -1 + # Sidebar stuff # ... requests that have similar imporant terms behavior_cache :tag => ['similar', @info_request.id] do @@ -272,6 +276,15 @@ class RequestController < ApplicationController return end + if !authenticated?( + :web => _("To send your FOI request"), + :email => _("Then your FOI request to {{public_body_name}} will be sent.",:public_body_name=>@info_request.public_body.name), + :email_subject => _("Confirm your FOI request to ") + @info_request.public_body.name + ) + # do nothing - as "authenticated?" has done the redirect to signin page for us + return + end + # Show preview page, if it is a preview if params[:preview].to_i == 1 message = "" @@ -294,15 +307,6 @@ class RequestController < ApplicationController return end - if !authenticated?( - :web => _("To send your FOI request"), - :email => _("Then your FOI request to {{public_body_name}} will be sent.",:public_body_name=>@info_request.public_body.name), - :email_subject => _("Confirm your FOI request to ") + @info_request.public_body.name - ) - # do nothing - as "authenticated?" has done the redirect to signin page for us - return - end - @info_request.user = authenticated_user # This automatically saves dependent objects, such as @outgoing_message, in the same transaction @info_request.save! @@ -738,5 +742,17 @@ class RequestController < ApplicationController return end end + + # Type ahead search + def search_typeahead + # Since acts_as_xapian doesn't support the Partial match flag, we work around it + # by making the last work a wildcard, which is quite the same + query = params[:q] + '*' + + query = query.split(' ').join(' OR ') # XXX: HACK for OR instead of default AND! + @xapian_requests = perform_search([InfoRequestEvent], query, 'relevant', 'request_collapse', 5) + + render :partial => "request/search_ahead.rhtml" + end end diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index d3c42c7f1..3e3913fae 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -8,6 +8,8 @@ class UserController < ApplicationController + layout :select_layout + protect_from_forgery :only => [ :contact, :set_profile_photo, :signchangeemail, @@ -106,7 +108,12 @@ class UserController < ApplicationController session[:user_id] = @user_signin.id session[:user_circumstance] = nil session[:remember_me] = params[:remember_me] ? true : false - do_post_redirect @post_redirect + + if is_modal_dialog + render :action => 'signin_successful' + else + do_post_redirect @post_redirect + end else send_confirmation_mail @user_signin end @@ -500,6 +507,15 @@ class UserController < ApplicationController private + def is_modal_dialog + (params[:modal].to_i != 0) + end + + # when logging in through a modal iframe, don't display chrome around the content + def select_layout + is_modal_dialog ? 'no_chrome' : 'default' + end + # Decide where we are going to redirect back to after signin/signup, and record that def work_out_post_redirect # Redirect to front page later if nothing else specified diff --git a/app/views/layouts/default.rhtml b/app/views/layouts/default.rhtml index 94ec5a956..391f2df15 100644 --- a/app/views/layouts/default.rhtml +++ b/app/views/layouts/default.rhtml @@ -1,8 +1,8 @@ <!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.js"></script> <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" > @@ -26,6 +26,8 @@ <style type="text/css">@import url("/stylesheets/ie6-custom.css");</style> <![endif]--> <%= stylesheet_link_tag 'custom', :title => "Main", :rel => "stylesheet" %> + <!-- XXX: add conditional include --> + <%= stylesheet_link_tag 'jquery.fancybox-1.3.4', :rel => "stylesheet" %> <% if @feed_autodetect %> <% for feed in @feed_autodetect %> @@ -80,11 +82,12 @@ <%= submit_tag _("Search") %> </p> <% end %> - </div> + <div id="topnav"> <ul id="navigation"> - <li><%= link_to _("Make request"), frontpage_url %></li> + <li><%= link_to _("Home"), frontpage_url %></li> + <li><%= link_to _("Make request"), select_authority_url %></li> <li><%= link_to _("View requests"), request_list_successful_url %></li> <li><%= link_to _("View authorities"), list_public_bodies_default %></li> <% if @user %> diff --git a/app/views/layouts/no_chrome.rhtml b/app/views/layouts/no_chrome.rhtml new file mode 100644 index 000000000..8225aec75 --- /dev/null +++ b/app/views/layouts/no_chrome.rhtml @@ -0,0 +1,14 @@ +<div class="entirebody"> + <div id="content"> + <% if flash[:notice] %> + <div id="notice"><%= flash[:notice] %></div> + <% end %> + <% if flash[:error] %> + <div id="error"><%= flash[:error] %></div> + <% end %> + + <div id="<%= controller.controller_name + "_" + controller.action_name %>" class="controller_<%= controller.controller_name %>"> + <%= yield :layout %> + </div> + </div> +</div> diff --git a/app/views/public_body/_search_ahead.rhtml b/app/views/public_body/_search_ahead.rhtml new file mode 100644 index 000000000..19c7eb4e8 --- /dev/null +++ b/app/views/public_body/_search_ahead.rhtml @@ -0,0 +1,18 @@ +<p> + <% 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 %> + <div id="authority_search_ahead_results"> + <% for result in @xapian_requests.results %> + <%= render :partial => 'body_listing_single', :locals => { :public_body => result[:model] } %> + <% end %> + </div> +</p> + + + diff --git a/app/views/public_body/show.rhtml b/app/views/public_body/show.rhtml index 36bba8851..406c1479e 100644 --- a/app/views/public_body/show.rhtml +++ b/app/views/public_body/show.rhtml @@ -21,6 +21,7 @@ <%= link_to _('View FOI email address'), view_public_body_email_url(@public_body.url_name) %><br> </div> +<div id="main_content"> <h1><%=h(@public_body.name)%></h1> <p class="subtitle"> @@ -99,4 +100,4 @@ <% 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 %> - +</div> diff --git a/app/views/request/_search_ahead.rhtml b/app/views/request/_search_ahead.rhtml new file mode 100644 index 000000000..053b10146 --- /dev/null +++ b/app/views/request/_search_ahead.rhtml @@ -0,0 +1,13 @@ +<p> + <div id="request_search_ahead_results"> + <% if @xapian_requests.results.size > 0 %> + <h3>Possibly related requests:</h3> + <% end %> + <% for result in @xapian_requests.results %> + <%= render :partial => 'request/request_listing_short_via_event', :locals => { :event => result[:model], :info_request => result[:model].info_request } %> + <% end %> + </div> +</p> + + + diff --git a/app/views/request/new.rhtml b/app/views/request/new.rhtml index b8625a8e6..5ddec100f 100644 --- a/app/views/request/new.rhtml +++ b/app/views/request/new.rhtml @@ -1,3 +1,55 @@ +<script type="text/javascript" src="/javascripts/ba-throttle-debounce.js"></script> +<script> + $(document).ready(function(){ + // Avoid triggering too often (on each keystroke) by using the debounce jQuery plugin: + // http://benalman.com/projects/jquery-throttle-debounce-plugin/ + $("#typeahead_search").keypress($.debounce( 300, function() { + $("#typeahead_response").load("<%=search_ahead_url%>?q="+encodeURI(this.value)); + })); + }); +</script> + +<% + enable_modal_signin = false; +%> + +<% if enable_modal_signin && !@user %> +<%= javascript_include_tag 'jquery.fancybox-1.3.4.pack' %> +<%= javascript_include_tag 'jquery.form' %> +<script> + function onSuccessfulLogin() { + $.fancybox.close(); + $("#write_form").ajaxFormUnbind(); + $("#write_form").submit(); + } + + function interceptFormSubmit(form_id) { + $(form_id).ajaxForm({ + success: function(responseText) { + $("#fancybox-content").html(responseText); + interceptFormSubmits(); + } + }); + }; + + function interceptFormSubmits() { + interceptFormSubmit("#signin_form"); + interceptFormSubmit("#signup_form"); + }; + + $(document).ready(function() { + $("#write_form").ajaxForm({ + success: function(responseText) { + $.fancybox({ + 'content': responseText, + 'onComplete': interceptFormSubmits + }); + } + }); + }); +</script> +<% end %> + <% @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)) %> <% if @existing_request %> @@ -10,107 +62,89 @@ </ul></div> <% end %> -<%= foi_error_messages_for :info_request, :outgoing_message %> + <%= foi_error_messages_for :info_request, :outgoing_message %> -<div id="request_advice"> - <h1><%= _('Read this before writing your {{info_request_law_used_full}} request', :info_request_law_used_full=>h(@info_request.law_used_full)) %></h1> - <ul> - <li> - <% form_tag("http://www.google.co.uk/search", {:id => "search_body_website_form", :method => "get"} ) do %> - <p> - <%= _('First,') %> - <% if !@info_request.public_body.publication_scheme.empty? %> - <%= _('<strong>browse</strong> the authority\'s <a href="%s">publication scheme</a> or <strong>search</strong> their web site ...') % [@info_request.public_body.publication_scheme] %> + <h1><%= _('2. Ask for Information') %></h1> + + <% form_for(:info_request, @info_request, :html => { :id => 'write_form' } ) do |f| %> + + <div id="request_header"> + <p> + <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"> + <% if @info_request.public_body.info_requests.size > 0 %> + <%= _("Browse <a href='{{url}}'>other requests</a> to '{{public_body_name}}' for examples of how to word your request.", :public_body_name=>h(@info_request.public_body.name), :url=>public_body_url(@info_request.public_body)) %> <% else %> - <%= _('<strong>search</strong> the authority\'s web site ...') %> + <%= _("Browse <a href='{{url}}'>other requests</a> for examples of how to word your request.", :url=>request_list_url) %> <% end %> - <% if !@info_request.public_body.calculated_home_page.nil? %> - <br> - <%= text_field_tag 'q', params[:q], { :size => 20 } %> - <%= hidden_field_tag 'as_sitesearch', @info_request.public_body.calculated_home_page %> - <%= submit_tag _("Search") %> - <% end %> - <br> - ... <%= _('to check that the info isn\'t already published.') %> - </p> - <% end %> - </li> + </div> + </p> - <li> - <% if @info_request.public_body.info_requests.size > 0 %> - <%= _("Browse <a href='{{url}}'>other requests</a> to '{{public_body_name}}' for examples of how to word your request.", :public_body_name=>h(@info_request.public_body.name), :url=>public_body_url(@info_request.public_body)) %> - <% else %> - <%= _('Browse <a href="%s">other requests</a> for examples of how to word your request.') % [request_list_url] %> + <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 %> - </li> - <li><%= _('Write your request in <strong>simple, precise language</strong>.') %></li> - <li><%= _('Ask for <strong>specific</strong> documents or information, this site is not suitable for general enquiries.') %></li> - <li><%= _('Keep it <strong>focused</strong>, you\'ll be more likely to get what you want (<a href="%s">why?</a>).') % [help_requesting_path + '#focused'] %></li> - <li><%= _('This site is <strong>public</strong>. Everything you type and any response will be published.') %></li> - </ul> - - <% if @info_request.public_body.has_notes? %> - <h1><%= _('Special note for this authority!') %></h1> - <ul> - <li><p><%= @info_request.public_body.notes_as_html %></p></li> - </ul> - <% end %> - <% if @info_request.public_body.eir_only? %> - <h1><%= _('Please ask for environmental information only') %></h1> - - <p><%= _('The Freedom of Information Act <strong>does not apply</strong> to') %> <%=h(@info_request.public_body.name)%>. - <%= _('However, you have the right to request environmental - information under a different law') %> (<a href="/help/requesting#eir">explanation</a>). - <%= _('This covers a very wide spectrum of information about the state of - the <strong>natural and built environment</strong>, such as:') %> + <% if @info_request.public_body.eir_only? %> + <h3><%= _('Please ask for environmental information only') %></h3> + <p><%= _('The Freedom of Information Act <strong>does not apply</strong> to') %> <%=h(@info_request.public_body.name)%>. + <%= _('However, you have the right to request environmental + information under a different law') %> (<a href="/help/requesting#eir">explanation</a>). + <%= _('This covers a very wide spectrum of information about the state of + the <strong>natural and built environment</strong>, such as:') %> + + <ul> + <li><%= _('Air, water, soil, land, flora and fauna (including how these effect + human beings)') %></li> + <li><%= _('Information on emissions and discharges (e.g. noise, energy, + radiation, waste materials)') %></li> + <li><%= _('Human health and safety') %></li> + <li><%= _('Cultural sites and built structures (as they may be affected by the + environmental factors listed above)') %></li> + <li><%= _('Plans and administrative measures that affect these matters') %></li> + </ul> + + <p><%= _('Please only request information that comes under those categories, <strong>do not waste your + time</strong> or the time of the public authority by requesting unrelated information.') %></p> + <% end %> + </div> + + <p> + <label class="form_label" for="info_request_title"><%= _('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 id="typeahead_response"> + </div> + </div> + + <div id="request_advice"> <ul> - <li><%= _('Air, water, soil, land, flora and fauna (including how these effect - human beings)') %></li> - <li><%= _('Information on emissions and discharges (e.g. noise, energy, - radiation, waste materials)') %></li> - <li><%= _('Human health and safety') %></li> - <li><%= _('Cultural sites and built structures (as they may be affected by the - environmental factors listed above)') %></li> - <li><%= _('Plans and administrative measures that affect these matters') %></li> + <li><%= _('Write your request in <strong>simple, precise language</strong>.') %></li> + <li><%= _('Ask for <strong>specific</strong> documents or information, this site is not suitable for general enquiries.') %></li> + <li><%= _('Keep it <strong>focused</strong>, you\'ll be more likely to get what you want (<a href="%s">why?</a>).') % [help_requesting_path + '#focused'] %></li> </ul> + </div> - <p><%= _('Please only request information that comes under those categories, <strong>do not waste your - time</strong> or the time of the public authority by requesting unrelated information.') %></p> - <% end %> -</div> - -<% form_for(:info_request, @info_request, :html => { :id => 'write_form' } ) do |f| %> - - <div id="request_form"> - <h1> - <label class="form_label" for="info_request_public_body_id"><%= _('To:') %></label> - <span id="to_public_body"><%=h(@info_request.public_body.name)%></span> - </h1> - - <p> - <label class="form_label" for="info_request_title"><%= _('Summary:') %></label> - <%= f.text_field :title, :size => 50 %> - </p> - <div class="form_item_note"> - (<%= _('a one line summary of the information you are requesting, - e.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> - - <% fields_for :outgoing_message do |o| %> - <p> - <label class="form_label" for="outgoing_message_body"><%= _('Your request:') %></label> - <%= o.text_area :body, :rows => 20, :cols => 60 %> - </p> - <% end %> - + <div id="request_form"> + <% fields_for :outgoing_message do |o| %> + <p> + <label class="form_label" for="outgoing_message_body"><%= _('Your request:') %></label> + <%= o.text_area :body, :rows => 20, :cols => 60 %> + </p> + <% end %> + <% if !@user %> <p class="form_note"> <%= _('Everything that you enter on this page, including <strong>your name</strong>, @@ -126,18 +160,19 @@ this website forever (<a href="%s">why?</a>).') % [help_privacy_path+"#public_request"] %> </p> <% end %> - - <p class="form_note"> - <%= _('<strong> Can I request information about myself?</strong> - <a href="%s">No! (Click here for details)</a>') % [help_requesting_path+"#data_protection"] %> - </p> - - <div class="form_button"> - <%= f.hidden_field(:public_body_id, { :value => @info_request.public_body_id } ) %> - <%= hidden_field_tag(:submitted_new_request, 1 ) %> - <%= hidden_field_tag(:preview, 1 ) %> - <%= submit_tag _("Preview your public request") %> - </div> + + <p class="form_note"> + <%= _("<strong> Can I request information about myself?</strong>\n" + + "\t\t\t<a href=\"%s\">No! (Click here for details)</a>") % [help_requesting_path+"#data_protection"] %> + </p> + + <div class="form_button"> + <%= f.hidden_field(:public_body_id, { :value => @info_request.public_body_id } ) %> + <%= hidden_field_tag(:submitted_new_request, 1 ) %> + <%= hidden_field_tag(:preview, 1 ) %> + <%= hidden_field_tag(:modal, 1 ) if enable_modal_signin %> + <%= submit_tag _("Preview your public request") %> + </div> <% if !@info_request.tag_string.empty? %> <p class="form_note"> @@ -148,8 +183,8 @@ <strong>Tags:</strong> <%=h @info_request.tag_string %> </p> <% end %> - - </div> + + </div> <% end %> diff --git a/app/views/request/preview.rhtml b/app/views/request/preview.rhtml index 6f6ecb2f9..45b6a3dc1 100644 --- a/app/views/request/preview.rhtml +++ b/app/views/request/preview.rhtml @@ -2,7 +2,7 @@ <% form_for(:info_request, @info_request, :html => { :id => 'preview_form' } ) do |f| %> - <h1><%= _('Now preview your request') %></h1> + <h1><%= _('3. Now check your request') %></h1> <ul> <li><%= _('Check you haven\'t included any <strong>personal information</strong>.') %></li> <li><%= _('Your name, request and any responses will appear in <strong>search engines</strong> @@ -37,14 +37,12 @@ <%= f.hidden_field(:tag_string) %> <%= hidden_field_tag(:submitted_new_request, 1) %> <%= hidden_field_tag(:preview, 0 ) %> - <%= submit_tag _("Re-edit this request"), :name => 'reedit' %> - <%= submit_tag _("Send public ") + h(@info_request.law_used_full) + " request", :name => 'submit' %> + <%= submit_tag _("Edit this request"), :name => 'reedit', :id => 'reedit_button' %> + <%= submit_tag _("Send request"), :name => 'submit', :id => 'submit_button' %> </p> <% if !@info_request.tag_string.empty? %> <p><strong><%= _('Tags:') %></strong> <%=h @info_request.tag_string %></p> <% end %> -<% end %> - - +<% end %>
\ No newline at end of file diff --git a/app/views/request/select_authority.rhtml b/app/views/request/select_authority.rhtml new file mode 100644 index 000000000..72660283e --- /dev/null +++ b/app/views/request/select_authority.rhtml @@ -0,0 +1,49 @@ +<script type="text/javascript" src="/javascripts/ba-throttle-debounce.js"></script> +<script> + $(document).ready(function(){ + $("#authority_preview").hide(); + + // 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%>?q="+encodeURI(this.value), function() { + $("#authority_preview").hide(); // Hide the preview, since results have changed + + // 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 a").click(function() { + $("#authority_preview").load(this.href+" #main_content", function() { + $("#authority_preview").show(); + }); + 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 => "general", :action => "search_redirect"}, {:id => "search_form"}) do %> + <p> + <p> + <%= _('First, type in the <strong>name of the UK public authority</strong> you\'d + <br>like information from. <strong>By law, they have to respond</strong> + (<a href="%s">why?</a>).') % help_about_url %> + </p> + <%= text_field_tag 'query', params[:query], { :size => 30 } %> + <%= hidden_field_tag 'bodies', 1 %> + <%= submit_tag _('Search') %> + </p> + <% end %> + <div id="typeahead_response"> + </div> + </div> + + <div id="authority_preview"> + </div> +
\ No newline at end of file diff --git a/app/views/user/_signin.rhtml b/app/views/user/_signin.rhtml index 79628b3a9..1c19ac05c 100644 --- a/app/views/user/_signin.rhtml +++ b/app/views/user/_signin.rhtml @@ -28,6 +28,7 @@ <div class="form_button"> <%= hidden_field_tag 'token', params[:token], { :id => 'signin_token' } %> + <%= hidden_field_tag :modal, params[:modal] %> <%= submit_tag _('Sign in') %> </div> <% end %> diff --git a/app/views/user/_signup.rhtml b/app/views/user/_signup.rhtml index 6b0a1f8c7..02abede5d 100644 --- a/app/views/user/_signup.rhtml +++ b/app/views/user/_signup.rhtml @@ -38,6 +38,7 @@ <div class="form_button"> <%= hidden_field_tag 'token', params[:token], { :id => 'signup_token' } %> + <%= hidden_field_tag :modal, params[:modal] %> <%= submit_tag _('Sign up') %> </div> diff --git a/app/views/user/signin_successful.rhtml b/app/views/user/signin_successful.rhtml new file mode 100644 index 000000000..38aebb846 --- /dev/null +++ b/app/views/user/signin_successful.rhtml @@ -0,0 +1,7 @@ +<%= _("You're in. <a href=\"#\" id=\"send-request\">Continue sending your request</a>") %> + +<script> + $("#send-request").click(function() { + onSuccessfulLogin(); return false; + }); +</script>
\ No newline at end of file |