osunyorg/admin

View on GitHub
app/views/extranet/personal_data/_details.html.erb

Summary

Maintainability
Test Coverage
<dl>
  <% [:phone_mobile, :phone_personal, :phone_professional].each do |attribute_name| %>
    <% next if person.public_send(attribute_name).blank? %>
    <dt class="fw-normal small"><%= University::Person.human_attribute_name(attribute_name) %></dt>
    <dd>
      <a href="tel:<%= person.public_send(attribute_name) %>" target="_blank" rel="noreferrer">
        <%= person.public_send(attribute_name) %>
      </a>
    </dd>
  <% end %>
  <% if person.email.present? %>
    <dt class="fw-normal small"><%= University::Person.human_attribute_name(:email) %></dt>
    <dd>
      <a href="mailto:<%= person.email %>" target="_blank" rel="noreferrer">
        <%= person.email %>
      </a>
    </dd>
  <% end %>
  <% if person.full_street_address.present? %>
    <dt class="fw-normal small"><%= University::Person.human_attribute_name("address") %></dt>
    <dd>
      <%= person.address %>
      <% if person.address.present? && (person.city.present? || person.zipcode.present?) %><br><% end %>
      <%= person.zipcode %>
      <%= person.city %>
    </dd>
  <% end %>
  <% if l10n.url.present? %>
    <dt class="fw-normal small"><%= University::Person::Localization.human_attribute_name(:url) %></dt>
    <dd><%= contact_link l10n.url, :website %></dd>
  <% end %>
  <% if l10n.linkedin.present? %>
    <dt class="fw-normal small"><%= University::Person::Localization.human_attribute_name(:linkedin) %></dt>
    <dd><%= contact_link l10n.linkedin, :linkedin %></dd>
  <% end %>
  <% if l10n.twitter.present? %>
    <dt class="fw-normal small"><%= University::Person::Localization.human_attribute_name(:twitter) %></dt>
    <dd><%= contact_link l10n.twitter, :twitter %></dd>
  <% end %>
  <% if l10n.mastodon.present? %>
    <dt class="fw-normal small"><%= University::Person::Localization.human_attribute_name(:mastodon) %></dt>
    <dd><%= contact_link l10n.mastodon, :mastodon %></dd>
  <% end %>
</dl>