add signature legal text field
This commit is contained in:
@@ -62,7 +62,8 @@ class ContractTemplatesController < ApplicationController
|
|||||||
def contract_template_params
|
def contract_template_params
|
||||||
params
|
params
|
||||||
.require(:contract_template)
|
.require(:contract_template)
|
||||||
.permit(:name, :release_type, :body, :guardian_clause, :fee,
|
.permit(:name, :release_type, :body, :guardian_clause,
|
||||||
|
:signature_legal_text, :fee,
|
||||||
:applicable_medium_id, :applicable_medium_text,
|
:applicable_medium_id, :applicable_medium_text,
|
||||||
:territory_id, :territory_text,
|
:territory_id, :territory_text,
|
||||||
:term_id, :term_text,
|
:term_id, :term_text,
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ class ContractTemplate < ApplicationRecord
|
|||||||
monetize :fee_cents
|
monetize :fee_cents
|
||||||
has_rich_text :body
|
has_rich_text :body
|
||||||
has_rich_text :guardian_clause
|
has_rich_text :guardian_clause
|
||||||
|
has_rich_text :signature_legal_text
|
||||||
|
|
||||||
validates :name, presence: true
|
validates :name, presence: true
|
||||||
validates :release_type, presence: true
|
validates :release_type, presence: true
|
||||||
|
|||||||
@@ -25,6 +25,11 @@
|
|||||||
<%= form.rich_text_area :guardian_clause %>
|
<%= form.rich_text_area :guardian_clause %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="signature_legal_text">
|
||||||
|
<%= form.form_group do %>
|
||||||
|
<%= form.rich_text_area :signature_legal_text %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%= field_set_tag content_tag(:span, t(".custom_fields.heading"), class: "h6 text-muted text-uppercase"), id: "custom_fields", style: "display: none;" do %>
|
<%= field_set_tag content_tag(:span, t(".custom_fields.heading"), class: "h6 text-muted text-uppercase"), id: "custom_fields", style: "display: none;" do %>
|
||||||
|
|||||||
@@ -12,4 +12,8 @@
|
|||||||
<%= fa_icon "refresh" %> <%= t "shared.clear" %>
|
<%= fa_icon "refresh" %> <%= t "shared.clear" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
<% if @contract_template && @contract_template.signature_legal_text.present? %>
|
||||||
|
<div class="alert alert-warning font-weight-bold"><%= @contract_template.signature_legal_text %></div>
|
||||||
|
<% end %>
|
||||||
@@ -364,6 +364,7 @@ en:
|
|||||||
contract_template:
|
contract_template:
|
||||||
fee: Leave at $0.00 for no-fee
|
fee: Leave at $0.00 for no-fee
|
||||||
guardian_clause: Leave blank if not required for this contract
|
guardian_clause: Leave blank if not required for this contract
|
||||||
|
signature_legal_text: Leave blank if not required for this contract
|
||||||
task_request:
|
task_request:
|
||||||
time_allowed: Minimum of 2 hours, no partial hours allowed
|
time_allowed: Minimum of 2 hours, no partial hours allowed
|
||||||
video:
|
video:
|
||||||
|
|||||||
@@ -160,6 +160,7 @@ es:
|
|||||||
contract_template:
|
contract_template:
|
||||||
fee: Leave at $0.00 for no-fee (ES)
|
fee: Leave at $0.00 for no-fee (ES)
|
||||||
guardian_clause: Leave blank if not required for this contract (ES)
|
guardian_clause: Leave blank if not required for this contract (ES)
|
||||||
|
signature_legal_text: Leave blank if not required for this contract (ES)
|
||||||
label:
|
label:
|
||||||
appearance_release:
|
appearance_release:
|
||||||
guardian_2_address_city: Guardian 2 city (ES)
|
guardian_2_address_city: Guardian 2 city (ES)
|
||||||
|
|||||||
@@ -35,6 +35,24 @@ RSpec.feature 'User manages contract templates', type: :feature do
|
|||||||
expect(page).to have_content(create_contract_template_success_message)
|
expect(page).to have_content(create_contract_template_success_message)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
scenario 'creating new release template, all release types accept signature legal text' do
|
||||||
|
all_release_types = ['Acquired Media', 'Appearance', 'Location', 'Material', 'Medical', 'Misc', 'Talent']
|
||||||
|
|
||||||
|
all_release_types.each do |release_type|
|
||||||
|
visit new_project_contract_template_path(project)
|
||||||
|
|
||||||
|
dropdown_selection = "#{release_type} Release"
|
||||||
|
select dropdown_selection, from: 'Release type'
|
||||||
|
|
||||||
|
fill_in 'Name', with: "My #{release_type} template"
|
||||||
|
fill_in_trix signature_legal_text_field, with: 'LL'
|
||||||
|
|
||||||
|
expect do
|
||||||
|
click_on 'Create Release Template'
|
||||||
|
end.to change(ContractTemplate, :count).by(1)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
scenario 'medical release template has a guardian clause field' do
|
scenario 'medical release template has a guardian clause field' do
|
||||||
visit new_project_contract_template_path(project)
|
visit new_project_contract_template_path(project)
|
||||||
|
|
||||||
@@ -310,6 +328,10 @@ RSpec.feature 'User manages contract templates', type: :feature do
|
|||||||
'contract_template_guardian_clause_trix_input_contract_template'
|
'contract_template_guardian_clause_trix_input_contract_template'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def signature_legal_text_field
|
||||||
|
'contract_template_signature_legal_text'
|
||||||
|
end
|
||||||
|
|
||||||
def create_contract_template_success_message
|
def create_contract_template_success_message
|
||||||
'The release template has been created'
|
'The release template has been created'
|
||||||
end
|
end
|
||||||
@@ -329,4 +351,8 @@ RSpec.feature 'User manages contract templates', type: :feature do
|
|||||||
def create_release_template
|
def create_release_template
|
||||||
t 'contract_templates.splash.actions.create_template'
|
t 'contract_templates.splash.actions.create_template'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def signature_legal_text_trix_field
|
||||||
|
'Signature legal text'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -41,6 +41,13 @@ feature "User managing acquired_media releases" do
|
|||||||
expect(AcquiredMediaRelease.last.categories).to include("Still Photograph")
|
expect(AcquiredMediaRelease.last.categories).to include("Still Photograph")
|
||||||
expect(page).to have_content("Your release was successfully submitted. Thank you.")
|
expect(page).to have_content("Your release was successfully submitted. Thank you.")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
scenario "creating a release, if contract template contains signature legal language, it is shown" do
|
||||||
|
contract_template = create(:contract_template, project: project, signature_legal_text: dummy_signature_legal_text)
|
||||||
|
visit new_account_project_contract_template_acquired_media_release_path(project.account, project, contract_template)
|
||||||
|
|
||||||
|
expect(page).to have_content dummy_signature_legal_text
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "when signed in" do
|
context "when signed in" do
|
||||||
@@ -357,4 +364,8 @@ feature "User managing acquired_media releases" do
|
|||||||
def destroy_release_alert
|
def destroy_release_alert
|
||||||
t "acquired_media_releases.destroy.alert"
|
t "acquired_media_releases.destroy.alert"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def dummy_signature_legal_text
|
||||||
|
'Some signature legal language'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -137,6 +137,13 @@ feature 'User managing appearance releases' do
|
|||||||
expect(page).to have_content(successful_submission_message)
|
expect(page).to have_content(successful_submission_message)
|
||||||
expect(AppearanceRelease.last.guardian_2_first_name).to eq 'Second'
|
expect(AppearanceRelease.last.guardian_2_first_name).to eq 'Second'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
scenario "creating a release, if contract template contains signature legal language, it is shown" do
|
||||||
|
contract_template = create(:contract_template, project: project, signature_legal_text: dummy_signature_legal_text)
|
||||||
|
visit new_account_project_contract_template_appearance_release_path(project.account, project, contract_template)
|
||||||
|
|
||||||
|
expect(page).to have_content dummy_signature_legal_text
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when signed in' do
|
context 'when signed in' do
|
||||||
@@ -706,4 +713,8 @@ feature 'User managing appearance releases' do
|
|||||||
def guardian_2_photo_heading
|
def guardian_2_photo_heading
|
||||||
t 'appearance_releases.form.photos.guardian_2_photo.heading'
|
t 'appearance_releases.form.photos.guardian_2_photo.heading'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def dummy_signature_legal_text
|
||||||
|
'Some signature legal language'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -71,6 +71,13 @@ feature "User managing location releases" do
|
|||||||
expect(page).to have_content("Your release was successfully submitted. Thank you.")
|
expect(page).to have_content("Your release was successfully submitted. Thank you.")
|
||||||
expect(LocationRelease.last.photos.attached?).to eq true
|
expect(LocationRelease.last.photos.attached?).to eq true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
scenario "creating a release, if contract template contains signature legal language, it is shown" do
|
||||||
|
contract_template = create(:contract_template, project: project, signature_legal_text: dummy_signature_legal_text)
|
||||||
|
visit new_account_project_contract_template_location_release_path(project.account, project, contract_template)
|
||||||
|
|
||||||
|
expect(page).to have_content dummy_signature_legal_text
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "when signed in" do
|
context "when signed in" do
|
||||||
@@ -375,4 +382,8 @@ feature "User managing location releases" do
|
|||||||
select "Other", from: "Restriction"
|
select "Other", from: "Restriction"
|
||||||
fill_in "Describe other restrictions", with: "Test"
|
fill_in "Describe other restrictions", with: "Test"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def dummy_signature_legal_text
|
||||||
|
'Some signature legal language'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -84,6 +84,13 @@ feature "User managing material releases" do
|
|||||||
click_button submit_release_button
|
click_button submit_release_button
|
||||||
expect(page).to have_content success_submit_message
|
expect(page).to have_content success_submit_message
|
||||||
end
|
end
|
||||||
|
|
||||||
|
scenario "creating a release, if contract template contains signature legal language, it is shown" do
|
||||||
|
contract_template = create(:contract_template, project: project, signature_legal_text: dummy_signature_legal_text)
|
||||||
|
visit new_account_project_contract_template_material_release_path(project.account, project, contract_template)
|
||||||
|
|
||||||
|
expect(page).to have_content dummy_signature_legal_text
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "when signed in" do
|
context "when signed in" do
|
||||||
@@ -382,4 +389,8 @@ feature "User managing material releases" do
|
|||||||
click_button submit_release_button
|
click_button submit_release_button
|
||||||
expect(page).not_to have_content success_submit_message
|
expect(page).not_to have_content success_submit_message
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def dummy_signature_legal_text
|
||||||
|
'Some signature legal language'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -168,6 +168,13 @@ feature "User managing medical releases" do
|
|||||||
expect(page).to have_content(successful_submission_message)
|
expect(page).to have_content(successful_submission_message)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
scenario "creating a release, if contract template contains signature legal language, it is shown" do
|
||||||
|
contract_template = create(:contract_template, project: project, signature_legal_text: dummy_signature_legal_text)
|
||||||
|
visit new_account_project_contract_template_medical_release_path(project.account, project, contract_template)
|
||||||
|
|
||||||
|
expect(page).to have_content dummy_signature_legal_text
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "when signed in as account manager" do
|
context "when signed in as account manager" do
|
||||||
@@ -447,4 +454,8 @@ feature "User managing medical releases" do
|
|||||||
def answer_field_for_question(number)
|
def answer_field_for_question(number)
|
||||||
"medical_release[question_#{number}_answer]"
|
"medical_release[question_#{number}_answer]"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def dummy_signature_legal_text
|
||||||
|
'Some signature legal language'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -48,6 +48,13 @@ feature "User managing misc releases" do
|
|||||||
expect(field).to be_visible
|
expect(field).to be_visible
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
scenario "creating a release, if contract template contains signature legal language, it is shown" do
|
||||||
|
contract_template = create(:contract_template, project: project, signature_legal_text: dummy_signature_legal_text)
|
||||||
|
visit new_account_project_contract_template_misc_release_path(project.account, project, contract_template)
|
||||||
|
|
||||||
|
expect(page).to have_content dummy_signature_legal_text
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "when signed in as account manager" do
|
context "when signed in as account manager" do
|
||||||
@@ -199,4 +206,8 @@ feature "User managing misc releases" do
|
|||||||
def person_is_minor_checkbox
|
def person_is_minor_checkbox
|
||||||
'misc_release_minor'
|
'misc_release_minor'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def dummy_signature_legal_text
|
||||||
|
'Some signature legal language'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -126,6 +126,13 @@ feature "User managing talent releases" do
|
|||||||
expect(TalentRelease.last.guardian_2_photo.attached?).to eq true
|
expect(TalentRelease.last.guardian_2_photo.attached?).to eq true
|
||||||
expect(TalentRelease.last.guardian_2_name).to eq "Second Guardian"
|
expect(TalentRelease.last.guardian_2_name).to eq "Second Guardian"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
scenario "creating a release, if contract template contains signature legal language, it is shown" do
|
||||||
|
contract_template = create(:contract_template, project: project, signature_legal_text: dummy_signature_legal_text)
|
||||||
|
visit new_account_project_contract_template_talent_release_path(project.account, project, contract_template)
|
||||||
|
|
||||||
|
expect(page).to have_content dummy_signature_legal_text
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "when signed in" do
|
context "when signed in" do
|
||||||
@@ -555,4 +562,8 @@ feature "User managing talent releases" do
|
|||||||
fill_in guardian_address_state_field, with: "NY"
|
fill_in guardian_address_state_field, with: "NY"
|
||||||
fill_in guardian_address_zip_field, with: '1000'
|
fill_in guardian_address_zip_field, with: '1000'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def dummy_signature_legal_text
|
||||||
|
'Some signature legal language'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user