Skip to content

Commit

Permalink
playlist track buttons hidden
Browse files Browse the repository at this point in the history
  • Loading branch information
michelson committed Aug 17, 2023
1 parent 3479e60 commit d2b540e
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 23 deletions.
2 changes: 1 addition & 1 deletion app/views/playlists/_playlist_item.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
/>-->

<%= link_to "#", phx_click: "like-playlist",
class: "@like_class.class" do %>
class: "button" do %>
<svg
xmlns="http://www.w3.org/2000/svg"
class="h-4 w-4"
Expand Down
47 changes: 26 additions & 21 deletions app/views/tracks/_track_item.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
<div class="p-2 sm:ml-3 sm:p-0 sm:pt-2 flex items-center space-x-1">

<%= render "sharer/share_button", resource: track %>

<%= render "likes/like_button", resource: track, button_class: track.respond_to?(:like_id) && track&.like_id.present? ? "button-active" : "button" %>

<%= render "reposts/repost_button", track: track, button_class: track.respond_to?(:repost_id) && track&.repost_id.present? ? "button-active" : "button" %>
Expand Down Expand Up @@ -136,28 +136,33 @@
<div class="hidden absolute right-0 z-10 mt-2 w-56 origin-top-right divide-y divide-gray-100 dark:divide-gray-900 rounded-md bg-white dark:bg-black shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none" role="menu" aria-orientation="vertical" aria-labelledby="menu-button" tabindex="-1" data-dropdown-target="menu" classsss="hidden transition transform origin-top-right absolute right-0" data-transition-enter-from="opacity-0 scale-95" data-transition-enter-to="opacity-100 scale-100" data-transition-leave-from="opacity-100 scale-100" data-transition-leave-to="opacity-0 scale-95">
<div class="py-1" role="none">

<%= link_to edit_track_path(track), class: "flex items-center space-x-2 text-gray-700 dark:text-gray-300 block px-4 py-2 text-sm",
"data-turbo-frame": "_top" do %>
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" viewBox="0 0 20 20" fill="currentColor">
<path d="M13.586 3.586a2 2 0 112.828 2.828l-.793.793-2.828-2.828.793-.793zM11.379 5.793L3 14.172V17h2.828l8.38-8.379-2.83-2.828z"></path>
</svg>
<span>Editar esta pista</span>
<% end %>
<% if user_signed_in? && track.user_id == current_user.id %>
<%= link_to edit_track_path(track), class: "flex items-center space-x-2 text-gray-700 dark:text-gray-300 block px-4 py-2 text-sm",
"data-turbo-frame": "_top" do %>
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" viewBox="0 0 20 20" fill="currentColor">
<path d="M13.586 3.586a2 2 0 112.828 2.828l-.793.793-2.828-2.828.793-.793zM11.379 5.793L3 14.172V17h2.828l8.38-8.379-2.83-2.828z"></path>
</svg>
<span><%= t("tracks.edit") %></span>
<% end %>


<div data-turbo="true">
<%= turbo_frame_tag "track-#{track.id}-delete" do %>
<%= button_to track_path(track),
method: :delete,
data: {confirm: "??", turbo_method: :delete, turbo_confirm: "Are you sure?"},

class: "flex items-center space-x-2 text-gray-700 dark:text-gray-300 block px-4 py-2 text-sm" do %>
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" viewBox="0 0 20 20" fill="currentColor">
<path fill-rule="evenodd" d="M9 2a1 1 0 00-.894.553L7.382 4H4a1 1 0 000 2v10a2 2 0 002 2h8a2 2 0 002-2V6a1 1 0 100-2h-3.382l-.724-1.447A1 1 0 0011 2H9zM7 8a1 1 0 012 0v6a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v6a1 1 0 102 0V8a1 1 0 00-1-1z" clip-rule="evenodd"></path>
</svg>
<span>Borrar esta pista</span>
<div data-turbo="true">
<%= turbo_frame_tag "track-#{track.id}-delete" do %>
<%= button_to track_path(track),
method: :delete,
data: {confirm: "??", turbo_method: :delete, turbo_confirm: "Are you sure?"},

class: "flex items-center space-x-2 text-gray-700 dark:text-gray-300 block px-4 py-2 text-sm" do %>
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" viewBox="0 0 20 20" fill="currentColor">
<path fill-rule="evenodd" d="M9 2a1 1 0 00-.894.553L7.382 4H4a1 1 0 000 2v10a2 2 0 002 2h8a2 2 0 002-2V6a1 1 0 100-2h-3.382l-.724-1.447A1 1 0 0011 2H9zM7 8a1 1 0 012 0v6a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v6a1 1 0 102 0V8a1 1 0 00-1-1z" clip-rule="evenodd"></path>
</svg>
<span>Borrar esta pista</span>
<% end %>
<% end %>
<% end %>
</div>
</div>

<% end %>

</div>
<div class="py-1" role="none">
<a class="flex items-center space-x-2 text-gray-700 dark:text-gray-300 block px-4 py-2 text-sm"
Expand Down
3 changes: 2 additions & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ en:
buy_digital_music: Buy digital music
or_more: or more
supporters: Supporters
edit: Edit this track

private_label: Private
private_hint: Private access. Hidden to the world
Expand Down Expand Up @@ -199,7 +200,7 @@ en:
copy: "Copy"
message_placeholder: "Enter your message here..."
at: "At"

time:
formats:
day: '%b %d'
Expand Down

0 comments on commit d2b540e

Please sign in to comment.