diff --git a/app/controllers/task_requests_controller.rb b/app/controllers/task_requests_controller.rb index 07172d0..81723d0 100644 --- a/app/controllers/task_requests_controller.rb +++ b/app/controllers/task_requests_controller.rb @@ -4,6 +4,7 @@ class TaskRequestsController < ApplicationController before_action :set_project before_action :build_task_request, only: [:new, :create] before_action :set_task_request, only: [:show, :edit, :update, :cancel] + before_action :show_splash_screen, only: :index def index @task_requests = task_requests.order_by_recent.paginate(page: params[:page]) @@ -46,6 +47,10 @@ class TaskRequestsController < ApplicationController private + def show_splash_screen + render :splash if task_requests.count.zero? + end + def task_request_params params.require(:task_request).permit(:description, :deadline, :time_allowed, :additional_notes, 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/task_requests/splash.html.erb b/app/views/task_requests/splash.html.erb new file mode 100644 index 0000000..98d626f --- /dev/null +++ b/app/views/task_requests/splash.html.erb @@ -0,0 +1,58 @@ +
+
+ <%= product_wordmark :task_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(TaskRequest).new? %> + <%= link_to t(".actions.create_task_request"), [:new, @project, :task_request], class: "btn btn-success border align-self-center h-50 pb-2" %> + <% end %> +
+ +
+ +
+
+
+
+
+
+ + + + + + +
+ Video tutorial will be available soon +
+
+
+
+
+
+
+
+

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

+
    +
  1. <%= t '.list_items.enter_task_request' %>
  2. +
  3. <%= t '.list_items.state_deadline' %>
  4. +
  5. <%= t '.list_items.enter_number_of_hours' %>
  6. +
  7. <%= t '.list_items.virtual_assistant_delivers_task' %>
  8. +
+
+
+
+
+

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

+
    + <%= content_tag(:li, fa_icon("check li", text: t('.list_items.reduces_need_for_full_time_staff'))) %> + <%= content_tag(:li, fa_icon("check li", text: t('.list_items.reduces_workload'))) %> + <%= content_tag(:li, fa_icon("check li", text: t('.list_items.spend_per_task'))) %> +
+
+
+
+
+
diff --git a/config/locales/en.yml b/config/locales/en.yml index cc28c89..ac37dd6 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. @@ -1202,6 +1202,23 @@ en: heading: New Task Request show: empty: Attached files will appear here. + splash: + actions: + book_demo: Schedule a Demo + create_task_request: Create Task Request + headings: + benefits: Benefits + how_it_works: How It Works + subtitle: Pay-by-the-hour, digitally-enabled remote assistants + welcome: Welcome to + list_items: + enter_number_of_hours: Enter the number of hours you want the task worked on + enter_task_request: Enter your task request + reduces_need_for_full_time_staff: Reduces need to hire full-time staff + reduces_workload: Reduces workload for current staff + spend_per_task: Spend as little as $60 per task + state_deadline: State your deadline + virtual_assistant_delivers_task: Virtual assistant delivers task via TaskME portal task_request: actions: manage: Manage diff --git a/config/locales/es.yml b/config/locales/es.yml index 3384431..72ad5aa 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -358,6 +358,23 @@ es: index: table_headers: task_request_description: Description (ES) + splash: + actions: + book_demo: Schedule a Demo (ES) + create_task_request: Create Task Request + headings: + benefits: Benefits (ES) + how_it_works: How It Works (ES) + subtitle: Pay-by-the-hour, digitally-enabled remote assistants (ES) + welcome: Welcome to (ES) + list_items: + enter_number_of_hours: Enter the number of hours you want the task worked on (ES) + enter_task_request: Enter your task request (ES) + reduces_need_for_full_time_staff: Reduces need to hire full-time staff (ES) + reduces_workload: Reduces workload for current staff (ES) + spend_per_task: Spend as little as $60 per task (ES) + state_deadline: State your deadline (ES) + virtual_assistant_delivers_task: Virtual assistant delivers task via TaskME portal (ES) task_request: actions: manage: Manage (ES) diff --git a/spec/controllers/task_requests_controller_spec.rb b/spec/controllers/task_requests_controller_spec.rb index 614d814..22df666 100644 --- a/spec/controllers/task_requests_controller_spec.rb +++ b/spec/controllers/task_requests_controller_spec.rb @@ -18,7 +18,14 @@ RSpec.describe TaskRequestsController, type: :controller do expect(response).to be_successful end - it "renders content" do + it "renders splash page if there are no task requests" do + get :index, params: { project_id: project } + + expect(response.body).to have_link "Create Task Request" + expect(response.body).to have_link schedule_demo + end + + it "renders task requests table if there are task requests" do create(:task_request, project: project, description: "Another Request") get :index, params: { project_id: project } @@ -126,4 +133,8 @@ RSpec.describe TaskRequestsController, type: :controller do def update_params { description: "This is updated description" } end + + def schedule_demo + t 'task_requests.splash.actions.book_demo' + end end diff --git a/spec/features/user_managing_task_requests_spec.rb b/spec/features/user_managing_task_requests_spec.rb index 80c4f1c..c40cd88 100644 --- a/spec/features/user_managing_task_requests_spec.rb +++ b/spec/features/user_managing_task_requests_spec.rb @@ -8,7 +8,14 @@ feature "User managing task requests" do sign_in current_user end + scenario "splash page is shown if there are no task requests" do + visit project_task_requests_path(project) + + expect(page).to have_content schedule_demo + end + scenario "task requests table is visible" do + create(:task_request, project: project, description: 'Short Desc') visit project_task_requests_path(project) expect(page).to have_content "Created On" @@ -19,10 +26,6 @@ feature "User managing task requests" do end scenario "sees list of task requests" do - visit project_task_requests_path(project) - - expect(page).to have_content no_task_requests_label - task_request = create(:task_request, project: project) visit project_task_requests_path(project) @@ -113,4 +116,8 @@ feature "User managing task requests" do def long_description_text 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.' end + + def schedule_demo + t 'task_requests.splash.actions.book_demo' + end end