internetee-registry/app/views/admin/api_users/_form.haml
Artur Beljajev 4b172e9acf Improve UI
#407
2017-11-21 23:53:55 +02:00

57 lines
2 KiB
Text

= form_for([:admin, @api_user], multipart: true,
html: {class: 'form-horizontal', autocomplete: 'off'}) do |f|
= render 'shared/full_errors', object: @api_user
.row
.col-md-8
.form-group
.col-md-4.control-label
= f.label :username, nil, class: 'required'
.col-md-7
= f.text_field :username, required: true, autofocus: true, class: 'form-control'
.form-group
.col-md-4.control-label
= f.label :password, nil, class: 'required'
.col-md-7
= f.text_field :password, required: true, class: 'form-control'
.form-group
.col-md-4.control-label
= f.label :identity_code
.col-md-7
= f.text_field(:identity_code, class: 'form-control')
.form-group
.form-group.has-feedback.js-typeahead-container
.col-md-4.control-label
= f.label :registrar_typeahead, t(:registrar_name), class: 'required'
.col-md-7
= f.text_field(:registrar_typeahead,
class: 'form-control js-registrar-typeahead typeahead required',
placeholder: t(:registrar_name), autocomplete: 'off')
%span.glyphicon.glyphicon-ok.form-control-feedback.js-typeahead-ok.hidden
%span.glyphicon.glyphicon-remove.form-control-feedback.js-typeahead-remove
= f.hidden_field(:registrar_id, class: 'js-registrar-id')
.form-group
.col-md-4.control-label
= f.label :role, nil, class: 'required'
.col-md-7
= select_tag 'api_user[roles][]',
options_for_select(ApiUser::ROLES.map {|x| [x, x] }, @api_user.roles.try(:first)),
class: 'form-control selectize'
.checkbox
%label{for: 'api_user_active'}
= f.check_box(:active)
= t('.active')
%hr
.row
.col-md-8.text-right
= button_tag(t(:save), class: 'btn btn-primary')
:javascript
window.addEventListener('load', function() {
Autocomplete.bindAdminRegistrarSearch();
});