User admin #1934

Closed
wants to merge 2 commits into
from
View
4 authentication/app/models/refinery/user.rb
@@ -1,5 +1,6 @@
require 'devise'
require 'friendly_id'
+require 'acts_as_indexed'
module Refinery
class User < Refinery::Core::BaseModel
@@ -10,6 +11,9 @@ class User < Refinery::Core::BaseModel
has_many :plugins, :class_name => "UserPlugin", :order => "position ASC", :dependent => :destroy
friendly_id :username, :use => [:slugged]
+ # Docs for acts_as_indexed http://github.com/dougal/acts_as_indexed
+ acts_as_indexed :fields => [:username, :email]
+
# Include default devise modules. Others available are:
# :token_authenticatable, :confirmable, :lockable and :timeoutable
if self.respond_to?(:devise)
View
3 authentication/app/views/refinery/admin/users/_actions.html.erb
@@ -1,5 +1,8 @@
<ul>
<li>
+ <%= render '/refinery/admin/search', :url => refinery.admin_users_path %>
+ </li>
+ <li>
<%= link_to t('.create_new_user'),
refinery.new_admin_user_path, :class => "add_icon" %>
</li>
View
10 authentication/app/views/refinery/admin/users/_records.html.erb
@@ -1,3 +1,13 @@
+<% if searching? %>
+ <%= link_to t('cancel_search', :scope => 'refinery.admin.search'), refinery.admin_users_path, :class => "cancel-search" %>
+ <h2><%= t('results_for_html', :scope => 'refinery.admin.search', :query => h(params[:search])).html_safe %></h2>
+<% end %>
+<% if @users.any? %>
<div class='pagination_container'>
<%= render 'users' %>
</div>
+<% else %>
+ <p>
+ <%= t('no_results', :scope => 'refinery.admin.search') %>
+ </p>
+<% end %>