Apply approved and rejected filters for register requests. Tune abilities. Link to user profile if user have already registered. Refs #174
This commit is contained in:
parent
43c896021e
commit
bab3a90155
|
@ -5,7 +5,7 @@ class RegisterRequestsController < ApplicationController
|
||||||
before_filter :find_register_request, :only => [:approve, :reject]
|
before_filter :find_register_request, :only => [:approve, :reject]
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@register_requests = @register_requests.unprocessed.paginate(:page => params[:page])
|
@register_requests = @register_requests.send((params[:scope] || 'unprocessed').to_sym).paginate(:page => params[:page])
|
||||||
end
|
end
|
||||||
|
|
||||||
def new
|
def new
|
||||||
|
|
|
@ -17,6 +17,8 @@ class Ability
|
||||||
cannot :destroy, Subscribe
|
cannot :destroy, Subscribe
|
||||||
cannot :create, Subscribe
|
cannot :create, Subscribe
|
||||||
cannot :create, RegisterRequest
|
cannot :create, RegisterRequest
|
||||||
|
cannot :approve, RegisterRequest, :approved => true
|
||||||
|
cannot :reject, RegisterRequest, :rejected => true
|
||||||
else
|
else
|
||||||
# Shared rights between guests and registered users
|
# Shared rights between guests and registered users
|
||||||
can :forbidden, Platform
|
can :forbidden, Platform
|
||||||
|
|
|
@ -5,6 +5,10 @@
|
||||||
%li= link_to t("layout.users.new"), new_user_path
|
%li= link_to t("layout.users.new"), new_user_path
|
||||||
%li.active= link_to t("layout.users.register_requests"), register_requests_path
|
%li.active= link_to t("layout.users.register_requests"), register_requests_path
|
||||||
.content
|
.content
|
||||||
|
%div{:style => 'float: right; margin: 20px'}
|
||||||
|
= link_to t("layout.register_request.approved"), register_requests_path(:scope => :approved)
|
||||||
|
\|
|
||||||
|
= link_to t("layout.register_request.rejected"), register_requests_path(:scope => :rejected)
|
||||||
%h2.title
|
%h2.title
|
||||||
= t("layout.register_request.list_header")
|
= t("layout.register_request.list_header")
|
||||||
.inner
|
.inner
|
||||||
|
@ -23,7 +27,8 @@
|
||||||
%tr{:class => cycle("odd", "even")}
|
%tr{:class => cycle("odd", "even")}
|
||||||
%td= check_box_tag 'request_ids[]', request.id
|
%td= check_box_tag 'request_ids[]', request.id
|
||||||
%td= request.name
|
%td= request.name
|
||||||
%td= request.email
|
- @user = User.find_by_email(request.email) if request.approved
|
||||||
|
%td= link_to_if @user, request.email, @user
|
||||||
%td= request.interest
|
%td= request.interest
|
||||||
%td= request.more
|
%td= request.more
|
||||||
%td= request.created_at
|
%td= request.created_at
|
||||||
|
|
Loading…
Reference in New Issue