.container-fluid.bg_light .row .col-md-12 .page_header %h1 #{t('admin.action.index.title')} de Usuários .hr .row .col-md-12 .breadcrumb .row .col-md-12 %ul.nav.nav-tabs %li.nav-item = link_to '', class: 'nav-link active', method: :get do %i.fa.fa-list = t('admin.actions.index.menu').capitalize .row .col-md-12 .tab-content.list .tab-pane.fade.show.active %nav.navbar.navbar-light.bg-light.filter = simple_form_for 'usuarios', :url =>"/admin/users", :method => :get, :id=>'form_filter', html: { class: "form-inline"} do |f| = f.input 'text', class: 'form-control mr-sm-2', placeholder: t('admin.misc.filter'), input_html: { name: 'q',value: params[:q]} = button_tag :button, class: 'btn btn-outline-success' do %i.fa.fa-refresh = t('admin.misc.refresh') %a.btn.btn-outline-danger{:href => '/admin/users'} %i.fa.fa-times %p %a{"aria-controls" => "collapseExample", "aria-expanded" => "false", "data-toggle" => "collapse", :href => "#collapseExample"} Mais filtros - if @filtros == "" = '- Nenhum Filtro Ativo' - else = '- Filtros Ativos: ' %a.btn.btn-outline-danger{ :style => "white-space: normal;",:href => '/admin/users'} %i.fa.fa-times = @filtros #collapseExample.collapse .card.card-block = render partial: 'filter' .row .col-md-6 = 'Foram encontrados ' + @users_length.to_s + ' resultados para a busca.' .col-md-6.text-right = link_to 'Download as .xlsx', users_export_path(request.parameters.merge(format: :xlsx)),download: 'cadastros.xlsx', class: 'pr-1' = link_to t('admin.misc.add_new'), new_admin_user_path, class: 'btn btn-default submit_buttons' %div{:style => "overflow-x:auto"} %table.table.table-condensed.table-striped %thead %tr %th #{t('activerecord.attributes.user.registration_status').titleize} %th #{t('activerecord.attributes.user.registration_status_at').titleize} %th #{t('activerecord.attributes.user.name').titleize} %th #{t('activerecord.attributes.user.email').titleize} %th #{t('activerecord.attributes.user.valid').titleize} %th #{t('activerecord.attributes.user.subscription').titleize} %th #{t('simple_form.labels.defaults.association_type').titleize} %th #{t('activerecord.attributes.user.registration').titleize} %th #{t('activerecord.attributes.user.situation').titleize} %th #{t('simple_form.labels.defaults.options').titleize} %th #{t('simple_form.labels.defaults.actions').titleize} %tbody - @users_paginate.each do |user| %tr %td= user.registration_status_list.key(user.registration_status.to_s) %td= user.registration_status_at %td= user.name %td= user.email %td= user.associate ? user.associate.valid_until : 'Não associado' %td= user.created_at %td= user.associate ? user.associate.association_type.description : t("activerecord.models.associate.not_associated") %td= user.associate ? 'Completo' : 'Simples' %td= user.associate ? t("activerecord.models.associate.#{user.associate.association_state}") : t("activerecord.models.associate.not_associated") %td = link_to admin_user_path(user), method: :get do %img{:title => "Informações do usuário", :alt => "Informações do usuário", :src => asset_path( 'icons/info.png' )}/ = link_to user_associate_admin_edit_path(user) do %img{:title => "Editar informações", :alt => "Editar informações", :src => asset_path( 'icons/edit.png' )}/ = link_to (admin_user_path(user) + "?" + @filtersQuery), method: :delete, data:{confirm: "Deseja mesmo excluir"} do %img{:title => "Excluir usuário", :alt => "Excluir usuário", :src => asset_path( 'icons/delete.png' )}/ - if user.associate %td - if user.associate.new_associate? = link_to (user_associate_approve_admin_users_path(user) + "?" + @filtersQuery), method: :get, data:{confirm: "Deseja mesmo aprovar?"} do %img{:title => "Aprovar", :alt => "Aprovar", :src => asset_path( 'icons/approve.png' )}/ = link_to '' , 'data-target': "#modalReject_" + user.id, 'data-toggle': "modal" do %img{:title => "Negar", :alt => "Negar", :src => asset_path( 'icons/reject.png' )}/ - if user.associate.approved? = link_to '' , 'data-target': "#modalReject_" + user.id, 'data-toggle': "modal" do %img{:title => "Negar", :alt => "Negar", :src => asset_path( 'icons/reject.png' )}/ - if user.associate.running? = link_to '' , 'data-target': "#modalReject_" + user.id, 'data-toggle': "modal" do %img{:title => "Negar", :alt => "Negar", :src => asset_path( 'icons/reject.png' )}/ - if user.associate.rejected? = link_to (user_associate_approve_admin_users_path(user) + "?" + @filtersQuery), method: :get, data:{confirm: "Deseja mesmo aprovar?"} do %img{:title => "Aprovar", :alt => "Aprovar", :src => asset_path( 'icons/approve.png' )}/ - if user.associate.expired? Expirado -# can nothing TODO validate -#= link_to admin_user_path(user), method: :get do -# %i.fa.fa-info-circle.fa-fw.fa-inverse = link_to user_associate_expire_admin_users_path(user), method: :get do %img{:alt => "Expirado", :src => "/assets/icons/payment-needed.png"}/ - else %td Não Associado -#input :association_state, collection: Associate.aasm.states.map(&:name) = paginate @users_paginate .row .div .col-md-12 -#%p -# %a{"aria-controls" => "collapseExample", "aria-expanded" => "false", "data-toggle" => "collapse", :href => "#collapseExample"} -# Link with href -##collapseExample.collapse -# .card.card-block -# asd - @users_paginate.each do |user| .modal.fade{"aria-labelledby" => "myModalLabel", :role => "dialog", :tabindex => "-1", :id => "modalReject_" + user.id} .modal-dialog{:role => "document"} .modal-content .modal-header %h4#myModalLabel.modal-title Escreva o Motivo %button.close{"aria-label" => "Close", "data-dismiss" => "modal", :type => "button"} %span{"aria-hidden" => "true"} × .modal-body %form.rejectMessageForm{:action => user_associate_reject_admin_users_path(user), :method => "get", :id => "userReject_" + user.id} .form-group %textarea{:name => "reason", :id => "userReject_" + user.id + "_reason", :class => 'form-control'} %input{:name => "__filters", :type => "hidden", :value => @filtersQuery} .col-12 %input.submitReject.btn.btn-primary{:type => "submit"}/ %button.btn.btn-secondary{"aria-label" => "Close", "data-dismiss" => "modal", :type => "button"} %span{"aria-hidden" => "true"} Cancelar -#