<commit_before><div class="row">
  <div class="col-md-7">
    <table id="transactions-table" class="table table-condensed table-bordered table-striped table-hover">
      <thead>
        <tr>
          <td>Price</td>
          <td>Receiver</td>
          <td>Admin</td>
          <td>Comment</td>
          <td>Date</td>
        </tr>
      </thead>
      <tbody>
        <% @account.transactions.includes(:receiver).includes(:administrator).order(date: :desc).limit(50).each do |t| %>
          <tr>
            <td><%= t.price / 100.0 %></td>
            <td><%= t.receiver.try(:trigramme) %></td>
            <td><%= t.administrator.try(:trigramme) %></td>
            <td><%= t.comment %></td>
            <td><time <% if t.date.to_date == Date.today %>class="timeago"<% end %> datetime="<%= t.date %>"><%= t.date.strftime('%F %T') %></time></td>
          </tr>
        <% end %>
      </tbody>
    </table>
  </div>

  <div class="col-md-5">
    <div class="row low-padding">
      <div class="col-md-5">
        <h1 style="display: inline-block;"> <!-- inline-block because we want the icon on same line -->
          <strong><%= @account.trigramme %></strong>
          <% unless @account.x_platal? %>
            <br>
            <small><%= @account.readable_status %></small>
          <% end %>
        </h1>
        <a data-toggle="collapse" href="#trigrammeCollapse" aria-expanded="false" aria-controls="trigrammeCollapse"><%= fa_icon "pencil-square-o" %></a>
        <div class="collapse text-right" id="trigrammeCollapse">
          <%= bootstrap_form_tag(
                remote: true, url: "/account/#{@account.id}", method: :post,
                html: { autocomplete: 'off', id: 'trigramme-form' }) do |f| %>
            <%= f.text_field(:trigramme, hide_label: true, placeholder: 'Trigramme') %>
            <%= f.select(
              :status,
              Account.statuses.keys.map { |k| [k.tr('_', ' ').capitalize, k] },
              selected: @account.status, hide_label: true)
            %>
            <%= f.primary 'Save' %>
          <% end %>
        </div>
        <h2>
          <%= @account.first_name %> <%= @account.name %>
          <small><%= @account.promo %></small>
        </h2>
        <div>
          <a data-toggle="collapse" href="#nicknameCollapse" aria-expanded="false" aria-controls="nicknameCollapse"><%= fa_icon "pencil-square-o" %></a>
          <% if @account.nickname.nil? || @account.nickname.blank? %>
            <small><em>Nickname</em></small>
          <% else %>
            <%= @account.nickname %>
          <% end %>
        </div>
        <div class="collapse text-right" id="nicknameCollapse">
          <br>
          <%= bootstrap_form_tag(
                remote: true, url: "/account/#{@account.id}", method: :post,
                html: { autocomplete: 'off', id: 'nickname-form' }) do |f| %>
            <%= f.text_area(:nickname, rows: 3, hide_label: true, value: @account.nickname) %>
            <%= f.primary 'Save' %>
          <% end %>
          <br>
        </div>
      </div>
      <div class="col-md-7 text-right">
        <%= image_tag @account.local_picture, alt: @account.first_name, id: 'account-image'  if @account.local_picture %>
      </div>
    </div><commit_msg>More width for nickname if no picture<commit_after><div class="row">
  <div class="col-md-7">
    <table id="transactions-table" class="table table-condensed table-bordered table-striped table-hover">
      <thead>
        <tr>
          <td>Price</td>
          <td>Receiver</td>
          <td>Admin</td>
          <td>Comment</td>
          <td>Date</td>
        </tr>
      </thead>
      <tbody>
        <% @account.transactions.includes(:receiver).includes(:administrator).order(date: :desc).limit(50).each do |t| %>
          <tr>
            <td><%= t.price / 100.0 %></td>
            <td><%= t.receiver.try(:trigramme) %></td>
            <td><%= t.administrator.try(:trigramme) %></td>
            <td><%= t.comment %></td>
            <td><time <% if t.date.to_date == Date.today %>class="timeago"<% end %> datetime="<%= t.date %>"><%= t.date.strftime('%F %T') %></time></td>
          </tr>
        <% end %>
      </tbody>
    </table>
  </div>

  <div class="col-md-5">
    <div class="row low-padding">
      <% if @account.local_picture %>
        <div class="col-md-5">
      <% else %>
        <div class="col-md-12">
      <% end %>
        <h1 style="display: inline-block;"> <!-- inline-block because we want the icon on same line -->
          <strong><%= @account.trigramme %></strong>
          <% unless @account.x_platal? %>
            <br>
            <small><%= @account.readable_status %></small>
          <% end %>
        </h1>
        <a data-toggle="collapse" href="#trigrammeCollapse" aria-expanded="false" aria-controls="trigrammeCollapse"><%= fa_icon "pencil-square-o" %></a>
        <div class="collapse text-right" id="trigrammeCollapse">
          <%= bootstrap_form_tag(
                remote: true, url: "/account/#{@account.id}", method: :post,
                html: { autocomplete: 'off', id: 'trigramme-form' }) do |f| %>
            <%= f.text_field(:trigramme, hide_label: true, placeholder: 'Trigramme') %>
            <%= f.select(
              :status,
              Account.statuses.keys.map { |k| [k.tr('_', ' ').capitalize, k] },
              selected: @account.status, hide_label: true)
            %>
            <%= f.primary 'Save' %>
          <% end %>
        </div>
        <h2>
          <%= @account.first_name %> <%= @account.name %>
          <small><%= @account.promo %></small>
        </h2>
        <div>
          <a data-toggle="collapse" href="#nicknameCollapse" aria-expanded="false" aria-controls="nicknameCollapse"><%= fa_icon "pencil-square-o" %></a>
          <% if @account.nickname.nil? || @account.nickname.blank? %>
            <small><em>Nickname</em></small>
          <% else %>
            <%= @account.nickname %>
          <% end %>
        </div>
        <div class="collapse text-right" id="nicknameCollapse">
          <br>
          <%= bootstrap_form_tag(
                remote: true, url: "/account/#{@account.id}", method: :post,
                html: { autocomplete: 'off', id: 'nickname-form' }) do |f| %>
            <%= f.text_area(:nickname, rows: 3, hide_label: true, value: @account.nickname) %>
            <%= f.primary 'Save' %>
          <% end %>
          <br>
        </div>
      </div>
      <% if @account.local_picture %>
        <div class="col-md-7 text-right">
          <%= image_tag @account.local_picture, alt: @account.first_name, id: 'account-image' %>
        </div>
      <% end %>
    </div>