- title show_user(@user)

.row-fluid
  .span3
    .well
      %h4= t '.person'
      %p= t '.member_since', time: distance_of_time_in_words(Time.now, @user.created_on)
      %dl
        - if FoodsoftConfig[:use_nick]
          %dt= heading_helper User, :nick
          %dd= @user.nick
        %dt= heading_helper User, :name
        %dd= h @user.name
        %dt= heading_helper User, :email
        %dd
          = @user.email
          - if @user.mail_delivery_status.any?
            = link_to t('.show_email_problems'), admin_mail_delivery_status_index_path(email: @user.email), class: 'btn btn-warning btn-mini'
        %dt= heading_helper User, :phone
        %dd= @user.phone
        %dt= heading_helper User, :last_login
        %dd= format_time(@user.last_login)
        %dt= heading_helper User, :last_activity
        %dd= format_time(@user.last_activity)
        %dt= t 'admin.access_to'
        %dd= format_roles(@user)
  .span5
    .well
      %h4= t '.preference'
      %table.table
        - @user.settings.profile.each do |key, setting|
          %tr
            %td= t("simple_form.labels.settings.profile.#{key}")
            %td= (setting != true and setting != false) ? setting : (setting === true ? t('simple_form.yes') : t('simple_form.no'))
  .span3
    .well
      %h4= t '.groupabos'
      %ul.unstyled
        - for membership in Membership.where(user: @user)
          %li= link_to(membership.group.name, [:admin, membership.group])

%hr/
%p
  = link_to t('ui.edit'), edit_admin_user_path(@user), class: 'btn'
  = link_to t('ui.delete'), [:admin, @user], method: :delete, class: 'btn btn-danger',
      data: {confirm: t('ui.confirm_delete', name: @user.first_name)}
  = link_to t('.sudo'), sudo_admin_user_path(@user), method: :post, class: 'btn',
      data: {confirm: t('.confirm_sudo', user: @user.first_name)}
