<div class="row-fluid">
  <div class="span4">
    <div class="default-padding">
      <div class="subblock bordered">
        <div class="default-padding clearfix">
          <h2>
            <%= @user.first_name %> <%= @user.last_name %>
            &nbsp;&nbsp;
            <% if @user.is_admin? %>
              <i class="concertocon-user-admin tooltip-basic" data-tooltip-text="<%= t('.system_wide_admin') %>"></i>
            <% end %>

            <% unless @user.leading_groups.empty? %>
              <i class="concertocon-user-leader tooltip-basic" data-tooltip-text="<%= t('.leader') %>"></i>
            <% end %>
          </h2>

          <% if user_signed_in? %>
            <p>
              <%= mail_to @user.email, @user.email, encode: "hex" unless @user.email.empty? %>
            </p>
          <% end %>
        </div>
      </div>
    </div>
  </div>
</div>

<!-- Begin Groups -->
<div class="clearfix default-padding">
  <div class="header-with-icon">
    <h3>
      <%= t '.group_header', count: @memberships.length %>
    </h3>
  </div>
  <br />

  <% unless @memberships.empty? %>
    <ul class="list-grid">
      <% @memberships.each do |membership| %>
        <li>
          <div class="cont thumb-icon">
            <%= link_to membership.group do %>
              <% if membership.is_leader? %>
                <i class="concertocon-controller-users-leader"></i>
              <% else %>
                <i class="fa fa-group"></i>
              <% end %>
            <% end %>
          </div>
          <div class="cont">
            <p><b><%= link_to membership.group.name, membership.group %></b></p>
            <p><%= membership.level_name.humanize %></p>

            <% if can? :edit, membership %>
              <%= form_for([membership.group, membership]) do |f| %>
                <div class="input checkbox">
                  <%= hidden_field_tag :receive_emails, "0" %>
                  <%= check_box_tag :receive_emails, nil, membership.receive_emails, {
                    id: "email#{membership.group.id}",
                    data: { autosubmit: true }} %>
                  <%= label_tag "email#{membership.group.id}", t('.receive_emails') %>
                </div>
              <% end %>
            <% end %>
          </div>
        </li>
      <% end %>
    </ul>
  <% end %>
</div>

<!-- Begin Screens -->
<div class="clearfix default-padding">
  <div class="header-with-icon">
    <h3>
      <%= t '.screen_header', count: @screens.count %>
    </h3>
  </div>
  <br />
  <%= render partial: "screens/thumbs", object: @screens,
             locals: { show_field_count: false, show_owner: false } %>
</div>

<!-- Begin Contents -->
<div class="clearfix default-padding">
  <div class="header-with-icon clearfix">
    <h3 style="float: left;">
      <%= t '.content_header', count: @contents_count %>
    </h3>
    <div class="pagination-cont">
      <%= paginate @contents unless @contents.empty? %>
    </div>
  </div>
  <br />

  <% unless @contents.empty? %>
    <% @contents.each do |content| %>
      <%= render partial: "contents/content_tile", locals: { content: content } %>
    <% end %>
  <% end %>

</div>