From f201580a01a44154d5fe54fa70274b4b9154e74d Mon Sep 17 00:00:00 2001 From: Bilal Date: Tue, 30 Jun 2020 18:29:22 +0200 Subject: [PATCH 1/6] add splash screen for releaseME --- app/assets/stylesheets/application.scss | 9 +++ .../contract_templates_controller.rb | 5 ++ app/helpers/wordmark_helper.rb | 5 +- app/views/contract_templates/splash.html.erb | 56 +++++++++++++++++++ config/locales/en.yml | 17 ++++++ config/locales/es.yml | 17 ++++++ .../contract_templates_controller_spec.rb | 12 +++- .../user_imports_release_templates_spec.rb | 6 +- .../user_manages_contract_templates_spec.rb | 11 ++++ 9 files changed, 130 insertions(+), 8 deletions(-) create mode 100644 app/views/contract_templates/splash.html.erb diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index b14620f..581f952 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -427,3 +427,12 @@ a[data-behavior=seekable-timecode] { width: 308px; height:308px; } + +// Add checkmark before list item +#checkmark-list > li { + list-style: none; + margin-left: -1em; +} +#checkmark-list > li:before { + content: '\2713\0020'; +} \ No newline at end of file diff --git a/app/controllers/contract_templates_controller.rb b/app/controllers/contract_templates_controller.rb index 5f3fbc6..3c15127 100644 --- a/app/controllers/contract_templates_controller.rb +++ b/app/controllers/contract_templates_controller.rb @@ -7,6 +7,7 @@ class ContractTemplatesController < ApplicationController before_action :set_project, except: [:destroy] before_action :set_contract_template, only: [:destroy] + before_action :show_splash_screen, only: :index def index @contract_templates = contract_templates.non_archived.order_by_name.paginate(page: params[:page]) @@ -38,6 +39,10 @@ class ContractTemplatesController < ApplicationController private + def show_splash_screen + render :splash if contract_templates.non_archived.count.zero? + end + def set_contract_template @contract_template = authorize contract_templates.find(params[:id]) end diff --git a/app/helpers/wordmark_helper.rb b/app/helpers/wordmark_helper.rb index 5b6eca7..09820c4 100644 --- a/app/helpers/wordmark_helper.rb +++ b/app/helpers/wordmark_helper.rb @@ -13,10 +13,13 @@ module WordmarkHelper css += options[:class].to_s content_tag(:div, class: css) do - safe_join [ + elements = [ content_tag(:span, t("shared.#{product_name}")), content_tag(:span, t("shared.me")) ] + prefix = options[:prefix] + elements.unshift content_tag(:span, "#{prefix} ") unless prefix.blank? + safe_join elements end end end diff --git a/app/views/contract_templates/splash.html.erb b/app/views/contract_templates/splash.html.erb new file mode 100644 index 0000000..20b8b04 --- /dev/null +++ b/app/views/contract_templates/splash.html.erb @@ -0,0 +1,56 @@ +
+
+ <%= product_wordmark :release_me, prefix: t('.headings.welcome'), class: "h2" %> +

<%= t '.headings.subtitle' %> +

+ + <%= link_to t(".actions.book_demo"), 'https://meetings.hubspot.com/bray2', class: "btn btn-primary border align-self-center h-50 ml-auto mr-2 pb-2", target: '_blank' %> + <%= link_to t(".actions.create_template"), [:new, @project, :contract_template], class: "btn btn-success border align-self-center h-50 pb-2" %> +
+ +
+ +
+
+
+
+
+
+ + + + + + +
+ Video tutorial will be available soon +
+
+
+
+
+
+
+
+

<%= t '.headings.how_it_works' %>

+
    +
  1. <%= t '.list_items.create_releases' %>
  2. +
  3. <%= t '.list_items.download_mobile_app' %>
  4. +
  5. <%= t '.list_items.print_QR_code' %>
  6. +
  7. <%= t '.list_items.releases_automatically_organized' %>
  8. +
+
+
+
+
+

<%= t '.headings.benefits' %>

+
    +
  • <%= t '.list_items.all_releases_available' %>
  • +
  • <%= t '.list_items.manage_large_audience' %>
  • +
  • <%= t '.list_items.add_tags_and_notes' %>
  • +
