From 1731f903df49c6f9f4b6f96f21f1c407d949b44e Mon Sep 17 00:00:00 2001 From: Martyn Whitwell Date: Thu, 11 Jul 2024 12:52:54 +0100 Subject: [PATCH] Content updates to event information page / prevent 2d scrolling (#4062) * Content updates to event information page reduce possibility for 2d scrolling * spec fixes * Remove CTA register button Temporary fix for 2D scroll issue --- app/views/teaching_events/show.html.erb | 2 +- .../show/_how-to-attend.html.erb | 41 ++++--------------- ...l.erb => _online-register-button.html.erb} | 0 .../show/_provider-info.html.erb | 19 +++++++-- .../show/_venue-information.html.erb | 5 --- spec/features/teaching_events/viewing_spec.rb | 14 +++---- 6 files changed, 28 insertions(+), 53 deletions(-) rename app/views/teaching_events/show/{_register-button.html.erb => _online-register-button.html.erb} (100%) diff --git a/app/views/teaching_events/show.html.erb b/app/views/teaching_events/show.html.erb index 887b16b965..f41d0b1971 100644 --- a/app/views/teaching_events/show.html.erb +++ b/app/views/teaching_events/show.html.erb @@ -11,7 +11,7 @@
<%= render(partial: 'teaching_events/show/date-and-time') %> <%= render(partial: 'teaching_events/show/location-and-setting') %> - <%= render(partial: 'teaching_events/show/register-button') if @event.allow_registration? %> + <%= render(partial: 'teaching_events/show/online-register-button') if @event.allow_registration? %>
<%= render(partial: 'teaching_events/show/event-image') %> diff --git a/app/views/teaching_events/show/_how-to-attend.html.erb b/app/views/teaching_events/show/_how-to-attend.html.erb index b89e050590..29f42344af 100644 --- a/app/views/teaching_events/show/_how-to-attend.html.erb +++ b/app/views/teaching_events/show/_how-to-attend.html.erb @@ -1,47 +1,20 @@ -<% - if @event.open? && [ - can_sign_up_online?(@event), - is_event_type?(@event, "School or University event"), - @event.provider_website_url, - @event.provider_contact_email - ].any? -%> +<% if @event.open? && can_sign_up_online?(@event) %>

How to attend

- <% if can_sign_up_online?(@event) %> - - <% if @event.in_person? %> + <% if @event.in_person? %>

Register for this event to secure your place and check in faster on arrival using a QR code.

- <% end %> - - <% if @event.online? %> -

- Register for this event and you'll receive joining - instructions via email. -

- + <% elsif @event.online? %>

- For the best experience when accessing this event, we recommend using Google Chrome on a laptop or desktop PC. + Register for this event and you'll receive joining instructions via email.

- <% end %> - - <%= render(partial: 'teaching_events/show/register-button') %> - <% elsif is_event_type?(@event, "School or University event") %>

- To register for this event, follow the instructions in the event information section. -

- <% elsif @event.provider_website_url %> -

- To attend this event, please <%= link_to("visit this website", @event.provider_website_url) %>. -

- <% elsif @event.provider_contact_email %> -

- To attend this event, please - <%= mail_to(@event.provider_contact_email, "email us") %>. + For the best experience when accessing this event, we recommend using Google Chrome on a laptop or desktop PC.

<% end %> + + <%= render(partial: 'teaching_events/show/online-register-button') %>
<% end %> diff --git a/app/views/teaching_events/show/_register-button.html.erb b/app/views/teaching_events/show/_online-register-button.html.erb similarity index 100% rename from app/views/teaching_events/show/_register-button.html.erb rename to app/views/teaching_events/show/_online-register-button.html.erb diff --git a/app/views/teaching_events/show/_provider-info.html.erb b/app/views/teaching_events/show/_provider-info.html.erb index ca639be849..cb329857ba 100644 --- a/app/views/teaching_events/show/_provider-info.html.erb +++ b/app/views/teaching_events/show/_provider-info.html.erb @@ -9,16 +9,27 @@

Provider information

<% if @event.provider_website_url %> -

Event website
<%= link_to(@event.provider_website_url, @event.provider_website_url, { target: "blank" }) %>

+

+ <%= link_to("Visit the event provider's website", @event.provider_website_url, { target: "blank" }) %>. +

<% end %> <% if @event.provider_target_audience %> -

Target audience
<%= @event.provider_target_audience %>

+

Target audience

+
+ <%= @event.provider_target_audience %> +
<% end %> <% if @event.provider_organiser %> -

Organiser
<%= @event.provider_organiser %>

+

Organiser

+
+ <%= @event.provider_organiser %> +
<% end %> <% if @event.provider_contact_email %> -

Contact email
<%= mail_to(@event.provider_contact_email) %>

+

Contact email

+
+ <%= mail_to(@event.provider_contact_email) %> +
<% end %> <% end %> diff --git a/app/views/teaching_events/show/_venue-information.html.erb b/app/views/teaching_events/show/_venue-information.html.erb index 83c1b71126..9b4d0ea8f3 100644 --- a/app/views/teaching_events/show/_venue-information.html.erb +++ b/app/views/teaching_events/show/_venue-information.html.erb @@ -9,11 +9,6 @@
  • <%= link_to("Open venue map in Google Maps", "https://maps.google.com/?q=#{event_address(@event)}", target: "blank") %>
  • - <% if display_event_provider_info?(@event) && @event.provider_website_url %> -
  • - <%= link_to("Visit venue website", @event.provider_website_url, { target: "blank" }) %> -
  • - <% end %> <% if @event.building.image_url %> diff --git a/spec/features/teaching_events/viewing_spec.rb b/spec/features/teaching_events/viewing_spec.rb index 7afebc8220..8685a39c27 100644 --- a/spec/features/teaching_events/viewing_spec.rb +++ b/spec/features/teaching_events/viewing_spec.rb @@ -78,8 +78,8 @@ within(".teaching-event__provider-information") do expect(page).to have_css("h2", text: "Provider information") - expect(page).to have_content("Event website") - expect(page).to have_link(event.provider_website_url) + expect(page).to have_content("Visit the event provider's website") + expect(page).to have_link(href: event.provider_website_url) expect(page).to have_content("Target audience") expect(page).to have_content(event.provider_target_audience) @@ -127,7 +127,7 @@ context "when it's a School or University event" do let(:event) { build(:event_api, :school_or_university_event, web_feed_id: nil) } - it { is_expected.to have_content("To register for this event, follow the instructions in the event information section.") } + it { is_expected.not_to have_css("h2", text: "How to attend") } it { is_expected.not_to have_link(register_link_text) } end @@ -136,18 +136,14 @@ let(:url) { "https://event-provider.com" } let(:event) { build(:event_api, :online_event, web_feed_id: nil, provider_website_url: url) } - it { is_expected.to have_content("To attend this event, please visit this website") } - it { is_expected.to have_link("visit this website", href: url) } - it { is_expected.not_to have_link(register_link_text) } + it { is_expected.to have_link("Visit the event provider's website", href: url) } end context "when the provider has an email address" do let(:email) { "events@event-provider.com" } let(:event) { build(:event_api, :online_event, web_feed_id: nil, provider_contact_email: email) } - it { is_expected.to have_content("To attend this event, please email us") } - it { is_expected.to have_link("email us", href: "mailto:" + email) } - it { is_expected.not_to have_link(register_link_text) } + it { is_expected.to have_link(email, href: "mailto:" + email) } end end end