From b13898de2351fbb4a4ce52c0c090dedd6e53fbb0 Mon Sep 17 00:00:00 2001 From: Miguel Michelson Date: Mon, 1 Jul 2024 00:38:01 -0400 Subject: [PATCH] order by release date --- app/views/embeds/_playlist.erb | 74 ---------------------------- app/views/home/_playlist_section.erb | 2 +- 2 files changed, 1 insertion(+), 75 deletions(-) diff --git a/app/views/embeds/_playlist.erb b/app/views/embeds/_playlist.erb index 0670ee5..ef65e88 100644 --- a/app/views/embeds/_playlist.erb +++ b/app/views/embeds/_playlist.erb @@ -5,17 +5,6 @@
-
- - -
-
@@ -31,41 +20,7 @@
-
- - <%= render "sharer/share_button", resource: @playlist %> - - <%= render "likes/like_button", resource: @playlist, button_class: liked?(@playlist) ? "button-active" : "button" %> - - <% if user_signed_in? && @playlist.user_id == current_user.id %> - <%= link_to edit_playlist_path(@playlist), class: "button", - "data-turbo-frame": "modal" do %> - - - - <%= t("playlists.edit") %> - <% end %> - - -
- <%= turbo_frame_tag "playlist-#{@playlist.id}-delete" do %> - <%= button_to playlist_path(@playlist), - method: :delete, - data: {confirm: t("delete.confirm"), turbo_method: :delete, turbo_confirm: t("delete.confirm")}, - class: "button" do %> - - - - <%= t("playlists.delete") %> - <% end %> - <% end %> -
- - <% end %> - - -
@@ -166,34 +121,5 @@ - - - -
-
- -
-
-
- -
-

- <%= t("profile.comments") %> -

-
- -
- - <%= render "comments/comment_list", comments: @playlist.comments.limit(10) %> - <% if user_signed_in? %> - <%= render "comments/form", resource: @playlist, comment: current_user.comments.new(commentable: @playlist) %> - <% end %> -
-
-
-
-
-
- \ No newline at end of file diff --git a/app/views/home/_playlist_section.erb b/app/views/home/_playlist_section.erb index 367bcc6..b1bffee 100644 --- a/app/views/home/_playlist_section.erb +++ b/app/views/home/_playlist_section.erb @@ -23,7 +23,7 @@
- <% Playlist.published.latests.where(playlist_type: playlist_type).limit(limit).each do |playlist| %> + <% Playlist.published.latests.where(playlist_type: playlist_type).order("release_date desc, id desc").limit(limit).each do |playlist| %>
<%= link_to playlist_path(playlist) do %>