UNC-Libraries/hy-c

View on GitHub
app/views/hyrax/base/_social_media.html.erb

Summary

Maintainability
Test Coverage
<%# [hyc-override] https://github.com/samvera/hyrax/blob/hyrax-v4.0.0/app/views/hyrax/base/_social_media.html.erb %>
<% page_title ||= content_for?(:page_title) ? content_for(:page_title) : default_page_title %>
<% share_url ||= request.original_url %>
<div class="social-media">
  <!-- Sharingbutton Facebook -->
  <%= link_to "https://facebook.com/sharer/sharer.php?#{{u: share_url}.to_param}", 'aria-label': t(:'hyrax.base.social_media.facebook_share'), class: 'resp-sharing-button__link', target: '_blank', rel: 'noopener noreferrer', title: t('hyrax.base.social_media.facebook') do %>
    <div class="resp-sharing-button resp-sharing-button--facebook resp-sharing-button--small"><div aria-hidden="true" class="resp-sharing-button__icon resp-sharing-button__icon--solid">
      <svg version="1.1" x="0px" y="0px" width="24px" height="24px" viewBox="0 0 24 24" enable-background="new 0 0 24 24" xml:space="preserve">
        <title><%= t(:'hyrax.base.social_media.facebook_share') %></title>
          <g>
              <path d="M18.768,7.465H14.5V5.56c0-0.896,0.594-1.105,1.012-1.105s2.988,0,2.988,0V0.513L14.171,0.5C10.244,0.5,9.5,3.438,9.5,5.32 v2.145h-3v4h3c0,5.212,0,12,0,12h5c0,0,0-6.85,0-12h3.851L18.768,7.465z" />
          </g>
      </svg>
      </div>
    </div>
  <% end %>

  <!-- Sharingbutton Twitter -->
  <%= link_to "https://twitter.com/intent/tweet/?#{{text: page_title, url: share_url}.to_param}", 'aria-label': t(:'hyrax.base.social_media.twitter_share'), class: 'resp-sharing-button__link', target: '_blank', rel: 'noopener noreferrer', title: t('hyrax.base.social_media.twitter') do %>
    <div class="resp-sharing-button resp-sharing-button--twitter resp-sharing-button--small"><div aria-hidden="true" class="resp-sharing-button__icon resp-sharing-button__icon--solid">
      <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-twitter-x" viewBox="0 0 16 16">
        <title><%= t(:'hyrax.base.social_media.twitter_share') %></title>
        <path d="M12.6.75h2.454l-5.36 6.142L16 15.25h-4.937l-3.867-5.07-4.425 5.07H.316l5.733-6.57L0 .75h5.063l3.495 4.633L12.601.75Zm-.86 13.028h1.36L4.323 2.145H2.865z"/>
      </svg>
      </div>
    </div>
  <% end %>

  <%# [hyc-override] Remove tumblr link %>
  <!-- Sharingbutton Tumblr -->
  <%#= link_to "https://www.tumblr.com/widgets/share/tool?#{{posttype: 'link', canonicalUrl: share_url, shareSource: 'tumblr_share_button'}.to_param}", 'aria-label': t(:'hyrax.base.social_media.tumblr_share'), class: 'resp-sharing-button__link', target: '_blank', rel: 'noopener noreferrer', title: t('hyrax.base.social_media.tumblr') do %>
    <%# <div class="resp-sharing-button resp-sharing-button--tumblr resp-sharing-button--small"><div aria-hidden="true" class="resp-sharing-button__icon resp-sharing-button__icon--solid"> %>
      <%# <svg version="1.1" x="0px" y="0px" width="24px" height="24px" viewBox="0 0 24 24" enable-background="new 0 0 24 24" xml:space="preserve"> %>
          <%# <title><%= t(:'hyrax.base.social_media.tumblr_share') % ></title> %>
          <%# <g> %>
              <%# <path d="M13.5,0.5v5h5v4h-5v5.515c0,5.028,3.52,4.427,6,2.798v4.433c-6.728,3.172-12-0.064-12-4.255V9.5h-3V6.668 c0.903-0.293,2.245-0.714,2.889-1.261c0.646-0.551,1.162-1.208,1.551-1.976C9.331,2.664,9.6,1.686,9.746,0.5H13.5z" /> %>
          <%# </g> %>
      <%# </svg> %>
      <%# </div> %>
    <%# </div> %>
  <%# end %>
</div>