Compare commits
2 Commits
add-photos
...
add-photos
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
68cb630041 | ||
|
|
d71755aabc |
@@ -64,8 +64,7 @@ class Public::LocationReleasesController < Public::BaseController
|
|||||||
:person_address_country,
|
:person_address_country,
|
||||||
:signature_base64,
|
:signature_base64,
|
||||||
:locale, :contract_template, :filming_started_on, :filming_ended_on,
|
:locale, :contract_template, :filming_started_on, :filming_ended_on,
|
||||||
:filming_hours,
|
:filming_hours
|
||||||
photos: []
|
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ class Public::MaterialReleasesController < Public::BaseController
|
|||||||
:person_first_name, :person_last_name, :person_title, :person_company, :person_phone, :person_email,
|
:person_first_name, :person_last_name, :person_title, :person_company, :person_phone, :person_email,
|
||||||
:person_address_street1, :person_address_street2, :person_address_city, :person_address_state, :person_address_zip, :person_address_country,
|
:person_address_street1, :person_address_street2, :person_address_city, :person_address_state, :person_address_zip, :person_address_country,
|
||||||
:signature_base64,
|
:signature_base64,
|
||||||
:locale, :contract_template, :description
|
:locale, :contract_template, :description, photos: []
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -3,10 +3,10 @@ module DropzoneHelper
|
|||||||
case releasable.model_name.param_key
|
case releasable.model_name.param_key
|
||||||
when "acquired_media_release"
|
when "acquired_media_release"
|
||||||
"To Add Photos & Videos to the release:<br>Drag & Drop Files<br>or<br>Click or Tap here to browse photos and connect to Camera"
|
"To Add Photos & Videos to the release:<br>Drag & Drop Files<br>or<br>Click or Tap here to browse photos and connect to Camera"
|
||||||
|
when "material_release"
|
||||||
|
t 'material_releases.form.photos.dropzone_label'
|
||||||
when "music_release"
|
when "music_release"
|
||||||
"To Add Audio Files to the release:<br>Drag & Drop Files<br>or<br>Click or Tap here to browse files"
|
"To Add Audio Files to the release:<br>Drag & Drop Files<br>or<br>Click or Tap here to browse files"
|
||||||
when "location_release"
|
|
||||||
t 'location_releases.form.photos.dropzone_label'
|
|
||||||
when "directory"
|
when "directory"
|
||||||
"To Add Files to the Folder:<br>Drag & Drop Files<br>or<br>Click or Tap here to browse files"
|
"To Add Files to the Folder:<br>Drag & Drop Files<br>or<br>Click or Tap here to browse files"
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -45,10 +45,6 @@
|
|||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%= card_field_set_tag t(".photos.heading") do %>
|
|
||||||
<%= render "shared/photos_dropzone_fields", form: form, release: @location_release %>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<%= card_field_set_tag t(".signature.heading") do %>
|
<%= card_field_set_tag t(".signature.heading") do %>
|
||||||
<%= render "shared/signature_fields", form: form, instruction: 'An Authorized Signatory' %>
|
<%= render "shared/signature_fields", form: form, instruction: 'An Authorized Signatory' %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -34,6 +34,10 @@
|
|||||||
<%= render "shared/address_fields", form: form, subject: "person" %>
|
<%= render "shared/address_fields", form: form, subject: "person" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
<%= card_field_set_tag t(".photo.heading") do %>
|
||||||
|
<%= render "shared/photos_dropzone_fields", form: form, release: @material_release %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
<%= card_field_set_tag t(".signature.heading") do %>
|
<%= card_field_set_tag t(".signature.heading") do %>
|
||||||
|
|||||||
@@ -556,7 +556,6 @@ en:
|
|||||||
heading: 1 of 4 Location Details
|
heading: 1 of 4 Location Details
|
||||||
photos:
|
photos:
|
||||||
heading: 4 of 4 Photos
|
heading: 4 of 4 Photos
|
||||||
dropzone_label: Tap to take a photo of the Property (optional)
|
|
||||||
signer_details:
|
signer_details:
|
||||||
heading: 2 of 4 Owner Details
|
heading: 2 of 4 Owner Details
|
||||||
index:
|
index:
|
||||||
@@ -591,6 +590,7 @@ en:
|
|||||||
heading: 1 of 3 Material Details
|
heading: 1 of 3 Material Details
|
||||||
photos:
|
photos:
|
||||||
heading: 4 of 4 Photos
|
heading: 4 of 4 Photos
|
||||||
|
dropzone_label: Tap to take a photo of Licensed Material (optional)
|
||||||
signer_details:
|
signer_details:
|
||||||
heading: 2 of 4 Licensor/Owner Details
|
heading: 2 of 4 Licensor/Owner Details
|
||||||
index:
|
index:
|
||||||
@@ -803,8 +803,6 @@ en:
|
|||||||
heading: Location Information
|
heading: Location Information
|
||||||
signature:
|
signature:
|
||||||
heading: Sign Below
|
heading: Sign Below
|
||||||
photos:
|
|
||||||
heading: Photos
|
|
||||||
material_releases:
|
material_releases:
|
||||||
create:
|
create:
|
||||||
notice: Your release has been signed. Thank you!
|
notice: Your release has been signed. Thank you!
|
||||||
@@ -818,6 +816,8 @@ en:
|
|||||||
heading: Release Information
|
heading: Release Information
|
||||||
signature:
|
signature:
|
||||||
heading: Sign Below
|
heading: Sign Below
|
||||||
|
photo:
|
||||||
|
heading: Photos
|
||||||
talent_releases:
|
talent_releases:
|
||||||
create:
|
create:
|
||||||
notice: Your release has been signed. Thank you!
|
notice: Your release has been signed. Thank you!
|
||||||
|
|||||||
@@ -175,9 +175,9 @@ es:
|
|||||||
show:
|
show:
|
||||||
choose_project: ¿Qué proyecto de la lista de abajo asistirá?
|
choose_project: ¿Qué proyecto de la lista de abajo asistirá?
|
||||||
welcome_html: Bienvenidos a la plataforma de firma autorizaciónes de <strong>%{name}</strong>
|
welcome_html: Bienvenidos a la plataforma de firma autorizaciónes de <strong>%{name}</strong>
|
||||||
location_releases:
|
material_releases:
|
||||||
new:
|
new:
|
||||||
photos:
|
photo:
|
||||||
heading: Photos (ES)
|
heading: Photos (ES)
|
||||||
shared:
|
shared:
|
||||||
print: Print (ES)
|
print: Print (ES)
|
||||||
@@ -186,7 +186,7 @@ es:
|
|||||||
photos:
|
photos:
|
||||||
guardian_photo:
|
guardian_photo:
|
||||||
heading: Guardian Photo (ES)
|
heading: Guardian Photo (ES)
|
||||||
location_releases:
|
material_releases:
|
||||||
form:
|
form:
|
||||||
photos:
|
photos:
|
||||||
dropzone_label: Tap to take a photo of the Property (optional) (ES)
|
dropzone_label: Tap to take a photo of Licensed Material (optional)
|
||||||
|
|||||||
@@ -7,15 +7,6 @@ describe Public::LocationReleasesController do
|
|||||||
render_views
|
render_views
|
||||||
|
|
||||||
describe "#create" do
|
describe "#create" do
|
||||||
it "allows photos param" do
|
|
||||||
contract_template = create(:contract_template, project: project)
|
|
||||||
|
|
||||||
post :create, params: { account_id: user.primary_account.to_param, project_id: project, contract_template_id: contract_template, location_release: location_release_params_with_photos }
|
|
||||||
|
|
||||||
expect(response).to be_successful
|
|
||||||
expect(LocationRelease.last.photos.attached?).to eq true
|
|
||||||
end
|
|
||||||
|
|
||||||
it "logs analytics" do
|
it "logs analytics" do
|
||||||
contract_template = create(:contract_template, project: project)
|
contract_template = create(:contract_template, project: project)
|
||||||
|
|
||||||
@@ -76,10 +67,6 @@ describe Public::LocationReleasesController do
|
|||||||
attributes_for(:location_release, :native).except(:signature).merge(signature_param).merge(person_address_params)
|
attributes_for(:location_release, :native).except(:signature).merge(signature_param).merge(person_address_params)
|
||||||
end
|
end
|
||||||
|
|
||||||
def location_release_params_with_photos
|
|
||||||
attributes_for(:location_release, :native, :with_photo).except(:signature).merge(signature_param)
|
|
||||||
end
|
|
||||||
|
|
||||||
def person_address_params
|
def person_address_params
|
||||||
{
|
{
|
||||||
person_address_street1: "123 Broadway",
|
person_address_street1: "123 Broadway",
|
||||||
|
|||||||
@@ -7,6 +7,15 @@ describe Public::MaterialReleasesController do
|
|||||||
render_views
|
render_views
|
||||||
|
|
||||||
describe "#create" do
|
describe "#create" do
|
||||||
|
it "allows photos param" do
|
||||||
|
contract_template = create(:contract_template, project: project)
|
||||||
|
|
||||||
|
post :create, params: { account_id: user.primary_account.to_param, project_id: project, contract_template_id: contract_template, material_release: material_release_params_with_photos }
|
||||||
|
|
||||||
|
expect(response).to be_successful
|
||||||
|
expect(MaterialRelease.last.photos.attached?).to eq true
|
||||||
|
end
|
||||||
|
|
||||||
it "logs analytics" do
|
it "logs analytics" do
|
||||||
contract_template = create(:contract_template, project: project)
|
contract_template = create(:contract_template, project: project)
|
||||||
|
|
||||||
@@ -65,6 +74,11 @@ describe Public::MaterialReleasesController do
|
|||||||
attributes_for(:material_release, :native).except(:signature).merge(signature_param)
|
attributes_for(:material_release, :native).except(:signature).merge(signature_param)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def material_release_params_with_photos
|
||||||
|
attributes_for(:material_release, :native, :with_photo).except(:signature).merge(signature_param)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
def signature_param
|
def signature_param
|
||||||
file = file_fixture("signature.png")
|
file = file_fixture("signature.png")
|
||||||
data_uri = Base64Image.from_image(file).data_uri
|
data_uri = Base64Image.from_image(file).data_uri
|
||||||
|
|||||||
@@ -15,13 +15,6 @@ FactoryBot.define do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
trait :with_photo do
|
|
||||||
photos do
|
|
||||||
path = Rails.root.join("spec", "fixtures", "files", "location_photo.png")
|
|
||||||
[Rack::Test::UploadedFile.new(path, "image/png")]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
trait :non_native do
|
trait :non_native do
|
||||||
contract do
|
contract do
|
||||||
path = Rails.root.join("spec", "fixtures", "files", "contract.pdf")
|
path = Rails.root.join("spec", "fixtures", "files", "contract.pdf")
|
||||||
|
|||||||
@@ -15,6 +15,14 @@ FactoryBot.define do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
trait :with_photo do
|
||||||
|
photos do
|
||||||
|
path = Rails.root.join("spec", "fixtures", "files", "material_photo.png")
|
||||||
|
[Rack::Test::UploadedFile.new(path, "image/png")]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
trait :non_native do
|
trait :non_native do
|
||||||
contract do
|
contract do
|
||||||
path = Rails.root.join("spec", "fixtures", "files", "contract.pdf")
|
path = Rails.root.join("spec", "fixtures", "files", "contract.pdf")
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ feature "User managing location releases" do
|
|||||||
let(:project) { create(:project, members: current_user, account: current_user.primary_account) }
|
let(:project) { create(:project, members: current_user, account: current_user.primary_account) }
|
||||||
|
|
||||||
context "when signed out" do
|
context "when signed out" do
|
||||||
scenario "creating a release without photos", js: true do
|
scenario "creating a release", js: true do
|
||||||
contract_template = create(:contract_template, project: project)
|
contract_template = create(:contract_template, project: project)
|
||||||
|
|
||||||
visit new_account_project_contract_template_location_release_path(project.account, project, contract_template)
|
visit new_account_project_contract_template_location_release_path(project.account, project, contract_template)
|
||||||
@@ -21,31 +21,10 @@ feature "User managing location releases" do
|
|||||||
draw_signature file_fixture("signature.png"), "location_release_signature_base64"
|
draw_signature file_fixture("signature.png"), "location_release_signature_base64"
|
||||||
end
|
end
|
||||||
|
|
||||||
click_button submit_release_button
|
click_button "I have read and agree to the above"
|
||||||
|
|
||||||
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 with photos", js: true do
|
|
||||||
contract_template = create(:contract_template, project: project)
|
|
||||||
|
|
||||||
visit new_account_project_contract_template_location_release_path(project.account, project, contract_template)
|
|
||||||
|
|
||||||
fill_in location_name_field, with: "Benny's Burritos"
|
|
||||||
fill_in person_first_name_field, with: "Jane"
|
|
||||||
fill_in person_last_name_field, with: "Doe"
|
|
||||||
fill_in person_phone_field, with: "555-555-5555"
|
|
||||||
fill_in person_email_field, with: "jane.doe@test.com"
|
|
||||||
fill_in person_address_street1_field, with: "100 Broadway"
|
|
||||||
fill_in filming_hours_field, with: "04:00 - 22:00"
|
|
||||||
draw_signature file_fixture("signature.png"), "location_release_signature_base64"
|
|
||||||
|
|
||||||
drop_file Rails.root.join(file_fixture("location_photo.png")), type: :dropzone
|
|
||||||
click_button submit_release_button
|
|
||||||
|
|
||||||
expect(page).to have_content("Your release was successfully submitted. Thank you.")
|
|
||||||
expect(LocationRelease.last.photos.attached?).to eq true
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
context "when signed in" do
|
context "when signed in" do
|
||||||
@@ -276,10 +255,6 @@ feature "User managing location releases" do
|
|||||||
t "helpers.submit.location_release.create"
|
t "helpers.submit.location_release.create"
|
||||||
end
|
end
|
||||||
|
|
||||||
def submit_release_button
|
|
||||||
t("shared.submit_release_long")
|
|
||||||
end
|
|
||||||
|
|
||||||
def create_release_notice
|
def create_release_notice
|
||||||
t "location_releases.create.notice"
|
t "location_releases.create.notice"
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ feature "User managing material releases" do
|
|||||||
let(:project) { create(:project, members: current_user, account: current_user.primary_account) }
|
let(:project) { create(:project, members: current_user, account: current_user.primary_account) }
|
||||||
|
|
||||||
context "when signed out" do
|
context "when signed out" do
|
||||||
scenario "creating a release", js: true do
|
scenario "creating a release without photos", js: true do
|
||||||
contract_template = create(:contract_template, project: project)
|
contract_template = create(:contract_template, project: project)
|
||||||
|
|
||||||
visit new_account_project_contract_template_material_release_path(project.account, project, contract_template)
|
visit new_account_project_contract_template_material_release_path(project.account, project, contract_template)
|
||||||
@@ -17,10 +17,27 @@ feature "User managing material releases" do
|
|||||||
draw_signature file_fixture("signature.png"), "material_release_signature_base64"
|
draw_signature file_fixture("signature.png"), "material_release_signature_base64"
|
||||||
end
|
end
|
||||||
|
|
||||||
click_button "I have read and agree to the above"
|
click_button submit_release_button
|
||||||
|
|
||||||
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 with photos", js: true do
|
||||||
|
contract_template = create(:contract_template, project: project)
|
||||||
|
|
||||||
|
visit new_account_project_contract_template_material_release_path(project.account, project, contract_template)
|
||||||
|
|
||||||
|
fill_in material_name_field, with: "Pepsi Logo"
|
||||||
|
fill_in person_first_name_field, with: "Jane"
|
||||||
|
fill_in person_last_name_field, with: "Doe"
|
||||||
|
draw_signature file_fixture("signature.png"), "material_release_signature_base64"
|
||||||
|
|
||||||
|
drop_file Rails.root.join(file_fixture("material_photo.png")), type: :dropzone
|
||||||
|
click_button submit_release_button
|
||||||
|
|
||||||
|
expect(page).to have_content("Your release was successfully submitted. Thank you.")
|
||||||
|
expect(MaterialRelease.last.photos.attached?).to eq true
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "when signed in" do
|
context "when signed in" do
|
||||||
@@ -224,6 +241,10 @@ feature "User managing material releases" do
|
|||||||
t "helpers.submit.material_release.create"
|
t "helpers.submit.material_release.create"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def submit_release_button
|
||||||
|
t 'shared.submit_release_long'
|
||||||
|
end
|
||||||
|
|
||||||
def create_release_notice
|
def create_release_notice
|
||||||
t "material_releases.create.notice"
|
t "material_releases.create.notice"
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user