<h1>Edit Profile</h1>
<div class="col-xs-12 col-sm-5 well">
  <%= form_for @user, url: sufia.profile_path(@user.to_param), html: {multipart: true, class: 'form-horizontal' } do |f| %>
    <div class="form-group">
      <%= f.label :avatar, '<i class="glyphicon glyphicon-camera"></i> Change picture'.html_safe, class: "col-xs-4 control-label" %>
      <div class="col-xs-8">
        <%= image_tag @user.avatar.url(:thumb) if @user.avatar? %>
        <%= f.file_field :avatar %>
        <%= f.hidden_field :avatar_cache %>
        <span class="help-block">JPG, GIF, or PNG (less than 2MB)</span>
      </div>
    </div><!-- .form-group -->

    <div class="col-xs-offset-4 col-xs-8">
      <div class="checkbox">
        <%= f.label :remove_avatar do %>
          <%= f.check_box :remove_avatar %>
          Delete picture
          <a href="#" id="delete_picture_help" rel="popover" data-content="If you would like to remove your picture entirely, check the box and save your profile." data-original-title="Delete Picture"><i class="glyphicon glyphicon-question-sign"></i></a>
        <% end %>
      </div>
      <div class="checkbox">
        <%= f.label :update_directory do %>
          <%= f.check_box :update_directory %>
          Refresh directory info
          <a href="#" id="refresh_directory_help" rel="popover" data-content="The information displayed in your profile comes from <%=t('sufia.institution_name') %>'s central directory (LDAP) and is cached by <%=t('sufia.product_name') %>.  If you have updated that information and don't see those changes in your <%=t('sufia.product_name') %> profile, check the box and save your profile." data-original-title="Refresh Directory Info"><i class="glyphicon glyphicon-question-sign"></i></a>
        <% end %>
      </div>
    </div>

    <div class="form-group">
      <%= f.label :twitter_handle, '<i class="fa fa-twitter"></i> Twitter Handle'.html_safe, class: 'col-xs-4 control-label' %>
      <div class="col-xs-8">
         <%= f.text_field :twitter_handle, class: "form-control" %>
      </div>
    </div><!-- .form-group -->

    <div class="form-group">
      <%= f.label :facebook_handle, '<i class="fa fa-facebook"></i> Facebook Handle'.html_safe, class: 'col-xs-4 control-label' %>
      <div class="col-xs-8">
         <%= f.text_field :facebook_handle, class: "form-control" %>
      </div>
    </div><!-- .form-group -->

    <div class="form-group">
      <%= f.label :googleplus_handle, '<i class="fa fa-google-plus"></i> Google+ Handle'.html_safe, class: 'col-xs-4 control-label' %>
      <div class="col-xs-8">
         <%= f.text_field :googleplus_handle, class: "form-control" %>
      </div>
    </div><!-- .form-group -->

    <%= render partial: 'trophy_edit', locals: {trophies: @trophies} %>

    <%= f.button '<i class="glyphicon glyphicon-save"></i> Save Profile'.html_safe, type: 'submit', class: "btn btn-primary" %>
  <% end %>
</div><!-- .col-xs-5 /well-->

<div class="col-xs-12 col-sm-offset-1 col-sm-6 well">
  <h2><i class="glyphicon glyphicon-user"></i> Directory Info (LDAP) <%= link_to 'Edit Instructions', 'http://www.psu.edu/directory/#update', class: 'btn btn-mini btn-primary' %></h3>
  <%= render partial: 'user_info', locals: {user: @user} %>

  <hr />

  <h2><i class="glyphicon glyphicon-group"></i> User Managed Groups Info (UMG) <%= link_to 'Manage UMG', 'http://umg.its.psu.edu/', class: 'btn btn-xs btn-primary' %> </h3>
  <% current_user.groups.each do |g| %>
    <i class="glyphicon glyphicon-asterisk"></i> <%= g %><br />
  <% end %>
</div>