]> git.openstreetmap.org Git - rails.git/blobdiff - app/views/oauth_clients/index.html.erb
Convert account setting menu to tabs, and include on other pages
[rails.git] / app / views / oauth_clients / index.html.erb
index f88d9316cd7e77cf88de2a34121f28a8d3184dd9..7c956d53166c70fa6230d45ac1e2ae8650d24ef0 100644 (file)
@@ -1,36 +1,43 @@
 <% content_for :heading do %>
-  <h1><%= t'oauth_clients.index.title' %></h1>
+  <h1><%= t ".title" %></h1>
 <% end %>
 
+<%= render :partial => "settings_menu" %>
+
 <% unless @tokens.empty? %>
-<h3><%= t'oauth_clients.index.my_tokens' %></h3>
-<p><%= t'oauth_clients.index.list_tokens' %></p>
-<table>
-  <tr><th><%= t'oauth_clients.index.application' %></th>
-    <th><%= t'oauth_clients.index.issued_at' %></th><th>&nbsp;</th></tr>
-  <% @tokens.each do |token|%>
-    <%= content_tag_for :tr, token do %>
+<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 %>
-       <%= submit_tag t('oauth_clients.index.revoke') %>
-       <% end %>
+        <%= 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>
-    <% end %>
+    </tr>
   <% end %>
 </table>
 <% end %>
-<h3><%= t'oauth_clients.index.my_apps' %></h3>
+<h3><%= t ".my_apps" %></h3>
 <% if @client_applications.empty? %>
-<p><%= raw(t('oauth_clients.index.no_apps', :oauth => "<a href=\"https://oauth.net\">OAuth</a>")) %></p>
+<p><%= t(".no_apps_html", :oauth => link_to(t(".oauth"), "https://oauth.net")) %></p>
 <% else %>
-<p><%= t'oauth_clients.index.registered_apps' %></p>
-<% @client_applications.each do |client|%>
-  <%= div_for client do %>
+<p><%= t ".registered_apps" %></p>
+<% @client_applications.each do |client| %>
+  <div class="client_application">
     <%= link_to client.name, :action => :show, :id => client.id %>
-  <% end %>
+  </div>
 <% end %>
 <% end %>
-<h3><%= link_to t('oauth_clients.index.register_new'), :action => :new %></h3>
+<h3><%= link_to t(".register_new"), :action => :new %></h3>