Skip to content

Commit

Permalink
add active admin
Browse files Browse the repository at this point in the history
  • Loading branch information
munen committed Feb 26, 2017
1 parent 5093954 commit 386978f
Show file tree
Hide file tree
Showing 10 changed files with 383 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ gem 'foundation-rails'

gem 'formtastic', '~> 3.0'

gem 'activeadmin'

# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

Expand Down
43 changes: 43 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,19 @@ GEM
erubis (~> 2.7.0)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.1)
activeadmin (1.0.0.pre1)
arbre (~> 1.0, >= 1.0.2)
bourbon
coffee-rails
formtastic (~> 3.1)
formtastic_i18n
inherited_resources (~> 1.6)
jquery-rails
jquery-ui-rails (~> 5.0)
kaminari (~> 0.15)
rails (>= 3.2, < 5.0)
ransack (~> 1.3)
sass-rails
activejob (4.2.2)
activesupport (= 4.2.2)
globalid (>= 0.3.0)
Expand All @@ -36,13 +49,18 @@ GEM
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
arbre (1.1.1)
activesupport (>= 3.0.0)
arel (6.0.4)
babel-source (5.8.35)
babel-transpiler (0.7.0)
babel-source (>= 4.0, < 6)
execjs (~> 2.0)
binding_of_caller (0.7.2)
debug_inspector (>= 0.0.1)
bourbon (4.3.3)
sass (~> 3.4)
thor (~> 0.19)
builder (3.2.3)
byebug (9.0.6)
coffee-rails (4.1.1)
Expand All @@ -58,21 +76,35 @@ GEM
execjs (2.7.0)
formtastic (3.1.3)
actionpack (>= 3.2.13)
formtastic_i18n (0.6.0)
foundation-rails (6.3.0.0)
railties (>= 3.1.0)
sass (>= 3.3.0, < 3.5)
sprockets-es6 (>= 0.9.0)
globalid (0.3.7)
activesupport (>= 4.1.0)
has_scope (0.6.0)
actionpack (>= 3.2, < 5)
activesupport (>= 3.2, < 5)
i18n (0.8.1)
inherited_resources (1.6.0)
actionpack (>= 3.2, < 5)
has_scope (~> 0.6.0.rc)
railties (>= 3.2, < 5)
responders
jbuilder (2.6.3)
activesupport (>= 3.0.0, < 5.2)
multi_json (~> 1.2)
jquery-rails (4.2.2)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
jquery-ui-rails (5.0.3)
railties (>= 3.2.16)
json (1.8.6)
kaminari (0.16.3)
actionpack (>= 3.0.0)
activesupport (>= 3.0.0)
loofah (2.0.3)
nokogiri (>= 1.5.9)
mail (2.6.4)
Expand All @@ -85,6 +117,8 @@ GEM
multi_json (1.12.1)
nokogiri (1.7.0.1)
mini_portile2 (~> 2.1.0)
polyamorous (1.1.0)
activerecord (>= 3.0)
rack (1.6.5)
rack-test (0.6.3)
rack (>= 1.0)
Expand Down Expand Up @@ -113,7 +147,15 @@ GEM
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (12.0.0)
ransack (1.6.4)
actionpack (>= 3.0)
activerecord (>= 3.0)
activesupport (>= 3.0)
i18n
polyamorous (~> 1.1)
rdoc (4.3.0)
responders (2.1.0)
railties (>= 4.2.0, < 5)
sass (3.4.23)
sass-rails (5.0.6)
railties (>= 4.0.0, < 6)
Expand Down Expand Up @@ -158,6 +200,7 @@ PLATFORMS
ruby

DEPENDENCIES
activeadmin
byebug
coffee-rails (~> 4.1.0)
formtastic (~> 3.0)
Expand Down
33 changes: 33 additions & 0 deletions app/admin/dashboard.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
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 # content
end
18 changes: 18 additions & 0 deletions app/admin/survey.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
ActiveAdmin.register Survey do


# 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 resource.something?
# permitted
# 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
17 changes: 17 additions & 0 deletions app/assets/stylesheets/active_admin.css.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// SASS variable overrides must be declared before loading up Active Admin's styles.
//
// To view the variables that Active Admin provides, take a look at
// `app/assets/stylesheets/active_admin/mixins/_variables.css.scss` in the
// Active Admin source.
//
// For example, to change the sidebar width:
// $sidebar-width: 242px;

// Active Admin's got SASS!
@import "active_admin/mixins";
@import "active_admin/base";

// Overriding any non-variable SASS must be done after the fact.
// For example, to change the default status-tag color:
//
// .status_tag { background: #6090DB; }
Loading

0 comments on commit 386978f

Please sign in to comment.