aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/request/preview.rhtml
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/request/preview.rhtml')
-rw-r--r--app/views/request/preview.rhtml37
1 files changed, 32 insertions, 5 deletions
diff --git a/app/views/request/preview.rhtml b/app/views/request/preview.rhtml
index 6f6ecb2f9..38cbf24f0 100644
--- a/app/views/request/preview.rhtml
+++ b/app/views/request/preview.rhtml
@@ -1,8 +1,29 @@
+<% if !@user %>
+<%= javascript_include_tag 'jquery.fancybox-1.3.4.pack' %>
+<script>
+ $(document).ready(function() {
+ $("#submit_button").fancybox({
+ 'modal': false,
+ 'width': 960,
+ 'height': 500,
+ 'type': 'iframe',
+ 'href': '/en/profile/sign_in?modal=1',
+ 'onClosed': function() {
+ // modal_signin_successful variable set by modal dialog box
+ if (typeof modal_signin_successful != 'undefined' ) {
+ $("#hidden_submit_button").click();
+ }
+ }
+ });
+ });
+</script>
+<% end %>
+
<% @title = "Preview new " + h(@info_request.law_used_short) + " request to '" + h(@info_request.public_body.name) + "'" %>
<% 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,8 +58,16 @@
<%= 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' %>
+
+ <!-- Since FancyBox is intercepting the click event to display the modal login form,
+ and I can't find a way of accessing the underlying default behaviour of the button,
+ we hide another submit button without FancyBox, to be called programatically.
+ Feels hacky. -->
+ <div style="visibility: hidden">
+ <%= submit_tag _("Send request"), :name => 'submit', :id => 'hidden_submit_button' %>
+ </div>
</p>
<% if !@info_request.tag_string.empty? %>
@@ -46,5 +75,3 @@
<% end %>
<% end %>
-
-