| 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": "<%= request.url %>", |
| 25 | "name": "<%= t("nav_lyrics") %>" |
| 26 | } |
| 27 | }] |
| 28 | } |
| 29 | </script> |
| 30 | <% end %> |
| 31 | <main> |
| 32 | <div class="row g-5"> |
| 33 | <div class="col-md-12"> |
| 34 | <h1><%= @page_title %></h1> |
| 35 | <%= render('shared/flash_message', object: flash) %> |
| 36 | </div> |
| 37 | </div> |
| 38 | <div class="row g-5"> |
| 39 | <div class="col-sm-3"> |
| 40 | <div class="position-sticky" style="top: 1rem;"> |
| 41 | <h2><%= t("top_10_song_lyrics") %></h2> |
| 42 | <% @trending_lyrics.each_with_index do |lyric, index| %> |
| 43 | <div class="row mb-3"> |
| 44 | <div class="col-sm-9"> |
| 45 | <%= "#{index + 1}." %> |
| 46 | <%= link_to( |
| 47 | t("song_lyric_detail", title: lyric.title_link), |
| 48 | lyric_detail_path(lyric.slug) |
| 49 | ) %> |
| 50 | </div> |
| 51 | <div class="col-sm-3"> |
| 52 | <i class="bi bi-graph-up-arrow"></i> |
| 53 | <span class="badge rounded-pill bg-warning text-dark"><%= lyric.views_count %></span> |
| 54 | </div> |
| 55 | </div> |
| 56 | <% end %> |
| 57 | </div> |
| 58 | </div> |
| 59 | <div class="col-sm-9"> |
| 60 | <h2> |
| 61 | <%= t("our_newest_song_lyrics") %> |
| 62 | </h2> |
| 63 | <% @lyrics.each_with_index do |lyric, index| %> |
| 64 | <% song = lyric.song %> |
| 65 | <div class="row <%= index % 2 == 0 ? 'list-group-item-primary' : ' list-group-item-warning' %>"> |
| 66 | <div class="col-11 mb-3 mt-3"> |
| 67 | <%= link_to( |
| 68 | t("song_lyric_detail", title: lyric.title_link), |
| 69 | lyric_detail_path(lyric.slug) |
| 70 | ) %> |
| 71 | </div> |
| 72 | <div class="col-1 mb-3 mt-3"> |
| 73 | <%= link_to( |
| 74 | '<i class="bi bi-info-circle"></i>'.html_safe, |
| 75 | song_lyrics_path(song.slug), |
| 76 | title: t('song_menu_aside_lyrics') |
| 77 | ) %> |
| 78 | </div> |
| 79 | </div> |
| 80 | <% end %> |
| 81 | <%= will_paginate @lyrics, class: 'flickr_pagination' %> |
| 82 | </div> |
| 83 | </div> |
| 84 | <%= render 'shared/partial_breadcrumbs' do %> |
| 85 | <li class="breadcrumb-item"><%= link_to t("nav_lyrics"), request.url %></li> |
| 86 | <% end %> |
| 87 | </main> |