diff --git a/app/controllers/speakers_controller.rb b/app/controllers/speakers_controller.rb index c3ee3de80..780c338a0 100644 --- a/app/controllers/speakers_controller.rb +++ b/app/controllers/speakers_controller.rb @@ -23,6 +23,14 @@ def index def show @talks = @speaker.talks.with_essential_card_data.order(date: :desc) @back_path = speakers_path + + @grouped_talks = @talks.group_by { |talk| talk.groupable_title.downcase }.map { |title, talks| [talks.first.groupable_title, talks] }.to_h + + @ungrouped_by_year = @grouped_talks.select { |title, talks| talks.count == 1 }.values.flatten.group_by { |talk| "#{talk.date.year} talks" } + @grouped_talks = @grouped_talks.reject { |_title, talks| talks.count == 1 } + + @grouped_talks = (@ungrouped_by_year.to_a + @grouped_talks.to_a).to_h.sort_by { |_title, talks| -talks.map(&:date).max.to_time.to_i } + set_meta_tags(@speaker) # fresh_when(@speaker) end diff --git a/app/models/talk.rb b/app/models/talk.rb index bdd278f2c..14f1d8a82 100644 --- a/app/models/talk.rb +++ b/app/models/talk.rb @@ -175,6 +175,18 @@ def related_talks(limit: 6) Talk.where(id: ids) end + def groupable_title + prefixes = ["Keynote", "Opening Keynote", "Closing Keynote", "Lightning Talks"] + + return "#{title} - #{event.name}" if title.in?(prefixes) + + title.dup.tap do |t| + prefixes.each do |prefix| + t.delete_prefix!("#{prefix}: ") + end + end + end + def transcript enhanced_transcript.presence || raw_transcript end diff --git a/app/views/speakers/_talks.html.erb b/app/views/speakers/_talks.html.erb new file mode 100644 index 000000000..89cf47be7 --- /dev/null +++ b/app/views/speakers/_talks.html.erb @@ -0,0 +1,15 @@ +

<%= title %>

