Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User admin #1934

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions authentication/app/models/refinery/user.rb
@@ -1,5 +1,6 @@
require 'devise' require 'devise'
require 'friendly_id' require 'friendly_id'
require 'acts_as_indexed'


module Refinery module Refinery
class User < Refinery::Core::BaseModel class User < Refinery::Core::BaseModel
Expand All @@ -10,6 +11,9 @@ class User < Refinery::Core::BaseModel
has_many :plugins, :class_name => "UserPlugin", :order => "position ASC", :dependent => :destroy has_many :plugins, :class_name => "UserPlugin", :order => "position ASC", :dependent => :destroy
friendly_id :username, :use => [:slugged] 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: # Include default devise modules. Others available are:
# :token_authenticatable, :confirmable, :lockable and :timeoutable # :token_authenticatable, :confirmable, :lockable and :timeoutable
if self.respond_to?(:devise) if self.respond_to?(:devise)
Expand Down
@@ -1,4 +1,7 @@
<ul> <ul>
<li>
<%= render '/refinery/admin/search', :url => refinery.admin_users_path %>
</li>
<li> <li>
<%= link_to t('.create_new_user'), <%= link_to t('.create_new_user'),
refinery.new_admin_user_path, :class => "add_icon" %> refinery.new_admin_user_path, :class => "add_icon" %>
Expand Down
10 changes: 10 additions & 0 deletions 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'> <div class='pagination_container'>
<%= render 'users' %> <%= render 'users' %>
</div> </div>
<% else %>
<p>
<%= t('no_results', :scope => 'refinery.admin.search') %>
</p>
<% end %>