Skip to content

Commit

Permalink
Fix sorting on Tour page
Browse files Browse the repository at this point in the history
  • Loading branch information
jcraigk committed Oct 19, 2023
1 parent 6555fd2 commit 24de9ba
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions app/controllers/concerns/ambiguity/tour_name.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ def tour
end

def hydrate_tour_page
@ogp_title = "Listen to shows from #{@tour.name}"
@shows = @tour.shows.sort_by(&:date).reverse
@ogp_title = "Listen to shows from #{tour.name}"
@shows = tour.shows.order(@order_by)
@shows_likes = user_likes_for_shows(@shows)
@sections = sections
@title = @tour.name
@sections = tour_sections
@title = tour.name
@view = 'shows/index'
end

def sections
def tour_sections
{
@tour.name => {
tour.name => {
shows: @shows,
likes: @shows_likes
}
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/sort_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def sort_songs_title(items)
def show_sort_items
{
'<i class="glyphicon glyphicon-time"></i> Reverse Date' => 'date desc',
'<i class="glyphicon glyphicon-time"></i> Date' => 'date',
'<i class="glyphicon glyphicon-time"></i> Date' => 'date asc',
'<i class="glyphicon glyphicon-heart"></i> Likes' => 'likes',
'<i class="glyphicon glyphicon-forward"></i> Duration' => 'duration'
}
Expand Down

0 comments on commit 24de9ba

Please sign in to comment.