mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-04-04 23:24:49 -04:00
Member admin
This commit is contained in:
12
app/controllers/admin/members_controller.rb
Normal file
12
app/controllers/admin/members_controller.rb
Normal file
@@ -0,0 +1,12 @@
|
||||
class Admin::MembersController < ApplicationController
|
||||
before_action :auth!
|
||||
def index
|
||||
@members = Member.order(:login_name).paginate(page: params[:page])
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def auth!
|
||||
authorize! :manage, :all
|
||||
end
|
||||
end
|
||||
@@ -21,6 +21,7 @@
|
||||
%h2 Member admin
|
||||
%ul
|
||||
%li= link_to "Newsletter subscribers", admin_newsletter_path
|
||||
%li= link_to "Members", admin_members_path
|
||||
|
||||
.row
|
||||
.col-md-12
|
||||
|
||||
15
app/views/admin/members/index.html.haml
Normal file
15
app/views/admin/members/index.html.haml
Normal file
@@ -0,0 +1,15 @@
|
||||
.pagination
|
||||
= page_entries_info @members
|
||||
= will_paginate @members
|
||||
|
||||
|
||||
%table.table.table-striped
|
||||
%tr
|
||||
%th Name
|
||||
%th Email
|
||||
%th
|
||||
%th
|
||||
- @members.each do |member|
|
||||
%tr
|
||||
%td=member.login_name
|
||||
%td=member.email
|
||||
@@ -90,6 +90,9 @@ Growstuff::Application.routes.draw do
|
||||
get '/shop/:action' => 'shop#:action'
|
||||
|
||||
comfy_route :cms_admin, path: '/admin/cms'
|
||||
namespace :admin do
|
||||
resources :members
|
||||
end
|
||||
get '/admin/orders' => 'admin/orders#index'
|
||||
get '/admin/orders/:action' => 'admin/orders#:action'
|
||||
get '/admin' => 'admin#index'
|
||||
|
||||
Reference in New Issue
Block a user