Compare commits
6 Commits
add-guardi
...
upgrade-ra
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6a0eb0dd06 | ||
|
|
6831c66fda | ||
|
|
4bff4c9d5b | ||
|
|
8951667e61 | ||
|
|
fe131491cd | ||
|
|
290dbfa48b |
2
Gemfile
2
Gemfile
@@ -4,7 +4,7 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
|
|||||||
ruby "2.6.3"
|
ruby "2.6.3"
|
||||||
|
|
||||||
# Bundle edge Rails instead: gem "rails", github: "rails/rails"
|
# Bundle edge Rails instead: gem "rails", github: "rails/rails"
|
||||||
gem "rails", "~> 6.0.0"
|
gem "rails", "~> 6.0.3.1"
|
||||||
# Use postgresql as the database for Active Record
|
# Use postgresql as the database for Active Record
|
||||||
gem "pg", "~> 0.18"
|
gem "pg", "~> 0.18"
|
||||||
# Use Puma as the app server
|
# Use Puma as the app server
|
||||||
|
|||||||
130
Gemfile.lock
130
Gemfile.lock
@@ -44,71 +44,71 @@ GEM
|
|||||||
remote: https://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
Ascii85 (1.0.3)
|
Ascii85 (1.0.3)
|
||||||
actioncable (6.0.0)
|
actioncable (6.0.3.2)
|
||||||
actionpack (= 6.0.0)
|
actionpack (= 6.0.3.2)
|
||||||
nio4r (~> 2.0)
|
nio4r (~> 2.0)
|
||||||
websocket-driver (>= 0.6.1)
|
websocket-driver (>= 0.6.1)
|
||||||
actionmailbox (6.0.0)
|
actionmailbox (6.0.3.2)
|
||||||
actionpack (= 6.0.0)
|
actionpack (= 6.0.3.2)
|
||||||
activejob (= 6.0.0)
|
activejob (= 6.0.3.2)
|
||||||
activerecord (= 6.0.0)
|
activerecord (= 6.0.3.2)
|
||||||
activestorage (= 6.0.0)
|
activestorage (= 6.0.3.2)
|
||||||
activesupport (= 6.0.0)
|
activesupport (= 6.0.3.2)
|
||||||
mail (>= 2.7.1)
|
mail (>= 2.7.1)
|
||||||
actionmailer (6.0.0)
|
actionmailer (6.0.3.2)
|
||||||
actionpack (= 6.0.0)
|
actionpack (= 6.0.3.2)
|
||||||
actionview (= 6.0.0)
|
actionview (= 6.0.3.2)
|
||||||
activejob (= 6.0.0)
|
activejob (= 6.0.3.2)
|
||||||
mail (~> 2.5, >= 2.5.4)
|
mail (~> 2.5, >= 2.5.4)
|
||||||
rails-dom-testing (~> 2.0)
|
rails-dom-testing (~> 2.0)
|
||||||
actionpack (6.0.0)
|
actionpack (6.0.3.2)
|
||||||
actionview (= 6.0.0)
|
actionview (= 6.0.3.2)
|
||||||
activesupport (= 6.0.0)
|
activesupport (= 6.0.3.2)
|
||||||
rack (~> 2.0)
|
rack (~> 2.0, >= 2.0.8)
|
||||||
rack-test (>= 0.6.3)
|
rack-test (>= 0.6.3)
|
||||||
rails-dom-testing (~> 2.0)
|
rails-dom-testing (~> 2.0)
|
||||||
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
||||||
actiontext (6.0.0)
|
actiontext (6.0.3.2)
|
||||||
actionpack (= 6.0.0)
|
actionpack (= 6.0.3.2)
|
||||||
activerecord (= 6.0.0)
|
activerecord (= 6.0.3.2)
|
||||||
activestorage (= 6.0.0)
|
activestorage (= 6.0.3.2)
|
||||||
activesupport (= 6.0.0)
|
activesupport (= 6.0.3.2)
|
||||||
nokogiri (>= 1.8.5)
|
nokogiri (>= 1.8.5)
|
||||||
actionview (6.0.0)
|
actionview (6.0.3.2)
|
||||||
activesupport (= 6.0.0)
|
activesupport (= 6.0.3.2)
|
||||||
builder (~> 3.1)
|
builder (~> 3.1)
|
||||||
erubi (~> 1.4)
|
erubi (~> 1.4)
|
||||||
rails-dom-testing (~> 2.0)
|
rails-dom-testing (~> 2.0)
|
||||||
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
||||||
active_storage_base64 (1.0.0)
|
active_storage_base64 (1.0.0)
|
||||||
rails (~> 6.0)
|
rails (~> 6.0)
|
||||||
activejob (6.0.0)
|
activejob (6.0.3.2)
|
||||||
activesupport (= 6.0.0)
|
activesupport (= 6.0.3.2)
|
||||||
globalid (>= 0.3.6)
|
globalid (>= 0.3.6)
|
||||||
activemodel (6.0.0)
|
activemodel (6.0.3.2)
|
||||||
activesupport (= 6.0.0)
|
activesupport (= 6.0.3.2)
|
||||||
activemodel-serializers-xml (1.0.2)
|
activemodel-serializers-xml (1.0.2)
|
||||||
activemodel (> 5.x)
|
activemodel (> 5.x)
|
||||||
activesupport (> 5.x)
|
activesupport (> 5.x)
|
||||||
builder (~> 3.1)
|
builder (~> 3.1)
|
||||||
activerecord (6.0.0)
|
activerecord (6.0.3.2)
|
||||||
activemodel (= 6.0.0)
|
activemodel (= 6.0.3.2)
|
||||||
activesupport (= 6.0.0)
|
activesupport (= 6.0.3.2)
|
||||||
activeresource (5.1.0)
|
activeresource (5.1.0)
|
||||||
activemodel (>= 5.0, < 7)
|
activemodel (>= 5.0, < 7)
|
||||||
activemodel-serializers-xml (~> 1.0)
|
activemodel-serializers-xml (~> 1.0)
|
||||||
activesupport (>= 5.0, < 7)
|
activesupport (>= 5.0, < 7)
|
||||||
activestorage (6.0.0)
|
activestorage (6.0.3.2)
|
||||||
actionpack (= 6.0.0)
|
actionpack (= 6.0.3.2)
|
||||||
activejob (= 6.0.0)
|
activejob (= 6.0.3.2)
|
||||||
activerecord (= 6.0.0)
|
activerecord (= 6.0.3.2)
|
||||||
marcel (~> 0.3.1)
|
marcel (~> 0.3.1)
|
||||||
activesupport (6.0.0)
|
activesupport (6.0.3.2)
|
||||||
concurrent-ruby (~> 1.0, >= 1.0.2)
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
||||||
i18n (>= 0.7, < 2)
|
i18n (>= 0.7, < 2)
|
||||||
minitest (~> 5.1)
|
minitest (~> 5.1)
|
||||||
tzinfo (~> 1.1)
|
tzinfo (~> 1.1)
|
||||||
zeitwerk (~> 2.1, >= 2.1.8)
|
zeitwerk (~> 2.2, >= 2.2.2)
|
||||||
addressable (2.7.0)
|
addressable (2.7.0)
|
||||||
public_suffix (>= 2.0.2, < 5.0)
|
public_suffix (>= 2.0.2, < 5.0)
|
||||||
afm (0.2.2)
|
afm (0.2.2)
|
||||||
@@ -181,7 +181,7 @@ GEM
|
|||||||
coffee-script-source
|
coffee-script-source
|
||||||
execjs
|
execjs
|
||||||
coffee-script-source (1.12.2)
|
coffee-script-source (1.12.2)
|
||||||
concurrent-ruby (1.1.5)
|
concurrent-ruby (1.1.6)
|
||||||
connection_pool (2.2.2)
|
connection_pool (2.2.2)
|
||||||
countries (2.1.4)
|
countries (2.1.4)
|
||||||
i18n_data (~> 0.8.0)
|
i18n_data (~> 0.8.0)
|
||||||
@@ -230,7 +230,7 @@ GEM
|
|||||||
hubspot-ruby (0.9.0)
|
hubspot-ruby (0.9.0)
|
||||||
activesupport (>= 3.0.0)
|
activesupport (>= 3.0.0)
|
||||||
httparty (>= 0.10.0)
|
httparty (>= 0.10.0)
|
||||||
i18n (1.8.2)
|
i18n (1.8.3)
|
||||||
concurrent-ruby (~> 1.0)
|
concurrent-ruby (~> 1.0)
|
||||||
i18n_data (0.8.0)
|
i18n_data (0.8.0)
|
||||||
i18n_yaml_sorter (0.2.0)
|
i18n_yaml_sorter (0.2.0)
|
||||||
@@ -270,22 +270,22 @@ GEM
|
|||||||
ruby_dep (~> 1.2)
|
ruby_dep (~> 1.2)
|
||||||
loaf (0.8.1)
|
loaf (0.8.1)
|
||||||
rails (>= 3.2)
|
rails (>= 3.2)
|
||||||
loofah (2.4.0)
|
loofah (2.6.0)
|
||||||
crass (~> 1.0.2)
|
crass (~> 1.0.2)
|
||||||
nokogiri (>= 1.5.9)
|
nokogiri (>= 1.5.9)
|
||||||
mail (2.7.1)
|
mail (2.7.1)
|
||||||
mini_mime (>= 0.1.1)
|
mini_mime (>= 0.1.1)
|
||||||
marcel (0.3.3)
|
marcel (0.3.3)
|
||||||
mimemagic (~> 0.3.2)
|
mimemagic (~> 0.3.2)
|
||||||
method_source (0.9.2)
|
method_source (1.0.0)
|
||||||
mime-types (3.3)
|
mime-types (3.3)
|
||||||
mime-types-data (~> 3.2015)
|
mime-types-data (~> 3.2015)
|
||||||
mime-types-data (3.2019.0904)
|
mime-types-data (3.2019.0904)
|
||||||
mimemagic (0.3.3)
|
mimemagic (0.3.5)
|
||||||
mini_magick (4.9.5)
|
mini_magick (4.9.5)
|
||||||
mini_mime (1.0.2)
|
mini_mime (1.0.2)
|
||||||
mini_portile2 (2.4.0)
|
mini_portile2 (2.4.0)
|
||||||
minitest (5.14.0)
|
minitest (5.14.1)
|
||||||
monetize (1.9.2)
|
monetize (1.9.2)
|
||||||
money (~> 6.12)
|
money (~> 6.12)
|
||||||
money (6.13.4)
|
money (6.13.4)
|
||||||
@@ -298,8 +298,8 @@ GEM
|
|||||||
msgpack (1.3.1)
|
msgpack (1.3.1)
|
||||||
multi_xml (0.6.0)
|
multi_xml (0.6.0)
|
||||||
multipart-post (2.1.1)
|
multipart-post (2.1.1)
|
||||||
nio4r (2.5.1)
|
nio4r (2.5.2)
|
||||||
nokogiri (1.10.7)
|
nokogiri (1.10.9)
|
||||||
mini_portile2 (~> 2.4.0)
|
mini_portile2 (~> 2.4.0)
|
||||||
oath (1.1.0)
|
oath (1.1.0)
|
||||||
bcrypt
|
bcrypt
|
||||||
@@ -337,20 +337,20 @@ GEM
|
|||||||
rack
|
rack
|
||||||
rack-test (1.1.0)
|
rack-test (1.1.0)
|
||||||
rack (>= 1.0, < 3)
|
rack (>= 1.0, < 3)
|
||||||
rails (6.0.0)
|
rails (6.0.3.2)
|
||||||
actioncable (= 6.0.0)
|
actioncable (= 6.0.3.2)
|
||||||
actionmailbox (= 6.0.0)
|
actionmailbox (= 6.0.3.2)
|
||||||
actionmailer (= 6.0.0)
|
actionmailer (= 6.0.3.2)
|
||||||
actionpack (= 6.0.0)
|
actionpack (= 6.0.3.2)
|
||||||
actiontext (= 6.0.0)
|
actiontext (= 6.0.3.2)
|
||||||
actionview (= 6.0.0)
|
actionview (= 6.0.3.2)
|
||||||
activejob (= 6.0.0)
|
activejob (= 6.0.3.2)
|
||||||
activemodel (= 6.0.0)
|
activemodel (= 6.0.3.2)
|
||||||
activerecord (= 6.0.0)
|
activerecord (= 6.0.3.2)
|
||||||
activestorage (= 6.0.0)
|
activestorage (= 6.0.3.2)
|
||||||
activesupport (= 6.0.0)
|
activesupport (= 6.0.3.2)
|
||||||
bundler (>= 1.3.0)
|
bundler (>= 1.3.0)
|
||||||
railties (= 6.0.0)
|
railties (= 6.0.3.2)
|
||||||
sprockets-rails (>= 2.0.0)
|
sprockets-rails (>= 2.0.0)
|
||||||
rails-controller-testing (1.0.4)
|
rails-controller-testing (1.0.4)
|
||||||
actionpack (>= 5.0.1.x)
|
actionpack (>= 5.0.1.x)
|
||||||
@@ -363,9 +363,9 @@ GEM
|
|||||||
nokogiri (>= 1.6)
|
nokogiri (>= 1.6)
|
||||||
rails-html-sanitizer (1.3.0)
|
rails-html-sanitizer (1.3.0)
|
||||||
loofah (~> 2.3)
|
loofah (~> 2.3)
|
||||||
railties (6.0.0)
|
railties (6.0.3.2)
|
||||||
actionpack (= 6.0.0)
|
actionpack (= 6.0.3.2)
|
||||||
activesupport (= 6.0.0)
|
activesupport (= 6.0.3.2)
|
||||||
method_source
|
method_source
|
||||||
rake (>= 0.8.7)
|
rake (>= 0.8.7)
|
||||||
thor (>= 0.20.3, < 2.0)
|
thor (>= 0.20.3, < 2.0)
|
||||||
@@ -469,7 +469,7 @@ GEM
|
|||||||
turbolinks-source (5.2.0)
|
turbolinks-source (5.2.0)
|
||||||
typhoeus (1.3.1)
|
typhoeus (1.3.1)
|
||||||
ethon (>= 0.9.0)
|
ethon (>= 0.9.0)
|
||||||
tzinfo (1.2.6)
|
tzinfo (1.2.7)
|
||||||
thread_safe (~> 0.1)
|
thread_safe (~> 0.1)
|
||||||
uglifier (4.1.20)
|
uglifier (4.1.20)
|
||||||
execjs (>= 0.3.0, < 3)
|
execjs (>= 0.3.0, < 3)
|
||||||
@@ -494,9 +494,9 @@ GEM
|
|||||||
activesupport (>= 4.2)
|
activesupport (>= 4.2)
|
||||||
rack-proxy (>= 0.6.1)
|
rack-proxy (>= 0.6.1)
|
||||||
railties (>= 4.2)
|
railties (>= 4.2)
|
||||||
websocket-driver (0.7.1)
|
websocket-driver (0.7.2)
|
||||||
websocket-extensions (>= 0.1.0)
|
websocket-extensions (>= 0.1.0)
|
||||||
websocket-extensions (0.1.4)
|
websocket-extensions (0.1.5)
|
||||||
will_paginate (3.2.1)
|
will_paginate (3.2.1)
|
||||||
will_paginate-bootstrap4 (0.2.2)
|
will_paginate-bootstrap4 (0.2.2)
|
||||||
will_paginate (~> 3.0, >= 3.0.0)
|
will_paginate (~> 3.0, >= 3.0.0)
|
||||||
@@ -504,7 +504,7 @@ GEM
|
|||||||
wkhtmltopdf-heroku (2.12.5.0)
|
wkhtmltopdf-heroku (2.12.5.0)
|
||||||
xpath (3.2.0)
|
xpath (3.2.0)
|
||||||
nokogiri (~> 1.8)
|
nokogiri (~> 1.8)
|
||||||
zeitwerk (2.2.2)
|
zeitwerk (2.3.1)
|
||||||
|
|
||||||
PLATFORMS
|
PLATFORMS
|
||||||
ruby
|
ruby
|
||||||
@@ -561,7 +561,7 @@ DEPENDENCIES
|
|||||||
rack!
|
rack!
|
||||||
rack-contrib (~> 2.0.1)
|
rack-contrib (~> 2.0.1)
|
||||||
rack-cors
|
rack-cors
|
||||||
rails (~> 6.0.0)
|
rails (~> 6.0.3.1)
|
||||||
rails-controller-testing (~> 1.0.4)
|
rails-controller-testing (~> 1.0.4)
|
||||||
rails-data-migrations (~> 1.2.0)
|
rails-data-migrations (~> 1.2.0)
|
||||||
redcarpet (~> 3.4.0)
|
redcarpet (~> 3.4.0)
|
||||||
|
|||||||
@@ -77,9 +77,43 @@ class AppearanceReleasesController < ApplicationController
|
|||||||
results
|
results
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def person_params
|
||||||
|
%i[
|
||||||
|
person_first_name
|
||||||
|
person_last_name
|
||||||
|
person_phone
|
||||||
|
person_email
|
||||||
|
person_photo
|
||||||
|
person_address_street1
|
||||||
|
]
|
||||||
|
end
|
||||||
|
|
||||||
|
def guardian_params
|
||||||
|
%i[
|
||||||
|
guardian_first_name
|
||||||
|
guardian_last_name
|
||||||
|
guardian_phone
|
||||||
|
guardian_email
|
||||||
|
guardian_photo
|
||||||
|
guardian_address_street1
|
||||||
|
]
|
||||||
|
end
|
||||||
|
|
||||||
|
def second_guardian_params
|
||||||
|
%i[
|
||||||
|
guardian_2_first_name
|
||||||
|
guardian_2_last_name
|
||||||
|
guardian_2_phone
|
||||||
|
guardian_2_email
|
||||||
|
guardian_2_photo
|
||||||
|
guardian_2_address_street1
|
||||||
|
]
|
||||||
|
end
|
||||||
|
|
||||||
def appearance_release_params
|
def appearance_release_params
|
||||||
params.require(:appearance_release).permit(:contract, :guardian_address_street1, :guardian_first_name, :guardian_last_name, :guardian_phone, :guardian_photo, :guardian_email, :minor,
|
params.require(:appearance_release).permit(person_params,
|
||||||
:person_address_street1, :person_first_name, :person_last_name, :person_phone, :person_email, :person_photo,
|
guardian_params, second_guardian_params,
|
||||||
|
:contract, :minor,
|
||||||
:applicable_medium_id, :applicable_medium_text,
|
:applicable_medium_id, :applicable_medium_text,
|
||||||
:territory_id, :territory_text,
|
:territory_id, :territory_text,
|
||||||
:term_id, :term_text, :person_date_of_birth,
|
:term_id, :term_text, :person_date_of_birth,
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ class AcquiredMediaReleasePolicy < ApplicationPolicy
|
|||||||
end
|
end
|
||||||
|
|
||||||
def destroy?
|
def destroy?
|
||||||
true
|
user.manager? || user.account_manager?
|
||||||
end
|
end
|
||||||
|
|
||||||
def tag_multiple?
|
def tag_multiple?
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ class AppearanceReleasePolicy < ReleasePolicy
|
|||||||
end
|
end
|
||||||
|
|
||||||
def destroy?
|
def destroy?
|
||||||
true
|
user.manager? || user.account_manager?
|
||||||
end
|
end
|
||||||
|
|
||||||
def tag_multiple?
|
def tag_multiple?
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ class LocationReleasePolicy < ReleasePolicy
|
|||||||
end
|
end
|
||||||
|
|
||||||
def destroy?
|
def destroy?
|
||||||
true
|
user.manager? || user.account_manager?
|
||||||
end
|
end
|
||||||
|
|
||||||
def edit_photos?
|
def edit_photos?
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ class MaterialReleasePolicy < ReleasePolicy
|
|||||||
end
|
end
|
||||||
|
|
||||||
def destroy?
|
def destroy?
|
||||||
true
|
user.manager? || user.account_manager?
|
||||||
end
|
end
|
||||||
|
|
||||||
def edit_photos?
|
def edit_photos?
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ class MedicalReleasePolicy < ReleasePolicy
|
|||||||
end
|
end
|
||||||
|
|
||||||
def destroy?
|
def destroy?
|
||||||
true
|
user.manager? || user.account_manager?
|
||||||
end
|
end
|
||||||
|
|
||||||
def edit_photos?
|
def edit_photos?
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ class MiscReleasePolicy < ReleasePolicy
|
|||||||
end
|
end
|
||||||
|
|
||||||
def destroy?
|
def destroy?
|
||||||
true
|
user.manager? || user.account_manager?
|
||||||
end
|
end
|
||||||
|
|
||||||
def edit_photos?
|
def edit_photos?
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ class MusicReleasePolicy < ReleasePolicy
|
|||||||
end
|
end
|
||||||
|
|
||||||
def destroy?
|
def destroy?
|
||||||
true
|
user.manager? || user.account_manager?
|
||||||
end
|
end
|
||||||
|
|
||||||
def tag_multiple?
|
def tag_multiple?
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ class TalentReleasePolicy < ReleasePolicy
|
|||||||
end
|
end
|
||||||
|
|
||||||
def destroy?
|
def destroy?
|
||||||
true
|
user.manager? || user.account_manager?
|
||||||
end
|
end
|
||||||
|
|
||||||
def edit_photos?
|
def edit_photos?
|
||||||
|
|||||||
@@ -17,17 +17,25 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="<%= class_string("collapse" => !appearance_release.minor?) %>" data-ujs-target="guardian-fields">
|
<div class="<%= class_string("collapse" => !appearance_release.minor?) %>" data-ujs-target="guardian-fields">
|
||||||
<div class="form-row">
|
<%= card_field_set_tag t(".guardian_info.heading") do %>
|
||||||
<%= form.text_field :guardian_first_name, required: appearance_release.minor?, wrapper_class: "col-sm-3" %>
|
<div class="form-row">
|
||||||
<%= form.text_field :guardian_last_name, required: appearance_release.minor?, wrapper_class: "col-sm-3" %>
|
<%= form.text_field :guardian_first_name, required: appearance_release.minor?, wrapper_class: "col-sm-3" %>
|
||||||
<%= form.phone_field :guardian_phone, wrapper_class: "col-sm-6" %>
|
<%= form.text_field :guardian_last_name, required: appearance_release.minor?, wrapper_class: "col-sm-3" %>
|
||||||
</div>
|
<%= form.phone_field :guardian_phone, wrapper_class: "col-sm-6" %>
|
||||||
<div class="form-row">
|
<%= form.text_field :guardian_email, wrapper_class: "col-sm-6" %>
|
||||||
<%= form.text_field :guardian_email, wrapper_class: "col-sm-6" %>
|
<%= form.text_field :guardian_address_street1, wrapper_class: "col-sm-6" %>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-row">
|
<% end %>
|
||||||
<%= form.text_field :guardian_address_street1, wrapper_class: "col-sm-6" %>
|
|
||||||
</div>
|
<%= card_field_set_tag t(".guardian_2_info.heading") do %>
|
||||||
|
<div class="form-row">
|
||||||
|
<%= form.text_field :guardian_2_first_name, wrapper_class: "col-sm-3" %>
|
||||||
|
<%= form.text_field :guardian_2_last_name, wrapper_class: "col-sm-3" %>
|
||||||
|
<%= form.phone_field :guardian_2_phone, wrapper_class: "col-sm-6" %>
|
||||||
|
<%= form.text_field :guardian_2_email, wrapper_class: "col-sm-6" %>
|
||||||
|
<%= form.text_field :guardian_2_address_street1, wrapper_class: "col-sm-6" %>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
@@ -62,20 +70,36 @@
|
|||||||
<div class="<%= class_string("collapse" => !appearance_release.minor?) %>" data-ujs-target="guardian-fields">
|
<div class="<%= class_string("collapse" => !appearance_release.minor?) %>" data-ujs-target="guardian-fields">
|
||||||
<div class="text-left">
|
<div class="text-left">
|
||||||
<p><%= t(".photos.guardian_photo.heading") %></p>
|
<p><%= t(".photos.guardian_photo.heading") %></p>
|
||||||
<div class="d-inline-block mb-2" data-behavior="guardian-photo-preview" data-file-input="[data-ujs-target=guardian-photo-input]">
|
<div id='guardian-photo-preview' class="d-inline-block mb-2" data-behavior="guardian-photo-preview" data-file-input="[data-ujs-target=guardian-photo-input]">
|
||||||
<div class="align-items-center d-flex photo-preview img-thumbnail justify-content-center">
|
<div class="align-items-center d-flex photo-preview img-thumbnail justify-content-center">
|
||||||
<span>No photo yet</span>
|
<span>No photo yet</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% if appearance_release.guardian_photo.attached? %>
|
<% if appearance_release.guardian_photo.attached? %>
|
||||||
<%= javascript_tag nonce: true do %>
|
<%= javascript_tag nonce: true do %>
|
||||||
App.PhotoPreview.set("[data-behavior=guardian-photo-preview]", "<%= url_for(appearance_release.guardian_photo.variant(auto_orient: true, resize: '200x200')) %>");
|
App.PhotoPreview.set("#guardian-photo-preview", "<%= url_for(appearance_release.guardian_photo.variant(auto_orient: true, resize: '200x200')) %>");
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<div class="d-inline-block">
|
<div class="d-inline-block">
|
||||||
<%= form.hidden_field :guardian_photo, value: form.object.guardian_photo.signed_id if appearance_release.guardian_photo.attached?%>
|
<%= form.hidden_field :guardian_photo, value: form.object.guardian_photo.signed_id if appearance_release.guardian_photo.attached?%>
|
||||||
<%= form.file_field :guardian_photo, hide_label: true, data: { ujs_target: "guardian-photo-input" }, help: "PNG or JPG only", accept: appearance_release.class.face_photo_acceptable_content_types.join(",") %>
|
<%= form.file_field :guardian_photo, hide_label: true, data: { ujs_target: "guardian-photo-input" }, help: "PNG or JPG only", accept: appearance_release.class.face_photo_acceptable_content_types.join(",") %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<p><%= t(".photos.guardian_2_photo.heading") %></p>
|
||||||
|
<div id='guardian-2-photo-preview' class="d-inline-block mb-2" data-behavior="guardian-photo-preview" data-file-input="[data-ujs-target=guardian-2-photo-input]">
|
||||||
|
<div class="align-items-center d-flex photo-preview img-thumbnail justify-content-center">
|
||||||
|
<span>No photo yet</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% if appearance_release.guardian_2_photo.attached? %>
|
||||||
|
<%= javascript_tag nonce: true do %>
|
||||||
|
App.PhotoPreview.set("#guardian-2-photo-preview", "<%= url_for(appearance_release.guardian_2_photo.variant(auto_orient: true, resize: '200x200')) %>");
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<div class="d-inline-block">
|
||||||
|
<%= form.hidden_field :guardian_2_photo, value: form.object.guardian_2_photo.signed_id if appearance_release.guardian_2_photo.attached?%>
|
||||||
|
<%= form.file_field :guardian_2_photo, hide_label: true, data: { ujs_target: "guardian-2-photo-input" }, help: "PNG or JPG only", accept: appearance_release.class.face_photo_acceptable_content_types.join(",") %>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<%= form.select :release_type, options_for_release_type_select(project, @release_type), { wrapper_class: "col-sm-6" }, data: { toggle: "collapse-select", target_show_values_mapping: { "#guardian_clause": %w(appearance talent misc medical), "#fee_field": %w(appearance talent location material acquired_media), "#exploitable_rights_fields": %w(appearance talent location material acquired_media), "#custom_fields": %w(medical) } }, class: "form-control custom-select" %>
|
<%= form.select :release_type, options_for_release_type_select(project, @release_type), { wrapper_class: "col-sm-6" }, data: { toggle: "collapse-select", target_show_values_mapping: { "#guardian_clause": %w(appearance talent misc medical), "#fee_field": %w(appearance talent location material acquired_media), "#exploitable_rights_fields": %w(appearance talent location material acquired_media), "#custom_fields": %w(medical) } }, class: "form-control custom-select" %>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-row" id="fee_field">
|
<div class="form-row" id="fee_field">
|
||||||
<%= form.number_field :fee, min:"0", max:"99999999", step: "0.01", prepend: "$", help: "Leave at $0.00 for no-fee", wrapper_class: "col-sm-6" %>
|
<%= form.number_field :fee, min:"0", max:"99999999", step: "0.01", prepend: "$", wrapper_class: "col-sm-6" %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|||||||
8
app/views/contracts/_medical_questionnaire.html.erb
Normal file
8
app/views/contracts/_medical_questionnaire.html.erb
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<p class="heading"><strong><u><%= t ".heading" %></u></strong></p>
|
||||||
|
|
||||||
|
<% (1..MedicalRelease::NUMBER_OF_CUSTOM_FIELDS).each do |n| %>
|
||||||
|
<% if contract_template.public_send("question_#{n}_text").present? %>
|
||||||
|
<p><strong><%= contract_template.public_send("question_#{n}_text") %></strong></p>
|
||||||
|
<p><%= releasable.public_send("question_#{n}_answer") %></p>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
@@ -39,15 +39,6 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
<% if releasable.model_name == "MedicalRelease" %>
|
|
||||||
<% (1..MedicalRelease::NUMBER_OF_CUSTOM_FIELDS).each do |n| %>
|
|
||||||
<% if contract_template.public_send("question_#{n}_text").present? %>
|
|
||||||
<p><strong><%= contract_template.public_send("question_#{n}_text") %></strong></p>
|
|
||||||
<p><%= releasable.public_send("question_#{n}_answer") %></p>
|
|
||||||
<% end %>
|
|
||||||
<% end %>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<% if releasable.minor? %>
|
<% if releasable.minor? %>
|
||||||
<br/>
|
<br/>
|
||||||
<p class="text-left"><strong>Guardian Information</strong></p>
|
<p class="text-left"><strong>Guardian Information</strong></p>
|
||||||
|
|||||||
@@ -15,6 +15,13 @@
|
|||||||
<p class="text-left"><strong>Guardian Clause</strong></p>
|
<p class="text-left"><strong>Guardian Clause</strong></p>
|
||||||
<%= contract_template.guardian_clause %>
|
<%= contract_template.guardian_clause %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
<% if releasable.model_name == "MedicalRelease" %>
|
||||||
|
<div class="page">
|
||||||
|
<%= render "contracts/medical_questionnaire", releasable: releasable, contract_template: contract_template, preview: preview %>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<div class="page">
|
<div class="page">
|
||||||
<%= render "contracts/signature_page", releasable: releasable, contract_template: contract_template, preview: preview %>
|
<%= render "contracts/signature_page", releasable: releasable, contract_template: contract_template, preview: preview %>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
<%= form.text_field :name, required: true, wrapper_class: "col-12" %>
|
<%= form.text_field :name, required: true, wrapper_class: "col-12" %>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<%= form.text_area :description, wrapper_class: "col-12" %>
|
<%= form.text_area :description, required: true, wrapper_class: "col-12" %>
|
||||||
</div>
|
</div>
|
||||||
<%= form.form_group :categories, label: { text: "Licensed property type" } do %>
|
<%= form.form_group :categories, label: { text: "Licensed property type" } do %>
|
||||||
<% AcquiredMediaRelease::CATEGORIES.each do |category| %>
|
<% AcquiredMediaRelease::CATEGORIES.each do |category| %>
|
||||||
@@ -31,14 +31,14 @@
|
|||||||
|
|
||||||
<%= card_field_set_tag t(".personal_info.heading") do %>
|
<%= card_field_set_tag t(".personal_info.heading") do %>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<%= form.text_field :person_first_name, wrapper_class: "col-sm-6" %>
|
<%= form.text_field :person_first_name, required: true, wrapper_class: "col-sm-6" %>
|
||||||
<%= form.text_field :person_last_name, wrapper_class: "col-sm-6" %>
|
<%= form.text_field :person_last_name, required: true, wrapper_class: "col-sm-6" %>
|
||||||
<%= form.text_field :person_title, wrapper_class: "col-sm-6" %>
|
<%= form.text_field :person_title, required: true, wrapper_class: "col-sm-6" %>
|
||||||
<%= form.phone_field :person_phone, wrapper_class: "col-sm-6", label: 'Phone' %>
|
<%= form.phone_field :person_phone, required: true, wrapper_class: "col-sm-6", label: 'Phone' %>
|
||||||
<%= form.email_field :person_email, wrapper_class: "col-sm-6", label: 'Email' %>
|
<%= form.email_field :person_email, required: true, wrapper_class: "col-sm-6", label: 'Email' %>
|
||||||
<%= form.text_field :person_fax, wrapper_class: "col-sm-6", label: 'Fax' %>
|
<%= form.text_field :person_fax, required: true, wrapper_class: "col-sm-6", label: 'Fax' %>
|
||||||
</div>
|
</div>
|
||||||
<%= render "shared/address_fields", form: form, subject: "person" %>
|
<%= render "shared/address_fields", form: form, required: true, subject: "person" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
|
|||||||
@@ -17,21 +17,21 @@
|
|||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<%= form.text_field :name, required: true, wrapper_class: "col-12" %>
|
<%= form.text_field :name, required: true, wrapper_class: "col-12" %>
|
||||||
</div>
|
</div>
|
||||||
<%= render "shared/address_fields", form: form, subject: "" %>
|
<%= render "shared/address_fields", form: form, required: true, subject: "" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
<%= card_field_set_tag t(".contact_info.heading") do %>
|
<%= card_field_set_tag t(".contact_info.heading") do %>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<%= form.text_field :person_first_name, wrapper_class: "col-sm-6" %>
|
<%= form.text_field :person_first_name, required: true, wrapper_class: "col-sm-6" %>
|
||||||
<%= form.text_field :person_last_name, wrapper_class: "col-sm-6" %>
|
<%= form.text_field :person_last_name, required: true, wrapper_class: "col-sm-6" %>
|
||||||
<%= form.phone_field :person_phone, wrapper_class: "col-sm-6" %>
|
<%= form.phone_field :person_phone, required: true, wrapper_class: "col-sm-6" %>
|
||||||
<%= form.email_field :person_email, wrapper_class: "col-sm-6" %>
|
<%= form.email_field :person_email, required: true, wrapper_class: "col-sm-6" %>
|
||||||
<%= form.text_field :person_company, wrapper_class: "col-sm-6" %>
|
<%= form.text_field :person_company, required: true, wrapper_class: "col-sm-6" %>
|
||||||
<%= form.text_field :person_title, wrapper_class: "col-sm-6" %>
|
<%= form.text_field :person_title, required: true, wrapper_class: "col-sm-6" %>
|
||||||
</div>
|
</div>
|
||||||
<%= render "shared/address_fields", form: form, subject: "person" %>
|
<%= render "shared/address_fields", form: form, required: true, subject: "person" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
@@ -39,9 +39,9 @@
|
|||||||
|
|
||||||
<%= card_field_set_tag t(".filming_info.heading") do %>
|
<%= card_field_set_tag t(".filming_info.heading") do %>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<%= form.text_field :filming_started_on, wrapper_class: "col-sm-6", class: "datepicker-control", readonly: true %>
|
<%= form.text_field :filming_started_on, required: true, 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_ended_on, required: true, wrapper_class: "col-sm-6", class: "datepicker-control", readonly: true %>
|
||||||
<%= form.text_field :filming_hours, wrapper_class: "col-sm-12" %>
|
<%= form.text_field :filming_hours, required: true, wrapper_class: "col-sm-12" %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|||||||
@@ -18,20 +18,20 @@
|
|||||||
<%= form.text_field :name, required: true, wrapper_class: "col-12" %>
|
<%= form.text_field :name, required: true, wrapper_class: "col-12" %>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<%= form.text_area :description, placeholder: true, wrapper_class: "col-sm-12", rows: 6 %>
|
<%= form.text_area :description, required: true, placeholder: true, wrapper_class: "col-sm-12", rows: 6 %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%= card_field_set_tag t(".contact_info.heading") do %>
|
<%= card_field_set_tag t(".contact_info.heading") do %>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<%= form.text_field :person_first_name, wrapper_class: "col-sm-6" %>
|
<%= form.text_field :person_first_name, required: true, wrapper_class: "col-sm-6" %>
|
||||||
<%= form.text_field :person_last_name, wrapper_class: "col-sm-6" %>
|
<%= form.text_field :person_last_name, required: true, wrapper_class: "col-sm-6" %>
|
||||||
<%= form.phone_field :person_phone, wrapper_class: "col-sm-6" %>
|
<%= form.phone_field :person_phone, required: true, wrapper_class: "col-sm-6" %>
|
||||||
<%= form.email_field :person_email, wrapper_class: "col-sm-6" %>
|
<%= form.email_field :person_email, required: true, wrapper_class: "col-sm-6" %>
|
||||||
<%= form.text_field :person_company, wrapper_class: "col-sm-6" %>
|
<%= form.text_field :person_company, required: true, wrapper_class: "col-sm-6" %>
|
||||||
<%= form.text_field :person_title, wrapper_class: "col-sm-6" %>
|
<%= form.text_field :person_title, required: true, wrapper_class: "col-sm-6" %>
|
||||||
</div>
|
</div>
|
||||||
<%= render "shared/address_fields", form: form, subject: "person" %>
|
<%= render "shared/address_fields", form: form, subject: "person", required: true %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%= card_field_set_tag t(".photo.heading") do %>
|
<%= card_field_set_tag t(".photo.heading") do %>
|
||||||
|
|||||||
@@ -123,9 +123,15 @@ en:
|
|||||||
form:
|
form:
|
||||||
contract_and_rights:
|
contract_and_rights:
|
||||||
heading: 2 of 3 Contract & Exploitable Rights
|
heading: 2 of 3 Contract & Exploitable Rights
|
||||||
|
guardian_2_info:
|
||||||
|
heading: Second Guardian Information (if company requires)
|
||||||
|
guardian_info:
|
||||||
|
heading: Guardian Information
|
||||||
person_details:
|
person_details:
|
||||||
heading: 1 of 3 Person Details
|
heading: 1 of 3 Person Details
|
||||||
photos:
|
photos:
|
||||||
|
guardian_2_photo:
|
||||||
|
heading: Second Guardian Photo
|
||||||
guardian_photo:
|
guardian_photo:
|
||||||
heading: Guardian Photo
|
heading: Guardian Photo
|
||||||
heading: 3 of 3 Photo
|
heading: 3 of 3 Photo
|
||||||
@@ -240,6 +246,8 @@ en:
|
|||||||
new:
|
new:
|
||||||
heading: New Release Template
|
heading: New Release Template
|
||||||
contracts:
|
contracts:
|
||||||
|
medical_questionnaire:
|
||||||
|
heading: Medical Questionnaire
|
||||||
photos:
|
photos:
|
||||||
guardian_2_photo_heading: Second guardian photo
|
guardian_2_photo_heading: Second guardian photo
|
||||||
guardian_photo_heading: Guardian photo
|
guardian_photo_heading: Guardian photo
|
||||||
@@ -309,6 +317,9 @@ en:
|
|||||||
notice: The release has been updated
|
notice: The release has been updated
|
||||||
helpers:
|
helpers:
|
||||||
help:
|
help:
|
||||||
|
contract_template:
|
||||||
|
fee: Leave at $0.00 for no-fee
|
||||||
|
guardian_clause: Leave blank if not required for this contract
|
||||||
video:
|
video:
|
||||||
audio_only_edl_file: If you do not upload an Audio Only EDL, the software will not generate a BiG Music Cue Sheet.
|
audio_only_edl_file: If you do not upload an Audio Only EDL, the software will not generate a BiG Music Cue Sheet.
|
||||||
edl_file: Please follow our directions on exporting the All Tracks EDL. Failure to do so could result in inaccurate and incomplete reporting.
|
edl_file: Please follow our directions on exporting the All Tracks EDL. Failure to do so could result in inaccurate and incomplete reporting.
|
||||||
|
|||||||
@@ -28,7 +28,13 @@ es:
|
|||||||
matching_started: Matching started (ES)
|
matching_started: Matching started (ES)
|
||||||
no_attachments: Failed to import - no attachments (ES)
|
no_attachments: Failed to import - no attachments (ES)
|
||||||
form:
|
form:
|
||||||
|
guardian_2_info:
|
||||||
|
heading: Second Guardian Information (if company requires) (ES)
|
||||||
|
guardian_info:
|
||||||
|
heading: Guardian Information (ES)
|
||||||
photos:
|
photos:
|
||||||
|
guardian_2_photo:
|
||||||
|
heading: Second Guardian Photo (ES)
|
||||||
guardian_photo:
|
guardian_photo:
|
||||||
heading: Guardian Photo (ES)
|
heading: Guardian Photo (ES)
|
||||||
person_photo:
|
person_photo:
|
||||||
@@ -114,6 +120,10 @@ es:
|
|||||||
errors_helper:
|
errors_helper:
|
||||||
failure_message: "Los siguientes errores han impedido que se presente este %{model_name}:"
|
failure_message: "Los siguientes errores han impedido que se presente este %{model_name}:"
|
||||||
helpers:
|
helpers:
|
||||||
|
help:
|
||||||
|
contract_template:
|
||||||
|
fee: Leave at $0.00 for no-fee (ES)
|
||||||
|
guardian_clause: 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)
|
||||||
|
|||||||
@@ -20,6 +20,17 @@ feature "User managing acquired_media releases" do
|
|||||||
by "filling out the form" do
|
by "filling out the form" do
|
||||||
fill_in acquired_media_name_field, with: "Jane Doe"
|
fill_in acquired_media_name_field, with: "Jane Doe"
|
||||||
acquired_media_category_fields
|
acquired_media_category_fields
|
||||||
|
fill_in acquried_media_description_field, with: "Description"
|
||||||
|
fill_in acquried_media_owner_first_name, with: "Jane"
|
||||||
|
fill_in acquried_media_owner_last_name, with: "Doe"
|
||||||
|
fill_in acquired_media_person_title, with: "Ms."
|
||||||
|
fill_in acquired_media_person_phone, with: "555-5555-5555"
|
||||||
|
fill_in acquired_media_person_email, with: "person@example.com"
|
||||||
|
fill_in acquired_media_person_fax, with: "FAX"
|
||||||
|
fill_in acquired_media_person_address_street_1, with: "Street 1"
|
||||||
|
fill_in acquired_media_person_address_city, with: "City"
|
||||||
|
fill_in acquired_media_person_address_state, with: "State"
|
||||||
|
fill_in acquired_media_release_person_address_zip, with: "ZIP"
|
||||||
|
|
||||||
draw_signature file_fixture("signature.png"), "acquired_media_release_signature_base64"
|
draw_signature file_fixture("signature.png"), "acquired_media_release_signature_base64"
|
||||||
end
|
end
|
||||||
@@ -220,6 +231,50 @@ feature "User managing acquired_media releases" do
|
|||||||
"acquired_media_release[name]"
|
"acquired_media_release[name]"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def acquried_media_description_field
|
||||||
|
"acquired_media_release[description]"
|
||||||
|
end
|
||||||
|
|
||||||
|
def acquried_media_owner_first_name
|
||||||
|
"acquired_media_release[person_first_name]"
|
||||||
|
end
|
||||||
|
|
||||||
|
def acquried_media_owner_last_name
|
||||||
|
"acquired_media_release[person_last_name]"
|
||||||
|
end
|
||||||
|
|
||||||
|
def acquired_media_person_title
|
||||||
|
"acquired_media_release[person_title]"
|
||||||
|
end
|
||||||
|
|
||||||
|
def acquired_media_person_phone
|
||||||
|
"acquired_media_release[person_phone]"
|
||||||
|
end
|
||||||
|
|
||||||
|
def acquired_media_person_email
|
||||||
|
"acquired_media_release[person_email]"
|
||||||
|
end
|
||||||
|
|
||||||
|
def acquired_media_person_fax
|
||||||
|
"acquired_media_release[person_fax]"
|
||||||
|
end
|
||||||
|
|
||||||
|
def acquired_media_person_address_street_1
|
||||||
|
"acquired_media_release[person_address_street1]"
|
||||||
|
end
|
||||||
|
|
||||||
|
def acquired_media_person_address_city
|
||||||
|
"acquired_media_release[person_address_city]"
|
||||||
|
end
|
||||||
|
|
||||||
|
def acquired_media_person_address_state
|
||||||
|
"acquired_media_release[person_address_state]"
|
||||||
|
end
|
||||||
|
|
||||||
|
def acquired_media_release_person_address_zip
|
||||||
|
"acquired_media_release[person_address_zip]"
|
||||||
|
end
|
||||||
|
|
||||||
def acquired_media_category_fields
|
def acquired_media_category_fields
|
||||||
find(:css, "#acquired_media_release_categories_video_footage").set(true)
|
find(:css, "#acquired_media_release_categories_video_footage").set(true)
|
||||||
find(:css, "#acquired_media_release_categories_still_photograph").set(true)
|
find(:css, "#acquired_media_release_categories_still_photograph").set(true)
|
||||||
|
|||||||
@@ -194,6 +194,28 @@ feature 'User managing appearance releases' do
|
|||||||
expect(page).to have_content 'New Jane'
|
expect(page).to have_content 'New Jane'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
scenario 'user can enter information for second guardian when editing non native release for minor', js: true do
|
||||||
|
appearance_release = create(:appearance_release, :non_native, :minor, project: project)
|
||||||
|
|
||||||
|
visit edit_appearance_release_path(appearance_release)
|
||||||
|
|
||||||
|
expect(page).to have_content guardian_2_first_name_field.titleize
|
||||||
|
expect(page).to have_content guardian_2_photo_heading
|
||||||
|
|
||||||
|
fill_in guardian_first_name_field, with: 'Guardian'
|
||||||
|
fill_in guardian_last_name_field, with: 'Name'
|
||||||
|
attach_file guardian_photo_field, file_fixture('hemsworth.jpeg'), visible: :all
|
||||||
|
|
||||||
|
fill_in guardian_2_first_name_field, with: 'Second'
|
||||||
|
fill_in guardian_2_last_name_field, with: 'guardian'
|
||||||
|
attach_file guardian_2_photo_field, file_fixture('person_photo.png'), visible: :all
|
||||||
|
|
||||||
|
click_button submit_update_button
|
||||||
|
|
||||||
|
expect(page).to have_content successful_update_message
|
||||||
|
expect(AppearanceRelease.last.guardian_2_photo.attached?).to eq true
|
||||||
|
end
|
||||||
|
|
||||||
scenario 'progress bar shows when user imports a release', js: true do
|
scenario 'progress bar shows when user imports a release', js: true do
|
||||||
visit project_appearance_releases_path(project)
|
visit project_appearance_releases_path(project)
|
||||||
|
|
||||||
@@ -557,6 +579,10 @@ feature 'User managing appearance releases' do
|
|||||||
'appearance_release[guardian_photo]'
|
'appearance_release[guardian_photo]'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def guardian_2_photo_field
|
||||||
|
'appearance_release[guardian_2_photo]'
|
||||||
|
end
|
||||||
|
|
||||||
def person_name_field
|
def person_name_field
|
||||||
t('helpers.label.appearance_release.person_name')
|
t('helpers.label.appearance_release.person_name')
|
||||||
end
|
end
|
||||||
@@ -662,4 +688,12 @@ feature 'User managing appearance releases' do
|
|||||||
def successful_destroy_message
|
def successful_destroy_message
|
||||||
'The release has been deleted'
|
'The release has been deleted'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def guardian_photo_heading
|
||||||
|
t 'appearance_releases.form.photos.guardian_photo.heading'
|
||||||
|
end
|
||||||
|
|
||||||
|
def guardian_2_photo_heading
|
||||||
|
t 'appearance_releases.form.photos.guardian_2_photo.heading'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -19,11 +19,20 @@ feature "User managing location releases" do
|
|||||||
|
|
||||||
by "filling out the form" do
|
by "filling out the form" do
|
||||||
fill_in location_name_field, with: "Benny's Burritos"
|
fill_in location_name_field, with: "Benny's Burritos"
|
||||||
|
fill_in location_address_street_1, with: "Location's street address"
|
||||||
|
fill_in location_address_city, with: "Location's city"
|
||||||
|
fill_in location_address_state, with: "Location's state"
|
||||||
|
fill_in location_address_zip, with: "Location's zip"
|
||||||
fill_in person_first_name_field, with: "Jane"
|
fill_in person_first_name_field, with: "Jane"
|
||||||
fill_in person_last_name_field, with: "Doe"
|
fill_in person_last_name_field, with: "Doe"
|
||||||
fill_in person_phone_field, with: "555-555-5555"
|
fill_in person_phone_field, with: "555-555-5555"
|
||||||
fill_in person_email_field, with: "jane.doe@test.com"
|
fill_in person_email_field, with: "jane.doe@test.com"
|
||||||
|
fill_in person_company_field, with: "BIG"
|
||||||
|
fill_in person_title_field, with: "Ms."
|
||||||
fill_in person_address_street1_field, with: "100 Broadway"
|
fill_in person_address_street1_field, with: "100 Broadway"
|
||||||
|
fill_in person_address_city, with: "Person's City"
|
||||||
|
fill_in person_address_state, with: "Person's State"
|
||||||
|
fill_in person_address_zip, with: "Person's Zip"
|
||||||
fill_in filming_hours_field, with: "04:00 - 22:00"
|
fill_in filming_hours_field, with: "04:00 - 22:00"
|
||||||
draw_signature file_fixture("signature.png"), "location_release_signature_base64"
|
draw_signature file_fixture("signature.png"), "location_release_signature_base64"
|
||||||
end
|
end
|
||||||
@@ -39,11 +48,20 @@ feature "User managing location releases" do
|
|||||||
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)
|
||||||
|
|
||||||
fill_in location_name_field, with: "Benny's Burritos"
|
fill_in location_name_field, with: "Benny's Burritos"
|
||||||
|
fill_in location_address_street_1, with: "Location's street address"
|
||||||
|
fill_in location_address_city, with: "Location's city"
|
||||||
|
fill_in location_address_state, with: "Location's state"
|
||||||
|
fill_in location_address_zip, with: "Location's zip"
|
||||||
fill_in person_first_name_field, with: "Jane"
|
fill_in person_first_name_field, with: "Jane"
|
||||||
fill_in person_last_name_field, with: "Doe"
|
fill_in person_last_name_field, with: "Doe"
|
||||||
fill_in person_phone_field, with: "555-555-5555"
|
fill_in person_phone_field, with: "555-555-5555"
|
||||||
fill_in person_email_field, with: "jane.doe@test.com"
|
fill_in person_email_field, with: "jane.doe@test.com"
|
||||||
|
fill_in person_company_field, with: "BIG"
|
||||||
|
fill_in person_title_field, with: "Ms."
|
||||||
fill_in person_address_street1_field, with: "100 Broadway"
|
fill_in person_address_street1_field, with: "100 Broadway"
|
||||||
|
fill_in person_address_city, with: "Person's City"
|
||||||
|
fill_in person_address_state, with: "Person's State"
|
||||||
|
fill_in person_address_zip, with: "Person's Zip"
|
||||||
fill_in filming_hours_field, with: "04:00 - 22:00"
|
fill_in filming_hours_field, with: "04:00 - 22:00"
|
||||||
draw_signature file_fixture("signature.png"), "location_release_signature_base64"
|
draw_signature file_fixture("signature.png"), "location_release_signature_base64"
|
||||||
|
|
||||||
@@ -235,6 +253,22 @@ feature "User managing location releases" do
|
|||||||
"location_release[name]"
|
"location_release[name]"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def location_address_street_1
|
||||||
|
"location_release[address_street1]"
|
||||||
|
end
|
||||||
|
|
||||||
|
def location_address_city
|
||||||
|
"location_release[address_city]"
|
||||||
|
end
|
||||||
|
|
||||||
|
def location_address_state
|
||||||
|
"location_release[address_state]"
|
||||||
|
end
|
||||||
|
|
||||||
|
def location_address_zip
|
||||||
|
"location_release[address_zip]"
|
||||||
|
end
|
||||||
|
|
||||||
def contract_field
|
def contract_field
|
||||||
"location_release[contract]"
|
"location_release[contract]"
|
||||||
end
|
end
|
||||||
@@ -247,18 +281,38 @@ feature "User managing location releases" do
|
|||||||
"location_release[person_last_name]"
|
"location_release[person_last_name]"
|
||||||
end
|
end
|
||||||
|
|
||||||
def person_email_field
|
|
||||||
"location_release[person_email]"
|
|
||||||
end
|
|
||||||
|
|
||||||
def person_address_street1_field
|
def person_address_street1_field
|
||||||
"location_release[person_address_street1]"
|
"location_release[person_address_street1]"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def person_address_city
|
||||||
|
"location_release[person_address_city]"
|
||||||
|
end
|
||||||
|
|
||||||
|
def person_address_state
|
||||||
|
"location_release[person_address_state]"
|
||||||
|
end
|
||||||
|
|
||||||
|
def person_address_zip
|
||||||
|
"location_release[person_address_zip]"
|
||||||
|
end
|
||||||
|
|
||||||
def person_phone_field
|
def person_phone_field
|
||||||
"location_release[person_phone]"
|
"location_release[person_phone]"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def person_email_field
|
||||||
|
"location_release[person_email]"
|
||||||
|
end
|
||||||
|
|
||||||
|
def person_company_field
|
||||||
|
"location_release[person_company]"
|
||||||
|
end
|
||||||
|
|
||||||
|
def person_title_field
|
||||||
|
"location_release[person_title]"
|
||||||
|
end
|
||||||
|
|
||||||
def filming_hours_field
|
def filming_hours_field
|
||||||
"location_release[filming_hours]"
|
"location_release[filming_hours]"
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -17,16 +17,12 @@ feature "User managing material releases" do
|
|||||||
|
|
||||||
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)
|
||||||
|
|
||||||
by "filling out the form" do
|
fill_all_fields
|
||||||
fill_in material_name_field, with: "Pepsi Logo"
|
draw_signature file_fixture("signature.png"), "material_release_signature_base64"
|
||||||
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"
|
|
||||||
end
|
|
||||||
|
|
||||||
click_button submit_release_button
|
click_button submit_release_button
|
||||||
|
|
||||||
expect(page).to have_content("Your release was successfully submitted. Thank you.")
|
expect(page).to have_content success_submit_message
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario "creating a release with photos", js: true do
|
scenario "creating a release with photos", js: true do
|
||||||
@@ -34,17 +30,60 @@ feature "User managing material releases" do
|
|||||||
|
|
||||||
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)
|
||||||
|
|
||||||
fill_in material_name_field, with: "Pepsi Logo"
|
fill_all_fields
|
||||||
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"
|
draw_signature file_fixture("signature.png"), "material_release_signature_base64"
|
||||||
|
|
||||||
drop_file Rails.root.join(file_fixture("material_photo.png")), type: :dropzone
|
drop_file Rails.root.join(file_fixture("material_photo.png")), type: :dropzone
|
||||||
|
|
||||||
click_button submit_release_button
|
click_button submit_release_button
|
||||||
|
|
||||||
expect(page).to have_content("Your release was successfully submitted. Thank you.")
|
expect(page).to have_content success_submit_message
|
||||||
expect(MaterialRelease.last.photos.attached?).to eq true
|
expect(MaterialRelease.last.photos.attached?).to eq true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
scenario "creating release is possible only after filling all fields", 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"
|
||||||
|
expect_failed_client_side_validation
|
||||||
|
|
||||||
|
fill_in material_description_field, with: "Description text"
|
||||||
|
expect_failed_client_side_validation
|
||||||
|
|
||||||
|
fill_in person_first_name_field, with: "Jane"
|
||||||
|
expect_failed_client_side_validation
|
||||||
|
|
||||||
|
fill_in person_last_name_field, with: "Doe"
|
||||||
|
expect_failed_client_side_validation
|
||||||
|
|
||||||
|
fill_in person_phone_field, with: "2229929229"
|
||||||
|
expect_failed_client_side_validation
|
||||||
|
|
||||||
|
fill_in person_email_field, with: "mail@mail.com"
|
||||||
|
expect_failed_client_side_validation
|
||||||
|
|
||||||
|
fill_in person_company_field, with: "Company"
|
||||||
|
expect_failed_client_side_validation
|
||||||
|
|
||||||
|
fill_in person_title_field, with: "Mr."
|
||||||
|
expect_failed_client_side_validation
|
||||||
|
|
||||||
|
fill_in person_address_street1_field, with: "Street 1 address"
|
||||||
|
expect_failed_client_side_validation
|
||||||
|
|
||||||
|
fill_in person_city_field, with: "City"
|
||||||
|
expect_failed_client_side_validation
|
||||||
|
|
||||||
|
fill_in person_state_field, with: "State"
|
||||||
|
expect_failed_client_side_validation
|
||||||
|
|
||||||
|
fill_in person_zip_field, with: "ZIP"
|
||||||
|
draw_signature file_fixture("signature.png"), "material_release_signature_base64"
|
||||||
|
|
||||||
|
click_button submit_release_button
|
||||||
|
expect(page).to have_content success_submit_message
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "when signed in" do
|
context "when signed in" do
|
||||||
@@ -216,6 +255,10 @@ feature "User managing material releases" do
|
|||||||
"material_release[name]"
|
"material_release[name]"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def material_description_field
|
||||||
|
"material_release[description]"
|
||||||
|
end
|
||||||
|
|
||||||
def person_first_name_field
|
def person_first_name_field
|
||||||
"material_release[person_first_name]"
|
"material_release[person_first_name]"
|
||||||
end
|
end
|
||||||
@@ -224,6 +267,38 @@ feature "User managing material releases" do
|
|||||||
"material_release[person_last_name]"
|
"material_release[person_last_name]"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def person_phone_field
|
||||||
|
"material_release[person_phone]"
|
||||||
|
end
|
||||||
|
|
||||||
|
def person_email_field
|
||||||
|
"material_release[person_email]"
|
||||||
|
end
|
||||||
|
|
||||||
|
def person_company_field
|
||||||
|
"material_release[person_company]"
|
||||||
|
end
|
||||||
|
|
||||||
|
def person_title_field
|
||||||
|
"material_release[person_title]"
|
||||||
|
end
|
||||||
|
|
||||||
|
def person_address_street1_field
|
||||||
|
"material_release[person_address_street1]"
|
||||||
|
end
|
||||||
|
|
||||||
|
def person_city_field
|
||||||
|
"material_release[person_address_city]"
|
||||||
|
end
|
||||||
|
|
||||||
|
def person_state_field
|
||||||
|
"material_release[person_address_state]"
|
||||||
|
end
|
||||||
|
|
||||||
|
def person_zip_field
|
||||||
|
"material_release[person_address_zip]"
|
||||||
|
end
|
||||||
|
|
||||||
def have_photo(filename)
|
def have_photo(filename)
|
||||||
have_selector("img[src*='#{filename}']")
|
have_selector("img[src*='#{filename}']")
|
||||||
end
|
end
|
||||||
@@ -282,4 +357,29 @@ feature "User managing material 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 fill_all_fields
|
||||||
|
fill_in material_name_field, with: "Pepsi Logo"
|
||||||
|
fill_in material_description_field, with: "Description text"
|
||||||
|
fill_in person_first_name_field, with: "Jane"
|
||||||
|
fill_in person_last_name_field, with: "Doe"
|
||||||
|
fill_in person_phone_field, with: "2229929229"
|
||||||
|
fill_in person_email_field, with: "mail@mail.com"
|
||||||
|
fill_in person_company_field, with: "Company"
|
||||||
|
fill_in person_title_field, with: "Mr."
|
||||||
|
fill_in person_address_street1_field, with: "Street 1 address"
|
||||||
|
fill_in person_city_field, with: "City"
|
||||||
|
fill_in person_state_field, with: "State"
|
||||||
|
fill_in person_zip_field, with: "ZIP"
|
||||||
|
end
|
||||||
|
|
||||||
|
def success_submit_message
|
||||||
|
'Your release was successfully submitted. Thank you.'
|
||||||
|
end
|
||||||
|
|
||||||
|
def expect_failed_client_side_validation
|
||||||
|
draw_signature file_fixture("signature.png"), "material_release_signature_base64"
|
||||||
|
click_button submit_release_button
|
||||||
|
expect(page).not_to have_content success_submit_message
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -133,7 +133,8 @@ RSpec.describe Account do
|
|||||||
ZoomMeeting,
|
ZoomMeeting,
|
||||||
MedicalRelease,
|
MedicalRelease,
|
||||||
MiscRelease,
|
MiscRelease,
|
||||||
MatchingRequest
|
MatchingRequest,
|
||||||
|
ActionMailbox::InboundEmail # This is Rails model, we are not using it and it is NOT added to the Account#storage_total calculation
|
||||||
]
|
]
|
||||||
Rails.application.eager_load!
|
Rails.application.eager_load!
|
||||||
ActiveRecord::Base.descendants.each do |model|
|
ActiveRecord::Base.descendants.each do |model|
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
require "rails_helper"
|
require "rails_helper"
|
||||||
|
|
||||||
describe AcquiredMediaReleasePolicy do
|
describe AcquiredMediaReleasePolicy do
|
||||||
let(:user_context) { build(:user_context) }
|
let(:user) { create(:user, :manager) }
|
||||||
|
let(:user_context) { build(:user_context, user: user, account: user.primary_account) }
|
||||||
|
|
||||||
subject { described_class }
|
subject { described_class }
|
||||||
|
|
||||||
@@ -24,6 +25,14 @@ describe AcquiredMediaReleasePolicy do
|
|||||||
end
|
end
|
||||||
|
|
||||||
permissions :destroy? do
|
permissions :destroy? do
|
||||||
it { is_expected.to permit(:destroy) }
|
it { is_expected.to permit(user_context, :destroy) }
|
||||||
|
end
|
||||||
|
|
||||||
|
context "for an associate" do
|
||||||
|
let(:user) { create(:user, :associate) }
|
||||||
|
|
||||||
|
permissions :destroy? do
|
||||||
|
it { is_expected.not_to permit(user_context, :destroy) }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
require "rails_helper"
|
require "rails_helper"
|
||||||
|
|
||||||
describe AppearanceReleasePolicy do
|
describe AppearanceReleasePolicy do
|
||||||
let(:user_context) { build(:user_context) }
|
let(:user) { create(:user, :manager) }
|
||||||
|
let(:user_context) { build(:user_context, user: user, account: user.primary_account) }
|
||||||
|
|
||||||
subject { described_class }
|
subject { described_class }
|
||||||
|
|
||||||
@@ -24,6 +25,14 @@ describe AppearanceReleasePolicy do
|
|||||||
end
|
end
|
||||||
|
|
||||||
permissions :destroy? do
|
permissions :destroy? do
|
||||||
it { is_expected.to permit(:destroy) }
|
it { is_expected.to permit(user_context, :destroy) }
|
||||||
|
end
|
||||||
|
|
||||||
|
context "for an associate" do
|
||||||
|
let(:user) { create(:user, :associate) }
|
||||||
|
|
||||||
|
permissions :destroy? do
|
||||||
|
it { is_expected.not_to permit(user_context, :destroy) }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
require "rails_helper"
|
require "rails_helper"
|
||||||
|
|
||||||
describe LocationReleasePolicy do
|
describe LocationReleasePolicy do
|
||||||
let(:user_context) { build(:user_context) }
|
let(:user) { create(:user, :manager) }
|
||||||
|
let(:user_context) { build(:user_context, user: user, account: user.primary_account) }
|
||||||
|
|
||||||
subject { described_class }
|
subject { described_class }
|
||||||
|
|
||||||
@@ -23,10 +24,6 @@ describe LocationReleasePolicy do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
permissions :destroy? do
|
|
||||||
it { is_expected.to permit(:destroy) }
|
|
||||||
end
|
|
||||||
|
|
||||||
permissions :edit_photos? do
|
permissions :edit_photos? do
|
||||||
it { is_expected.to permit(:edit_photos) }
|
it { is_expected.to permit(:edit_photos) }
|
||||||
end
|
end
|
||||||
@@ -34,4 +31,16 @@ describe LocationReleasePolicy do
|
|||||||
permissions :update_photos? do
|
permissions :update_photos? do
|
||||||
it { is_expected.to permit(:update_photos) }
|
it { is_expected.to permit(:update_photos) }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
permissions :destroy? do
|
||||||
|
it { is_expected.to permit(user_context, :destroy) }
|
||||||
|
end
|
||||||
|
|
||||||
|
context "for an associate" do
|
||||||
|
let(:user) { create(:user, :associate) }
|
||||||
|
|
||||||
|
permissions :destroy? do
|
||||||
|
it { is_expected.not_to permit(user_context, :destroy) }
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
require "rails_helper"
|
require "rails_helper"
|
||||||
|
|
||||||
describe MaterialReleasePolicy do
|
describe MaterialReleasePolicy do
|
||||||
let(:user_context) { build(:user_context) }
|
let(:user) { create(:user, :manager) }
|
||||||
|
let(:user_context) { build(:user_context, user: user, account: user.primary_account) }
|
||||||
|
|
||||||
subject { described_class }
|
subject { described_class }
|
||||||
|
|
||||||
@@ -23,10 +24,6 @@ describe MaterialReleasePolicy do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
permissions :destroy? do
|
|
||||||
it { is_expected.to permit(:destroy) }
|
|
||||||
end
|
|
||||||
|
|
||||||
permissions :edit_photos? do
|
permissions :edit_photos? do
|
||||||
it { is_expected.to permit(:edit_photos) }
|
it { is_expected.to permit(:edit_photos) }
|
||||||
end
|
end
|
||||||
@@ -34,4 +31,16 @@ describe MaterialReleasePolicy do
|
|||||||
permissions :update_photos? do
|
permissions :update_photos? do
|
||||||
it { is_expected.to permit(:update_photos) }
|
it { is_expected.to permit(:update_photos) }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
permissions :destroy? do
|
||||||
|
it { is_expected.to permit(user_context, :destroy) }
|
||||||
|
end
|
||||||
|
|
||||||
|
context "for an associate" do
|
||||||
|
let(:user) { create(:user, :associate) }
|
||||||
|
|
||||||
|
permissions :destroy? do
|
||||||
|
it { is_expected.not_to permit(user_context, :destroy) }
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
require "rails_helper"
|
require "rails_helper"
|
||||||
|
|
||||||
describe MedicalReleasePolicy do
|
describe MedicalReleasePolicy do
|
||||||
let(:user_context) { build(:user_context) }
|
let(:user) { create(:user, :manager) }
|
||||||
|
let(:user_context) { build(:user_context, user: user, account: user.primary_account) }
|
||||||
|
|
||||||
subject { described_class }
|
subject { described_class }
|
||||||
|
|
||||||
@@ -23,10 +24,6 @@ describe MedicalReleasePolicy do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
permissions :destroy? do
|
|
||||||
it { is_expected.to permit(:destroy) }
|
|
||||||
end
|
|
||||||
|
|
||||||
permissions :edit_photos? do
|
permissions :edit_photos? do
|
||||||
it { is_expected.to permit(:edit_photos) }
|
it { is_expected.to permit(:edit_photos) }
|
||||||
end
|
end
|
||||||
@@ -34,4 +31,16 @@ describe MedicalReleasePolicy do
|
|||||||
permissions :update_photos? do
|
permissions :update_photos? do
|
||||||
it { is_expected.to permit(:update_photos) }
|
it { is_expected.to permit(:update_photos) }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
permissions :destroy? do
|
||||||
|
it { is_expected.to permit(user_context, :destroy) }
|
||||||
|
end
|
||||||
|
|
||||||
|
context "for an associate" do
|
||||||
|
let(:user) { create(:user, :associate) }
|
||||||
|
|
||||||
|
permissions :destroy? do
|
||||||
|
it { is_expected.not_to permit(user_context, :destroy) }
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
require "rails_helper"
|
require "rails_helper"
|
||||||
|
|
||||||
describe MiscReleasePolicy do
|
describe MiscReleasePolicy do
|
||||||
let(:user_context) { build(:user_context) }
|
let(:user) { create(:user, :manager) }
|
||||||
|
let(:user_context) { build(:user_context, user: user, account: user.primary_account) }
|
||||||
|
|
||||||
subject { described_class }
|
subject { described_class }
|
||||||
|
|
||||||
@@ -19,10 +20,6 @@ describe MiscReleasePolicy do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
permissions :destroy? do
|
|
||||||
it { is_expected.to permit(:destroy) }
|
|
||||||
end
|
|
||||||
|
|
||||||
permissions :edit_photos? do
|
permissions :edit_photos? do
|
||||||
it { is_expected.to permit(:edit_photos) }
|
it { is_expected.to permit(:edit_photos) }
|
||||||
end
|
end
|
||||||
@@ -30,4 +27,16 @@ describe MiscReleasePolicy do
|
|||||||
permissions :update_photos? do
|
permissions :update_photos? do
|
||||||
it { is_expected.to permit(:update_photos) }
|
it { is_expected.to permit(:update_photos) }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
permissions :destroy? do
|
||||||
|
it { is_expected.to permit(user_context, :destroy) }
|
||||||
|
end
|
||||||
|
|
||||||
|
context "for an associate" do
|
||||||
|
let(:user) { create(:user, :associate) }
|
||||||
|
|
||||||
|
permissions :destroy? do
|
||||||
|
it { is_expected.not_to permit(user_context, :destroy) }
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
require "rails_helper"
|
require "rails_helper"
|
||||||
|
|
||||||
RSpec.describe MusicReleasePolicy do
|
RSpec.describe MusicReleasePolicy do
|
||||||
let(:user_context) { build(:user_context) }
|
let(:user) { create(:user, :manager) }
|
||||||
|
let(:user_context) { build(:user_context, user: user, account: user.primary_account) }
|
||||||
|
|
||||||
subject { described_class }
|
subject { described_class }
|
||||||
|
|
||||||
@@ -18,6 +19,14 @@ RSpec.describe MusicReleasePolicy do
|
|||||||
end
|
end
|
||||||
|
|
||||||
permissions :destroy? do
|
permissions :destroy? do
|
||||||
it { is_expected.to permit(:destroy) }
|
it { is_expected.to permit(user_context, :destroy) }
|
||||||
|
end
|
||||||
|
|
||||||
|
context "for an associate" do
|
||||||
|
let(:user) { create(:user, :associate) }
|
||||||
|
|
||||||
|
permissions :destroy? do
|
||||||
|
it { is_expected.not_to permit(user_context, :destroy) }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
require "rails_helper"
|
require "rails_helper"
|
||||||
|
|
||||||
describe TalentReleasePolicy do
|
describe TalentReleasePolicy do
|
||||||
let(:user_context) { build(:user_context) }
|
let(:user) { create(:user, :manager) }
|
||||||
|
let(:user_context) { build(:user_context, user: user, account: user.primary_account) }
|
||||||
|
|
||||||
subject { described_class }
|
subject { described_class }
|
||||||
|
|
||||||
@@ -23,10 +24,6 @@ describe TalentReleasePolicy do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
permissions :destroy? do
|
|
||||||
it { is_expected.to permit(:destroy) }
|
|
||||||
end
|
|
||||||
|
|
||||||
permissions :edit_photos? do
|
permissions :edit_photos? do
|
||||||
it { is_expected.to permit(:edit_photos) }
|
it { is_expected.to permit(:edit_photos) }
|
||||||
end
|
end
|
||||||
@@ -34,4 +31,16 @@ describe TalentReleasePolicy do
|
|||||||
permissions :update_photos? do
|
permissions :update_photos? do
|
||||||
it { is_expected.to permit(:update_photos) }
|
it { is_expected.to permit(:update_photos) }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
permissions :destroy? do
|
||||||
|
it { is_expected.to permit(user_context, :destroy) }
|
||||||
|
end
|
||||||
|
|
||||||
|
context "for an associate" do
|
||||||
|
let(:user) { create(:user, :associate) }
|
||||||
|
|
||||||
|
permissions :destroy? do
|
||||||
|
it { is_expected.not_to permit(user_context, :destroy) }
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user