.container
  .row
    .col-md-12
      .page-header
        %h1 Edit your profile
  .row
    .col-md-12
      = form_for(@user) do |f|
        .form-group
          = f.label :name
          = f.text_field :name, class: 'form-control'
          %span.help-block
            This is your real name
        .form-group
          = f.label :nickname
          = f.text_field :nickname, class: 'form-control'
        .form-group
          = f.label :avatar
          %br
          = image_tag(@user.gravatar_url(size: '48'), title: "Yo #{@user.name}!", alt: '', class: 'img-rounded')
          %span.help-block
            Change your avatar on
            = link_to 'gravatar.com', 'https://gravatar.com'
        .form-group
          = f.label :affiliation
          = f.text_field :affiliation, class: 'form-control'
          %span.help-block
            The company you work work, the user group you belong to, or nothing at all.
        .form-group
          = f.label :biography
          = f.text_area :biography, rows: 5, data: { provide: 'markdown' }, class: 'form-control'
          %span.help-block
            You have used
            %span#bio_length
              = @user.biography ? @user.biography.split.length : 0
            words.  Biographies are limited to 150 words.
            = markdown_hint
        .form-group
          .text-right
            = f.submit nil,  class: 'btn btn-primary'

