Make open source
This commit is contained in:
27
app/admin/admin_users.rb
Normal file
27
app/admin/admin_users.rb
Normal file
@ -0,0 +1,27 @@
|
||||
ActiveAdmin.register AdminUser do
|
||||
permit_params :email, :password, :password_confirmation
|
||||
|
||||
index do
|
||||
selectable_column
|
||||
id_column
|
||||
column :email
|
||||
column :current_sign_in_at
|
||||
column :sign_in_count
|
||||
column :created_at
|
||||
actions
|
||||
end
|
||||
|
||||
filter :email
|
||||
filter :current_sign_in_at
|
||||
filter :sign_in_count
|
||||
filter :created_at
|
||||
|
||||
form do |f|
|
||||
f.inputs do
|
||||
f.input :email
|
||||
f.input :password
|
||||
f.input :password_confirmation
|
||||
end
|
||||
f.actions
|
||||
end
|
||||
end
|
25
app/admin/attendees.rb
Normal file
25
app/admin/attendees.rb
Normal file
@ -0,0 +1,25 @@
|
||||
ActiveAdmin.register Attendee do
|
||||
scope :child?
|
||||
scope :diet?
|
||||
|
||||
controller do
|
||||
def apply_sorting(chain)
|
||||
params[:order] ? chain : chain.reorder(last_name: :asc, first_name: :asc)
|
||||
end
|
||||
end
|
||||
|
||||
index do
|
||||
column :first_name
|
||||
column :last_name
|
||||
column :email
|
||||
column :diet
|
||||
column :notes
|
||||
column :child
|
||||
column :updated_at
|
||||
end
|
||||
|
||||
config.batch_actions = false
|
||||
config.filters = false
|
||||
config.per_page = 500
|
||||
config.clear_action_items!
|
||||
end
|
32
app/admin/dashboard.rb
Normal file
32
app/admin/dashboard.rb
Normal file
@ -0,0 +1,32 @@
|
||||
ActiveAdmin.register_page 'Dashboard' do
|
||||
menu priority: 1, label: proc { I18n.t('active_admin.dashboard') }
|
||||
|
||||
content title: proc { I18n.t('active_admin.dashboard') } do
|
||||
div class: 'blank_slate_container', id: 'dashboard_default_message' do
|
||||
span class: 'blank_slate' do
|
||||
span I18n.t('active_admin.dashboard_welcome.welcome')
|
||||
small I18n.t('active_admin.dashboard_welcome.call_to_action')
|
||||
end
|
||||
end
|
||||
|
||||
# Here is an example of a simple dashboard with columns and panels.
|
||||
#
|
||||
# columns do
|
||||
# column do
|
||||
# panel "Recent Posts" do
|
||||
# ul do
|
||||
# Post.recent(5).map do |post|
|
||||
# li link_to(post.title, admin_post_path(post))
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
|
||||
# column do
|
||||
# panel "Info" do
|
||||
# para "Welcome to ActiveAdmin."
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
end
|
||||
end
|
21
app/admin/guests.rb
Normal file
21
app/admin/guests.rb
Normal file
@ -0,0 +1,21 @@
|
||||
ActiveAdmin.register Guest do
|
||||
permit_params :email, :first_name, :last_name, :attending, :diet, :songs,
|
||||
:notes
|
||||
|
||||
scope :confirmed
|
||||
scope :attending
|
||||
scope :not_attending
|
||||
|
||||
form do |_f|
|
||||
inputs 'Guest' do
|
||||
input :email, as: :string
|
||||
input :first_name
|
||||
input :last_name
|
||||
input :attending
|
||||
input :diet, as: :text
|
||||
input :songs, as: :text
|
||||
input :notes, as: :text
|
||||
end
|
||||
actions
|
||||
end
|
||||
end
|
13
app/admin/plus_ones.rb
Normal file
13
app/admin/plus_ones.rb
Normal file
@ -0,0 +1,13 @@
|
||||
ActiveAdmin.register PlusOne do
|
||||
permit_params :first_name, :last_name, :diet, :child
|
||||
|
||||
form do |_f|
|
||||
inputs 'Plus One' do
|
||||
input :first_name
|
||||
input :last_name
|
||||
input :diet, as: :text
|
||||
input :child
|
||||
end
|
||||
actions
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user