libertarian-party/partynest

View on GitHub
app/views/staffs/people/show.html.erb

Summary

Maintainability
Test Coverage
<div class="container">
  <%= nav_breadcrumb(
    [translate(:staff_services), staff_root_path],
    [Person.model_name.human(count: 0), staff_people_path],
    @person.full_name,
  ) %>

  <%= render partial: 'nav_tabs', locals: { person: @person, tab: :overview } %>

  <div class="row">
    <div class="col-md-4">
      <% if @person.photo.attached? %>
        <%= image_tag @person.photo, class: 'img-thumbnail mb-4' %>
      <% else %>
        <%= image_tag 'image_placeholder.png', class: 'img-thumbnail mb-4' %>
      <% end %>
    </div>

    <div class="col-md-8">
      <dl>
        <dt><%= Person.human_attribute_name :account %></dt>
        <dd>
          <%= staff_account_link_or_none @person.account %>

          <% if policy([:staff,
                        @person,
                        AccountConnectionLink.new(@person)]).show? %>
            <br/>

            <small>
              <%= link_to(
                translate('.create_link_to_connect_account'),
                staff_person_account_connection_link_path(@person),
              ) %>
            </small>
          <% end %>
        </dd>

        <%= render partial: 'people/common_descr_list_items',
                   locals: { person: @person } %>
      </dl>
    </div>
  </div>
</div>