app/views/admin/users.html.haml in community_engine-2.3.2 vs app/views/admin/users.html.haml in community_engine-3.0.0

- old
+ new

@@ -1,72 +1,57 @@ -.yui-b.sidebar - = render :partial => 'shared/admin_nav' += render :partial => 'shared/admin_nav' +-@page_title = :members.l +-box do + = bootstrap_form_tag :url => admin_users_url, :class => 'MainForm', :method => :get do |f| + = f.text_field :login + = f.text_field :email + = f.primary :search_users.l -#yui-main - .yui-b - -box do - %h3 - = configatron.community_name - = :members.l + = paginate @users, :theme => 'bootstrap' - = form_tag admin_users_url, :class => 'MainForm', :method => :get do - %label= :user_login.l - = text_field_tag 'login', params['login'] - %label= :user_e_mail.l - = text_field_tag 'email', params['email'] - %p - %input{:type=>"submit", :value=> :search_users.l } + %br + = bootstrap_form_tag :url => delete_selected_users_path, :id => 'users' do + %table.table.table-bordered.table-striped + %tr + %th + -if configatron.has_key?(:akismet_key) + %th + %th + %th + %th=:login.l + %th=:e_mail.l + %th=:status.l + %th=:actions.l - = paginate @users + - @users.each do |user| + %tr{:id => "user_#{user.id}"} + %td + = link_to fa_icon("trash-o"), user_path(user), :method => :delete, 'data-manual-confirm' => :are_you_sure_you_want_to_permanently_delete_this_user.l, :class => 'delete-via-ajax' + -if configatron.has_key?(:akismet_key) + %td + = link_to fa_icon("ban"), user_path(user, :spam => true), :method => :delete, :confirm => :are_you_sure_you_want_to_permanently_delete_this_user_and_mark_as_spam.l, :class => 'delete-via-ajax' + %td= check_box_tag "delete[]", user.id - = form_tag delete_selected_users_path, :id => 'users' do - %table{"cellspacing"=>"0", "border"=>"0", "cellpadding"=>"0", "width"=>"100%"} - %thead - %tr - %th{:width => '60px', :colspan => '3'} - %th=:login.l - %th=:e_mail.l - %th=:status.l - %th=:actions.l + %td + -if user.avatar + = image_tag user.avatar.photo.url(:thumb), :width => 25 + %td + = link_to_if user.active?, user.login, user_path(user) + %td + = h user.email + %td + = user.active? ? :active.l : :inactive.l + %td + -if user.active? + = link_to :assume_id.l , assume_user_path(user), :method => 'post', :class => 'btn btn-default' + -else + = link_to :activate.l, admin_activate_user_path(:id => user), :class => 'btn btn-success' - %tbody - - @users.each do |user| - %tr{:id => "user_#{user.id}"} - %td - = link_to_remote(image_tag('icons/delete.png'), {:url => user_path(user), :method => :delete, :success => visual_effect(:fade, "user_#{user.id}"), :confirm => "Are you sure you want to permanently delete this user?"} ) - %td - -if !configatron.akismet_key.nil? - = link_to_remote(image_tag('icons/bad-flag.png'), {:url => user_path(user, :spam => true), :method => :delete, 500 => 'alert(\'Sorry, there was a server error\'); return false', :success => visual_effect(:fade, "user_#{user.id}"), :confirm => "Are you sure you want to permanently delete this user and mark it as spam!?"} ) - %td= check_box_tag "delete[]", user.id - - %td - -if user.avatar - = image_tag user.avatar.photo.url(:thumb), :width => 25, :height => 25 - = link_to_if user.active?, h(user.login), user_path(user) - %td - = h user.email - %td - = user.active? ? :active.l : :inactive.l - %td - -if user.active? - = link_to(:assume_id.l , assume_user_path(user), :method => :post) - -else - = link_to(:activate.l, :controller => "/admin", :action => "activate_user", :id => user.id) + -if @users.any? + -if configatron.has_key?(:akismet_key) + = check_box_tag :spam + =:delete_selected_mark_as_spam.l + %br + %a.btn.btn-default.check-all{:href=>"#"} Toggle all + = submit_tag :delete_selected.l, :class => 'btn btn-danger' - %tfoot - %tr - %td{ :colspan => "4" } - -if @users.any? - %a{:href=>"#", :onclick=>"checkboxes.each(function(e){ e.checked = (e.checked == 0 ? 1 : 0) }); return false;"} Toggle all - %p - -if !configatron.akismet_key.nil? - = check_box_tag :spam - =:delete_selected_mark_as_spam.l - %br - = submit_tag :delete_selected.l - - = paginate @users - --content_for :end_javascript do - :javascript - var form = $('users'); - checkboxes = form.getInputs('checkbox'); + = paginate @users, :theme => 'bootstrap'