| 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="<%= javanese_gending_gamelan_notation_detail_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": "<%= javanese_gamelan_url %>", |
| 25 | "name": "<%= t("nav_javanese_gamelan") %>" |
| 26 | } |
| 27 | },{ |
| 28 | "@type": "ListItem", |
| 29 | "position": 3, |
| 30 | "item": { |
| 31 | "@id": "<%= javanese_gending_gamelan_notation_detail_url %>", |
| 32 | "name": "<%= t("gending_notation") + @gending.name %>" |
| 33 | } |
| 34 | }] |
| 35 | } |
| 36 | </script> |
| 37 | <% end %> |
| 38 | <main> |
| 39 | <div class="row g-5"> |
| 40 | <div class="col-12"> |
| 41 | <div class="lead p-3"> |
| 42 | <%= |
| 43 | t( |
| 44 | 'gending_notation_add_explanation', |
| 45 | href: link_to( |
| 46 | t('gending_notation_add'), |
| 47 | add_gending_notation_path, |
| 48 | class: 'btn btn-primary' |
| 49 | ), |
| 50 | bach_link: link_to("<span class='badge bg-warning text-dark'>€BACH</span>".html_safe, bach_path) |
| 51 | ).html_safe |
| 52 | %> |
| 53 | </div> |
| 54 | </div> |
| 55 | </div> |
| 56 | <div class="row g-5"> |
| 57 | <div class="col-md-12"> |
| 58 | <h1><%= @page_title %></h1> |
| 59 | </div> |
| 60 | </div> |
| 61 | <div class="row g-5"> |
| 62 | <div class="col-sm-1"> |
| 63 | <div class="position-sticky" style="top: 1rem;"> |
| 64 | <div class="text-center mt-3"> |
| 65 | <% if user_signed_in? && @gending.users.include?(current_user) %> |
| 66 | <%= link_to( |
| 67 | '<i class="bi bi-heart-fill"></i>'.html_safe, |
| 68 | javanese_gending_notation_unvote_path(id: @gending.id), |
| 69 | remote: true, |
| 70 | method: :delete, |
| 71 | :id => "ajax_trigger" |
| 72 | ) |
| 73 | %> |
| 74 | <% else %> |
| 75 | <%= link_to( |
| 76 | '<i class="bi bi-heart"></i>'.html_safe, |
| 77 | javanese_gending_notation_vote_path(id: @gending.id), |
| 78 | remote: true, |
| 79 | method: :post, |
| 80 | :id => "ajax_trigger" |
| 81 | ) |
| 82 | %> |
| 83 | <% end %> |
| 84 | <span class="badge rounded-pill bg-warning text-dark"><%= @gending.gending_notation_vote.count %></span> |
| 85 | </div> |
| 86 | <div class="text-center mt-4"> |
| 87 | <i class="bi bi-graph-up-arrow"></i> |
| 88 | <span class="badge rounded-pill bg-warning text-dark"><%= @gending.views_count %></span> |
| 89 | </div> |
| 90 | </div> |
| 91 | </div> |
| 92 | <div class="col-sm-11"> |
| 93 | <%= render('shared/partial_meta_top', author: @author, created_at: @gending.created_at) %> |
| 94 | <div class="row mt-5"> |
| 95 | <div class="col-md-12"> |
| 96 | <%= render('partial_menus', active_menu: 'legacy' ) %> |
| 97 | </div> |
| 98 | </div> |
| 99 | <div class="row"> |
| 100 | <div class="col-md-12 mb-5 mt-3"> |
| 101 | <%= @content_notation.html_safe %> |
| 102 | </div> |
| 103 | </div> |
| 104 | <div class="row"> |
| 105 | <div class="col-12"> |
| 106 | <h3 id="discussion"><%= t('discussion') %></h3> |
| 107 | <%= render "shared/flash_message", object: flash %> |
| 108 | <div class="mb-3"> |
| 109 | <%= form_for [@gending, Comment.new] do |f| %> |
| 110 | <%= f.text_area :body, placeholder: t('discussion_comment_placeholder'), rows: "4" , cols: "50%" %><br/> |
| 111 | <%= f.hidden_field :user_id, value: current_user.id if user_signed_in? %> |
| 112 | <%= f.submit t('discussion_comment_button'), class: "btn btn-primary" %> |
| 113 | <% end %> |
| 114 | </div> |
| 115 | <%= render(partial: 'comments/comment', collection: @gending.comments) %> |
| 116 | </div> |
| 117 | </div> |
| 118 | </div> |
| 119 | </div> |
| 120 | <%= render "shared/partial_breadcrumbs" do %> |
| 121 | <li class="breadcrumb-item"><%= link_to t("nav_javanese_gamelan"), javanese_gamelan_path %></li> |
| 122 | <li class="breadcrumb-item"><%= link_to t("gending_notation") + @gending.name, javanese_gending_gamelan_notation_detail_path %></li> |
| 123 | <% end %> |
| 124 | </main> |