diff options
author | Martin Wright <martin@mysociety.org> | 2015-01-13 17:04:49 +0000 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2015-03-02 16:26:43 +0000 |
commit | b48ecd8048d35e327d0eec182ca73355e64f36a6 (patch) | |
tree | 255d0f5c8ad681c0807e2f65f320d93a31335785 | |
parent | 7c5fbd63a635025fb294a491735a6c4dae160e1e (diff) |
complete new styling of new request page
-rw-r--r-- | app/assets/stylesheets/responsive/_new_request_layout.scss | 4 | ||||
-rw-r--r-- | app/assets/stylesheets/responsive/_new_request_style.scss | 5 | ||||
-rw-r--r-- | app/views/request/new.html.erb | 300 |
3 files changed, 167 insertions, 142 deletions
diff --git a/app/assets/stylesheets/responsive/_new_request_layout.scss b/app/assets/stylesheets/responsive/_new_request_layout.scss index dc2d43900..a5714a510 100644 --- a/app/assets/stylesheets/responsive/_new_request_layout.scss +++ b/app/assets/stylesheets/responsive/_new_request_layout.scss @@ -140,6 +140,10 @@ } +#outgoing_message_body { + width: 100%; +} + /* Message preview */ .message-preview { @include grid-row($behavior: nest); diff --git a/app/assets/stylesheets/responsive/_new_request_style.scss b/app/assets/stylesheets/responsive/_new_request_style.scss index 574c98c9e..fa0180d62 100644 --- a/app/assets/stylesheets/responsive/_new_request_style.scss +++ b/app/assets/stylesheets/responsive/_new_request_style.scss @@ -103,6 +103,11 @@ input#reedit_button { border: none; } + +input[name=commit] { + +} + /* Batch request page */ .batch_public_body_toggle { diff --git a/app/views/request/new.html.erb b/app/views/request/new.html.erb index 27c578481..cbcf5a0a5 100644 --- a/app/views/request/new.html.erb +++ b/app/views/request/new.html.erb @@ -31,100 +31,115 @@ }); </script> <% end %> + + + <% if @batch %> <% @title = _("Make an {{law_used_short}} request", :law_used_short=>h(@info_request.law_used_short)) %> <% 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 %> + + +<%= form_for(@info_request, :url => (@batch ? new_batch_path : new_request_path), :html => { :id => 'write_form' } ) do |f| %> <div id="request_header"> <div id="request_header_body"> <h1><%= _('Make a request') %></h1> <% if @existing_request %> - <div class="errorExplanation" id="errorExplanation"><ul> - <li> - <%= _('{{existing_request_user}} already - created the same request on {{date}}. You can either view the <a href="{{existing_request}}">existing request</a>, - or edit the details below to make a new but similar request.',:existing_request_user=>user_or_you_capital_link(@existing_request.user), :date=>simple_date(@existing_request.created_at), :existing_request=>request_path(@existing_request)) %> - </li> - </ul></div> + <div class="errorExplanation" id="errorExplanation"> + <ul> + <li> + <%= _('{{existing_request_user}} already + created the same request on {{date}}. You can either view the <a href="{{existing_request}}">existing request</a>, + or edit the details below to make a new but similar request.',:existing_request_user=>user_or_you_capital_link(@existing_request.user), :date=>simple_date(@existing_request.created_at), :existing_request=>request_path(@existing_request)) %> + </li> + </ul> + </div> <% end %> + <% if @existing_batch %> - <div class="errorExplanation" id="errorExplanation"><ul> - <li> - <%= _('You already created the same batch of requests on {{date}}. You can either view the <a href="{{existing_batch}}">existing batch</a>, or edit the details below to make a new but similar batch of requests.', :date=>simple_date(@existing_batch.created_at), :existing_batch=>info_request_batch_path(@existing_batch)) %> - </li> - </ul></div> + <div class="errorExplanation" id="errorExplanation"> + <ul> + <li> + <%= _('You already created the same batch of requests on {{date}}. You can either view the <a href="{{existing_batch}}">existing batch</a>, or edit the details below to make a new but similar batch of requests.', :date=>simple_date(@existing_batch.created_at), :existing_batch=>info_request_batch_path(@existing_batch)) %> + </li> + </ul> + </div> <% end %> <%= foi_error_messages_for :info_request, :outgoing_message %> - <%= form_for(@info_request, :url => (@batch ? new_batch_path : new_request_path), :html => { :id => 'write_form' } ) do |f| %> - </div> - </div> - <div class="request_body"> - <div id="request_body_header"> - <% if @info_request.public_body.override_request_email %> - <div class="warning"> - <%= _("<strong>Note:</strong> Because we're testing, requests are being sent to {{email}} rather than to the actual authority.", :email => @info_request.public_body.override_request_email) %> - </div> - <% end %> - - <% if @batch %> - <label class="form_label"><%= _('To:') %></label> - <span id="to_public_body"> - <%= _("Your selected authorities") %> - <span class="batch_public_body_toggle" data-hidetext="<%= _("(hide)") %>" data-showtext="<%= _("(show)") %>"><a class="toggle-message"></a></span> - </span> - - <div class="batch_public_body_list"> - <ul> - <% @public_bodies.each do |public_body| %> - <li><%= public_body.name %></li> - <% end %> - </ul> - </div> + <% if @info_request.public_body.override_request_email %> + <div class="warning"> + <%= _("<strong>Note:</strong> Because we're testing, requests are being sent to {{email}} rather than to the actual authority.", :email => @info_request.public_body.override_request_email) %> + </div> + <% end %> - <% else %> - <p id="to_public_body"><span class="to_public_body_label">To:</span> - <%=h(@info_request.public_body.name)%> - </p> - <% end %> + <% if @batch %> + <label class="form_label"><%= _('To:') %></label> + <span id="to_public_body"> + <%= _("Your selected authorities") %> + <span class="batch_public_body_toggle" data-hidetext="<%= _("(hide)") %>" data-showtext="<%= _("(show)") %>"><a class="toggle-message"></a></span> + </span> - <% unless @batch %> - <% if @info_request.public_body.has_notes? %> - <div id="request_header_text"> - <p><%= @info_request.public_body.notes_as_html.html_safe %></p> - </div> + <div class="batch_public_body_list"> + <ul> + <% @public_bodies.each do |public_body| %> + <li><%= public_body.name %></li> <% end %> + </ul> + </div> + <% else %> + <p id="to_public_body"><span class="to_public_body_label">To:</span> + <%=h(@info_request.public_body.name)%> + </p> + <% end %> - <% 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 %> + <% unless @batch %> + <% if @info_request.public_body.has_notes? %> + <div id="request_header_text"> + <p><%= @info_request.public_body.notes_as_html.html_safe %></p> + </div> <% end %> + <% end %> + + </div> + </div> + + <% unless @batch %> + <% if @info_request.public_body.eir_only? %> + <div class="request_body"> + <div id="request_body_header"> + <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:') %> + </p> + <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> + </div> </div> + <% end %> + <% end %> - <div id="request_advice"> + <div class="request_body"> + <div id="request_advice"> + <% unless @batch %> <p> <% 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_path(@info_request.public_body)) %> @@ -132,89 +147,90 @@ <%= _("Browse <a href='{{url}}'>other requests</a> for examples of how to word your request.", :url=>request_list_url) %> <% end %> </p> - <% unless @batch %> - <% if !@user %> - <p> - <%= raw(_('Everything that you enter on this page, including <strong>your name</strong>, - will be <strong>displayed publicly</strong> on - this website <a href="{{url}}">forever</a>', :url => (help_privacy_path+"#public_request").html_safe)) %>. - </p> - <p> - <%= raw(_('<a href="{{url}}">Thinking of using a pseudonym?</a>.', :url => (help_privacy_path+"#real_name").html_safe)) %> - </p> - <% else %> - <p> - <%= raw(_('Everything that you enter on this page - will be <strong>displayed publicly</strong> on - this website forever (<a href="{{url}}">why?</a>).', :url => (help_privacy_path+"#public_request").html_safe)) %> - </p> - <% end %> + <% end %> - <p> - <%= raw(_("<strong> Can I request information about myself?</strong>\n" + - "\t\t\t<a href=\"{{url}}\">No!</a>", :url => (help_requesting_path+"#data_protection").html_safe)) %> - </p> - <div class="advice-panel"> - <ul> - <% end %> - <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><%= _('<a href="{{url}}">Keep it <strong>focused</strong></a>, you\'ll be more likely to get what you want.', :url => (help_requesting_path + '#focused').html_safe) %></li> - </ul> - </div> + <% if !@user %> + <p> + <%= raw(_('Everything that you enter on this page, including <strong>your name</strong>, + will be <strong>displayed publicly</strong> on + this website <a href="{{url}}">forever</a>', :url => (help_privacy_path+"#public_request").html_safe)) %>. + </p> + <p> + <%= raw(_('<a href="{{url}}">Thinking of using a pseudonym?</a>.', :url => (help_privacy_path+"#real_name").html_safe)) %> + </p> + <% else %> + <p> + <%= raw(_('Everything that you enter on this page + will be <strong>displayed publicly</strong> on + this website forever (<a href="{{url}}">why?</a>).', :url => (help_privacy_path+"#public_request").html_safe)) %> + </p> + <% end %> + + <p> + <%= raw(_("<strong> Can I request information about myself?</strong>\n" + + "\t\t\t<a href=\"{{url}}\">No!</a>", :url => (help_requesting_path+"#data_protection").html_safe)) %> + </p> + <div class="advice-panel"> + <ul> + + <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><%= _('<a href="{{url}}">Keep it <strong>focused</strong></a>, you\'ll be more likely to get what you want.', :url => (help_requesting_path + '#focused').html_safe) %></li> + </ul> </div> - <div id="request_form"> - - <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.") %> - <%= render :partial => "summary_suggestion" %> - </div> - </div> + </div> - <div id="typeahead_response"> - </div> + <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 %> + <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.") %> + <%= render :partial => "summary_suggestion" %> + </div> + </div> + <div id="typeahead_response"> + </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 class="form_button"> - <% if @batch %> - <% params[:public_body_ids].each do |public_body_id| %> - <%= hidden_field_tag("public_body_ids[]", public_body_id)%> - <% end %> - <% else %> - <%= f.hidden_field(:public_body_id, { :value => @info_request.public_body_id } ) %> - <% end %> - <%= hidden_field_tag(:submitted_new_request, 1 ) %> - <%= hidden_field_tag(:preview, 1 ) %> - <%= submit_tag _("Preview your public request") %> - </div> + <div class="form_button"> + <% if @batch %> + <% params[:public_body_ids].each do |public_body_id| %> + <%= hidden_field_tag("public_body_ids[]", public_body_id)%> + <% end %> + <% else %> + <%= f.hidden_field(:public_body_id, { :value => @info_request.public_body_id } ) %> + <% end %> + <%= hidden_field_tag(:submitted_new_request, 1 ) %> + <%= hidden_field_tag(:preview, 1 ) %> + <%= submit_tag _("Preview your public request") %> + </div> - <% if !@info_request.tag_string.empty? %> - <p class="form_note"> - <!-- <label class="form_label" for="info_request_tag_string"><%= _("Tags (separated by a space):") %></label> - <%= f.text_field :tag_string, :size => 50 %> --> + <% if !@info_request.tag_string.empty? %> + <p class="form_note"> + <!-- <label class="form_label" for="info_request_tag_string"><%= _("Tags (separated by a space):") %></label> + <%= f.text_field :tag_string, :size => 50 %> --> - <%= f.hidden_field(:tag_string) %> - <strong>Tags:</strong> <%=h @info_request.tag_string %> - </p> - <% end %> + <%= f.hidden_field(:tag_string) %> + <strong>Tags:</strong> <%=h @info_request.tag_string %> + </p> + <% end %> - </div> - </div> + </div> + </div> <% end %> + <% if @batch %> <%= javascript_include_tag 'new-request.js' %> <% end %> |