diff --git a/app/views/admin/api_users/_form.html.erb b/app/views/admin/api_users/_form.html.erb index b97d45539..0b4eadb0f 100644 --- a/app/views/admin/api_users/_form.html.erb +++ b/app/views/admin/api_users/_form.html.erb @@ -1,5 +1,6 @@ <%= form_for([:admin, @api_user.registrar, @api_user], html: { class: 'form-horizontal', autocomplete: 'off' }) do |f| %> <%= render 'shared/full_errors', object: @api_user %> +
@@ -10,6 +11,7 @@ <%= f.text_field :username, required: true, autofocus: true, class: 'form-control' %>
+
<%= f.label :plain_text_password, nil, class: 'required' %> @@ -18,6 +20,7 @@ <%= f.text_field :plain_text_password, required: true, class: 'form-control' %>
+
<%= f.label :identity_code %> @@ -26,10 +29,12 @@ <%= f.text_field(:identity_code, class: 'form-control') %>
+
<%= f.label :role, nil, class: 'required' %>
+
<%= select_tag 'api_user[roles][]', options_for_select(ApiUser::ROLES.map { |x| [x, x] }, @api_user.roles.try(:first)), class: 'form-control selectize' %>
@@ -42,10 +47,13 @@
+
+
<%= button_tag(t(:save), class: 'btn btn-primary') %>
+ <% end %> diff --git a/app/views/admin/api_users/index.html.erb b/app/views/admin/api_users/index.html.erb index 20c76e54f..8faff2cff 100644 --- a/app/views/admin/api_users/index.html.erb +++ b/app/views/admin/api_users/index.html.erb @@ -1,42 +1,41 @@ +
- - - - - - - - <% @api_users.each do |api_user| %> - - - + + + - <% end %> + + + + <% @api_users.each do |api_user| %> + + + + + + <% end %>
- <%= sort_link(@q, 'username') %> - - <%= sort_link(@q, 'registrar_name', t(:registrar_name)) %> - - <%= sort_link(@q, 'active', t('.active')) %> -
- <%= link_to api_user, admin_registrar_api_user_path(api_user.registrar, api_user) %> - - <%= link_to api_user.registrar, [:admin, api_user.registrar] %> - - <%= api_user.active %> - + <%= sort_link(@q, 'username') %> + + <%= sort_link(@q, 'registrar_name', t(:registrar_name)) %> + + <%= sort_link(@q, 'active', t('.active')) %> +
<%= link_to api_user, + admin_registrar_api_user_path(api_user.registrar, + api_user) %><%= link_to api_user.registrar, [:admin, api_user.registrar] %><%= api_user.active %>
+
<%= paginate @api_users %> diff --git a/app/views/admin/api_users/show.html.erb b/app/views/admin/api_users/show.html.erb index 0061263f8..1c7c9941b 100644 --- a/app/views/admin/api_users/show.html.erb +++ b/app/views/admin/api_users/show.html.erb @@ -32,43 +32,29 @@ <%= t(:general) %>
+
-
- <%= t(:username) %> -
-
- <%= @api_user.username %> -
-
- <%= t(:password) %> -
-
- <%= @api_user.plain_text_password %> -
-
- <%= t(:registrar_name) %> -
-
- <%= link_to(@api_user.registrar, admin_registrar_path(@api_user.registrar)) %> -
-
- <%= t(:role) %> -
-
- <%= @api_user.roles.join(', ') %> -
-
- <%= t('.active') %> -
-
- <%= @api_user.active %> -
+
<%= t(:username) %>
+
<%= @api_user.username %>
+ +
<%= t(:password) %>
+
<%= @api_user.plain_text_password %>
+ +
<%= t(:registrar_name) %>
+
<%= link_to(@api_user.registrar, admin_registrar_path(@api_user.registrar)) %>
+ +
<%= t(:role) %>
+
<%= @api_user.roles.join(', ') %>
+ +
<%= t('.active') %>
+
<%= @api_user.active %>
+
@@ -81,40 +67,46 @@ <%= link_to(t(:upload_csr), new_admin_api_user_certificate_path(@api_user), class: 'btn btn-primary btn-xs') %>
+
- - - - + + + + + - <% @api_user.certificates.each do |x| %> - <% if x.csr %> - - - - - <% elsif x.crt %> - - - - + <% @api_user.certificates.each do |x| %> + <% if x.csr %> + + + + + <% elsif x.crt %> + + + + + <% end %> <% end %> - <% end %>
- <%= t('.subject') %> - - <%= t(:status) %> -
+ <%= t('.subject') %> + + <%= t(:status) %> +
- <%= link_to(x.parsed_csr.try(:subject), admin_api_user_certificate_path(@api_user, x)) %> - - <%= x.status %> -
- <%= link_to(x.parsed_crt.try(:subject), admin_api_user_certificate_path(@api_user, x)) %> - - <%= x.status %> -
+ <%= link_to(x.parsed_csr.try(:subject), + admin_api_user_certificate_path(@api_user, + x)) %> + + <%= x.status %> +
+ <%= link_to(x.parsed_crt.try(:subject), + admin_api_user_certificate_path(@api_user, + x)) %> + + <%= x.status %> +