+
+
+
+
+
\ No newline at end of file diff --git a/config/locales/en.yml b/config/locales/en.yml index cc28c89..2263d4b 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -252,6 +252,23 @@ en: signed_release_count: No. Signed Releases new: heading: New Release Template + splash: + headings: + welcome: Welcome to + subtitle: The easiest way to create and manage releases. + how_it_works: How It Works + benefits: Benefits + actions: + book_demo: Schedule a Demo + create_template: Create New Release Template + list_items: + create_releases: Create releases for your video shoot + download_mobile_app: Download the ME Suite mobile app + print_QR_code: Print out release QR codes + releases_automatically_organized: Releases are automatically organized as they’re submitted + all_releases_available: All release types available including Covid Medical, Appearance, Location and more + manage_large_audience: Easily manage large audiences with the crowd control feature + add_tags_and_notes: Add tags and notes to releases for added organization and searchability contracts: medical_questionnaire: heading: Medical Questionnaire diff --git a/config/locales/es.yml b/config/locales/es.yml index 3384431..ccf8e0e 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -70,6 +70,23 @@ es: heading: Legal (ES) release_info: heading: Release Info (ES) + splash: + headings: + welcome: Welcome to (ES) + subtitle: The easiest way to create and manage releases. (ES) + how_it_works: How It Works (ES) + benefits: "" + actions: + book_demo: Schedule a Demo (ES) + create_template: Create New Release Template (ES) + list_items: + create_releases: Create releases for your video shoot (ES) + download_mobile_app: Download the ME Suite mobile app (ES) + print_QR_code: Print out release QR codes (ES) + releases_automatically_organized: Releases are automatically organized as they’re submitted (ES) + all_releases_available: All release types available including Covid Medical, Appearance, Location and more (ES) + manage_large_audience: Easily manage large audiences with the crowd control feature (ES) + add_tags_and_notes: Add tags and notes to releases for added organization and searchability (ES) contracts: photos: guardian_2_photo_heading: Second guardian photo (ES) diff --git a/spec/controllers/contract_templates_controller_spec.rb b/spec/controllers/contract_templates_controller_spec.rb index 87ba377..72c77a4 100644 --- a/spec/controllers/contract_templates_controller_spec.rb +++ b/spec/controllers/contract_templates_controller_spec.rb @@ -19,7 +19,7 @@ describe ContractTemplatesController do expect(response).to be_successful end - it 'renders content' do + it 'renders content if there are contract templates' do contract_template = create(:contract_template, name: 'My Contract Template', fee: 50, release_type: 'appearance', project: project) @@ -39,10 +39,11 @@ describe ContractTemplatesController do end context 'when there are no contract templates' do - it 'renders an empty message' do + it 'renders splash screen' do get :index, params: { project_id: project } - expect(response.body).to have_content('Release Templates will appear here') + expect(response.body).to have_link "Create New Release Template" + expect(response.body).to have_link schedule_demo end end @@ -50,6 +51,7 @@ describe ContractTemplatesController do let(:current_user) { create(:user, :associate) } it 'does not show the new contract template button' do + create(:contract_template, project: project) get :index, params: { project_id: project } expect(response.body).not_to have_link('Create New Release Template') @@ -166,4 +168,8 @@ describe ContractTemplatesController do restriction_text: 'restrictions' } end + + def schedule_demo + t 'contract_templates.splash.actions.book_demo' + end end diff --git a/spec/features/user_imports_release_templates_spec.rb b/spec/features/user_imports_release_templates_spec.rb index f9e0131..41206cd 100644 --- a/spec/features/user_imports_release_templates_spec.rb +++ b/spec/features/user_imports_release_templates_spec.rb @@ -13,8 +13,7 @@ feature "User imports release templates", type: :feature do end scenario "importing two existing templates into a project" do - visit project_contract_templates_path(project) - click_on "Import Release Template" + visit new_project_release_template_imports_path(project) select_templates([project_one_template.id, project_two_template.id]) click_on "Import Selected Templates" expect(page).to have_content("Selected templates were imported with success") @@ -31,8 +30,7 @@ feature "User imports release templates", type: :feature do end scenario "searching for a template", js: true do - visit project_contract_templates_path(project) - click_on "Import Release Template" + visit new_project_release_template_imports_path(project) fill_in "query", with: "Second" click_on "search-button" expect(page).not_to have_content("First Contract Template") diff --git a/spec/features/user_manages_contract_templates_spec.rb b/spec/features/user_manages_contract_templates_spec.rb index 094c8bd..9d29f28 100644 --- a/spec/features/user_manages_contract_templates_spec.rb +++ b/spec/features/user_manages_contract_templates_spec.rb @@ -11,6 +11,12 @@ RSpec.feature 'User manages contract templates', type: :feature do sign_in(current_user) end + scenario 'splash page is shown if tehre are no contract templates' do + visit project_contract_templates_path(project) + + expect(page).to have_content schedule_demo + end + scenario 'creating a new release template' do visit new_project_contract_template_path(project) @@ -223,6 +229,7 @@ RSpec.feature 'User manages contract templates', type: :feature do let(:current_user) { create(:user, :associate) } it 'does not show management buttons for release templates' do + create(:contract_template, project: project) visit project_contract_templates_path(project) expect(page).not_to have_content('Create New Release Template') @@ -273,4 +280,8 @@ RSpec.feature 'User manages contract templates', type: :feature do def fill_hidden(id, with:) find(:xpath, "//input[@id='#{id}']", visible: false).set with end + + def schedule_demo + t 'contract_templates.splash.actions.book_demo' + end end -- 2.47.3 From 08e475642c2e4bc40765eb12295da692e5ab8a47 Mon Sep 17 00:00:00 2001 From: Bilal Date: Tue, 30 Jun 2020 18:38:30 +0200 Subject: [PATCH 2/6] improve spec --- spec/features/user_imports_release_templates_spec.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/spec/features/user_imports_release_templates_spec.rb b/spec/features/user_imports_release_templates_spec.rb index 41206cd..f2c5c60 100644 --- a/spec/features/user_imports_release_templates_spec.rb +++ b/spec/features/user_imports_release_templates_spec.rb @@ -13,7 +13,9 @@ feature "User imports release templates", type: :feature do end scenario "importing two existing templates into a project" do - visit new_project_release_template_imports_path(project) + create(:contract_template, project: project) + visit project_contract_templates_path(project) + click_on "Import Release Template" select_templates([project_one_template.id, project_two_template.id]) click_on "Import Selected Templates" expect(page).to have_content("Selected templates were imported with success") @@ -30,7 +32,9 @@ feature "User imports release templates", type: :feature do end scenario "searching for a template", js: true do - visit new_project_release_template_imports_path(project) + create(:contract_template, project: project) + visit project_contract_templates_path(project) + click_on "Import Release Template" fill_in "query", with: "Second" click_on "search-button" expect(page).not_to have_content("First Contract Template") -- 2.47.3 From 2a7deef3c88c474ebbcb27bff982c1e8c3a4283f Mon Sep 17 00:00:00 2001 From: Bilal Date: Tue, 30 Jun 2020 19:10:55 +0200 Subject: [PATCH 3/6] sort translations --- config/locales/en.yml | 16 ++++++++-------- config/locales/es.yml | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index 2263d4b..120ba93 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -253,22 +253,22 @@ en: new: heading: New Release Template splash: - headings: - welcome: Welcome to - subtitle: The easiest way to create and manage releases. - how_it_works: How It Works - benefits: Benefits actions: book_demo: Schedule a Demo create_template: Create New Release Template + headings: + benefits: Benefits + how_it_works: How It Works + subtitle: The easiest way to create and manage releases. + welcome: Welcome to list_items: + add_tags_and_notes: Add tags and notes to releases for added organization and searchability + all_releases_available: All release types available including Covid Medical, Appearance, Location and more create_releases: Create releases for your video shoot download_mobile_app: Download the ME Suite mobile app + manage_large_audience: Easily manage large audiences with the crowd control feature print_QR_code: Print out release QR codes releases_automatically_organized: Releases are automatically organized as they’re submitted - all_releases_available: All release types available including Covid Medical, Appearance, Location and more - manage_large_audience: Easily manage large audiences with the crowd control feature - add_tags_and_notes: Add tags and notes to releases for added organization and searchability contracts: medical_questionnaire: heading: Medical Questionnaire diff --git a/config/locales/es.yml b/config/locales/es.yml index ccf8e0e..bf6d128 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -71,22 +71,22 @@ es: release_info: heading: Release Info (ES) splash: - headings: - welcome: Welcome to (ES) - subtitle: The easiest way to create and manage releases. (ES) - how_it_works: How It Works (ES) - benefits: "" actions: book_demo: Schedule a Demo (ES) create_template: Create New Release Template (ES) + headings: + benefits: "" + how_it_works: How It Works (ES) + subtitle: The easiest way to create and manage releases. (ES) + welcome: Welcome to (ES) list_items: + add_tags_and_notes: Add tags and notes to releases for added organization and searchability (ES) + all_releases_available: All release types available including Covid Medical, Appearance, Location and more (ES) create_releases: Create releases for your video shoot (ES) download_mobile_app: Download the ME Suite mobile app (ES) + manage_large_audience: Easily manage large audiences with the crowd control feature (ES) print_QR_code: Print out release QR codes (ES) releases_automatically_organized: Releases are automatically organized as they’re submitted (ES) - all_releases_available: All release types available including Covid Medical, Appearance, Location and more (ES) - manage_large_audience: Easily manage large audiences with the crowd control feature (ES) - add_tags_and_notes: Add tags and notes to releases for added organization and searchability (ES) contracts: photos: guardian_2_photo_heading: Second guardian photo (ES) -- 2.47.3 From c8f314142c194272ea2ae7d58f3f8fad724ef925 Mon Sep 17 00:00:00 2001 From: Bilal Date: Wed, 1 Jul 2020 10:57:55 +0200 Subject: [PATCH 4/6] fix MR comments --- app/assets/stylesheets/application.scss | 9 --------- app/views/contract_templates/splash.html.erb | 12 +++++++----- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 581f952..2942959 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -426,13 +426,4 @@ a[data-behavior=seekable-timecode] { .fix-h-and-w { width: 308px; height:308px; -} - -// Add checkmark before list item -#checkmark-list > li { - list-style: none; - margin-left: -1em; -} -#checkmark-list > li:before { - content: '\2713\0020'; } \ No newline at end of file diff --git a/app/views/contract_templates/splash.html.erb b/app/views/contract_templates/splash.html.erb index 20b8b04..f2ef542 100644 --- a/app/views/contract_templates/splash.html.erb +++ b/app/views/contract_templates/splash.html.erb @@ -5,7 +5,9 @@ <%= link_to t(".actions.book_demo"), 'https://meetings.hubspot.com/bray2', class: "btn btn-primary border align-self-center h-50 ml-auto mr-2 pb-2", target: '_blank' %> - <%= link_to t(".actions.create_template"), [:new, @project, :contract_template], class: "btn btn-success border align-self-center h-50 pb-2" %> + <% if policy(ContractTemplate).new? %> + <%= link_to t(".actions.create_template"), [:new, @project, :contract_template], class: "btn btn-success border align-self-center h-50 pb-2" %> +<% end %>
@@ -44,10 +46,10 @@

<%= t '.headings.benefits' %>

-
    -
  • <%= t '.list_items.all_releases_available' %>
  • -
  • <%= t '.list_items.manage_large_audience' %>
  • -
  • <%= t '.list_items.add_tags_and_notes' %>
  • +
      + <%= content_tag(:li, fa_icon("check li", text: t('.list_items.all_releases_available'))) %> + <%= content_tag(:li, fa_icon("check li", text: t('.list_items.manage_large_audience'))) %> + <%= content_tag(:li, fa_icon("check li", text: t('.list_items.add_tags_and_notes'))) %>
-- 2.47.3 From ea025a86b3762b091ca7beb83778d046fe7d905f Mon Sep 17 00:00:00 2001 From: Bilal Date: Wed, 1 Jul 2020 11:09:47 +0200 Subject: [PATCH 5/6] fix MR comments --- config/locales/en.yml | 4 ++-- .../user_manages_contract_templates_spec.rb | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index 120ba93..ea0c740 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -341,11 +341,11 @@ en: notice: The release has been updated helpers: help: - task_request: - time_allowed: Minimum of 2 hours, no partial hours allowed contract_template: fee: Leave at $0.00 for no-fee guardian_clause: Leave blank if not required for this contract + task_request: + time_allowed: Minimum of 2 hours, no partial hours allowed video: 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. diff --git a/spec/features/user_manages_contract_templates_spec.rb b/spec/features/user_manages_contract_templates_spec.rb index 9d29f28..6fe9915 100644 --- a/spec/features/user_manages_contract_templates_spec.rb +++ b/spec/features/user_manages_contract_templates_spec.rb @@ -15,6 +15,7 @@ RSpec.feature 'User manages contract templates', type: :feature do visit project_contract_templates_path(project) expect(page).to have_content schedule_demo + expect(page).to have_content create_release_template end scenario 'creating a new release template' do @@ -236,6 +237,13 @@ RSpec.feature 'User manages contract templates', type: :feature do expect(page).not_to have_content(import_template_button) expect(page).not_to have_content('Delete') end + + it 'does not show create release button on splash page' do + visit project_contract_templates_path(project) + + expect(page).to have_content schedule_demo + expect(page).not_to have_content create_release_template + end end context 'When the user is account manager' do @@ -249,6 +257,13 @@ RSpec.feature 'User manages contract templates', type: :feature do click_on 'Manage' expect(page).to have_content('Archive') end + + it 'does not show create release button on splash page' do + visit project_contract_templates_path(project) + + expect(page).to have_content schedule_demo + expect(page).to have_content create_release_template + end end private @@ -284,4 +299,8 @@ RSpec.feature 'User manages contract templates', type: :feature do def schedule_demo t 'contract_templates.splash.actions.book_demo' end + + def create_release_template + t 'contract_templates.splash.actions.create_template' + end end -- 2.47.3 From 062b1d75cd2e1768372eaa0280b08f3320e19617 Mon Sep 17 00:00:00 2001 From: Bilal Date: Wed, 1 Jul 2020 11:11:08 +0200 Subject: [PATCH 6/6] fix MR comments --- app/assets/stylesheets/application.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 2942959..b14620f 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -426,4 +426,4 @@ a[data-behavior=seekable-timecode] { .fix-h-and-w { width: 308px; height:308px; -} \ No newline at end of file +} -- 2.47.3