-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add conference speakers page * Use Turbo Frame to navigate between subpages * Tweak Frame Navigation, add kind titles, group by kind on speaker page, remove hero banner flicker * Update Q&A and AMA kind matching * Fix `Heroes` spelling * Make sure speakers are uniq per kind * Add interview kind to speakers index
- Loading branch information
Showing
14 changed files
with
166 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
class Events::SpeakersController < ApplicationController | ||
skip_before_action :authenticate_user!, only: %i[index] | ||
before_action :set_event, only: %i[index] | ||
|
||
def index | ||
end | ||
|
||
private | ||
|
||
def set_event | ||
@event = Event.includes(:organisation, talks: {speakers: :user}).find_by!(slug: params[:event_slug]) | ||
|
||
redirect_to schedule_event_path(@event.canonical), status: :moved_permanently if @event.canonical.present? | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<div class="w-full md:h-[198px] lg:h-[267px] xl:h-[336px] 2xl:h-[405px] justify-center align-center flex mt-3 border-t border-b" style="view-transition-name: hero; background: <%= event.banner_background %>"> | ||
<%= image_tag image_path(@event.banner_image_path), class: "w-full md:container" %> | ||
</div> | ||
|
||
<div class="container py-8"> | ||
<div class="block lg:flex gap-8 align-center justify-between"> | ||
<div class="flex flex-col lg:flex-row gap-8 items-center lg:justify-right text-center lg:text-left mb-6 lg:mb-0"> | ||
<%= image_tag image_path(event.avatar_image_path), | ||
class: "rounded-full border border-[#D9DFE3] size-24 md:size-36", | ||
alt: "#{event.name} Avatar", | ||
style: "view-transition-name: avatar", | ||
loading: :lazy %> | ||
|
||
<div class="flex-col flex justify-center"> | ||
<h1 class="mb-2 text-black font-bold" style="view-transition-name: title"><%= event.name %></h1> | ||
<h3 class="text-[#636B74]"><%= event.location %> • <%= event.formatted_dates %></h3> | ||
</div> | ||
</div> | ||
|
||
<div class="flex flex-col gap-3 place-items-center"> | ||
<%= link_to "Visit Website", event.organisation.website, class: "btn btn-primary w-full", target: "_blank" %> | ||
<%= link_to "View all #{event.organisation.name} events", event.organisation, class: "btn w-full" %> | ||
</div> | ||
</div> | ||
|
||
<p class="mt-6 text-[#636B74] max-w-[700px]"> | ||
<%= event.description %> | ||
</p> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<div role="tablist" class="mb-12 tabs tabs-bordered"> | ||
<%= active_link_to "Talks", event_path(event), class: "tab", active_class: "tab-active", role: "tab" %> | ||
<%= active_link_to "Speakers", event_speakers_path(event), class: "tab", active_class: "tab-active", role: "tab" %> | ||
<% if false %> | ||
<a role="tab" class="tab">Schedule</a> | ||
<a role="tab" class="tab">Organizers</a> | ||
<a role="tab" class="tab">Photos</a> | ||
<a role="tab" class="tab">Sponsors</a> | ||
<% end %> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,79 +1,40 @@ | ||
<%= turbo_refreshes_with method: :morph, scroll: :preserve %> | ||
|
||
<div class="w-full max-h-92 justify-center align-center flex mt-3 border-t border-b" style="view-transition-name: hero; background: <%= @event.banner_background %>"> | ||
<%= image_tag image_path(@event.banner_image_path), class: "w-full max-h- aspect-auto container" %> | ||
</div> | ||
|
||
<div class="container py-8"> | ||
<div class="block lg:flex gap-8 align-center justify-between"> | ||
<div class="flex flex-col lg:flex-row gap-8 items-center lg:justify-right text-center lg:text-left mb-6 lg:mb-0"> | ||
<%= image_tag image_path(@event.avatar_image_path), | ||
class: "rounded-full border border-[#D9DFE3] size-24 md:size-36", | ||
alt: "#{@event.name} Avatar", | ||
style: "view-transition-name: avatar", | ||
loading: :lazy %> | ||
|
||
<div class="flex-col flex justify-center"> | ||
<h1 class="mb-2 text-black font-bold"><%= @event.name %></h1> | ||
<h3 class="text-[#636B74]"><%= @event.location %> • <%= @event.formatted_dates %></h3> | ||
</div> | ||
</div> | ||
|
||
<div class="flex flex-col gap-3 place-items-center"> | ||
<%= link_to "Visit Website", @event.website, class: "btn btn-primary w-full", target: "_blank" %> | ||
<%= link_to "View all #{@event.organisation.name} events", @event.organisation, class: "btn w-full" %> | ||
</div> | ||
</div> | ||
|
||
<p class="mt-6 text-[#636B74] max-w-[700px]"> | ||
<%= @event.description %> | ||
</p> | ||
|
||
<% if false %> | ||
<div role="tablist" class="mt-12 tabs tabs-bordered"> | ||
<a role="tab" class="tab tab-active">Talks</a> | ||
<a role="tab" class="tab">Schedule</a> | ||
<a role="tab" class="tab">Speakers</a> | ||
<a role="tab" class="tab">Organizers</a> | ||
<a role="tab" class="tab">Photos</a> | ||
<a role="tab" class="tab">Sponsors</a> | ||
</div> | ||
<% end %> | ||
</div> | ||
|
||
<div class="container py-8"> | ||
|
||
<div class="flex items-start flex-wrap gap-8 sm:flex-nowrap w-full"> | ||
<div class="w-full"> | ||
<div id="talks" class="min-w-full grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-8 h-full"> | ||
<%= render partial: "talks/card", | ||
collection: @talks, | ||
locals: { | ||
favoritable: true, | ||
user_favorite_talks_ids: @user_favorite_talks_ids, | ||
watched_talks_ids: user_watched_talks_ids, | ||
back_to: request.fullpath, | ||
back_to_title: @event.name | ||
}, | ||
as: :talk %> | ||
</div> | ||
<%= render partial: "header", locals: {event: @event} %> | ||
<%= turbo_frame_tag dom_id(@event), data: {turbo_action: "advance", turbo_frame: "_top"} do %> | ||
<div class="container py-8"> | ||
<%= render partial: "navigation", locals: {event: @event} %> | ||
|
||
<div class="flex items-start flex-wrap gap-8 sm:flex-nowrap w-full"> | ||
<div class="w-full"> | ||
<div id="talks" class="min-w-full grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-8 h-full"> | ||
<%= render partial: "talks/card", | ||
collection: @talks, | ||
locals: { | ||
favoritable: true, | ||
user_favorite_talks_ids: @user_favorite_talks_ids, | ||
back_to: request.fullpath, | ||
back_to_title: @event.name | ||
}, | ||
as: :talk %> | ||
</div> | ||
|
||
<% if @talks.empty? %> | ||
<div class="flex justify-center border rounded" style="padding-top: 3rem; padding-bottom: 3rem; padding-right: 1rem; padding-left: 1rem"> | ||
<div class="text-center text-gray-600"> | ||
<p> | ||
<b>No talks found for this event.</b> | ||
</p> | ||
<p class="mt-2"> | ||
Please | ||
<a href="https://github.com/adrienpoly/rubyvideo/issues/new?title=<%= CGI.escape("#{@event.name} Recordings") %>&body=<%= CGI.escape("<!-- Your Content Here -->\n\nIssue opened from event page: #{event_url(@event)}") %>" class="text-primary" target="_blank">open an issue on GitHub</a> | ||
if you know how to get access to the recordings of this event. Thank you! | ||
</p> | ||
<% if @talks.empty? %> | ||
<div class="flex justify-center border rounded" style="padding-top: 3rem; padding-bottom: 3rem; padding-right: 1rem; padding-left: 1rem"> | ||
<div class="text-center text-gray-600"> | ||
<p> | ||
<b>No talks found for this event.</b> | ||
</p> | ||
<p class="mt-2"> | ||
Please | ||
<a href="https://github.com/adrienpoly/rubyvideo/issues/new?title=<%= CGI.escape("#{@event.name} Recordings") %>&body=<%= CGI.escape("<!-- Your Content Here -->\n\nIssue opened from event page: #{event_url(@event)}") %>" class="text-primary" target="_blank">open an issue on GitHub</a> | ||
if you know how to get access to the recordings of this event. Thank you! | ||
</p> | ||
</div> | ||
</div> | ||
</div> | ||
<% end %> | ||
<% end %> | ||
<%== pagy_nav(@pagy) if @pagy.pages > 1 %> | ||
<%== pagy_nav(@pagy) if @pagy.pages > 1 %> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<%= render partial: "events/header", locals: {event: @event} %> | ||
<%= turbo_frame_tag dom_id(@event), data: {turbo_action: "advance", turbo_frame: "_top"} do %> | ||
<div class="container py-8"> | ||
<%= render partial: "events/navigation", locals: {event: @event} %> | ||
|
||
<div class="flex items-start flex-wrap gap-8 sm:flex-nowrap w-full"> | ||
<div class="w-full"> | ||
<% titles = { | ||
keynote: "Keynote Speaker", | ||
talk: "Speaker", | ||
lightning_talk: "Lightning Talk Speaker", | ||
panel: "Panelist", | ||
discussion: "Panelist", | ||
gameshow: "Game Show Host", | ||
workshop: "Workshop Instructor", | ||
podcast: "Podcast Host/Participant", | ||
q_and_a: "Q&A Host/Participant", | ||
fireside_chat: "Fireside Chat Host/Participant", | ||
interview: "Interviewer/Interviewee", | ||
award: "Award Presenter/Winner" | ||
} %> | ||
<% grouped = @event.talks.flat_map { |talk| talk.speakers.map { |speaker| [talk.kind, speaker] } }.group_by(&:first).transform_values(&:uniq).sort_by { |kind, _speakers| Talk.kinds.values.index(kind) } %> | ||
<% grouped.each do |kind, speakers| %> | ||
<h2 class="mb-6"><%= titles[kind.to_sym].pluralize(speakers.count) %></h2> | ||
|
||
<div id="keynote-speakers" class="mb-12 min-w-full grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 h-full"> | ||
<% speakers.each do |kind, speaker| %> | ||
<div class="border rounded-lg bg-white hover:bg-gray-200 transition-bg duration-300 ease-in-out"> | ||
<%= render partial: "talks/speaker", locals: {speaker: speaker} %> | ||
</div> | ||
<% end %> | ||
</div> | ||
<% end %> | ||
</div> | ||
</div> | ||
</div> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters