From 9d5525dd78a51da6a0c5dfccab7dc81a5db8de03 Mon Sep 17 00:00:00 2001 From: Henry Hadlow Date: Fri, 23 Oct 2015 17:03:04 +0100 Subject: [PATCH 01/13] Make 'Other parliamentary business' heading bigger and add portcullis icon --- app/assets/stylesheets/petitions/views/_shared.scss | 2 +- app/views/petitions/_other_business_details.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/stylesheets/petitions/views/_shared.scss b/app/assets/stylesheets/petitions/views/_shared.scss index 8a36c25bf..f1717134a 100644 --- a/app/assets/stylesheets/petitions/views/_shared.scss +++ b/app/assets/stylesheets/petitions/views/_shared.scss @@ -191,7 +191,7 @@ input.back-page { background-position: 0 26px; @include background-image("graphics/graphic_crown", 36px, 25px); } -.about-item-count-debate { +.about-item-count-debate, .about-item-other-business { background-position: 4px 20px; @include background-image("graphics/graphic_portcullis", 26px, 32px); } diff --git a/app/views/petitions/_other_business_details.html.erb b/app/views/petitions/_other_business_details.html.erb index 174fc76a5..57ea52c4c 100644 --- a/app/views/petitions/_other_business_details.html.erb +++ b/app/views/petitions/_other_business_details.html.erb @@ -1,5 +1,5 @@ <% unless petition.emails.empty? %> -
+

Other parliamentary business

<% petition.emails.each do |email| %> From bceec4f91b6a333e8d4b792dd7c535f9725c6917 Mon Sep 17 00:00:00 2001 From: Henry Hadlow Date: Fri, 23 Oct 2015 17:03:31 +0100 Subject: [PATCH 02/13] Preview new petition: add hint text MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ‘You can’t change your petition after this point’ --- app/views/petitions/create/_replay_petition_ui.html.erb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/views/petitions/create/_replay_petition_ui.html.erb b/app/views/petitions/create/_replay_petition_ui.html.erb index edff6d44c..b48222900 100644 --- a/app/views/petitions/create/_replay_petition_ui.html.erb +++ b/app/views/petitions/create/_replay_petition_ui.html.erb @@ -16,3 +16,5 @@ <%= f.submit 'This looks good', :name => 'move:next', :class => 'button', :tabindex => increment %> <%= f.submit 'Go back and make changes', :name => 'move:back', :class => 'button-secondary', :tabindex => increment %> + +

You can’t change your petition after this point.

From f705fe10eb81dbfde49d6be49c2a1369b30db884 Mon Sep 17 00:00:00 2001 From: Henry Hadlow Date: Fri, 23 Oct 2015 17:03:53 +0100 Subject: [PATCH 03/13] Create petition -- use div instead of section section must have a heading --- app/views/petitions/create/_your_details_ui.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/petitions/create/_your_details_ui.html.erb b/app/views/petitions/create/_your_details_ui.html.erb index bbc1cfece..ad8a949db 100644 --- a/app/views/petitions/create/_your_details_ui.html.erb +++ b/app/views/petitions/create/_your_details_ui.html.erb @@ -11,8 +11,8 @@ <%= f.submit 'Continue', :name => 'move:next', :class => 'button', :tabindex => increment %> -
+

Your name will be published on this petition as the petition creator.

Other than that, we won’t publish your personal details anywhere or use them for anything other than this petition.

We will email you about this petition, and nothing else. You can unsubscribe at any time.

-
+ From 7ef2d04ee6aed5cf0c2f8ad7b78ee4e5989ad729 Mon Sep 17 00:00:00 2001 From: Henry Hadlow Date: Fri, 23 Oct 2015 17:04:15 +0100 Subject: [PATCH 04/13] Create petition: change hint text MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ‘You must use your full name’ --- app/views/signatures/_form.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/signatures/_form.html.erb b/app/views/signatures/_form.html.erb index 8cec56358..5a25d72be 100644 --- a/app/views/signatures/_form.html.erb +++ b/app/views/signatures/_form.html.erb @@ -19,7 +19,7 @@ <%= error_messages_for_field signature, :name %> <%= f.text_field :name, :tabindex => increment, :maxlength => 255, :size => nil, :class => 'form-control' %> <% if context == 'create-petition' %> - You must use your real name + You must use your full name <% end %> <% end %> From aa1c3c613e761909d23ecd178867c7da028319b1 Mon Sep 17 00:00:00 2001 From: Henry Hadlow Date: Fri, 23 Oct 2015 17:04:41 +0100 Subject: [PATCH 05/13] Add waiting time estimate to petition creator mail --- .../sponsor_mailer/sponsor_signed_email_on_threshold.html.erb | 2 +- .../sponsor_mailer/sponsor_signed_email_on_threshold.text.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/sponsor_mailer/sponsor_signed_email_on_threshold.html.erb b/app/views/sponsor_mailer/sponsor_signed_email_on_threshold.html.erb index 3ecaa4069..1c8d5da33 100644 --- a/app/views/sponsor_mailer/sponsor_signed_email_on_threshold.html.erb +++ b/app/views/sponsor_mailer/sponsor_signed_email_on_threshold.html.erb @@ -4,7 +4,7 @@

<%= @sponsor.signature.name %> supported your petition – “<%= @petition.action %>”.

-

<%= @supporting_sponsors_count %> people have supported your petition so far. We’re checking your petition to make sure it meets the petition standards. If it does, we’ll publish it.

+

<%= @supporting_sponsors_count %> people have supported your petition so far. We’re checking your petition to make sure it meets the petition standards. If it does, we’ll publish it. This usually takes a week or less.

Find out how we check petitions before we publish them:
<%= link_to nil, help_url(anchor: 'standards') %>

diff --git a/app/views/sponsor_mailer/sponsor_signed_email_on_threshold.text.erb b/app/views/sponsor_mailer/sponsor_signed_email_on_threshold.text.erb index 5130a040e..2eb0057de 100644 --- a/app/views/sponsor_mailer/sponsor_signed_email_on_threshold.text.erb +++ b/app/views/sponsor_mailer/sponsor_signed_email_on_threshold.text.erb @@ -4,7 +4,7 @@ Your petition is nearly ready to go. <%= @sponsor.signature.name %> supported your petition – "<%= @petition.action %>". -<%= @supporting_sponsors_count %> people have supported your petition so far. We’re checking your petition to make sure it meets the petition standards. If it does, we’ll publish it. +<%= @supporting_sponsors_count %> people have supported your petition so far. We’re checking your petition to make sure it meets the petition standards. If it does, we’ll publish it. This usually takes a week or less. Find out how we check petitions before we publish them: <%= help_url(anchor: 'standards') %> From 71772b2ebbeb6ce74581eb09fb62197ca4e4138b Mon Sep 17 00:00:00 2001 From: Henry Hadlow Date: Thu, 29 Oct 2015 15:41:45 +0000 Subject: [PATCH 06/13] Add petition json link --- app/views/petitions/_closed_petition_show.html.erb | 3 +++ app/views/petitions/_open_petition_show.html.erb | 3 +++ app/views/petitions/_rejected_petition_show.html.erb | 3 +++ 3 files changed, 9 insertions(+) diff --git a/app/views/petitions/_closed_petition_show.html.erb b/app/views/petitions/_closed_petition_show.html.erb index 8e396d392..e87ca7b56 100644 --- a/app/views/petitions/_closed_petition_show.html.erb +++ b/app/views/petitions/_closed_petition_show.html.erb @@ -34,5 +34,8 @@
  • Date closed <%= short_date_format petition.closed_at %>
  • +
  • + <%= link_to "Get petition data (json format)", petition_path(petition, :json) %> +
  • <% end %> diff --git a/app/views/petitions/_open_petition_show.html.erb b/app/views/petitions/_open_petition_show.html.erb index 9974c5402..85b96c8bf 100644 --- a/app/views/petitions/_open_petition_show.html.erb +++ b/app/views/petitions/_open_petition_show.html.erb @@ -36,5 +36,8 @@ Deadline <%= short_date_format petition.deadline %> All petitions run for 6 months +
  • + <%= link_to "Get petition data (json format)", petition_path(petition, :json) %> +
  • <% end %> diff --git a/app/views/petitions/_rejected_petition_show.html.erb b/app/views/petitions/_rejected_petition_show.html.erb index 4d3cabe44..919c7480b 100644 --- a/app/views/petitions/_rejected_petition_show.html.erb +++ b/app/views/petitions/_rejected_petition_show.html.erb @@ -25,5 +25,8 @@
  • Date submitted <%= short_date_format petition.created_at %>
  • +
  • + <%= link_to "Get petition data (json format)", petition_path(petition, :json) %> +
  • <% end %> From de7de0bebe6409c8cd14f45be367f7513afaf836 Mon Sep 17 00:00:00 2001 From: Henry Hadlow Date: Thu, 29 Oct 2015 15:42:08 +0000 Subject: [PATCH 07/13] Add petitions json link --- app/views/petitions/search/_results.html.erb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/petitions/search/_results.html.erb b/app/views/petitions/search/_results.html.erb index b34edb39e..7bc0faa3e 100644 --- a/app/views/petitions/search/_results.html.erb +++ b/app/views/petitions/search/_results.html.erb @@ -10,5 +10,6 @@ <% end -%> <%= render 'petitions/search/result_list_footer', petitions: @petitions %> +

    <%= link_to "Get this data (json format)", petitions_path(:json, params.slice(:page, :state)) %>

    <% end %> From 3580e35097d77b9147f6c264724fc2bb31f72114 Mon Sep 17 00:00:00 2001 From: Henry Hadlow Date: Thu, 29 Oct 2015 15:43:51 +0000 Subject: [PATCH 08/13] Add 'Show on a map' link for petition signatures [WIP] --- .../petitions/views/_petition-show.scss | 15 +++++++++++++-- app/views/petitions/_open_petition_show.html.erb | 7 ++++++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/app/assets/stylesheets/petitions/views/_petition-show.scss b/app/assets/stylesheets/petitions/views/_petition-show.scss index 5258fafdc..0cfb633b0 100644 --- a/app/assets/stylesheets/petitions/views/_petition-show.scss +++ b/app/assets/stylesheets/petitions/views/_petition-show.scss @@ -18,10 +18,21 @@ } } + .signatures-on-a-map, .signature-count-goal { + margin: $gutter-half 0 $gutter-half *-1; + @include media(desktop) { + margin-bottom: $gutter-half 0 $gutter-one-third *-1; + } + } + .signatures-on-a-map { + float: left; + @extend %contain-floats; + } .signature-count-goal { - color: $secondary-text-colour; + width: 30%; + float: right; text-align: right; - margin: $gutter-one-third 0 $gutter *-1; + color: $secondary-text-colour; @extend %contain-floats; } diff --git a/app/views/petitions/_open_petition_show.html.erb b/app/views/petitions/_open_petition_show.html.erb index 85b96c8bf..016223a00 100644 --- a/app/views/petitions/_open_petition_show.html.erb +++ b/app/views/petitions/_open_petition_show.html.erb @@ -15,10 +15,15 @@ <%= link_to "Sign this petition", new_petition_signature_path(petition), :class => 'button button-sign-petition', :tabindex => increment(5) %>
    -

    <%= signature_count(:default, petition.signature_count) %>

    +

    + <%= signature_count(:default, petition.signature_count) %> +

    +

    + Show on a map +

    <%= number_with_delimiter(current_threshold(petition)) %>

    From dde54cd392bc7e4320b8e732f55ddd34cbb5288d Mon Sep 17 00:00:00 2001 From: Henry Hadlow Date: Thu, 29 Oct 2015 15:48:44 +0000 Subject: [PATCH 09/13] Enable Facebook analytics access --- app/views/application/_social_meta.html.erb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/views/application/_social_meta.html.erb b/app/views/application/_social_meta.html.erb index d4154400e..3345bdf24 100644 --- a/app/views/application/_social_meta.html.erb +++ b/app/views/application/_social_meta.html.erb @@ -1,3 +1,5 @@ + + <%= open_graph_tag 'site_name', :site_name %> <%= open_graph_tag 'locale', 'en_GB' %> From 23958ba99bb32aff504f3ec85f0f35edf55618e7 Mon Sep 17 00:00:00 2001 From: Henry Hadlow Date: Thu, 29 Oct 2015 15:50:17 +0000 Subject: [PATCH 10/13] Enable Google Webmasters analytics access --- public/google2c72409b182ebce8.html | 1 + 1 file changed, 1 insertion(+) create mode 100644 public/google2c72409b182ebce8.html diff --git a/public/google2c72409b182ebce8.html b/public/google2c72409b182ebce8.html new file mode 100644 index 000000000..3245fb33f --- /dev/null +++ b/public/google2c72409b182ebce8.html @@ -0,0 +1 @@ +google-site-verification: google2c72409b182ebce8.html \ No newline at end of file From c7b912d382beaf9fd07a19c2afa322b3a74b83dd Mon Sep 17 00:00:00 2001 From: Henry Hadlow Date: Thu, 29 Oct 2015 16:22:58 +0000 Subject: [PATCH 11/13] Change message to 'You can't use a disposable email address' --- config/locales/activerecord.en-GB.yml | 2 +- features/suzie_signs_a_petition.feature | 2 +- spec/models/signature_spec.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/locales/activerecord.en-GB.yml b/config/locales/activerecord.en-GB.yml index a09b23fea..482398040 100644 --- a/config/locales/activerecord.en-GB.yml +++ b/config/locales/activerecord.en-GB.yml @@ -43,7 +43,7 @@ en-GB: email: blank: "Email must be completed" invalid: "Email '%{value}' not recognised" - disposable: "Email must not be disposable" + disposable: "You can’t use a disposable email address" action: blank: "Action must be completed" too_long: "Action is too long" diff --git a/features/suzie_signs_a_petition.feature b/features/suzie_signs_a_petition.feature index 4a123486f..b51ab3379 100644 --- a/features/suzie_signs_a_petition.feature +++ b/features/suzie_signs_a_petition.feature @@ -98,7 +98,7 @@ Feature: Suzie signs a petition And I fill in my details with email "suzie@10minutemail.com" And I try to sign Then I should see an error - And I should see "Email must not be disposable" + And I should see "You can’t use a disposable email address" Scenario: Suzie sees notice that she has already signed when she validates more than once When I fill in my details and sign a petition diff --git a/spec/models/signature_spec.rb b/spec/models/signature_spec.rb index 65c3847ca..d69e719d8 100644 --- a/spec/models/signature_spec.rb +++ b/spec/models/signature_spec.rb @@ -120,7 +120,7 @@ it "does not allow emails from disposable addresses" do signature = FactoryGirl.build(:signature, email: 'foobar@10minutemail.com') expect(signature).not_to have_valid(:email) - expect(signature.errors.full_messages).to include("Email must not be disposable") + expect(signature.errors.full_messages).to include("You can’t use a disposable email address") end describe "uniqueness of email" do From d585e99d2ca35360bfe3dd5e6b04883d495ac57e Mon Sep 17 00:00:00 2001 From: Henry Hadlow Date: Thu, 29 Oct 2015 16:31:06 +0000 Subject: [PATCH 12/13] Open the government response from the list view MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If you open a petition from the list ‘Petitions with a Government response’, the government response should show by default --- .../_petition_result_for_facet_with_response.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/petitions/search/result_items/_petition_result_for_facet_with_response.html.erb b/app/views/petitions/search/result_items/_petition_result_for_facet_with_response.html.erb index c84c87b28..0120d05e6 100644 --- a/app/views/petitions/search/result_items/_petition_result_for_facet_with_response.html.erb +++ b/app/views/petitions/search/result_items/_petition_result_for_facet_with_response.html.erb @@ -1,4 +1,4 @@ -

    <%= link_to petition.action, petition_path(petition) %>

    +

    <%= link_to petition.action, petition_path(petition, reveal_response: "yes", anchor: 'response-threshold') %>

    Government responded – <%= short_date_format(petition.government_response_at) %>

    <%= petition.government_response.summary %>

    <%= signature_count(:default, petition.signature_count) %>

    From 24efc06a4371eb0eba354b4957a79af9eb75eb5e Mon Sep 17 00:00:00 2001 From: Henry Hadlow Date: Thu, 29 Oct 2015 16:31:51 +0000 Subject: [PATCH 13/13] Open the debate from homepage and list view If you click a debated petition from the homepage or list view, the debate should show by default --- app/views/pages/_home_debated_petitions.html.erb | 2 +- app/views/petitions/_debate_threshold.html.erb | 2 +- .../result_items/_petition_result_for_facet_debated.html.erb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/pages/_home_debated_petitions.html.erb b/app/views/pages/_home_debated_petitions.html.erb index 39fc5b30f..c9af32e5d 100644 --- a/app/views/pages/_home_debated_petitions.html.erb +++ b/app/views/pages/_home_debated_petitions.html.erb @@ -4,7 +4,7 @@
      <% actioned[:with_debated_outcome][:list].each.with_index do |petition, index| %>
    1. -

      <%= link_to petition.action, petition_path(petition) %>

      +

      <%= link_to petition.action, petition_path(petition, anchor: 'debate-threshold') %>

      This topic was debated on <%= short_date_format petition.debate_outcome.debated_on %>

      <% if index == 0 && petition.debate_outcome.video_url? -%> <%= link_to petition.debate_outcome.video_url, rel: 'external' do %> diff --git a/app/views/petitions/_debate_threshold.html.erb b/app/views/petitions/_debate_threshold.html.erb index 6acd7b7db..b3da720dc 100644 --- a/app/views/petitions/_debate_threshold.html.erb +++ b/app/views/petitions/_debate_threshold.html.erb @@ -1,4 +1,4 @@ -
      +
      <%# Has debate outcome details #%> <% if debate_outcome = petition.debate_outcome? -%> <% if debate_outcome.debated? %> diff --git a/app/views/petitions/search/result_items/_petition_result_for_facet_debated.html.erb b/app/views/petitions/search/result_items/_petition_result_for_facet_debated.html.erb index 0e5d1e243..1edb63778 100644 --- a/app/views/petitions/search/result_items/_petition_result_for_facet_debated.html.erb +++ b/app/views/petitions/search/result_items/_petition_result_for_facet_debated.html.erb @@ -1,4 +1,4 @@ -

      <%= link_to petition.action, petition_path(petition) %>

      +

      <%= link_to petition.action, petition_path(petition, anchor: 'debate-threshold') %>

      <%= signature_count(:default, petition.signature_count) %>

      <% if debate_outcome = petition.debate_outcome %>

      Debated <%= short_date_format(debate_outcome.debated_on) %>