Refatored to use shared/title partial

This commit is contained in:
Priit Tark 2015-04-16 16:29:04 +03:00
parent 4c660df43e
commit 8d4124585c
73 changed files with 402 additions and 411 deletions

View file

@ -1,9 +1,5 @@
.row
.col-sm-6
%h2.text-center-xs
= "#{t('edit_api_user')}"
.col-sm-6
%h2.text-right.text-center-xs
= link_to(t('back_to_api_user'), [:admin, @api_user], class: 'btn btn-default')
%hr
- content_for :actions do
= link_to(t(:back_to_api_user), [:admin, @api_user], class: 'btn btn-default')
= render 'shared/title', name: "#{t(:edit)}: #{@api_user.name}"
= render 'form'

View file

@ -1,10 +1,7 @@
.row
.col-sm-6
%h2.text-center-xs= t('api_users')
.col-sm-6
%h2.text-right.text-center-xs
= link_to(t('create_new_api_user'), new_admin_api_user_path, class: 'btn btn-primary')
%hr
- content_for :actions do
= link_to(t(:create_new_api_user), new_admin_api_user_path, class: 'btn btn-primary')
= render 'shared/title', name: t(:api_users)
.row
.col-md-12
.table-responsive
@ -14,9 +11,9 @@
%th{class: 'col-xs-2'}
= sort_link(@q, 'username')
%th{class: 'col-xs-2'}
= sort_link(@q, 'registrar_name', t('registrar'))
= sort_link(@q, 'registrar_name', t(:registrar))
%th{class: 'col-xs-2'}
= sort_link(@q, 'active', t('active'))
= sort_link(@q, 'active', t(:active))
%tbody
- @api_users.each do |x|
%tr

View file

@ -1,3 +1,3 @@
%h2= t('create_new_api_user')
%hr
= render 'shared/title', name: t(:create_new_api_user)
= render 'form'

View file

@ -1,13 +1,9 @@
.row
.col-sm-6
%h2.text-center-xs
= "#{t('api_user_details')}"
.col-sm-6
%h2.text-right.text-center-xs
= link_to(t('edit'), edit_admin_api_user_path(@api_user), class: 'btn btn-primary')
= link_to(t('delete'), admin_api_user_path(@api_user), method: :delete, data: { confirm: t('are_you_sure') }, class: 'btn btn-danger')
- content_for :actions do
= link_to(t(:edit), edit_admin_api_user_path(@api_user), class: 'btn btn-primary')
= link_to(t(:delete), admin_api_user_path(@api_user),
method: :delete, data: { confirm: t(:are_you_sure) }, class: 'btn btn-danger')
= render 'shared/title', @api_user.name
%hr
- if @api_user.errors.any?
- @api_user.errors.each do |attr, err|
= err
@ -18,32 +14,33 @@
.col-md-12
.panel.panel-default
.panel-heading
%h3.panel-title= t('general')
%h3.panel-title= t(:general)
.panel-body
%dl.dl-horizontal
%dt= t('username')
%dt= t(:username)
%dd= @api_user.username
%dt= t('password')
%dt= t(:password)
%dd= @api_user.password
%dt= t('active')
%dt= t(:active)
%dd= @api_user.active
.row
.col-md-12
.panel.panel-default
.panel-heading.clearfix
.pull-left
= t('certificates')
= t(:certificates)
.pull-right
= link_to(t('upload_csr'), new_admin_api_user_certificate_path(@api_user), 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')
.table-responsive
%table.table.table-hover.table-bordered.table-condensed
%thead
%tr
%th{class: 'col-xs-10'}= t('subject')
%th{class: 'col-xs-2'}= t('status')
%th{class: 'col-xs-10'}= t(:subject)
%th{class: 'col-xs-2'}= t(:status)
%tbody
- @api_user.certificates.each do |x|
- if x.csr