Skip to content

Commit

Permalink
Content updates to event information page / prevent 2d scrolling (#4062)
Browse files Browse the repository at this point in the history
* Content updates to event information page

reduce possibility for 2d scrolling

* spec fixes

* Remove CTA register button

Temporary fix for 2D scroll issue
  • Loading branch information
martyn-w authored Jul 11, 2024
1 parent 05fc075 commit 1731f90
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 53 deletions.
2 changes: 1 addition & 1 deletion app/views/teaching_events/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<div class="event-details">
<%= 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? %>
</div>

<%= render(partial: 'teaching_events/show/event-image') %>
Expand Down
41 changes: 7 additions & 34 deletions app/views/teaching_events/show/_how-to-attend.html.erb
Original file line number Diff line number Diff line change
@@ -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) %>
<section class="teaching-event__how-to-attend">
<h2>How to attend</h2>

<% if can_sign_up_online?(@event) %>
<% if @event.in_person? %>
<% if @event.in_person? %>
<p>
Register for this event to secure your place and check in faster on arrival using a QR code.
</p>
<% end %>
<% if @event.online? %>
<p>
Register for this event and you'll receive joining
instructions via email.
</p>

<% elsif @event.online? %>
<p>
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.
</p>
<% end %>
<%= render(partial: 'teaching_events/show/register-button') %>
<% elsif is_event_type?(@event, "School or University event") %>
<p>
To register for this event, follow the instructions in the event information section.
</p>
<% elsif @event.provider_website_url %>
<p>
To attend this event, please <%= link_to("visit this website", @event.provider_website_url) %>.
</p>
<% elsif @event.provider_contact_email %>
<p>
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.
</p>
<% end %>
<%= render(partial: 'teaching_events/show/online-register-button') %>
</section>
<% end %>
19 changes: 15 additions & 4 deletions app/views/teaching_events/show/_provider-info.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,27 @@
<h2>Provider information</h2>

<% if @event.provider_website_url %>
<p><strong>Event website</strong><br><%= link_to(@event.provider_website_url, @event.provider_website_url, { target: "blank" }) %><em class="icon"></em></p>
<p>
<%= link_to("Visit the event provider's website", @event.provider_website_url, { target: "blank" }) %>.
</p>
<% end %>
<% if @event.provider_target_audience %>
<p><strong>Target audience</strong><br><%= @event.provider_target_audience %></p>
<h4 class="heading--margin-bottom-0">Target audience</h4>
<div>
<%= @event.provider_target_audience %>
</div>
<% end %>
<% if @event.provider_organiser %>
<p><strong>Organiser</strong><br><%= @event.provider_organiser %></p>
<h4 class="heading--margin-bottom-0">Organiser</h4>
<div>
<%= @event.provider_organiser %>
</div>
<% end %>
<% if @event.provider_contact_email %>
<p><strong>Contact email</strong><br><%= mail_to(@event.provider_contact_email) %></p>
<h4 class="heading--margin-bottom-0">Contact email</h4>
<div>
<%= mail_to(@event.provider_contact_email) %>
</div>
<% end %>
</section>
<% end %>
5 changes: 0 additions & 5 deletions app/views/teaching_events/show/_venue-information.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@
<li>
<%= link_to("Open venue map in Google Maps", "https://maps.google.com/?q=#{event_address(@event)}", target: "blank") %>
</li>
<% if display_event_provider_info?(@event) && @event.provider_website_url %>
<li>
<%= link_to("Visit venue website", @event.provider_website_url, { target: "blank" }) %>
</li>
<% end %>
</ul>

<% if @event.building.image_url %>
Expand Down
14 changes: 5 additions & 9 deletions spec/features/teaching_events/viewing_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand All @@ -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
Expand Down

0 comments on commit 1731f90

Please sign in to comment.