denny/ShinyCMS-ruby

View on GitHub
plugins/ShinyProfiles/app/views/shiny_profiles/profiles/_public.html.erb

Summary

Maintainability
Test Coverage
<section>
  <% if @profile.profile_pic.attached? %>
  <%= image_tag url_for( @profile.profile_pic.variant( resize_to_limit: [400,400] ) ), class: 'user-profile-pic' %>
  <% end %>

  <header>
    <h2>
      <%= @profile.name %>
    </h2>
  </header>

  <% if @profile.bio.present? %>
  <%= simple_format @profile.bio %>
  <% end %>

  <% if @profile.links.present? %>
  <h3>
    Links
  </h3>

  <ul>
    <% @profile.links.each do |link| %>
    <li>
      <%= link_to link.name, link.url %>
    </li>
    <% end %>
  </ul>
  <% end %>

  <br>

  <p>
    Joined on <%= display_date( @profile.created_at ) %>
  </p>

  <% if @profile.profile_pic.present? %>
  <div class="clear-both"></div>
  <% end %>
</section>