<h3>Generated bitcoin addresses</h3>
<table class="table">
  <tr>
    <td>Loaded to market</td><td><%= GeneratedAddress.bitcoin.loaded_to_market.count %></td>
  </tr>
  <tr>
    <td>Not yet loaded to market</td><td><%= GeneratedAddress.bitcoin.where(loaded_to_market: false).count %></td>
  </tr>
  <tr>
    <td>Addresses with PGP signature present</td><td><%= GeneratedAddress.bitcoin.signed.count %></td>
  </tr>
  <tr>
    <td>Addresses with nil PGP signature</td><td><%= GeneratedAddress.bitcoin.where(pgp_signature: nil).count %></td>
  </tr>
  <tr>
    <td>Total count of bitcoin addresses generated by payment server</td><td><%= GeneratedAddress.bitcoin.all.count %></td>
  </tr>
</table>

<% if PaymentMethod.litecoin_exists? %>
  <h3>Generated litecoin addresses</h3>
  <table class="table">
    <tr>
      <td>Loaded to market</td><td><%= GeneratedAddress.litecoin.loaded_to_market.count %></td>
    </tr>
    <tr>
      <td>Not yet loaded to market</td><td><%= GeneratedAddress.litecoin.where(loaded_to_market: false).count %></td>
    </tr>
    <tr>
      <td>Addresses with PGP signature present</td><td><%= GeneratedAddress.litecoin.signed.count %></td>
    </tr>
    <tr>
      <td>Addresses with nil PGP signature</td><td><%= GeneratedAddress.litecoin.where(pgp_signature: nil).count %></td>
    </tr>
    <tr>
      <td>Total count of litecoin addresses generated by payment server</td><td><%= GeneratedAddress.litecoin.all.count %></td>
    </tr>
  </table>
<%end%>

<h3>Search</h3>
<%=form_tag admin_generated_address_search_path, class: 'form-horizontal' do %>
  <div class="form-group">
    <%= label_tag :btc_address, nil, class: 'col-sm-2 control-label' %>
    <div class="col-sm-4">
      <%= text_field_tag :btc_address, nil, class: 'form-control' %>
    </div>
  </div>
  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-4">
      <%= submit_tag "Search", class: 'btn btn-primary' %>
    </div>
  </div>
<%end%>

<% if @btc_address %>
  <p>
  <%= @btc_address.btc_address %>
  </p>

  <pre>
<%= @btc_address.pgp_signature %>
  </pre>

  uploaded: <%=@btc_address.loaded_to_market%>

<% end %>