+ +
+ <%= render( + partial: "talks/card", + collection: talks, + as: :talk, + locals: { + favoritable: true, + user_favorite_talks_ids: user_favorite_talks_ids, + back_to: request.fullpath, + back_to_title: speaker.name + } + ) %> +
diff --git a/app/views/speakers/show.html.erb b/app/views/speakers/show.html.erb index 81c3e5ffb..1e3f9f733 100644 --- a/app/views/speakers/show.html.erb +++ b/app/views/speakers/show.html.erb @@ -30,17 +30,23 @@
-
- <%= render partial: "talks/card", - collection: @talks, - as: :talk, - locals: { - favoritable: true, - user_favorite_talks_ids: @user_favorite_talks_ids, - back_to: request.fullpath, - back_to_title: @speaker.name - } %> -
+ <% if @grouped_talks.any? %> +
+ +
+ <% @grouped_talks.each do |title, talks| %> + <%= render partial: "talks", locals: {title: title, talks: talks, speaker: @speaker, user_favorite_talks_ids: @user_favorite_talks_ids} %> + <% end %> +
+ + +
+ <%= render partial: "talks", locals: {talks: @talks, speaker: @speaker, user_favorite_talks_ids: @user_favorite_talks_ids} %> +
+
+ <% else %> + <%= render partial: "talks", locals: {talks: @talks, speaker: @speaker, user_favorite_talks_ids: @user_favorite_talks_ids} %> + <% end %>
diff --git a/data/balkanruby/balkanruby-2019/videos.yml b/data/balkanruby/balkanruby-2019/videos.yml index 7a826359f..c23779c53 100644 --- a/data/balkanruby/balkanruby-2019/videos.yml +++ b/data/balkanruby/balkanruby-2019/videos.yml @@ -5,7 +5,7 @@ # TODO: conference website # TODO: schedule website -- title: 'Compacting GC for MRI' +- title: 'Compacting GC for MRI in Ruby 2.7' raw_title: Balkan Ruby 2019 – Aaron Patterson – Compacting GC for MRI speakers: - Aaron Patterson @@ -41,7 +41,7 @@ description: '' video_id: QMhgm9ir8js -- title: 'The Past, Present and Future of Rails at GitHub' +- title: 'The Past, Present, and Future of Rails at GitHub' raw_title: Balkan Ruby 2019 – Eileen Uchitelle – The Past, Present and Future of Rails at GitHub speakers: - Eileen M. Uchitelle diff --git a/data/balkanruby/balkanruby-2024/videos.yml b/data/balkanruby/balkanruby-2024/videos.yml index 443584d3f..683e63bd1 100644 --- a/data/balkanruby/balkanruby-2024/videos.yml +++ b/data/balkanruby/balkanruby-2024/videos.yml @@ -92,7 +92,7 @@ Join him on a journey to explore the use-cases and benefits of running SQLite in a production environment. video_id: 7QMYfpU6_-s -- title: 'The history of a Rails monolith' +- title: '2000 Engineers, 2 Millions Lines of Code: The History of a Rails Monolith' raw_title: Cristian Planas & Anatoly Mikhaylov – The history of a Rails monolith speakers: - Cristian Planas diff --git a/data/balticruby/balticruby-2024/videos.yml b/data/balticruby/balticruby-2024/videos.yml index 466d5715d..848a9d4be 100644 --- a/data/balticruby/balticruby-2024/videos.yml +++ b/data/balticruby/balticruby-2024/videos.yml @@ -42,7 +42,7 @@ data integrity, efficiency and performance along the way! video_id: xa9ixrLU7X4 -- title: "2000 engineers, 2 millions lines of code: the history of a Rails monolith" +- title: "2000 Engineers, 2 Millions Lines of Code: The History of a Rails Monolith" raw_title: '"2000 engineers, 2 millions lines of code: the history of a Rails monolith"' speakers: - Cristian Planas @@ -173,7 +173,7 @@ problems along the way. video_id: mZzIJ4QpQck -- title: "Keynote: Second system syndrome" +- title: "Keynote: Second System Syndrome" raw_title: '"Second system syndrome"' speakers: - Yukihiro "Matz" Matsumoto diff --git a/data/euruko/euruko-2023/videos.yml b/data/euruko/euruko-2023/videos.yml index 488768af7..9ac47e8ef 100644 --- a/data/euruko/euruko-2023/videos.yml +++ b/data/euruko/euruko-2023/videos.yml @@ -160,7 +160,7 @@ description: "" video_id: 79LN5Sn4Nac -- title: "Panel: 30 years of Ruby" +- title: "Panel: 30 Years of Ruby" raw_title: Panel discussion "30 years of Ruby" speakers: - James Bell diff --git a/data/pivorak/pivorak-conf-3/videos.yml b/data/pivorak/pivorak-conf-3/videos.yml index 99a623e71..1181b409b 100644 --- a/data/pivorak/pivorak-conf-3/videos.yml +++ b/data/pivorak/pivorak-conf-3/videos.yml @@ -23,7 +23,7 @@ benefits: https://bit.ly/313cImj" video_id: vKN3v3omJqM -- title: Do You Need That Validation? +- title: Do You Need That Validation? Let Me Call You Back About It raw_title: Do You Need That Validation? - Tobias Pfeiffer speakers: - Tobias Pfeiffer @@ -47,7 +47,7 @@ benefits: https://bit.ly/313cImj" video_id: Bm7XpipPU9g -- title: 'Compacting GC in Ruby 2.7' +- title: 'Compacting GC for MRI in Ruby 2.7' raw_title: Compacting GC in Ruby 2.7 - Aaron Patterson speakers: - Aaron Patterson diff --git a/data/railsconf/railsconf-2017/videos.yml b/data/railsconf/railsconf-2017/videos.yml index 5e32b61b2..8aecdd530 100644 --- a/data/railsconf/railsconf-2017/videos.yml +++ b/data/railsconf/railsconf-2017/videos.yml @@ -53,7 +53,7 @@ description: 'RailsConf 2017: Opening Keynote by David Heinemeier Hansson' video_id: Cx6aGMC6MjU -- title: "Building Rails ActionDispatch::SystemTestCase Framework" +- title: "Building the Rails ActionDispatch::SystemTestCase Framework" raw_title: 'RailsConf 2017: Building Rails ActionDispatch::SystemTestCase Framework by Eileen Uchitelle' speakers: - Eileen M. Uchitelle diff --git a/data/railsconf/railsconf-2021/videos.yml b/data/railsconf/railsconf-2021/videos.yml index 12cc4e1ad..db97fbf74 100644 --- a/data/railsconf/railsconf-2021/videos.yml +++ b/data/railsconf/railsconf-2021/videos.yml @@ -1242,7 +1242,7 @@ After a quick recap of the fundamentals, you'll learn the procedural, technical and human factors that can affect the trustworthiness of a test. More importantly, I'll show you how to mitigate these issues with easy, actionable tips that will have you A/B testing accurately in no time! video_id: IsgQ9RJ0rJE -- title: The Rising Storm of Ethics in Open Source +- title: The Rising Ethical Storm in Open Source raw_title: "RailsConf 2021: The Rising Storm of Ethics in Open Source - Coraline Ada Ehmke" speakers: - Coraline Ada Ehmke diff --git a/data/ruby-warsaw-community-conference/ruby-warsaw-community-conference-summer-edition-2024/videos.yml b/data/ruby-warsaw-community-conference/ruby-warsaw-community-conference-summer-edition-2024/videos.yml index d72cfec06..276a1add7 100644 --- a/data/ruby-warsaw-community-conference/ruby-warsaw-community-conference-summer-edition-2024/videos.yml +++ b/data/ruby-warsaw-community-conference/ruby-warsaw-community-conference-summer-edition-2024/videos.yml @@ -28,7 +28,7 @@ https://github.com/visualitypl" video_id: TDQ2wtmgeKw -- title: '2000 Engineers, 2 millions lines of code: The history of a Rails monolith' +- title: '2000 Engineers, 2 Millions Lines of Code: The History of a Rails Monolith' raw_title: "[EN] 2000 Engineers, 2 millions lines of code: The history of a Rails monolith - Cristian Planas" speakers: - Cristian Planas diff --git a/data/rubyconf/rubyconf-2015/videos.yml b/data/rubyconf/rubyconf-2015/videos.yml index 580f708be..4c70360a4 100644 --- a/data/rubyconf/rubyconf-2015/videos.yml +++ b/data/rubyconf/rubyconf-2015/videos.yml @@ -235,7 +235,7 @@ Your code is your partner. It struggles against you, but also alongside you. Your code comes to you as it is, not as you wish it were. Like a real-life partner, it has a history that you’ll never fully know; like a real-life child, it bears your imprint, but it is wild, unruly, and fiercely self-sovereign. You’ll never stop working with code that’s hard to figure out or difficult to change. But this code, this stubborn creature, is entrusted to you. Let go of your anger at the developer who wrote it. Let go of the terror of being blamed for its unforeseeable regressions. Let go--and find joy. video_id: JC4mS7sYQlU -- title: How does Bundler work, anyway? +- title: How Does Bundler Work, Anyway? raw_title: RubyConf 2015 - How does Bundler work, anyway? by Andre Arko speakers: - André Arko diff --git a/data/rubyconf/rubyconf-2019/videos.yml b/data/rubyconf/rubyconf-2019/videos.yml index a6e4fb6ab..bb40ef56d 100644 --- a/data/rubyconf/rubyconf-2019/videos.yml +++ b/data/rubyconf/rubyconf-2019/videos.yml @@ -1068,7 +1068,7 @@ so I'll try to explain it by emoji\n\n\n\n#confreaks #rubyconf2019" video_id: SzgmcVN7qu4 -- title: Compacting Heaps in Ruby 2.7 +- title: Compacting GC for MRI in Ruby 2.7 raw_title: RubyConf 2019 - Compacting Heaps in Ruby 2.7 by Aaron Patterson speakers: - Aaron Patterson diff --git a/data/rubyconf/rubyconf-2021/videos.yml b/data/rubyconf/rubyconf-2021/videos.yml index 4f96ab5d9..75988675d 100644 --- a/data/rubyconf/rubyconf-2021/videos.yml +++ b/data/rubyconf/rubyconf-2021/videos.yml @@ -1238,7 +1238,7 @@ description: "" video_id: cWzsmOw-AFw -- title: "Keynote: Beyond Ruby3.0" +- title: "Keynote: Beyond Ruby 3.0" raw_title: "RubyConf 2021 - Keynote: Beyond Ruby3.0 by Yukihiro (Matz) Matsumoto" speakers: - Yukihiro "Matz" Matsumoto diff --git a/data/rubyday/rubyday-2021/videos.yml b/data/rubyday/rubyday-2021/videos.yml index c8699c9b8..8de80ad29 100644 --- a/data/rubyday/rubyday-2021/videos.yml +++ b/data/rubyday/rubyday-2021/videos.yml @@ -77,7 +77,7 @@ 7th 2021. \n\nSpeaker and details on https://2021.rubyday.it/" video_id: OevCwq5I9fM -- title: "Ruby 3.0 and Beyond" +- title: "Ruby 3 and Beyond" raw_title: Ruby3.0 and Beyond - Yukihiro "Matz" Matsumoto - rubyday 2021 speakers: - Yukihiro "Matz" Matsumoto