feature/share-libs
erb 36 lines 1.19 KB
Raw
1 <div class="meta-line mb-5">
2 <% if user_signed_in? && @song.users.include?(current_user) %>
3 <%= link_to(
4 '<i class="bi bi-heart-fill"></i>'.html_safe,
5 song_chord_pleas_unloved_path(id: @song.id),
6 remote: true,
7 method: :delete,
8 :id => "ajax_trigger"
9 )
10 %>
11 <% else %>
12 <%= link_to(
13 '<i class="bi bi-heart"></i>'.html_safe,
14 song_chord_pleas_loved_path(id: @song.id),
15 remote: true,
16 method: :post,
17 :id => "ajax_trigger"
18 )
19 %>
20 <% end %>
21
22 <% if @lovers != nil && @lovers.count > 0 %>
23 <span class="meta-line-by"><%= t('by') %><span>
24 <% @lovers.each_with_index do |user, index| %>
25 <%= " " if index != 0 %>
26 <span class="meta-line-lovers">
27 <%= link_to name_or_username(user), profile_path_enhanced(user) %>
28 </span>
29 <%= "," if index != @lovers.count - 1 %>
30 <% end %>
31 <% else %>
32 <span class="meta-line-no-love">
33 <%= t('somebody_to_love') %>
34 <span>
35 <% end %>
36 </div>