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

Develop/admin role #3

Merged
merged 9 commits into from
Aug 1, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
source 'https://rubygems.org'
gem 'devise'

gem 'bootstrap-sass', '~> 3.2.0'
gem 'bootstrap-sass', '~> 3.3.6' #3.2.0 - old version
gem 'autoprefixer-rails'

gem "font-awesome-rails"
Expand All @@ -13,6 +13,14 @@ gem 'acts-as-taggable-on', :git => 'https://github.com/mbleigh/acts-as-taggable-
gem "mailboxer", github: 'mailboxer/mailboxer'
gem 'figaro'

#Needed files for the prerelease of Active admin for Rails5
gem 'inherited_resources', github: 'activeadmin/inherited_resources'
gem 'ransack', github: 'activerecord-hackery/ransack'
gem 'draper', '> 3.x'
gem 'activeadmin', '~> 1.0.0.pre4'
gem 'active_admin_theme'
gem 'responsive_active_admin'

gem 'chosen-rails'
gem 'jquery-turbolinks'

Expand Down
101 changes: 88 additions & 13 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,8 +1,29 @@
GIT
remote: git://github.com/activeadmin/inherited_resources.git
revision: ba9467db4817944591df35dfe340f4c05a948033
specs:
inherited_resources (1.6.0)
actionpack (>= 3.2, < 5.1)
has_scope (~> 0.6)
railties (>= 3.2, < 5.1)
responders

GIT
remote: git://github.com/activerecord-hackery/ransack.git
revision: d02246aa240272bf68d5f5520e142da24327a4b1
specs:
ransack (1.8.1)
actionpack (>= 3.0)
activerecord (>= 3.0)
activesupport (>= 3.0)
i18n
polyamorous (~> 1.3)

GIT
remote: git://github.com/mailboxer/mailboxer.git
revision: 6798be07ece2258f227ac311f0198267af0bdcba
revision: 21637042628f4174d734d63401ed6e2fd1919cc2
specs:
mailboxer (0.13.0)
mailboxer (0.14.0)
carrierwave (>= 0.5.8)
rails (>= 4.2.0)

Expand Down Expand Up @@ -39,11 +60,31 @@ GEM
erubis (~> 2.7.0)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
active_admin_theme (1.0.3)
activeadmin (1.0.0.pre4)
arbre (~> 1.0, >= 1.0.2)
bourbon
coffee-rails
formtastic (~> 3.1)
formtastic_i18n
inherited_resources (~> 1.6)
jquery-rails
jquery-ui-rails
kaminari (~> 0.15)
rails (>= 3.2, < 5.1)
ransack (~> 1.3)
sass-rails
sprockets (< 4)
activejob (5.0.0)
activesupport (= 5.0.0)
globalid (>= 0.3.6)
activemodel (5.0.0)
activesupport (= 5.0.0)
activemodel-serializers-xml (1.0.1)
activemodel (> 5.x)
activerecord (> 5.x)
activesupport (> 5.x)
builder (~> 3.1)
activerecord (5.0.0)
activemodel (= 5.0.0)
activesupport (= 5.0.0)
Expand All @@ -53,14 +94,20 @@ GEM
i18n (~> 0.7)
minitest (~> 5.1)
tzinfo (~> 1.1)
arel (7.1.0)
arbre (1.1.1)
activesupport (>= 3.0.0)
arel (7.1.1)
autoprefixer-rails (6.3.7)
execjs
bcrypt (3.1.11)
bootstrap-sass (3.2.0.2)
sass (~> 3.2)
bootstrap-sass (3.3.7)
autoprefixer-rails (>= 5.2.1)
sass (>= 3.3.4)
bootstrap-will_paginate (0.0.10)
will_paginate
bourbon (4.2.7)
sass (~> 3.4)
thor (~> 0.19)
builder (3.2.2)
byebug (9.0.5)
callsite (0.0.11)
Expand Down Expand Up @@ -93,17 +140,29 @@ GEM
railties (>= 4.1.0, < 5.1)
responders
warden (~> 1.2.3)
draper (3.0.0.pre1)
actionpack (~> 5.0)
activemodel (~> 5.0)
activemodel-serializers-xml (~> 1.0)
activesupport (~> 5.0)
request_store (~> 1.0)
erubis (2.7.0)
execjs (2.7.0)
ffi (1.9.14)
figaro (1.1.1)
thor (~> 0.14)
font-awesome-rails (4.6.3.1)
railties (>= 3.2, < 5.1)
globalid (0.3.6)
formtastic (3.1.4)
actionpack (>= 3.2.13)
formtastic_i18n (0.6.0)
globalid (0.3.7)
activesupport (>= 4.1.0)
has_scope (0.7.0)
actionpack (>= 4.1, < 5.1)
activesupport (>= 4.1, < 5.1)
i18n (0.7.0)
jbuilder (2.5.0)
jbuilder (2.6.0)
activesupport (>= 3.0.0, < 5.1)
multi_json (~> 1.2)
jquery-rails (4.1.1)
Expand All @@ -113,7 +172,12 @@ GEM
jquery-turbolinks (2.1.0)
railties (>= 3.1.0)
turbolinks
jquery-ui-rails (5.0.5)
railties (>= 3.2.16)
json (2.0.2)
kaminari (0.17.0)
actionpack (>= 3.0.0)
activesupport (>= 3.0.0)
listen (3.0.8)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
Expand Down Expand Up @@ -147,7 +211,9 @@ GEM
mime-types
mimemagic (~> 0.3.0)
pkg-config (1.1.7)
puma (3.5.0)
polyamorous (1.3.1)
activerecord (>= 3.0)
puma (3.6.0)
rack (2.0.1)
rack-contrib (1.2.0)
rack (>= 0.9.1)
Expand Down Expand Up @@ -180,10 +246,13 @@ GEM
rb-fsevent (0.9.7)
rb-inotify (0.9.7)
ffi (>= 0.5.0)
request_store (1.3.1)
responders (2.2.0)
railties (>= 4.2.0, < 5.1)
responsive_active_admin (0.0.5)
activeadmin
sass (3.4.22)
sass-rails (5.0.5)
sass-rails (5.0.6)
railties (>= 4.0.0, < 6)
sass (~> 3.1)
sprockets (>= 2.8, < 4.0)
Expand All @@ -193,7 +262,7 @@ GEM
spring-watcher-listen (2.0.0)
listen (>= 2.7, < 4.0)
spring (~> 1.2)
sprockets (3.6.3)
sprockets (3.7.0)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (3.1.1)
Expand All @@ -204,12 +273,12 @@ GEM
thor (0.19.1)
thread_safe (0.3.5)
tilt (2.0.5)
turbolinks (5.0.0)
turbolinks (5.0.1)
turbolinks-source (~> 5)
turbolinks-source (5.0.0)
tzinfo (1.2.2)
thread_safe (~> 0.1)
uglifier (3.0.0)
uglifier (3.0.1)
execjs (>= 0.3.0, < 3)
warden (1.2.6)
rack (>= 1.0)
Expand All @@ -227,16 +296,20 @@ PLATFORMS
ruby

