@@ -1,6 +1,7 @@
 <%
 url = @api_client.new_record? ? super_admin_api_clients_path : super_admin_api_client_path(@api_client)
 meth = @api_client.new_record? ? :post : :put
+orgs = Org.where(is_other: false)
 %>
 
 <%= form_for @api_client, url: url, method: meth,
<%
url = @api_client.new_record? ? super_admin_api_clients_path : super_admin_api_client_path(@api_client)
meth = @api_client.new_record? ? :post : :put
%>

<%= form_for @api_client, url: url, method: meth,
                          html: { class: 'api_client' } do |f| %>
  <div class="row">
    <div class="form-group col-xs-4">
      <%= f.label :name, _('Name'), class: 'control-label' %>
      <%= f.text_field :name, class: 'form-control', aria: { required: true } %>
    </div>
    <div class="form-group col-xs-4">
      <%= f.label :homepage, _('Homepage'), class: 'control-label' %>
      <%= f.url_field :homepage, class: 'form-control' %>
    </div>
  </div>
  <div class="row">
    <div class="form-group col-xs-8">
      <%= f.label :description, _('Description'), class: 'control-label' %>
      <%= f.text_area :description, class: 'form-control api-client-text' %>
    </div>
  </div>
  <div class="row">
    <div class="form-group col-xs-4">
      <%= f.label :contact_email, _('Contact Name'), class: 'control-label' %>
      <%= f.text_field :contact_name, class: 'form-control' %>
    </div>
    <div class="form-group col-xs-4">
      <%= f.label :contact_email, _('Contact Email'), class: 'control-label' %>
      <%= f.email_field :contact_email, class: 'form-control', aria: { required: true } %>
    </div>
  </div>

  <% unless @api_client.new_record? %>
    <div class="row" id="api-client-credentials">
      <div class="form-group col-xs-4">
        <%= f.label :client_id, _('Client ID'), class: 'control-label' %>
        <%= f.email_field :client_id, class: 'form-control', disabled: true %>
      </div>
      <div class="form-group col-xs-4">
        <%= f.label :client_secret, _('Client Secret'), class: 'control-label' %>
        <%= f.email_field :client_secret, class: 'form-control', disabled: true %>
      </div>
    </div>

    <div class="row">
      <div class="form-group col-xs-3">
        <%= f.label :client_id, _('Last accessed on'), class: 'control-label' %>
        <% date = @api_client.last_access.present? ? @api_client.last_access.utc.to_s  : _("Never") %>
        <%= f.text_field :last_access, class: 'form-control', disabled: true,
                                       value: date %>
      </div>
    </div>
  <% end %>

  <div class="pull-right">
    <%= f.button _('Save'), class: 'btn btn-default', type: 'submit' %>

    <% unless @api_client.new_record? %>
      <%= link_to _("Refresh client ID and secret"),
                  refresh_credentials_super_admin_api_client_path(@api_client),
                  class: "btn btn-default", remote: true %>

      <%= link_to _("Email credentials to contact"),
                  email_credentials_super_admin_api_client_path(@api_client),
                  class: "btn btn-default", remote: true %>

      <%= link_to(
            _('Delete'),
            super_admin_api_client_path(@api_client),
            class: 'btn btn-default',
            method: :delete,
            data: { confirm: _('Are you sure you want to delete the API client: "%{name}"') % { name: @api_client.name }}) %>
    <% end %>

    <%= link_to _('Cancel'), super_admin_api_clients_path, class: 'btn btn-default', role: 'button' %>
  </div>
<% end %>

should this refer to the new `managed` flag rather than `is_other`?