<div class='data-container'>
  <h3>Client ID</h3>
  <p class='sub'>This is your Client ID, you should send with each API request.</p>
  <p class="key"><%= cinstance.application_id %></p>
</div>

<div class='data-container'>
  <h3>Client Secret</h3>
  <p class='sub'>This is your Client Secret used to authenticate requests.</p>
  <table class="data">
    <tr>
      <th rowspan="<%= cinstance.keys.size %>">Client Secret</th>
      <td><span class="key" id="oauth_secret"><%= cinstance.keys.first %></span></td>
    </tr>
  </table>
  <p>
    <% if cinstance.keys.empty? %>
      <%= fancy_button_to 'Create secret', admin_application_keys_path(cinstance),
        :method  => :post,
        :class   => 'create_key' %>
    <% elsif can? :regenerate_user_key, cinstance %>
      <%= fancy_button_to("Regenerate", regenerate_admin_application_key_path(:application_id => cinstance.id, :id => cinstance.keys.first), :method => :put, :class => 'delete', :remote => true)%>
    <% end %>
  </p>

</div>

<div id="redirect_url">
  <h3>Redirect URL</h3>
  <p>This is your Redirect URL for OAuth.</p>

  <%= semantic_form_for cinstance, :url => admin_application_path(cinstance), :remote => true do |form| %>
    <%= form.inputs do %>
        <%= form.input :redirect_url, :as => :string %>
    <% end %>
    <%= form.buttons do %>
      <%= form.commit_button "Submit" %>
    <% end %>
  <% end %>
</div>
