Rework some of the OAuth2 views, adding links and messages when there are no applications.

This commit is contained in:
Andy Allan 2021-05-12 12:04:56 +01:00
parent b96f3867e6
commit 7c26d84a84
7 changed files with 70 additions and 45 deletions

View file

@ -1,7 +1,7 @@
<tr>
<td class="align-middle">
<ul class="list-unstyled mb-0">
<li><%= application.name %></li>
<li><%= link_to application.name, oauth_application_path(application) %></li>
<% application.redirect_uri.split.each do |uri| -%>
<li class="text-muted"><%= uri %></li>
<% end -%>

View file

@ -2,12 +2,22 @@
<h1><%= t ".title" %></h1>
<% end %>
<% if @applications.length > 0 %>
<table class="table table-borderless table-striped">
<thead>
<th><%= t ".name" %></th>
<th><%= t ".permissions" %></th>
<th></th>
<th></th>
</thead>
<tbody>
<%= render :partial => "application", :collection => @applications %>
</tbody>
</table>
<% else %>
<p><%= t ".no_applications_html", :oauth2 => link_to(t(".oauth_2"), "https://oauth.net/2/") %></p>
<% end %>
<p>
<%= link_to t(".new"), new_oauth_application_path, :class => "btn btn-outline-primary" %>
</p>
<table class="table table-borderless table-striped">
<tbody>
<%= render :partial => "application", :collection => @applications %>
</tbody>
</table>

View file

@ -42,3 +42,8 @@
</td>
</tr>
</table>
<div>
<%= link_to t(".edit"), edit_oauth_application_path(@application), :class => "btn btn-outline-primary" %>
<%= link_to t(".delete"), oauth_application_path(@application), { :method => :delete, :class => "btn btn-outline-danger", :data => { :confirm => t(".confirm_delete") } } %>
</td>