Skip to content

Commit

Permalink
add activeadmin and run its standard generator
Browse files Browse the repository at this point in the history
  • Loading branch information
bru committed Nov 1, 2013
1 parent 4da30a0 commit 74129e0
Show file tree
Hide file tree
Showing 16 changed files with 797 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ gem 'sinatra'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 1.2'

# Admin
gem 'responders', github: 'plataformatec/responders'
gem 'inherited_resources', github: 'josevalim/inherited_resources'
gem 'ransack', github: 'ernie/ransack', branch: 'rails-4'
gem 'activeadmin', github: 'gregbell/active_admin', branch: 'rails4'
gem 'formtastic', github: 'justinfrench/formtastic'

group :doc do
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', require: false
Expand Down
81 changes: 81 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,3 +1,54 @@
GIT
remote: git://github.com/ernie/ransack.git
revision: 43fff052ca7a850103c2ac122c99541cd34cf48d
branch: rails-4
specs:
ransack (0.7.3)
actionpack (~> 4.0.0)
activerecord (~> 4.0.0)
polyamorous (~> 0.6.0)

GIT
remote: git://github.com/gregbell/active_admin.git
revision: 54fb71c5415f7b1a7aa0cdde680ee882fa3b2d6f
branch: rails4
specs:
activeadmin (0.6.0)
arbre (>= 1.0.1)
bourbon (>= 1.0.0)
coffee-rails (>= 3.2.0)
devise (>= 3.0.0.rc)
formtastic (>= 2.0.0)
inherited_resources (>= 1.3.1)
jquery-rails (>= 3.0.0)
jquery-ui-rails (>= 4.0.0)
kaminari (>= 0.13.0)
rails (>= 3.2.0)
ransack (>= 0.7.0)
sass-rails (>= 3.2.0)

GIT
remote: git://github.com/josevalim/inherited_resources.git
revision: 2656ca0cea51cc7469be1d30cace24752d5b4e3b
specs:
inherited_resources (1.4.0)
has_scope (~> 0.6.0.rc)
responders (~> 1.0.0.rc)

GIT
remote: git://github.com/justinfrench/formtastic.git
revision: cd6cb88f28ea7444267802ced8e5ec0f5cfd0f90
specs:
formtastic (2.3.0.rc2)
actionpack (>= 3.0)

GIT
remote: git://github.com/plataformatec/responders.git
revision: 6b57da9efb85c79157434a85c1bc34b2b4231aaa
specs:
responders (1.0.0.rc)
railties (>= 3.2, < 5)

GEM
remote: https://rubygems.org/
specs:
Expand Down Expand Up @@ -25,8 +76,14 @@ GEM
multi_json (~> 1.3)
thread_safe (~> 0.1)
tzinfo (~> 0.3.37)
arbre (1.0.1)
activesupport (>= 3.0.0)
arel (4.0.0)
atomic (1.1.10)
bcrypt-ruby (3.1.1)
bourbon (3.1.8)
sass (>= 3.2.0)
thor
builder (3.1.4)
coffee-rails (4.0.0)
coffee-script (>= 2.2.0)
Expand All @@ -42,6 +99,11 @@ GEM
debugger-ruby_core_source (~> 1.2.3)
debugger-linecache (1.2.0)
debugger-ruby_core_source (1.2.3)
devise (3.0.0)
bcrypt-ruby (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 3.2.6, < 5)
warden (~> 1.2.3)
diff-lcs (1.2.4)
erubis (2.7.0)
execjs (1.4.0)
Expand All @@ -53,6 +115,9 @@ GEM
railties (>= 3.0.0)
haml (4.0.3)
tilt
has_scope (0.6.0.rc)
actionpack (>= 3.2, < 5)
activesupport (>= 3.2, < 5)
hike (1.2.3)
i18n (0.6.4)
jbuilder (1.4.2)
Expand All @@ -61,14 +126,23 @@ GEM
jquery-rails (3.0.4)
railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0)
jquery-ui-rails (4.0.3)
jquery-rails
railties (>= 3.1.0)
json (1.8.0)
kaminari (0.14.1)
actionpack (>= 3.0.0)
activesupport (>= 3.0.0)
mail (2.5.4)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.23)
minitest (4.7.5)
multi_json (1.7.7)
orm_adapter (0.4.0)
pg (0.15.1)
polyamorous (0.6.3)
activerecord (>= 3.0)
polyglot (0.3.3)
rack (1.5.2)
rack-protection (1.5.0)
Expand Down Expand Up @@ -136,19 +210,26 @@ GEM
uglifier (2.1.2)
execjs (>= 0.3.0)
multi_json (~> 1.0, >= 1.0.2)
warden (1.2.3)
rack (>= 1.0)

PLATFORMS
ruby

DEPENDENCIES
activeadmin!
coffee-rails (~> 4.0.0)
debugger
factory_girl_rails
formtastic!
haml
inherited_resources!
jbuilder (~> 1.2)
jquery-rails
pg
rails (= 4.0.0)
ransack!
responders!
rspec-rails (~> 2.0)
sass-rails (~> 4.0.0)
sdoc
Expand Down
20 changes: 20 additions & 0 deletions app/admin/admin_user.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
ActiveAdmin.register AdminUser do
index do
column :email
column :current_sign_in_at
column :last_sign_in_at
column :sign_in_count
default_actions
end

filter :email

form do |f|
f.inputs "Admin Details" do
f.input :email
f.input :password
f.input :password_confirmation
end
f.actions
end
end
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
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; }
7 changes: 7 additions & 0 deletions app/models/admin_user.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class AdminUser < ActiveRecord::Base
# Include default devise modules. Others available are:
# :token_authenticatable, :confirmable,
# :lockable, :timeoutable and :omniauthable
devise :database_authenticatable,
:recoverable, :rememberable, :trackable, :validatable
end
Loading

0 comments on commit 74129e0

Please sign in to comment.