DEPENDENCIES
active_admin_theme
activeadmin (~> 1.0.0.pre4)
acts-as-taggable-on!
autoprefixer-rails
bootstrap-sass (~> 3.2.0)
bootstrap-sass (~> 3.3.6)
bootstrap-will_paginate
byebug
chosen-rails
coffee-rails (~> 4.2)
devise
draper (> 3.x)
figaro
font-awesome-rails
inherited_resources!
jbuilder (~> 2.5)
jquery-rails
jquery-turbolinks
Expand All @@ -247,6 +320,8 @@ DEPENDENCIES
paperclip (~> 5.0.0)
puma (~> 3.0)
rails (~> 5.0.0)
ransack!
responsive_active_admin
sass-rails (~> 5.0)
spring
spring-watcher-listen (~> 2.0.0)
Expand Down
28 changes: 28 additions & 0 deletions app/admin/admin_user.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
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 "Admin Details" do
f.input :email
f.input :password
f.input :password_confirmation
end
f.actions
end

end
37 changes: 37 additions & 0 deletions app/admin/dashboard.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
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 Users" do
ul do
table_for User.order("created_at desc").limit(5) do
column :name do |user|
link_to user.name, admin_panel_user_path(user)
end
column :created_at
end
strong { link_to "View All Users", admin_panel_users_path }
end
end
end

column do
panel "Info" do
para "Welcome to ActiveAdmin."
end
end
end
end
end
24 changes: 24 additions & 0 deletions app/admin/speaker.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
ActiveAdmin.register Speaker do
index do
column :name
column :email
column :twitter
column :linkedin
column :github
actions
end
# See permitted parameters documentation:
# https://github.com/activeadmin/activeadmin/blob/master/docs/2-resource-customization.md#setting-up-strong-parameters
#
# permit_params :list, :of, :attributes, :on, :model
#
# or
#
# permit_params do
# permitted = [:permitted, :attributes]
# permitted << :other if params[:action] == 'create' && current_user.admin?
# permitted
# end


end
37 changes: 37 additions & 0 deletions app/admin/user.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
ActiveAdmin.register User do
# index do
# column :name
# column :email
# column :summary
# column :twitter
# column :linkedin
# column :github
# end
# See permitted parameters documentation:
# https://github.com/activeadmin/activeadmin/blob/master/docs/2-resource-customization.md#setting-up-strong-parameters
#
# permit_params :list, :of, :attributes, :on, :model
#
# or
#
# permit_params do
# permitted = [:permitted, :attributes]
# permitted << :other if params[:action] == 'create' && current_user.admin?
# permitted
# end
permit_params [:email, :password, :password_confirmation, :type]

form do |f|
f.inputs "User" do
f.input :email
f.input :password
f.input :password_confirmation
f.radio_button("type", "Speaker")
f.label :type, ' Speaker '
f.radio_button("type", "Attendee")
f.label :type, ' Attendee'
end
f.actions
end

end
1 change: 1 addition & 0 deletions app/assets/javascripts/active_admin.js.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#= require active_admin/base
Loading