diff --git a/app/controllers/location_releases_controller.rb b/app/controllers/location_releases_controller.rb
index 5ece1f0..898032a 100644
--- a/app/controllers/location_releases_controller.rb
+++ b/app/controllers/location_releases_controller.rb
@@ -68,7 +68,8 @@ class LocationReleasesController < ApplicationController
:territory_id, :territory_text,
:term_id, :term_text,
:restriction_id, :restriction_text,
- :filming_started_on, :filming_ended_on
+ :filming_started_on, :filming_ended_on,
+ :filming_hours
)
end
diff --git a/app/controllers/public/location_releases_controller.rb b/app/controllers/public/location_releases_controller.rb
index 563e188..a88de75 100644
--- a/app/controllers/public/location_releases_controller.rb
+++ b/app/controllers/public/location_releases_controller.rb
@@ -63,7 +63,8 @@ class Public::LocationReleasesController < Public::BaseController
:person_address_zip,
:person_address_country,
:signature_base64,
- :locale, :contract_template, :filming_started_on, :filming_ended_on
+ :locale, :contract_template, :filming_started_on, :filming_ended_on,
+ :filming_hours
)
end
diff --git a/app/views/contracts/_signature_page.html.erb b/app/views/contracts/_signature_page.html.erb
index e6ad5d6..e39c8be 100644
--- a/app/views/contracts/_signature_page.html.erb
+++ b/app/views/contracts/_signature_page.html.erb
@@ -29,6 +29,7 @@
<% if releasable.model_name == "LocationRelease" %>
<%= description_list_pair "Filming Started On:", releasable&.filming_started_on&.strftime("%D") %>
<%= description_list_pair "Filming Ended On:", releasable&.filming_ended_on&.strftime("%D") %>
+ <%= description_list_pair "Filming Hours:", releasable&.filming_hours %>
<% end %>
<% if contract_template.fee? %>
<%= description_list_pair "Fee:", number_to_currency(contract_template.fee) %>
diff --git a/app/views/location_releases/_form.html.erb b/app/views/location_releases/_form.html.erb
index 33aeb45..b076b95 100644
--- a/app/views/location_releases/_form.html.erb
+++ b/app/views/location_releases/_form.html.erb
@@ -39,6 +39,9 @@
<%= form.text_field :filming_started_on, wrapper_class: "col-sm-6", class: "datepicker-control", readonly: true %>
<%= form.text_field :filming_ended_on, wrapper_class: "col-sm-6", class: "datepicker-control", readonly: true %>
+
+ <%= form.text_field :filming_hours, wrapper_class: "col-sm-12" %>
+
<% end %>
diff --git a/app/views/public/location_releases/new.html.erb b/app/views/public/location_releases/new.html.erb
index 2e3625e..48b65c4 100644
--- a/app/views/public/location_releases/new.html.erb
+++ b/app/views/public/location_releases/new.html.erb
@@ -46,6 +46,9 @@
<%= form.text_field :filming_started_on, wrapper_class: "col-sm-6", class: "datepicker-control", readonly: true %>
<%= form.text_field :filming_ended_on, wrapper_class: "col-sm-6", class: "datepicker-control", readonly: true %>
+
+ <%= form.text_field :filming_hours, wrapper_class: "col-sm-12" %>
+
<% end %>
<%= card_field_set_tag t(".signature.heading") do %>
diff --git a/db/migrate/20200603090419_add_filming_hours_to_location_releases.rb b/db/migrate/20200603090419_add_filming_hours_to_location_releases.rb
new file mode 100644
index 0000000..589a021
--- /dev/null
+++ b/db/migrate/20200603090419_add_filming_hours_to_location_releases.rb
@@ -0,0 +1,5 @@
+class AddFilmingHoursToLocationReleases < ActiveRecord::Migration[6.0]
+ def change
+ add_column :location_releases, :filming_hours, :text, default: ''
+ end
+end
diff --git a/spec/features/user_managing_location_releases_spec.rb b/spec/features/user_managing_location_releases_spec.rb
index 8a2c916..9e8a32f 100644
--- a/spec/features/user_managing_location_releases_spec.rb
+++ b/spec/features/user_managing_location_releases_spec.rb
@@ -17,6 +17,7 @@ feature "User managing location releases" do
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"
end
@@ -51,6 +52,7 @@ feature "User managing location releases" do
by "filling out the remaining information" do
fill_in_release_fields name: "Test Location Release"
+ fill_in filming_hours_field, with: "04:00 - 22:00"
click_button create_release_button
expect(page).to have_content(create_release_notice)
expect(page).to have_photo("location_photo.png")
@@ -136,6 +138,7 @@ feature "User managing location releases" do
:native,
project: project,
name: "Benny's Burritos",
+ filming_hours: "06:00 - 20:00",
tag_list: "Restaurant",
notes: [
build(:note,
@@ -172,6 +175,8 @@ feature "User managing location releases" do
expect(pdf_body).to have_content("Restaurant")
expect(pdf_body).to have_content photos_heading.upcase
expect(pdf_body).to have_content("location_photo.png")
+ expect(pdf_body).to have_content("Filming Hours")
+ expect(pdf_body).to have_content("06:00 - 20:00")
end
context "when the user is associate" do
@@ -222,6 +227,10 @@ feature "User managing location releases" do
"location_release[person_phone]"
end
+ def filming_hours_field
+ "location_release[filming_hours]"
+ end
+
def have_photo(filename, attr: "src")
have_selector("img[#{attr}*='#{filename}']")
end