From 3c16effbe1e91e5d7f40aa720fbd82bdd6ad2459 Mon Sep 17 00:00:00 2001 From: Bilal Date: Wed, 29 Jul 2020 09:47:44 +0200 Subject: [PATCH 1/2] add main legal language to the amendment signing page --- app/views/public/amendments/new.html.erb | 4 ++++ config/locales/en.yml | 2 ++ config/locales/es.yml | 2 ++ db/structure.sql | 17 +++-------------- .../user_managing_location_releases_spec.rb | 8 ++++++++ 5 files changed, 19 insertions(+), 14 deletions(-) diff --git a/app/views/public/amendments/new.html.erb b/app/views/public/amendments/new.html.erb index 24b31c3..76420ed 100644 --- a/app/views/public/amendments/new.html.erb +++ b/app/views/public/amendments/new.html.erb @@ -8,6 +8,10 @@
<%= errors_summary_for @release %> <%= bootstrap_form_with model: @release, method: :post, url: public_send("account_project_contract_template_#{@contract_template.release_type}_release_amendments_path"), local: true do |form| %> + <%= card_field_set_tag t(".body_clause.heading") do %> +

<%= @contract_template.body %>

+ <% end %> + <%= card_field_set_tag t(".amendment.heading") do %>

<%= @contract_template.amendment_clause %>

<% end %> diff --git a/config/locales/en.yml b/config/locales/en.yml index f4dc09b..0b8ff80 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1138,6 +1138,8 @@ en: copy_url: Copy sign amendment URL signature: heading: Signature + body_clause: + heading: Legal appearance_releases: create: notice: Your release has been signed. Thank you! diff --git a/config/locales/es.yml b/config/locales/es.yml index 9e1f967..8597839 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -504,6 +504,8 @@ es: copy_url: Copy sign amendment URL (ES) signature: heading: Signature (ES) + body_clause: + heading: Legal (ES) appearance_releases: create: notice: La autorización está firmada. ¡Gracias! diff --git a/db/structure.sql b/db/structure.sql index 7246f09..5e3e9ce 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -9,20 +9,6 @@ SET xmloption = content; SET client_min_messages = warning; SET row_security = off; --- --- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: - --- - -CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog; - - --- --- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: - --- - -COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language'; - - -- -- Name: fuzzystrmatch; Type: EXTENSION; Schema: -; Owner: - -- @@ -1475,6 +1461,7 @@ CREATE TABLE public.settings ( -- CREATE SEQUENCE public.settings_id_seq + AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE @@ -1510,6 +1497,7 @@ CREATE TABLE public.taggings ( -- CREATE SEQUENCE public.taggings_id_seq + AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE @@ -1540,6 +1528,7 @@ CREATE TABLE public.tags ( -- CREATE SEQUENCE public.tags_id_seq + AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE diff --git a/spec/features/user_managing_location_releases_spec.rb b/spec/features/user_managing_location_releases_spec.rb index 3eb55de..6ff5e50 100644 --- a/spec/features/user_managing_location_releases_spec.rb +++ b/spec/features/user_managing_location_releases_spec.rb @@ -251,6 +251,10 @@ feature "User managing location releases" do new_window = window_opened_by { click_link sign_amendment_link } within_window new_window do expect(page).to have_content amendments_heading + expect(page).to have_content body_clause_heading + + expect(page).to have_content contract_template.body.to_plain_text + expect(page).to have_content contract_template.amendment_clause.to_plain_text fill_in amendment_signer_name_field, with: 'Big Signer' draw_signature file_fixture("signature.png"), amendment_signature_field @@ -690,6 +694,10 @@ feature "User managing location releases" do t 'public.amendments.new.amendment.heading' end + def body_clause_heading + t 'public.amendments.new.body_clause.heading' + end + def amendment_signer_name_field 'location_release[amendment_signer_name]' end -- 2.47.3 From 8410eaee0791106dbb7e2d931c593a2815b26bd1 Mon Sep 17 00:00:00 2001 From: Bilal Date: Wed, 29 Jul 2020 19:48:06 +0200 Subject: [PATCH 2/2] add contract preview to the amendment signing form --- app/views/public/amendments/new.html.erb | 4 ++-- config/locales/en.yml | 3 +-- config/locales/es.yml | 3 +-- spec/features/user_managing_location_releases_spec.rb | 9 ++++----- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/app/views/public/amendments/new.html.erb b/app/views/public/amendments/new.html.erb index 76420ed..195aa81 100644 --- a/app/views/public/amendments/new.html.erb +++ b/app/views/public/amendments/new.html.erb @@ -8,8 +8,8 @@
<%= errors_summary_for @release %> <%= bootstrap_form_with model: @release, method: :post, url: public_send("account_project_contract_template_#{@contract_template.release_type}_release_amendments_path"), local: true do |form| %> - <%= card_field_set_tag t(".body_clause.heading") do %> -

<%= @contract_template.body %>

+ <%= card_field_set_tag t('.signed_contract_preview') do %> + " width="80%" height="1200" /> <% end %> <%= card_field_set_tag t(".amendment.heading") do %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 0b8ff80..e82ce66 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1138,8 +1138,7 @@ en: copy_url: Copy sign amendment URL signature: heading: Signature - body_clause: - heading: Legal + signed_contract_preview: Signed Contract Preview appearance_releases: create: notice: Your release has been signed. Thank you! diff --git a/config/locales/es.yml b/config/locales/es.yml index 8597839..b87f3aa 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -504,8 +504,7 @@ es: copy_url: Copy sign amendment URL (ES) signature: heading: Signature (ES) - body_clause: - heading: Legal (ES) + signed_contract_preview: Signed Contract Preview (ES) appearance_releases: create: notice: La autorización está firmada. ¡Gracias! diff --git a/spec/features/user_managing_location_releases_spec.rb b/spec/features/user_managing_location_releases_spec.rb index 6ff5e50..5882e85 100644 --- a/spec/features/user_managing_location_releases_spec.rb +++ b/spec/features/user_managing_location_releases_spec.rb @@ -251,10 +251,9 @@ feature "User managing location releases" do new_window = window_opened_by { click_link sign_amendment_link } within_window new_window do expect(page).to have_content amendments_heading - expect(page).to have_content body_clause_heading + expect(page).to have_content signed_contract_preview.upcase - expect(page).to have_content contract_template.body.to_plain_text - expect(page).to have_content contract_template.amendment_clause.to_plain_text + expect(page).to have_selector 'embed' fill_in amendment_signer_name_field, with: 'Big Signer' draw_signature file_fixture("signature.png"), amendment_signature_field @@ -694,8 +693,8 @@ feature "User managing location releases" do t 'public.amendments.new.amendment.heading' end - def body_clause_heading - t 'public.amendments.new.body_clause.heading' + def signed_contract_preview + t 'public.amendments.new.signed_contract_preview' end def amendment_signer_name_field -- 2.47.3