feature/share-libs
erb 86 lines 2.9 KB
Raw
1 <% content_for :meta_head do %>
2 <title><%= @meta_title %></title>
3 <meta name="description" content="<%= @meta_description %>">
4 <meta property="og:title" content="<%= @meta_title %>" />
5 <meta property="og:description" content="<%= @meta_description %>" />
6 <meta property="og:url" content="<%= @meta_url %>" />
7 <% end %>
8 <% content_for :breadcrumb do %>
9 <script type="application/ld+json">
10 {
11 "@context": "http://schema.org",
12 "@type": "BreadcrumbList",
13 "itemListElement": [{
14 "@type": "ListItem",
15 "position": 1,
16 "item": {
17 "@id": "<%= root_url %>",
18 "name": "<%= t("site_name") %>"
19 }
20 },{
21 "@type": "ListItem",
22 "position": 2,
23 "item": {
24 "@id": "<%= song_path %>",
25 "name": "<%= t("nav_songs") %>"
26 }
27 },{
28 "@type": "ListItem",
29 "position": 2,
30 "item": {
31 "@id": "<%= most_loved_songs_url %>",
32 "name": "<%= t("breadcrumb_most_loved_songs") %>"
33 }
34 }]
35 }
36 </script>
37 <% end %>
38 <main>
39 <div class="row g-5">
40 <div class="col-md-12">
41 <h1><%= @page_title %></h1>
42 <%= render('shared/flash_message', object: flash) %>
43 </div>
44 </div>
45 <div class="row">
46 <div class="col-md-12">
47 <ul class="list-group">
48 <% @most_loved_songs.each_with_index do |song, index| %>
49 <li class="list-group-item <%= index % 2 == 0 ? 'list-group-item-primary' : ' list-group-item-warning' %>">
50 <%= index + 1 %>.
51 <%= link_to(
52 song.name,
53 song_detail_path(song.slug)
54 ) %>
55 <span class="p-2">
56 <i class='bi bi-heart-fill'></i>
57 <span class='badge rounded-pill bg-warning text-dark'><%= song.users_count %></span>
58 </span>
59 <%= link_to(
60 '<i class="bi bi-info-circle"></i>'.html_safe,
61 song_detail_path(song.slug),
62 title: t('song_menu_aside_info'),
63 class: 'float-end p-1'
64 ) %>
65 <%= link_to(
66 '<i class="bi bi-music-note-list"></i>'.html_safe,
67 song_chords_path(song.slug),
68 title: t('song_menu_aside_chords'),
69 class: 'float-end p-1'
70 ) %>
71 <%= link_to(
72 '<i class="bi bi-music-note-beamed"></i>'.html_safe,
73 song_chords_path(song.slug),
74 title: t('song_menu_aside_audio'),
75 class: 'float-end p-1'
76 ) %>
77 </li>
78 <% end %>
79 </ul>
80 </div>
81 </div>
82 <%= render 'shared/partial_breadcrumbs' do %>
83 <li class="breadcrumb-item"><%= link_to t("nav_songs"), song_path %></li>
84 <li class="breadcrumb-item"><%= link_to t("breadcrumb_most_loved_songs"), most_loved_songs_url %></li>
85 <% end %>
86 </main>