]> git.openstreetmap.org Git - rails.git/blob - app/views/oauth2_applications/show.html.erb
Rework some of the OAuth2 views, adding links and messages when there are no applicat...
[rails.git] / app / views / oauth2_applications / show.html.erb
1 <% content_for :heading do %>
2   <h1><%= @application.name %></h1>
3 <% end %>
4
5 <% secret = flash[:application_secret].presence || @application.plaintext_secret %>
6
7 <table class="table table-borderless">
8   <tr>
9     <th><%= t ".client_id" %></th>
10     <td><code><%= @application.uid %></code></td>
11   </tr>
12   <% unless secret.blank? && Doorkeeper.config.application_secret_hashed? -%>
13   <tr>
14     <th><%= t ".client_secret" %></th>
15     <td>
16       <code><%= secret %></code>
17       <% if Doorkeeper.config.application_secret_hashed? -%>
18       <br />
19       <small class="text-danger"><%= t ".client_secret_warning" %></small>
20       <% end -%>
21     </td>
22   </tr>
23   <% end -%>
24   <tr>
25     <th><%= t ".permissions" %></th>
26     <td>
27       <ul class="list-unstyled mb-0">
28         <% @application.scopes.each do |scope| -%>
29           <li><%= t "oauth.scopes.#{scope}" %> <code class="text-muted">(<%= scope %>)</code></li>
30         <% end -%>
31       </ul>
32     </td>
33   </tr>
34   <tr>
35     <th><%= t ".redirect_uris" %></th>
36     <td>
37       <ul class="list-unstyled mb-0">
38         <% @application.redirect_uri.split.each do |uri| -%>
39           <li><%= uri %></li>
40         <% end -%>
41       </ul>
42     </td>
43   </tr>
44 </table>
45
46 <div>
47   <%= link_to t(".edit"), edit_oauth_application_path(@application), :class => "btn btn-outline-primary" %>
48   <%= link_to t(".delete"), oauth_application_path(@application), { :method => :delete, :class => "btn btn-outline-danger", :data => { :confirm => t(".confirm_delete") } } %>
49 </td>