crowdAI/crowdai

View on GitHub
app/concepts/participant/views/participant_masthead.erb

Summary

Maintainability
Test Coverage
<div class="masthead-detailed">
  <div class="row">
    <div class="pic pic-user">
      <%= concept(Image::Cell,participant,size: :medium) %>
    </div>
    <div class="info info-user">
      <div class="heading-w-icon">
        <h2><%= participant.name %></h2>
        <% if policy(participant).edit? %>
          <%= link_to edit_participant_path(participant), title: "Edit participant" do %>
            <i class="fa fa-pencil-square-o fa-lg" aria-hidden="true"></i>
          <% end %>
        <% end %>
      </div>
      <% if participant.affiliation.present? %>
        <p class="location">
          <%=  participant.affiliation %>
        </p>
      <% end %>
      <div class="text-w-icon">
        <% if policy(participant).edit? %>
          <p><strong>API key:</strong> <%= participant.api_key %></p>
            <%= link_to participant_regen_api_key_path(participant_id: participant.id) do %>
              <i class="fa fa-refresh" aria-hidden="true"></i>
            <% end %>
        <% end %>
      </div>
      <ul class="social-links">
        <% if participant.twitter.present? %>
          <li><%= link_to '<i class="fa fa-twitter" aria-hidden="true"></i>', url_for(participant.twitter) %></li>
        <% end %>
        <% if participant.github.present? %>
          <li><%= link_to '<i class="fa fa-github" aria-hidden="true"></i>', url_for(participant.github) %></li>
        <% end %>
        <% if participant.linkedin.present? %>
          <li><%= link_to '<i class="fa fa-linkedin" aria-hidden="true"></i>', url_for(participant.linkedin) %></li>
        <% end %>
        <% if participant.website.present? %>
          <li><%= link_to '<i class="fa fa-link" aria-hidden="true"></i>', url_for(participant.website) %></li>
        <% end %>
      </ul>
      <% if current_participant && current_participant.admin? %>
        <div class="text-w-icon">
          <p class="location">
            <%= participant.email %> &middot; <%= link_to 'Email Notifications', edit_participant_email_preference_path(participant,participant.email_preferences.first) %>
          </p>
        </div>

      <% end %>
    </div>
  </div>
</div>