From ba985b0af6e984b0ef44ad41ae2c2f3822542637 Mon Sep 17 00:00:00 2001 From: Bilal Date: Tue, 30 Jun 2020 19:41:02 +0200 Subject: [PATCH 1/5] add splash screen for deliverME --- app/assets/stylesheets/application.scss | 9 ++++ app/controllers/videos_controller.rb | 5 ++ app/helpers/wordmark_helper.rb | 5 +- app/views/videos/splash.html.erb | 57 ++++++++++++++++++++++ config/locales/en.yml | 18 +++++++ config/locales/es.yml | 19 ++++++++ spec/controllers/videos_controller_spec.rb | 12 +++-- spec/features/user_managing_videos_spec.rb | 16 ++++++ 8 files changed, 137 insertions(+), 4 deletions(-) create mode 100644 app/views/videos/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/videos_controller.rb b/app/controllers/videos_controller.rb index 18465bd..049341e 100644 --- a/app/controllers/videos_controller.rb +++ b/app/controllers/videos_controller.rb @@ -3,6 +3,7 @@ class VideosController < ApplicationController before_action :set_project, only: [:index, :new, :create, :landing] before_action :set_video, only: [:edit, :update] + before_action :show_splash_screen, only: :index def landing authorize Video, :new? @@ -60,6 +61,10 @@ class VideosController < ApplicationController private + def show_splash_screen + render :splash if videos.count.zero? + end + def set_project @project = policy_scope(Project).find(params[:project_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/videos/splash.html.erb b/app/views/videos/splash.html.erb new file mode 100644 index 0000000..18c503f --- /dev/null +++ b/app/views/videos/splash.html.erb @@ -0,0 +1,57 @@ +
+
+ <%= product_wordmark :deliver_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.upload_video"), [:new, @project, :video], 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.import_video' %>
  2. +
  3. <%= t '.list_items.import_EDLs' %>
  4. +
  5. <%= t '.list_items.AI_generates_documents' %>
  6. +
  7. <%= t '.list_items.download_documents' %>
  8. +
+
+
+
+
+

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

+
    +
  • <%= t '.list_items.reduces_labor_cost' %>
  • +
  • <%= t '.list_items.more_accurate' %>
  • +
  • <%= t '.list_items.simplifies_cue_sheets' %>
  • +
  • <%= t '.list_items.production_elements_logs' %>
  • +
+
+
+
+
+
\ No newline at end of file diff --git a/config/locales/en.yml b/config/locales/en.yml index cc28c89..c5c02f1 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1273,6 +1273,24 @@ en: new: heading: Upload Video subheading: 2 of 2 Files + splash: + actions: + book_demo: Schedule a Demo + upload_video: Upload New Video + headings: + benefits: Benefits + how_it_works: How It Works + subtitle: Automate your deliverable documents + welcome: Welcome to + list_items: + AI_generates_documents: AI generates deliverable documents + download_documents: Download deliverable documents + import_EDLs: Import your EDLs + import_video: Import your video + more_accurate: More accurate than human-generated reports + production_elements_logs: Production Elements Logs, and more + reduces_labor_cost: Reduces labor costs + simplifies_cue_sheets: Simplifies Music Cue Sheets, Graphic Cue Sheets update: notice: The video has been updated video: diff --git a/config/locales/es.yml b/config/locales/es.yml index 3384431..7202c2a 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -363,3 +363,22 @@ es: manage: Manage (ES) open_deliverable: Open Deliverable (ES) read_more: read more (ES) + videos: + splash: + actions: + book_demo: Schedule a Demo (ES) + upload_video: Upload New Video (ES) + headings: + benefits: Benefits (ES) + how_it_works: How It Works (ES) + subtitle: Automate your deliverable documents (ES) + welcome: Welcome to (ES) + list_items: + AI_generates_documents: AI generates deliverable documents (ES) + download_documents: Download deliverable documents (ES) + import_EDLs: Import your EDLs (ES) + import_video: Import your video (ES) + more_accurate: More accurate than human-generated reports (ES) + production_elements_logs: Production Elements Logs, and more (ES) + reduces_labor_cost: Reduces labor costs (ES) + simplifies_cue_sheets: Simplifies Music Cue Sheets, Graphic Cue Sheets (ES) diff --git a/spec/controllers/videos_controller_spec.rb b/spec/controllers/videos_controller_spec.rb index 63cf92b..a14a0b7 100644 --- a/spec/controllers/videos_controller_spec.rb +++ b/spec/controllers/videos_controller_spec.rb @@ -20,6 +20,7 @@ RSpec.describe VideosController, type: :controller do end it "has a search form" do + create(:video, project: project) get :index, params: { project_id: project } expect(response.body).to have_button("search-button") @@ -43,7 +44,7 @@ RSpec.describe VideosController, type: :controller do end - it "renders content" do + it "renders content if there are existing videos" do video = create(:video, project: project, name: "My Video", number: "001", created_at: 1.day.ago) get :index, params: { project_id: project } @@ -58,10 +59,11 @@ RSpec.describe VideosController, type: :controller do end context "when there are no records" do - it "renders an empty message" do + it "renders splash screen" do get :index, params: { project_id: project } - expect(response.body).to have_content("Videos will appear here") + expect(response.body).to have_link "Upload New Video" + expect(response.body).to have_link schedule_demo end end @@ -277,4 +279,8 @@ RSpec.describe VideosController, type: :controller do def video_update_params attributes_for(:video, :with_graphics_only_edl_file, :with_audio_only_edl_file, name: "Test Video").except(:file) end + + def schedule_demo + t 'videos.splash.actions.book_demo' + end end diff --git a/spec/features/user_managing_videos_spec.rb b/spec/features/user_managing_videos_spec.rb index 9dcdfa4..883bf48 100644 --- a/spec/features/user_managing_videos_spec.rb +++ b/spec/features/user_managing_videos_spec.rb @@ -17,6 +17,14 @@ feature "User managing videos" do sign_in current_user end + scenario "splash page is shown if there are no existing videos" do + Video.delete_all + visit project_videos_path(project) + + expect(page).to have_content schedule_demo + expect(page).to have_content upload_new_video + end + scenario "creating a video", js: true do visit project_videos_path(project) click_link "Upload New Video" @@ -115,4 +123,12 @@ feature "User managing videos" do def update_video_notice t "videos.update.notice" end + + def schedule_demo + t 'videos.splash.actions.book_demo' + end + + def upload_new_video + t 'videos.splash.actions.upload_video' + end end -- 2.47.3 From 6fc05f0b7fb673abd4adddd118fc4a4ee553921d Mon Sep 17 00:00:00 2001 From: Bilal Date: Wed, 1 Jul 2020 11:21:52 +0200 Subject: [PATCH 2/5] rebase; sort translations --- config/locales/en.yml | 4 ++-- db/structure.sql | 40 ++++++---------------------------------- 2 files changed, 8 insertions(+), 36 deletions(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index c5c02f1..dc3670a 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -324,11 +324,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/db/structure.sql b/db/structure.sql index c4de3ba..70304ab 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -9,20 +9,6 @@ SET xmloption = content; SET client_min_messages = warning; SET row_security = off; --- --- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: - --- - -CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog; - - --- --- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: - --- - -COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language'; - - -- -- Name: fuzzystrmatch; Type: EXTENSION; Schema: -; Owner: - -- @@ -331,8 +317,8 @@ CREATE TABLE public.appearance_releases ( person_last_name character varying, guardian_first_name character varying, guardian_last_name character varying, - guardian_email character varying, identifier character varying, + guardian_email character varying, person_address_street2 character varying, person_address_city character varying, person_address_state character varying, @@ -666,15 +652,6 @@ CREATE SEQUENCE public.contract_templates_id_seq ALTER SEQUENCE public.contract_templates_id_seq OWNED BY public.contract_templates.id; --- --- Name: data_migrations; Type: TABLE; Schema: public; Owner: - --- - -CREATE TABLE public.data_migrations ( - version character varying NOT NULL -); - - -- -- Name: directories; Type: TABLE; Schema: public; Owner: - -- @@ -1401,6 +1378,7 @@ CREATE TABLE public.settings ( -- CREATE SEQUENCE public.settings_id_seq + AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE @@ -1436,6 +1414,7 @@ CREATE TABLE public.taggings ( -- CREATE SEQUENCE public.taggings_id_seq + AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE @@ -1466,6 +1445,7 @@ CREATE TABLE public.tags ( -- CREATE SEQUENCE public.tags_id_seq + AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE @@ -1826,9 +1806,9 @@ CREATE TABLE public.zoom_meetings ( api_meeting_id character varying, created_at timestamp(6) without time zone NOT NULL, updated_at timestamp(6) without time zone NOT NULL, - status integer DEFAULT 0, zoom_user_id bigint, - project_id bigint + project_id bigint, + status integer DEFAULT 0 ); @@ -2305,14 +2285,6 @@ ALTER TABLE ONLY public.contract_templates ADD CONSTRAINT contract_templates_pkey PRIMARY KEY (id); --- --- Name: data_migrations data_migrations_pkey; Type: CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.data_migrations - ADD CONSTRAINT data_migrations_pkey PRIMARY KEY (version); - - -- -- Name: directories directories_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- -- 2.47.3 From 469839cee7d72702a4a947ba9d95f16111843ec1 Mon Sep 17 00:00:00 2001 From: Bilal Date: Wed, 1 Jul 2020 11:27:18 +0200 Subject: [PATCH 3/5] fix MR comments --- app/assets/stylesheets/application.scss | 9 --------- app/views/videos/splash.html.erb | 14 ++++++++------ spec/features/user_managing_videos_spec.rb | 12 ++++++++++++ 3 files changed, 20 insertions(+), 15 deletions(-) diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 581f952..b14620f 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -427,12 +427,3 @@ 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/views/videos/splash.html.erb b/app/views/videos/splash.html.erb index 18c503f..e620631 100644 --- a/app/views/videos/splash.html.erb +++ b/app/views/videos/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.upload_video"), [:new, @project, :video], class: "btn btn-success border align-self-center h-50 pb-2" %> + <% if policy(Video).new? %> + <%= link_to t(".actions.upload_video"), [:new, @project, :video], class: "btn btn-success border align-self-center h-50 pb-2" %> + <% end %>
@@ -44,11 +46,11 @@

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

-
    -
  • <%= t '.list_items.reduces_labor_cost' %>
  • -
  • <%= t '.list_items.more_accurate' %>
  • -
  • <%= t '.list_items.simplifies_cue_sheets' %>
  • -
  • <%= t '.list_items.production_elements_logs' %>
  • +
      + <%= content_tag(:li, fa_icon("check li", text: t('.list_items.reduces_labor_cost'))) %> + <%= content_tag(:li, fa_icon("check li", text: t('.list_items.more_accurate'))) %> + <%= content_tag(:li, fa_icon("check li", text: t('.list_items.simplifies_cue_sheets'))) %> + <%= content_tag(:li, fa_icon("check li", text: t('.list_items.production_elements_logs'))) %>
diff --git a/spec/features/user_managing_videos_spec.rb b/spec/features/user_managing_videos_spec.rb index 883bf48..af283d4 100644 --- a/spec/features/user_managing_videos_spec.rb +++ b/spec/features/user_managing_videos_spec.rb @@ -104,6 +104,18 @@ feature "User managing videos" do expect(page).to have_content("Second Video") end + context 'When the user is associate' do + let(:current_user) { create(:user, :associate) } + + it 'does show button to upload new video' do + Video.delete_all + visit project_videos_path(project) + + expect(page).to have_content schedule_demo + expect(page).to have_content upload_new_video + end + end + private def fill_in_video_fields(data) -- 2.47.3 From 709cdc030dab1a0cb5978815d5150b452dc834d8 Mon Sep 17 00:00:00 2001 From: Bilal Date: Wed, 1 Jul 2020 11:44:21 +0200 Subject: [PATCH 4/5] fix MR comments --- spec/features/user_managing_videos_spec.rb | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/spec/features/user_managing_videos_spec.rb b/spec/features/user_managing_videos_spec.rb index af283d4..a8c1fe3 100644 --- a/spec/features/user_managing_videos_spec.rb +++ b/spec/features/user_managing_videos_spec.rb @@ -1,8 +1,8 @@ require "rails_helper" feature "User managing videos" do - let(:current_user) { create(:user) } - let(:project) { create(:project, account: current_user.primary_account) } + let(:current_user) { create(:user, :manager) } + let(:project) { create(:project, members: current_user, account: current_user.primary_account) } let!(:video) do create(:video, :with_graphics_only_edl_file, @@ -116,6 +116,18 @@ feature "User managing videos" do end end + context 'When the user is account manager' do + let(:current_user) { create(:user, :associate) } + + it 'does show button to upload new video' do + Video.delete_all + visit project_videos_path(project) + + expect(page).to have_content schedule_demo + expect(page).to have_content upload_new_video + end + end + private def fill_in_video_fields(data) -- 2.47.3 From 749aa4efd92cc03be48de1f7ae63193b33361b27 Mon Sep 17 00:00:00 2001 From: Bilal Date: Wed, 1 Jul 2020 12:46:53 +0200 Subject: [PATCH 5/5] fix spec --- spec/features/user_managing_videos_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/features/user_managing_videos_spec.rb b/spec/features/user_managing_videos_spec.rb index a8c1fe3..ca5bec6 100644 --- a/spec/features/user_managing_videos_spec.rb +++ b/spec/features/user_managing_videos_spec.rb @@ -117,7 +117,7 @@ feature "User managing videos" do end context 'When the user is account manager' do - let(:current_user) { create(:user, :associate) } + let(:current_user) { create(:user, :account_manager) } it 'does show button to upload new video' do Video.delete_all -- 2.47.3