Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Events categorised as "past" too soon #286

Closed
sophiedeziel opened this issue Mar 21, 2018 · 2 comments
Closed

Events categorised as "past" too soon #286

sophiedeziel opened this issue Mar 21, 2018 · 2 comments
Labels

Comments

@sophiedeziel
Copy link
Member

Events are defined as "past" when the start time is in the past. So, when a Meetup is scheduled at 18:30 PM and it's 18:31, it is already marked as past.

This is not very convenient on the home page, because the next event will show up first and people just a little bit late might be confused. Like thinking they are heading to the wrong venue.

With that in mind, I think there should be another special category: Today's event. I should be right on top, followed by next events (if any) and past events.

@opiation
Copy link
Contributor

If it helps any, I think there could be an easy win here to remain almost as elegant as partition from the home controller...

grouped_events = Event.published.includes(
  :translations,
  :location,
  :sponsors,
  talks: %i(member translations)
).order(:starts_at).limit(5).group_by do |event|
  if event.to_date < Date.today
    :past
  elsif event.to_date == Date.today
    :today
  else
    :future
  end
end
@todays_events, @past_events, @future_events = grouped_events.values_at(
  :today, :past, :future
)

...and then updating the view accordingly.

@shalstein
Copy link
Contributor

shalstein commented Jun 26, 2018

I made a PR that implements this feature:
#295

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants