Skip to content

Commit

Permalink
Issue #3: Install ActiveAdmin.
Browse files Browse the repository at this point in the history
  • Loading branch information
whastings committed Apr 15, 2014
1 parent 8852da5 commit d5cedc2
Show file tree
Hide file tree
Showing 15 changed files with 839 additions and 1 deletion.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ gem 'draper', '~> 1.3'
gem 'jquery-ui-rails'
gem 'compass-rails'
gem 'breakpoint', '~>2.4.0'
gem 'activeadmin', github: 'gregbell/active_admin'

# Use PostgreSQL as the database for Active Record
gem 'pg', '0.15.1'
Expand Down
55 changes: 55 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,24 @@ GIT
specs:
database_cleaner (1.2.0)

GIT
remote: git://github.com/gregbell/active_admin.git
revision: ec4b6d186e40b9679444c26d143b09d2c89ef7f0
specs:
activeadmin (1.0.0.pre)
arbre (~> 1.0)
bourbon
coffee-rails
devise (~> 3.2)
formtastic (~> 2.3.0.rc2)
inherited_resources (~> 1.3)
jquery-rails
jquery-ui-rails
kaminari (~> 0.15)
rails (>= 3.2, <= 4.1)
ransack (~> 1.0)
sass-rails

GEM
remote: https://rubygems.org/
specs:
Expand Down Expand Up @@ -38,6 +56,8 @@ GEM
addressable (2.3.5)
annotate (2.5.0)
rake
arbre (1.0.1)
activesupport (>= 3.0.0)
arel (4.0.1)
atomic (1.1.14)
backbone-on-rails (1.1.1.0)
Expand All @@ -49,6 +69,7 @@ GEM
ejs
jquery-rails
railties
bcrypt (3.1.7)
bcrypt-ruby (3.1.2)
better_errors (1.1.0)
coderay (>= 1.0.0)
Expand All @@ -59,6 +80,9 @@ GEM
sass (~> 3.2)
bootstrap-will_paginate (0.0.10)
will_paginate
bourbon (3.1.8)
sass (>= 3.2.0)
thor
breakpoint (2.4.2)
sass (~> 3.3.0)
sassy-maps (< 1.0.0)
Expand Down Expand Up @@ -95,6 +119,12 @@ GEM
compass-rails (1.1.3)
compass (>= 0.12.2)
debug_inspector (0.0.2)
devise (3.2.4)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 3.2.6, < 5)
thread_safe (~> 0.1)
warden (~> 1.2.3)
diff-lcs (1.2.5)
draper (1.3.0)
actionpack (>= 3.0)
Expand All @@ -117,15 +147,23 @@ GEM
faker (1.2.0)
i18n (~> 0.5)
ffi (1.9.3)
formtastic (2.3.0.rc3)
actionpack (>= 3.0)
friendly_id (5.0.2)
activerecord (~> 4.0.0)
handlebars_assets (0.15)
execjs (>= 1.2.9)
multi_json
sprockets (>= 2.0.3)
tilt
has_scope (0.6.0.rc)
actionpack (>= 3.2, < 5)
activesupport (>= 3.2, < 5)
hike (1.2.3)
i18n (0.6.5)
inherited_resources (1.4.1)
has_scope (~> 0.6.0.rc)
responders (~> 1.0.0.rc)
jbuilder (1.5.2)
activesupport (>= 3.0.0)
multi_json (>= 1.2.0)
Expand All @@ -135,6 +173,9 @@ GEM
jquery-ui-rails (4.2.0)
railties (>= 3.2.16)
json (1.8.1)
kaminari (0.15.1)
actionpack (>= 3.0.0)
activesupport (>= 3.0.0)
launchy (2.4.2)
addressable (~> 2.3)
letter_opener (1.2.0)
Expand All @@ -153,7 +194,10 @@ GEM
multi_json (1.8.2)
nokogiri (1.6.0)
mini_portile (~> 0.5.0)
orm_adapter (0.5.0)
pg (0.15.1)
polyamorous (1.0.0)
activerecord (>= 3.0)
polyglot (0.3.3)
pry (0.9.12.6)
coderay (~> 1.0)
Expand All @@ -180,6 +224,12 @@ GEM
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (10.1.0)
ransack (1.2.2)
actionpack (>= 3.0)
activerecord (>= 3.0)
activesupport (>= 3.0)
i18n
polyamorous (~> 1.0.0)
rb-fsevent (0.9.4)
rb-inotify (0.9.3)
ffi (>= 0.5.0)
Expand All @@ -188,6 +238,8 @@ GEM
rdoc (3.12.2)
json (~> 1.4)
request_store (1.0.5)
responders (1.0.0)
railties (>= 3.2, < 5)
rspec-core (2.13.1)
rspec-expectations (2.13.0)
diff-lcs (>= 1.1.3, < 2.0)
Expand Down Expand Up @@ -239,6 +291,8 @@ GEM
uglifier (2.3.2)
execjs (>= 0.3.0)
json (>= 1.8.0)
warden (1.2.3)
rack (>= 1.0)
will_paginate (3.0.4)
xpath (2.0.0)
nokogiri (~> 1.3)
Expand All @@ -247,6 +301,7 @@ PLATFORMS
ruby

DEPENDENCIES
activeadmin!
annotate (= 2.5.0)
backbone-on-rails
bcrypt-ruby (= 3.1.2)
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
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; }
25 changes: 25 additions & 0 deletions app/models/admin_user.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# == Schema Information
#
# Table name: admin_users
#
# id :integer not null, primary key
# email :string(255) default(""), not null
# encrypted_password :string(255) default(""), not null
# reset_password_token :string(255)
# reset_password_sent_at :datetime
# remember_created_at :datetime
# sign_in_count :integer default(0), not null
# current_sign_in_at :datetime
# last_sign_in_at :datetime
# current_sign_in_ip :string(255)
# last_sign_in_ip :string(255)
# created_at :datetime
# updated_at :datetime
#

class AdminUser < ActiveRecord::Base
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable,
:recoverable, :rememberable, :trackable, :validatable
end
Loading

0 comments on commit d5cedc2

Please sign in to comment.