mirror of
https://github.com/internetee/registry.git
synced 2025-06-11 23:24:48 +02:00
Extract partials
This commit is contained in:
parent
9079fc68ec
commit
c815da3afd
4 changed files with 89 additions and 82 deletions
|
@ -26,90 +26,12 @@
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<div class="panel panel-default">
|
<%= render 'admin/api_users/show/details' %>
|
||||||
<div class="panel-heading">
|
|
||||||
<h3 class="panel-title">
|
|
||||||
<%= t '.header' %>
|
|
||||||
</h3>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="panel-body">
|
|
||||||
<dl class="dl-horizontal">
|
|
||||||
<dt><%= ApiUser.human_attribute_name :username %></dt>
|
|
||||||
<dd><%= @api_user.username %></dd>
|
|
||||||
|
|
||||||
<dt><%= ApiUser.human_attribute_name :plain_text_password %></dt>
|
|
||||||
<dd><%= @api_user.plain_text_password %></dd>
|
|
||||||
|
|
||||||
<dt><%= Registrar.model_name.human %></dt>
|
|
||||||
<dd><%= link_to(@api_user.registrar, admin_registrar_path(@api_user.registrar)) %></dd>
|
|
||||||
|
|
||||||
<dt><%= ApiUser.human_attribute_name :roles %></dt>
|
|
||||||
<dd><%= @api_user.roles.join(', ') %></dd>
|
|
||||||
|
|
||||||
<dt><%= ApiUser.human_attribute_name :active %></dt>
|
|
||||||
<dd><%= @api_user.active %></dd>
|
|
||||||
</dl>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<div class="panel panel-default">
|
<%= render 'admin/api_users/show/certificates' %>
|
||||||
<div class="panel-heading clearfix">
|
|
||||||
<div class="pull-left">
|
|
||||||
<%= t(:certificates) %>
|
|
||||||
</div>
|
|
||||||
<div class="pull-right">
|
|
||||||
<%= link_to(t(:upload_crt), new_admin_api_user_certificate_path(@api_user, crt: true), class: 'btn btn-primary btn-xs') %>
|
|
||||||
<%= link_to(t(:upload_csr), new_admin_api_user_certificate_path(@api_user), class: 'btn btn-primary btn-xs') %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="table-responsive">
|
|
||||||
<table class="table table-hover table-bordered table-condensed">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th class="col-xs-10">
|
|
||||||
<%= t('.subject') %>
|
|
||||||
</th>
|
|
||||||
<th class="col-xs-2">
|
|
||||||
<%= t(:status) %>
|
|
||||||
</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
|
|
||||||
<tbody>
|
|
||||||
<% @api_user.certificates.each do |x| %>
|
|
||||||
<% if x.csr %>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<%= link_to(x.parsed_csr.try(:subject),
|
|
||||||
admin_api_user_certificate_path(@api_user,
|
|
||||||
x)) %>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<%= x.status %>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<% elsif x.crt %>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<%= link_to(x.parsed_crt.try(:subject),
|
|
||||||
admin_api_user_certificate_path(@api_user,
|
|
||||||
x)) %>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<%= x.status %>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<% end %>
|
|
||||||
<% end %>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
55
app/views/admin/api_users/show/_certificates.html.erb
Normal file
55
app/views/admin/api_users/show/_certificates.html.erb
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
<div class="panel panel-default">
|
||||||
|
<div class="panel-heading clearfix">
|
||||||
|
<div class="pull-left">
|
||||||
|
<%= t(:certificates) %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="pull-right">
|
||||||
|
<%= link_to(t(:upload_crt), new_admin_api_user_certificate_path(@api_user, crt: true), class: 'btn btn-primary btn-xs') %>
|
||||||
|
<%= link_to(t(:upload_csr), new_admin_api_user_certificate_path(@api_user), class: 'btn btn-primary btn-xs') %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="table-responsive">
|
||||||
|
<table class="table table-hover table-bordered table-condensed">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th class="col-xs-10">
|
||||||
|
<%= t('.subject') %>
|
||||||
|
</th>
|
||||||
|
<th class="col-xs-2">
|
||||||
|
<%= t(:status) %>
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
<% @api_user.certificates.each do |x| %>
|
||||||
|
<% if x.csr %>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<%= link_to(x.parsed_csr.try(:subject),
|
||||||
|
admin_api_user_certificate_path(@api_user,
|
||||||
|
x)) %>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<%= x.status %>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<% elsif x.crt %>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<%= link_to(x.parsed_crt.try(:subject),
|
||||||
|
admin_api_user_certificate_path(@api_user,
|
||||||
|
x)) %>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<%= x.status %>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
26
app/views/admin/api_users/show/_details.html.erb
Normal file
26
app/views/admin/api_users/show/_details.html.erb
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
<div class="panel panel-default">
|
||||||
|
<div class="panel-heading">
|
||||||
|
<h3 class="panel-title">
|
||||||
|
<%= t '.header' %>
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="panel-body">
|
||||||
|
<dl class="dl-horizontal">
|
||||||
|
<dt><%= ApiUser.human_attribute_name :username %></dt>
|
||||||
|
<dd><%= @api_user.username %></dd>
|
||||||
|
|
||||||
|
<dt><%= ApiUser.human_attribute_name :plain_text_password %></dt>
|
||||||
|
<dd><%= @api_user.plain_text_password %></dd>
|
||||||
|
|
||||||
|
<dt><%= Registrar.model_name.human %></dt>
|
||||||
|
<dd><%= link_to(@api_user.registrar, admin_registrar_path(@api_user.registrar)) %></dd>
|
||||||
|
|
||||||
|
<dt><%= ApiUser.human_attribute_name :roles %></dt>
|
||||||
|
<dd><%= @api_user.roles.join(', ') %></dd>
|
||||||
|
|
||||||
|
<dt><%= ApiUser.human_attribute_name :active %></dt>
|
||||||
|
<dd><%= @api_user.active %></dd>
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -11,12 +11,16 @@ en:
|
||||||
created: API user has been successfully created
|
created: API user has been successfully created
|
||||||
|
|
||||||
show:
|
show:
|
||||||
header: Details
|
|
||||||
subject: Subject
|
|
||||||
edit_btn: Edit
|
edit_btn: Edit
|
||||||
delete_btn: Delete
|
delete_btn: Delete
|
||||||
delete_btn_confirm: Are you sure you want to delete this API user?
|
delete_btn_confirm: Are you sure you want to delete this API user?
|
||||||
|
|
||||||
|
details:
|
||||||
|
header: Details
|
||||||
|
|
||||||
|
certificates:
|
||||||
|
subject: Subject
|
||||||
|
|
||||||
edit:
|
edit:
|
||||||
header: Edit API user
|
header: Edit API user
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue