Remove Registrar from User

This commit is contained in:
Martin Lensment 2014-12-16 15:58:34 +02:00
parent 9c8fed999d
commit 2c35aa1471
14 changed files with 12 additions and 72 deletions

View file

@ -44,26 +44,6 @@
%dt= t('shared.billing_address')
%dd= @registrar.billing_address
.row
.col-md-12
#users.panel.panel-default
.panel-heading.clearfix
= t('shared.users')
.table-responsive
%table.table.table-hover.table-bordered.table-condensed
%thead
%tr
%th{class: 'col-xs-3'}= t('shared.username')
%th{class: 'col-xs-3'}= t('shared.email')
%th{class: 'col-xs-3'}= t('shared.identity_code')
%th{class: 'col-xs-3'}= t('shared.admin')
%tbody
- @registrar.users.each do |x|
%tr
%td= link_to(x, [:admin, x])
%td= x.email
%td= x.identity_code
%td= x.admin
.row
.col-md-12

View file

@ -25,13 +25,6 @@
.form-group
= f.label :email
= f.text_field(:email, class: 'form-control')
.form-group
.form-group.has-feedback.js-typeahead-container
= f.label :registrar_typeahead, t('shared.registrar')
= f.text_field(:registrar_typeahead, class: 'form-control js-registrar-typeahead', placeholder: t('shared.registrar'), 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
.checkbox
%label{for: 'user_admin'}
@ -41,19 +34,3 @@
.row
.col-md-12.text-right
= button_tag(t('shared.save'), class: 'btn btn-primary')
:javascript
Autocomplete.bindAdminRegistrarSearch();
toggleRegistrar();
$('#user_admin').click(function() {
toggleRegistrar();
});
function toggleRegistrar() {
if($('.js-admin').is(':checked')) {
$('.js-registrar-typeahead, .js-registrar-id').attr('disabled', true);
} else {
$('.js-registrar-typeahead, .js-registrar-id').attr('disabled', false);
}
}

View file

@ -19,8 +19,6 @@
= sort_link(@q, 'identity_code', t('shared.identity_code'))
%th{class: 'col-xs-2'}
= sort_link(@q, 'admin', t('shared.admin'))
%th{class: 'col-xs-2'}
= sort_link(@q, 'registrar', t('shared.registrar'))
%tbody
- @users.each do |x|
%tr
@ -28,7 +26,6 @@
%td= x.email
%td= x.identity_code
%td= x.admin
%td= x.registrar
.row
.col-md-12
= paginate @users

View file

@ -39,8 +39,5 @@
%dt= t('shared.email')
%dd= @user.email
%dt= t('shared.registrar')
%dd= @user.registrar
%dt= t('shared.admin')
%dd= @user.admin