add splash screen for releaseME

This commit is contained in:
Bilal
2020-06-30 18:29:22 +02:00
parent e49498bbbf
commit f201580a01
9 changed files with 130 additions and 8 deletions

View File

@@ -427,3 +427,12 @@ a[data-behavior=seekable-timecode] {
width: 308px; width: 308px;
height:308px; height:308px;
} }
// Add checkmark before list item
#checkmark-list > li {
list-style: none;
margin-left: -1em;
}
#checkmark-list > li:before {
content: '\2713\0020';
}

View File

@@ -7,6 +7,7 @@ class ContractTemplatesController < ApplicationController
before_action :set_project, except: [:destroy] before_action :set_project, except: [:destroy]
before_action :set_contract_template, only: [:destroy] before_action :set_contract_template, only: [:destroy]
before_action :show_splash_screen, only: :index
def index def index
@contract_templates = contract_templates.non_archived.order_by_name.paginate(page: params[:page]) @contract_templates = contract_templates.non_archived.order_by_name.paginate(page: params[:page])
@@ -38,6 +39,10 @@ class ContractTemplatesController < ApplicationController
private private
def show_splash_screen
render :splash if contract_templates.non_archived.count.zero?
end
def set_contract_template def set_contract_template
@contract_template = authorize contract_templates.find(params[:id]) @contract_template = authorize contract_templates.find(params[:id])
end end

View File

@@ -13,10 +13,13 @@ module WordmarkHelper
css += options[:class].to_s css += options[:class].to_s
content_tag(:div, class: css) do content_tag(:div, class: css) do
safe_join [ elements = [
content_tag(:span, t("shared.#{product_name}")), content_tag(:span, t("shared.#{product_name}")),
content_tag(:span, t("shared.me")) content_tag(:span, t("shared.me"))
] ]
prefix = options[:prefix]
elements.unshift content_tag(:span, "#{prefix} ") unless prefix.blank?
safe_join elements
end end
end end
end end

View File

@@ -0,0 +1,56 @@
<div class="d-flex flex-row">
<div class="d-flex flex-column">
<%= product_wordmark :release_me, prefix: t('.headings.welcome'), class: "h2" %>
<p class="text-muted"><%= t '.headings.subtitle' %>
</div>
<%= 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" %>
</div>
<hr>
<div class="pt-2">
<div class="row">
<div class="col">
<div class="card-body p-0">
<div class="embed-responsive embed-responsive-16by9">
<div class="embed-responsive-item">
<table class="w-100 h-100 bg-secondary">
<tbody>
<tr>
<td class="text-center align-middle text-white">
Video tutorial will be available soon
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="col">
<div class="row">
<div class="col">
<h3><%= t '.headings.how_it_works' %></h3>
<ol>
<li><%= t '.list_items.create_releases' %></li>
<li><%= t '.list_items.download_mobile_app' %></li>
<li><%= t '.list_items.print_QR_code' %></li>
<li><%= t '.list_items.releases_automatically_organized' %></li>
</ol>
</div>
</div>
<div class="row">
<div class="col">
<h3><%= t '.headings.benefits' %></h3>
<ul id="checkmark-list">
<li><%= t '.list_items.all_releases_available' %></li>
<li><%= t '.list_items.manage_large_audience' %></li>
<li><%= t '.list_items.add_tags_and_notes' %></li>
</ul>
</div>
</div>
</div>
</div>
</div>

View File

@@ -252,6 +252,23 @@ en:
signed_release_count: No. Signed Releases signed_release_count: No. Signed Releases
new: new:
heading: New Release Template 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 theyre 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: contracts:
medical_questionnaire: medical_questionnaire:
heading: Medical Questionnaire heading: Medical Questionnaire

View File

@@ -70,6 +70,23 @@ es:
heading: Legal (ES) heading: Legal (ES)
release_info: release_info:
heading: Release Info (ES) 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 theyre 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: contracts:
photos: photos:
guardian_2_photo_heading: Second guardian photo (ES) guardian_2_photo_heading: Second guardian photo (ES)

View File

@@ -19,7 +19,7 @@ describe ContractTemplatesController do
expect(response).to be_successful expect(response).to be_successful
end end
it 'renders content' do it 'renders content if there are contract templates' do
contract_template = create(:contract_template, contract_template = create(:contract_template,
name: 'My Contract Template', fee: 50, release_type: 'appearance', name: 'My Contract Template', fee: 50, release_type: 'appearance',
project: project) project: project)
@@ -39,10 +39,11 @@ describe ContractTemplatesController do
end end
context 'when there are no contract templates' do 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 } 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
end end
@@ -50,6 +51,7 @@ describe ContractTemplatesController do
let(:current_user) { create(:user, :associate) } let(:current_user) { create(:user, :associate) }
it 'does not show the new contract template button' do it 'does not show the new contract template button' do
create(:contract_template, project: project)
get :index, params: { project_id: project } get :index, params: { project_id: project }
expect(response.body).not_to have_link('Create New Release Template') expect(response.body).not_to have_link('Create New Release Template')
@@ -166,4 +168,8 @@ describe ContractTemplatesController do
restriction_text: 'restrictions' restriction_text: 'restrictions'
} }
end end
def schedule_demo
t 'contract_templates.splash.actions.book_demo'
end
end end

View File

@@ -13,8 +13,7 @@ feature "User imports release templates", type: :feature do
end end
scenario "importing two existing templates into a project" do scenario "importing two existing templates into a project" do
visit project_contract_templates_path(project) visit new_project_release_template_imports_path(project)
click_on "Import Release Template"
select_templates([project_one_template.id, project_two_template.id]) select_templates([project_one_template.id, project_two_template.id])
click_on "Import Selected Templates" click_on "Import Selected Templates"
expect(page).to have_content("Selected templates were imported with success") expect(page).to have_content("Selected templates were imported with success")
@@ -31,8 +30,7 @@ feature "User imports release templates", type: :feature do
end end
scenario "searching for a template", js: true do scenario "searching for a template", js: true do
visit project_contract_templates_path(project) visit new_project_release_template_imports_path(project)
click_on "Import Release Template"
fill_in "query", with: "Second" fill_in "query", with: "Second"
click_on "search-button" click_on "search-button"
expect(page).not_to have_content("First Contract Template") expect(page).not_to have_content("First Contract Template")

View File

@@ -11,6 +11,12 @@ RSpec.feature 'User manages contract templates', type: :feature do
sign_in(current_user) sign_in(current_user)
end 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 scenario 'creating a new release template' do
visit new_project_contract_template_path(project) 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) } let(:current_user) { create(:user, :associate) }
it 'does not show management buttons for release templates' do it 'does not show management buttons for release templates' do
create(:contract_template, project: project)
visit project_contract_templates_path(project) visit project_contract_templates_path(project)
expect(page).not_to have_content('Create New Release Template') 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:) def fill_hidden(id, with:)
find(:xpath, "//input[@id='#{id}']", visible: false).set with find(:xpath, "//input[@id='#{id}']", visible: false).set with
end end
def schedule_demo
t 'contract_templates.splash.actions.book_demo'
end
end end