diff --git a/app/controllers/broadcasts_controller.rb b/app/controllers/broadcasts_controller.rb
index c83338a..aad9bb1 100644
--- a/app/controllers/broadcasts_controller.rb
+++ b/app/controllers/broadcasts_controller.rb
@@ -5,6 +5,7 @@ class BroadcastsController < ApplicationController
before_action :build_broadcast, only: [:new, :create]
before_action :set_broadcast, only: [:show, :destroy, :update]
before_action :set_multi_view_broadcasts, only: [:show]
+ before_action :show_splash_screen, only: :index
def index
@broadcasts = filtered_broadcasts.order_by_recent.paginate(page: params[:page])
@@ -49,6 +50,10 @@ class BroadcastsController < ApplicationController
private
+ def show_splash_screen
+ render :splash if broadcasts.count.zero?
+ end
+
def broadcast_params
params.require(:broadcast).permit(:name, files: [])
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/broadcasts/splash.html.erb b/app/views/broadcasts/splash.html.erb
new file mode 100644
index 0000000..9df4d51
--- /dev/null
+++ b/app/views/broadcasts/splash.html.erb
@@ -0,0 +1,59 @@
+
+
+ <%= product_wordmark :direct_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' %>
+ <% if policy(Broadcast).new? %>
+ <%= link_to t(".actions.create_stream"), [:new, @project, :broadcast], class: "btn btn-success border align-self-center h-50 pb-2" %>
+ <% end %>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+ Video tutorial will be available soon
+ |
+
+
+
+
+
+
+
+
+
+
+
<%= t '.headings.how_it_works' %>
+
+ - <%= t '.list_items.create_stream' %>
+ - <%= t '.list_items.share_stream' %>
+ - <%= t '.list_items.launch_video_conference' %>
+ - <%= t '.list_items.share_files' %>
+
+
+
+
+
+
<%= t '.headings.benefits' %>
+
+ <%= content_tag(:li, fa_icon("check li", text: t('.list_items.stream_from_mobile_app'))) %>
+ <%= content_tag(:li, fa_icon("check li", text: t('.list_items.direct_shoots_anywhere'))) %>
+ <%= content_tag(:li, fa_icon("check li", text: t('.list_items.share_live_stream'))) %>
+ <%= content_tag(:li, fa_icon("check li", text: t('.list_items.stream_multiple_cameras'))) %>
+
+
+
+
+
+
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 88f77b1..c0c6df8 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -207,6 +207,24 @@ en:
new:
heading:
Create Live Stream
+ splash:
+ actions:
+ book_demo: Schedule a Demo
+ create_stream: Create New Live Stream
+ headings:
+ benefits: Benefits
+ how_it_works: How It Works
+ subtitle: Remote directing and video village solution
+ welcome: Welcome to
+ list_items:
+ create_stream: Create a live stream
+ direct_shoots_anywhere: Direct shoots anywhere around the world
+ launch_video_conference: Launch Video Conference using plugin
+ share_files: Share files via the ME Suite mobile app
+ share_live_stream: Share live stream with clients all over the the world
+ share_stream: Share live stream link with clients
+ stream_from_mobile_app: Stream from ME Suite Mobile app, or via a professional camera
+ stream_multiple_cameras: Stream multiple cameras at one time
bulk_taggings:
new_bulk_tag_modal:
submit: Add
diff --git a/config/locales/es.yml b/config/locales/es.yml
index 3384431..91c1dff 100644
--- a/config/locales/es.yml
+++ b/config/locales/es.yml
@@ -57,6 +57,25 @@ es:
pdf:
do_not_copy_warning: "Do not copy (ES)"
serial_number_label: "Serial Number (ES)"
+ broadcasts:
+ splash:
+ actions:
+ book_demo: Schedule a Demo
+ create_stream: Create New Live Stream
+ headings:
+ benefits: Benefits
+ how_it_works: How It Works
+ subtitle: Remote directing and video village solution
+ welcome: Welcome to
+ list_items:
+ create_stream: Create a live stream
+ direct_shoots_anywhere: Direct shoots anywhere around the world
+ launch_video_conference: Launch Video Conference using plugin
+ share_files: Share files via the ME Suite mobile app
+ share_live_stream: Share live stream with clients all over the the world
+ share_stream: Share live stream link with clients
+ stream_from_mobile_app: Stream from ME Suite Mobile app, or via a professional camera
+ stream_multiple_cameras: Stream multiple cameras at one time
contract_templates:
blank_contracts:
create:
diff --git a/spec/controllers/broadcasts_controller_spec.rb b/spec/controllers/broadcasts_controller_spec.rb
index 08b686a..782299d 100644
--- a/spec/controllers/broadcasts_controller_spec.rb
+++ b/spec/controllers/broadcasts_controller_spec.rb
@@ -22,7 +22,7 @@ RSpec.describe BroadcastsController, type: :controller do
expect(response).to be_successful
end
- it "renders content" do
+ it "renders content if theere are existing broadcasts" do
create(:broadcast, project: project, name: "Another Broadcast")
get :index, params: { project_id: project }
@@ -34,12 +34,13 @@ RSpec.describe BroadcastsController, type: :controller do
end
context "when there are no active broadcasts" do
- it "renders an empty message" do
+ it "renders splash screen" do
Broadcast.destroy_all
get :index, params: { project_id: project }
- expect(response.body).to have_content("Live streams will appear here")
+ expect(response.body).to have_link create_stream
+ expect(response.body).to have_link schedule_demo
end
end
@@ -55,10 +56,8 @@ RSpec.describe BroadcastsController, type: :controller do
context "for xhr request" do
it "filters the broadcasts by a query param" do
- appearance_releases = [
- create(:broadcast, skip_create_callback: true, name: "Stream by Adam"),
- create(:broadcast, skip_create_callback: true, name: "Stream by Zoe"),
- ]
+ create(:broadcast, project: project, skip_create_callback: true, name: "Stream by Adam")
+ create(:broadcast, project: project, skip_create_callback: true, name: "Stream by Zoe")
get :index, params: { project_id: project, query: "Zoe" }, xhr: true
@@ -245,4 +244,12 @@ RSpec.describe BroadcastsController, type: :controller do
{ files: [contract_file] }
end
+
+ def schedule_demo
+ t 'broadcasts.splash.actions.book_demo'
+ end
+
+ def create_stream
+ t 'broadcasts.splash.actions.create_stream'
+ end
end
diff --git a/spec/features/user_managing_broadcasts_spec.rb b/spec/features/user_managing_broadcasts_spec.rb
index 318697b..9be98bc 100644
--- a/spec/features/user_managing_broadcasts_spec.rb
+++ b/spec/features/user_managing_broadcasts_spec.rb
@@ -12,6 +12,13 @@ feature 'User managing broadcasts' do
allow(MuxLiveStream).to receive(:new).and_return(double(id: 'id', key: 'key', playback_id: 'playback_id'))
end
+ scenario "splash page is shown if there are no existing streams" do
+ visit project_broadcasts_path(project)
+
+ expect(page).to have_content schedule_demo
+ expect(page).to have_content create_stream
+ end
+
scenario 'creating and deleting a broadcast', js: true do
visit new_project_broadcast_path(project)
@@ -131,6 +138,29 @@ feature 'User managing broadcasts' do
end
end
end
+
+ context 'When the user is associate' do
+ let(:current_user) { create(:user, :associate) }
+
+ it 'does not show button to create new live stream' do
+ visit project_broadcasts_path(project)
+
+ expect(page).to have_content schedule_demo
+ expect(page).not_to have_content create_stream
+ end
+ end
+
+ context 'When the user is account manager' do
+ let(:current_user) { create(:user, :account_manager) }
+
+ it 'does show button to create new live stream' do
+ visit project_broadcasts_path(project)
+
+ expect(page).to have_content schedule_demo
+ expect(page).to have_content create_stream
+ end
+ end
+
end
private
@@ -151,4 +181,12 @@ feature 'User managing broadcasts' do
def switch_view_dropdown
'Switch View'
end
+
+ def schedule_demo
+ t 'broadcasts.splash.actions.book_demo'
+ end
+
+ def create_stream
+ t 'broadcasts.splash.actions.create_stream'
+ end
end