added endpoints to demo registry for accr results

This commit is contained in:
olegphenomenon 2021-12-10 16:53:25 +02:00
parent 487cbb1774
commit c07abaea59
20 changed files with 401 additions and 78 deletions

View file

@ -2,4 +2,16 @@
<td><%= link_to api_user, admin_registrar_api_user_path(api_user.registrar, api_user) %></td>
<td><%= link_to api_user.registrar, admin_registrar_path(api_user.registrar) %></td>
<td><%= api_user.active %></td>
<td style="text-align: center;">
<% if !api_user.accredited? || api_user.accreditation_expired? %>
<%= button_to t(:set_test_btn),
{ controller: 'api_users', action: 'set_test_date_to_api_user', user_api_id: api_user.id },
{ method: :post, class: 'btn btn-primary'} %>
<% else %>
<%= button_to t(:remove_test_btn),
{ controller: 'api_users', action: 'remove_test_date_to_api_user', user_api_id: api_user.id },
{ method: :post, class: 'btn btn-danger'} %>
<% end %>
</td>
</tr>

View file

@ -10,15 +10,18 @@
<table class="table table-hover table-bordered table-condensed">
<thead>
<tr>
<th class="col-xs-2">
<th class="col-xs-3">
<%= sort_link(@q, 'username') %>
</th>
<th class="col-xs-2">
<th class="col-xs-3">
<%= sort_link(@q, 'registrar_name', Registrar.model_name.human) %>
</th>
<th class="col-xs-2">
<th class="col-xs-3">
<%= sort_link(@q, 'active', ApiUser.human_attribute_name(:active)) %>
</th>
<th class="col-xs-1">
Test status
</th>
</tr>
</thead>

View file

@ -6,12 +6,12 @@
</ol>
<div class="page-header">
<div class="row">
<div class="row" style="display: flex; flex-direction: row; align-items: baseline;">
<div class="col-sm-8">
<h1><%= @api_user.username %></h1>
</div>
<div class="col-sm-4 text-right">
<div class="col-sm-4 text-right" style="display: flex; flex-direction: row; align-items: baseline; justify-content: space-evenly;">
<%= link_to t('.edit_btn'), edit_admin_registrar_api_user_path(@api_user.registrar,
@api_user),
class: 'btn btn-primary' %>
@ -20,6 +20,16 @@
method: :delete,
data: { confirm: t('.delete_btn_confirm') },
class: 'btn btn-default' %>
<% if !@api_user.accredited? || @api_user.accreditation_expired? %>
<%= button_to t(:set_test_btn),
{ controller: 'api_users', action: 'set_test_date_to_api_user', user_api_id: @api_user.id },
{ method: :post, class: 'btn btn-primary'} %>
<% else %>
<%= button_to t(:remove_test_btn),
{ controller: 'api_users', action: 'remove_test_date_to_api_user', user_api_id: @api_user.id },
{ method: :post, class: 'btn btn-danger'} %>
<% end %>
</div>
</div>
</div>