openstreetmap-website/app/views/oauth_clients/index.html.erb

47 lines
1.4 KiB
Text

<% content_for :heading do %>
<h1><%= t ".title" %></h1>
<% end %>
<%= render :partial => "settings_menu" %>
<% unless @tokens.empty? %>
<h3><%= t ".my_tokens" %></h3>
<p><%= t ".list_tokens" %></p>
<table class="table table-sm">
<thead>
<tr>
<th><%= t ".application" %></th>
<th><%= t ".issued_at" %></th>
<th>&nbsp;</th>
</tr>
</thead>
<% @tokens.each do |token| %>
<tr>
<td><%= link_to token.client_application.name, token.client_application.url %></td>
<td><%= token.authorized_at %></td>
<td>
<%= form_tag({ :controller => "oauth", :action => "revoke" }) do %>
<%= hidden_field_tag "token", token.token, :autocomplete => "off" %>
<%= submit_tag t(".revoke"), :class => "btn btn-sm btn-primary" %>
<% end %>
</td>
</tr>
<% end %>
</table>
<% end %>
<h3><%= t ".my_apps" %></h3>
<% if @client_applications.empty? %>
<p><%= t(".no_apps_html", :oauth => link_to(t(".oauth"), "https://oauth.net")) %></p>
<% else %>
<p><%= t ".registered_apps" %></p>
<ul>
<% @client_applications.each do |client| %>
<li class="client_application">
<%= link_to client.name, :action => :show, :id => client.id %>
</li>
<% end %>
</ul>
<% end %>
<% if Settings.oauth_10_registration -%>
<%= link_to t(".register_new"), { :action => :new }, :class => "btn btn-outline-primary" %>
<% end -%>