Show tabs for upcoming and past events on the events page#465
Show tabs for upcoming and past events on the events page#465mu-tsu-mi wants to merge 12 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds dedicated “Upcoming Events” and “Past Events” index pages for the Melbourne site, and updates navigation to point users to these pages.
Changes:
- Added UpcomingEvents and PastEvents controllers with corresponding index views
- Updated Melbourne routes to expose upcoming/past event listing endpoints
- Added request specs (and a placeholder view spec) for the new pages, and updated the home page “All events” link target
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| sites/melbourne/spec/views/upcoming_events/index.html.erb_spec.rb | Adds a view spec file (currently only a pending placeholder) |
| sites/melbourne/spec/requests/upcoming_events_spec.rb | Adds request coverage for upcoming events index |
| sites/melbourne/spec/requests/past_events_spec.rb | Adds request coverage for past events index |
| sites/melbourne/config/routes/melbourne.rb | Adds routes for upcoming/past events pages |
| sites/melbourne/app/views/melbourne/upcoming_events/index.html.erb | Introduces upcoming events index UI and link to past events |
| sites/melbourne/app/views/melbourne/past_events/index.html.erb | Introduces past events index UI and link to upcoming events |
| sites/melbourne/app/views/melbourne/home/show.html.erb | Updates “All events” CTA to point to upcoming events |
| sites/melbourne/app/controllers/upcoming_events_controller.rb | Adds upcoming events controller action |
| sites/melbourne/app/controllers/past_events_controller.rb | Adds past events controller action |
| module Melbourne | ||
| class UpcomingEventsController < ApplicationController | ||
| def index | ||
| @events = Event.upcoming | ||
| end |
There was a problem hiding this comment.
As discussed, I didn't change this.
| module Melbourne | ||
| class PastEventsController < ApplicationController | ||
| def index | ||
| @events = Event.past | ||
| end |
There was a problem hiding this comment.
As discussed, I didn't change this too.
| let(:events) { Melbourne::Event.upcoming } | ||
|
|
||
| before do | ||
| allow(Melbourne::Event).to receive(:upcoming).and_return(events) | ||
| end |
There was a problem hiding this comment.
I fixed this by creating a list of events.
| let(:events) { Melbourne::Event.past } | ||
|
|
||
| before do | ||
| allow(Melbourne::Event).to receive(:past).and_return(events) | ||
| end |
There was a problem hiding this comment.
I fixed this by creating a list of events.
| get "/events/upcoming", to: "upcoming_events#index" | ||
| resources :upcoming_events, only: %i[index] | ||
|
|
||
| get "/events/past", to: "past_events#index" | ||
| resources :past_events, only: %i[index] |
There was a problem hiding this comment.
I removed get "/events/upcoming", to: "upcoming_events#index" and am keeping resources. I'm not sure if I fixed this properly. Please let me know if there is a better way of handling this.
| require 'rails_helper' | ||
|
|
||
| RSpec.describe "upcoming_events/index.html.erb", type: :view do | ||
| pending "add some examples to (or delete) #{__FILE__}" |
| @@ -42,7 +42,7 @@ | |||
| </div> | |||
| <div> | |||
| <%= link_to "All events", | |||
| <div class="font-bold py-2 border-b-3 border-b-[#0025CA] text-gray-500">Upcoming Events</div> | ||
| <div class="flex cursor-pointer rounded-md text-gray-500 hover:bg-[var(--code-off-white)] hover:text-gray-400"> | ||
| <%= link_to "Past Events", melbourne_past_events_path, class:"px-8 py-2" %> | ||
| </div> |
There was a problem hiding this comment.
I fixed styling so link_to has hover setting and cursor pointer.
| <div class="flex cursor-pointer rounded-md text-gray-500 hover:bg-[var(--code-off-white)] hover:text-gray-400"> | ||
| <%= link_to "Upcoming Events", melbourne_upcoming_events_path, class:"px-8 py-2" %> | ||
| </div> | ||
| <div class="font-bold py-2 border-b-3 border-b-[#0025CA] text-gray-500">Past Events</div> |
There was a problem hiding this comment.
Fixed this in the same manner as the issue above (i.e. upcoming view).
|
I left a comment for each copilot suggestion. Please review the changes. |
HashNotAdam
left a comment
There was a problem hiding this comment.
Thank you so much, @mu-tsu-mi, this is going to be extremely helpful to me when planning the upcoming meetups
I added upcoming and past events tabs for the Melbourne site. Please refer below and review this request.
Scope: Melbourne site
Change: Added upcoming and past events tabs and new controllers for these listings and test for the controllers. I didn't modify the model.
Reason of the change: Easier navigation to upcoming/past events compared to all events listing
The related issue is here: Showing separate events list for future and past events #463 (comment)
UI Screenshots:

Upcoming Events Listing
Past Events Listing
