Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: CaDs/tokyo-project
base: 0cbc585ec9
...
head fork: CaDs/tokyo-project
compare: e5302a4a0e
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 36 files changed
  • 0 commit comments
  • 1 contributor
Showing with 4,390 additions and 35 deletions.
  1. +1 −0  .components
  2. +10 −0 .gitignore
  3. +5 −8 Gemfile
  4. +8 −2 Gemfile.lock
  5. +40 −0 admin/app.rb
  6. +47 −0 admin/controllers/accounts.rb
  7. +6 −0 admin/controllers/base.rb
  8. +26 −0 admin/controllers/sessions.rb
  9. +35 −0 admin/views/accounts/_form.erb
  10. +18 −0 admin/views/accounts/edit.erb
  11. +38 −0 admin/views/accounts/index.erb
  12. +17 −0 admin/views/accounts/new.erb
  13. +13 −0 admin/views/base/_sidebar.erb
  14. +17 −0 admin/views/base/index.erb
  15. +44 −0 admin/views/layouts/application.erb
  16. +56 −0 admin/views/sessions/new.erb
  17. +2 −0  config/apps.rb
  18. +9 −25 config/database.rb
  19. +16 −0 db/migrate/001_create_accounts.rb
  20. +26 −0 db/schema.rb
  21. +28 −0 db/seeds.rb
  22. +38 −0 models/account.rb
  23. +95 −0 public/admin/stylesheets/base.css
  24. +364 −0 public/admin/stylesheets/themes/amro/style.css
  25. +290 −0 public/admin/stylesheets/themes/bec-green/style.css
  26. +301 −0 public/admin/stylesheets/themes/bec/style.css
  27. +287 −0 public/admin/stylesheets/themes/blue/style.css
  28. +373 −0 public/admin/stylesheets/themes/default/style.css
  29. +305 −0 public/admin/stylesheets/themes/djime-cerulean/style.css
  30. +279 −0 public/admin/stylesheets/themes/kathleene/style.css
  31. +345 −0 public/admin/stylesheets/themes/olive/style.css
  32. +269 −0 public/admin/stylesheets/themes/orange/style.css
  33. +302 −0 public/admin/stylesheets/themes/reidb-greenish/style.css
  34. +281 −0 public/admin/stylesheets/themes/ruby/style.css
  35. +391 −0 public/admin/stylesheets/themes/warehouse/style.css
  36. +8 −0 spec/models/account_spec.rb
View
1  .components
@@ -5,3 +5,4 @@
:script: jquery
:renderer: erb
:stylesheet: none
+:admin_renderer: erb
View
10 .gitignore
@@ -0,0 +1,10 @@
+.bundle
+vendor/bundle/*
+log/*.log
+log/
+tmp/**/*
+*.swp
+.DS_Store
+.svn
+.rvmrc
+.sass-cache
View
13 Gemfile
@@ -9,9 +9,10 @@ gem 'rake'
gem 'sinatra-flash', :require => 'sinatra/flash'
# Component requirements
+gem 'bcrypt-ruby', :require => "bcrypt"
gem 'erubis', "~> 2.7.0"
gem 'activerecord', :require => "active_record"
-gem 'mysql'
+gem 'mysql2'
# Test requirements
gem 'rspec', :group => "test"
@@ -20,10 +21,6 @@ gem 'rack-test', :require => "rack/test", :group => "test"
# Padrino Stable Gem
gem 'padrino', '0.10.7'
-# Or Padrino Edge
-# gem 'padrino', :git => 'git://github.com/padrino/padrino-framework.git'
-
-# Or Individual Gems
-# %w(core gen helpers cache mailer admin).each do |g|
-# gem 'padrino-' + g, '0.10.7'
-# end
+#Cache
+gem 'memcachier', :require => 'memcachier'
+gem 'dalli', :require => 'dalli'
View
10 Gemfile.lock
@@ -13,7 +13,9 @@ GEM
i18n (~> 0.6)
multi_json (~> 1.0)
arel (3.0.2)
+ bcrypt-ruby (3.0.1)
builder (3.0.4)
+ dalli (2.6.2)
diff-lcs (1.2.1)
erubis (2.7.0)
http_router (0.10.2)
@@ -24,9 +26,10 @@ GEM
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
+ memcachier (0.0.2)
mime-types (1.21)
multi_json (1.7.1)
- mysql (2.9.1)
+ mysql2 (0.3.11)
padrino (0.10.7)
padrino-admin (= 0.10.7)
padrino-cache (= 0.10.7)
@@ -89,8 +92,11 @@ PLATFORMS
DEPENDENCIES
activerecord
+ bcrypt-ruby
+ dalli
erubis (~> 2.7.0)
- mysql
+ memcachier
+ mysql2
padrino (= 0.10.7)
rack-test
rake
View
40 admin/app.rb
@@ -0,0 +1,40 @@
+class Admin < Padrino::Application
+ use ActiveRecord::ConnectionAdapters::ConnectionManagement
+ register Padrino::Rendering
+ register Padrino::Mailer
+ register Padrino::Cache
+ register Padrino::Helpers
+ register Padrino::Admin::AccessControl
+
+ set :cache, Padrino::Cache::Store::Memcache.new(::Dalli::Client.new)
+ ##
+ # Application configuration options
+ #
+ # set :raise_errors, true # Raise exceptions (will stop application) (default for test)
+ # set :dump_errors, true # Exception backtraces are written to STDERR (default for production/development)
+ # set :show_exceptions, true # Shows a stack trace in browser (default for development)
+ # set :logging, true # Logging in STDOUT for development and file for production (default only for development)
+ # set :public_folder, "foo/bar" # Location for static assets (default root/public)
+ # set :reload, false # Reload application files (default in development)
+ # set :default_builder, "foo" # Set a custom form builder (default 'StandardFormBuilder')
+ # set :locale_path, "bar" # Set path for I18n translations (default your_app/locales)
+ # disable :sessions # Disabled sessions by default (enable if needed)
+ # disable :flash # Disables sinatra-flash (enabled by default if Sinatra::Flash is defined)
+ # layout :my_layout # Layout can be in views/layouts/foo.ext or views/foo.ext (default :application)
+ #
+
+ set :admin_model, 'Account'
+ set :login_page, "/admin/sessions/new"
+
+ enable :sessions
+ disable :store_location
+
+ access_control.roles_for :any do |role|
+ role.protect "/"
+ role.allow "/sessions"
+ end
+
+ access_control.roles_for :admin do |role|
+ role.project_module :accounts, '/accounts'
+ end
+end
View
47 admin/controllers/accounts.rb
@@ -0,0 +1,47 @@
+Admin.controllers :accounts do
+
+ get :index do
+ @accounts = Account.all
+ render 'accounts/index'
+ end
+
+ get :new do
+ @account = Account.new
+ render 'accounts/new'
+ end
+
+ post :create do
+ @account = Account.new(params[:account])
+ if @account.save
+ flash[:notice] = 'Account was successfully created.'
+ redirect url(:accounts, :edit, :id => @account.id)
+ else
+ render 'accounts/new'
+ end
+ end
+
+ get :edit, :with => :id do
+ @account = Account.find(params[:id])
+ render 'accounts/edit'
+ end
+
+ put :update, :with => :id do
+ @account = Account.find(params[:id])
+ if @account.update_attributes(params[:account])
+ flash[:notice] = 'Account was successfully updated.'
+ redirect url(:accounts, :edit, :id => @account.id)
+ else
+ render 'accounts/edit'
+ end
+ end
+
+ delete :destroy, :with => :id do
+ account = Account.find(params[:id])
+ if account != current_account && account.destroy
+ flash[:notice] = 'Account was successfully destroyed.'
+ else
+ flash[:error] = 'Unable to destroy Account!'
+ end
+ redirect url(:accounts, :index)
+ end
+end
View
6 admin/controllers/base.rb
@@ -0,0 +1,6 @@
+Admin.controllers :base do
+
+ get :index, :map => "/" do
+ render "base/index"
+ end
+end
View
26 admin/controllers/sessions.rb
@@ -0,0 +1,26 @@
+Admin.controllers :sessions do
+
+ get :new do
+ render "/sessions/new", nil, :layout => false
+ end
+
+ post :create do
+ if account = Account.authenticate(params[:email], params[:password])
+ set_current_account(account)
+ redirect url(:base, :index)
+ elsif Padrino.env == :development && params[:bypass]
+ account = Account.first
+ set_current_account(account)
+ redirect url(:base, :index)
+ else
+ params[:email], params[:password] = h(params[:email]), h(params[:password])
+ flash[:warning] = "Login or password wrong."
+ redirect url(:sessions, :new)
+ end
+ end
+
+ delete :destroy do
+ set_current_account(nil)
+ redirect url(:sessions, :new)
+ end
+end
View
35 admin/views/accounts/_form.erb
@@ -0,0 +1,35 @@
+<div class="group">
+ <%= f.label :name %><%= f.error_message_on :name %>
+ <%= f.text_field :name, :class => :text_field %>
+ <span class="description">Ex: a simple text</span>
+</div>
+<div class="group">
+ <%= f.label :surname %><%= f.error_message_on :surname %>
+ <%= f.text_field :surname, :class => :text_field %>
+ <span class="description">Ex: a simple text</span>
+</div>
+<div class="group">
+ <%= f.label :email %><%= f.error_message_on :email %>
+ <%= f.text_field :email, :class => :text_field %>
+ <span class="description">Ex: a simple text</span>
+</div>
+<div class="group">
+ <%= f.label :password %><%= f.error_message_on :password %>
+ <%= f.password_field :password, :class => :password_field %>
+ <span class="description">Ex: a simple text</span>
+</div>
+<div class="group">
+ <%= f.label :password_confirmation %><%= f.error_message_on :password_confirmation %>
+ <%= f.password_field :password_confirmation, :class => :password_field %>
+ <span class="description">Ex: a simple text</span>
+</div>
+<div class="group">
+ <%= f.label :role %><%= f.error_message_on :role %>
+ <%= f.select :role, :options => access_control.roles %>
+ <span class="description">Ex: a simple text</span>
+</div>
+
+<div class="group navform wat-cf">
+ <%= f.submit pat(:save), :class => :button %>
+ <%= f.submit pat(:cancel), :onclick => "window.location='#{url(:accounts, :index)}';return false", :class => :button %>
+</div>
View
18 admin/views/accounts/edit.erb
@@ -0,0 +1,18 @@
+<div class="block">
+ <div class="secondary-navigation">
+ <ul class="wat-cf">
+ <li class="first"><%= link_to pat(:list), url(:accounts, :index) %></li>
+ <li><%= link_to pat(:new), url(:accounts, :new) %></li>
+ <li class="active"><%= link_to pat(:edit), url(:accounts, :edit, :id => @account.id) %></li>
+ </ul>
+ </div>
+ <div class="content">
+ <h2 class="title"><%= pat(:edit) %> <% mt(:account) %></h2>
+ <div class="inner">
+ <% form_for :account, url(:accounts, :update, :id => @account.id), :method => :put, :class => :form do |f| %>
+ <%= partial "accounts/form", :locals => { :f => f } %>
+ <% end %>
+ </div>
+ </div>
+</div>
+<% content_for :sidebar, partial("base/sidebar") %>
View
38 admin/views/accounts/index.erb
@@ -0,0 +1,38 @@
+<div class="block">
+ <div class="secondary-navigation">
+ <ul class="wat-cf">
+ <li class="first active"><%= link_to pat(:list), url(:accounts, :index) %></li>
+ <li><%= link_to pat(:new), url(:accounts, :new) %></li>
+ </ul>
+ </div>
+ <div class="content">
+ <h2 class="title"><%= pat(:all) %> <% mt(:accounts) %></h2>
+ <div class="inner">
+ <table class="table">
+ <tr>
+ <th class="first"><%= mat(:account, :id) %></th>
+ <th><%= mat(:account, :name) %></th>
+ <th><%= mat(:account, :surname) %></th>
+ <th><%= mat(:account, :email) %></th>
+ <th class="last">&nbsp;</th>
+ </tr>
+ <% @accounts.each do |account| %>
+ <tr>
+ <td class="first"><%= account.id %></td>
+ <td><%= account.name %></td>
+ <td><%= account.surname %></td>
+ <td><%= account.email %></td>
+ <td class="last">
+ <%= button_to pat(:edit), url(:accounts, :edit, :id => account.id), :method => :get, :class => :button_to %> |
+ <%= button_to pat(:delete), url(:accounts, :destroy, :id => account.id), :method => :delete, :class => :button_to, :onsubmit => "return confirm('#{pat(:confirm)}')" %>
+ </td>
+ </tr>
+ <% end %>
+ </table>
+ <div class="actions-bar wat-cf">
+ <div class="actions"></div>
+ </div>
+ </div>
+ </div>
+</div>
+<% content_for :sidebar, partial("base/sidebar") %>
View
17 admin/views/accounts/new.erb
@@ -0,0 +1,17 @@
+<div class="block">
+ <div class="secondary-navigation">
+ <ul class="wat-cf">
+ <li class="first"><%= link_to pat(:list), url(:accounts, :index) %></li>
+ <li class="active"><%= link_to pat(:new), url(:accounts, :new) %></li>
+ </ul>
+ </div>
+ <div class="content">
+ <h2 class="title"><%= pat(:new) %> <% mt(:account) %></h2>
+ <div class="inner">
+ <% form_for :account, url(:accounts, :create), :class => :form do |f| %>
+ <%= partial "accounts/form", :locals => { :f => f } %>
+ <% end %>
+ </div>
+ </div>
+</div>
+<% content_for :sidebar, partial("base/sidebar") %>
View
13 admin/views/base/_sidebar.erb
@@ -0,0 +1,13 @@
+<div class="block">
+ <h3>Simple Block</h3>
+ <div class="content">
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
+ </div>
+</div>
+<div class="block">
+ <h3>Links</h3>
+ <ul class="navigation">
+ <li><%= link_to "Link 1" %></li>
+ <li><%= link_to "Link 1" %></li>
+ </ul>
+</div>
View
17 admin/views/base/index.erb
@@ -0,0 +1,17 @@
+<div class="block" id="block-text">
+ <div class="content">
+ <h2 class="title">Dashboard</h2>
+ <div class="inner">
+ <p class="first">
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. <span class="hightlight">Excepteur sint occaecat cupidatat non proident</span>, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ </p>
+ <p> <span class="small">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore</span></p>
+ <p> <span class="gray">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore</span></p>
+ <hr />
+ <p>
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. <span class="hightlight">Excepteur sint occaecat cupidatat non proident</span>, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ </p>
+ </div>
+ </div>
+</div>
+<% content_for :sidebar, partial("base/sidebar") %>
View
44 admin/views/layouts/application.erb
@@ -0,0 +1,44 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>Padrino Admin</title>
+ <%= stylesheet_link_tag :base, "themes/default/style" %>
+</head>
+<body>
+ <div id="container">
+ <div id="header">
+ <h1><%= link_to "Padrino Admin", url(:base_index) %></h1>
+ <div id="user-navigation">
+ <ul class="wat-cf">
+ <li><%= link_to pat(:profile), url(:accounts, :edit, :id => current_account.id) %></li>
+ <li><%= button_to pat(:logout), url(:sessions, :destroy), :method => :delete, :class => :button_to %></li>
+ </ul>
+ </div>
+ <div id="main-navigation">
+ <ul class="wat-cf">
+ <% project_modules.each do |project_module| %>
+ <li class="<%= "active" if request.path_info =~ /^#{project_module.path}/ %>"><%= link_to project_module.human_name, project_module.path("/admin") %></li>
+ <% end %>
+ </ul>
+ </div>
+ </div>
+ <div id="wrapper" class="wat-cf">
+ <div class="flash">
+ <%= [:error, :warning, :notice].map { |type| flash_tag(type, :class => "message #{type}") }.join %>
+ </div>
+ <div id="main">
+ <%= yield %>
+ <div id="footer">
+ <div class="block">
+ <p>Copyright &copy; <%= Time.now.year %> Your Site - Powered by <a href="http://www.padrinorb.com" target="_blank">Padrino v.<%= Padrino.version %>.</a></p>
+ </div>
+ </div>
+ </div>
+ <div id="sidebar">
+ <%= yield_content :sidebar %>
+ </div>
+ </div>
+ </div>
+</body>
+</html>
View
56 admin/views/sessions/new.erb
@@ -0,0 +1,56 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>Padrino Admin</title>
+ <%= stylesheet_link_tag :base, "themes/default/style" %>
+</head>
+<body>
+ <div id="container">
+ <div id="box">
+ <h1>Padrino Admin</h1>
+ <div class="block" id="block-login">
+ <h2>Login Box</h2>
+ <div class="content login">
+ <div class="flash">
+ <%= [:error, :warning, :notice].map { |type| flash_tag(type, :class => "message #{type}") }.join %>
+ </div>
+ <% form_tag(url(:sessions, :create), :class => 'form login') do %>
+ <div class="group wat-cf">
+ <div class="left">
+ <label class="label right">Login</label>
+ </div>
+ <div class="right">
+ <%= text_field_tag :email, :value => params[:email], :class => 'text_field' %>
+ </div>
+ </div>
+ <div class="group wat-cf">
+ <div class="left">
+ <label class="label right">Password</label>
+ </div>
+ <div class="right">
+ <%= password_field_tag :password, :value => params[:password], :class => 'text_field' %>
+ </div>
+ </div>
+ <% if Padrino.env == :development %>
+ <div class="group wat-cf">
+ <div class="left">
+ <label class="label right">Bypass login?</label>
+ </div>
+ <div class="right">
+ <%= check_box_tag :bypass %>
+ </div>
+ </div>
+ <% end %>
+ <div class="group navform wat-cf">
+ <div class="right">
+ <%= submit_tag "Sign in", :class => :button %>
+ </div>
+ </div>
+ <% end %>
+ </div>
+ </div>
+ </div>
+ </div>
+</body>
+</html>
View
2  config/apps.rb
@@ -32,3 +32,5 @@
# Mounts the core application for this project
Padrino.mount("TokyoProject").to('/')
+
+Padrino.mount("Admin").to("/admin")
View
34 config/database.rb
@@ -1,20 +1,7 @@
-##
-# You can use other adapters like:
-#
-# ActiveRecord::Base.configurations[:development] = {
-# :adapter => 'mysql',
-# :encoding => 'utf8',
-# :reconnect => true,
-# :database => 'your_database',
-# :pool => 5,
-# :username => 'root',
-# :password => '',
-# :host => 'localhost',
-# :socket => '/tmp/mysql.sock'
-# }
-#
+cleardb = URI.parse(ENV['DATABASE_URL'] || '')
+
ActiveRecord::Base.configurations[:development] = {
- :adapter => 'mysql',
+ :adapter => 'mysql2',
:encoding => 'utf8',
:reconnect => true,
:database => 'tokyo_project_development',
@@ -27,20 +14,17 @@
}
ActiveRecord::Base.configurations[:production] = {
- :adapter => 'mysql',
+ :adapter => 'mysql2',
:encoding => 'utf8',
:reconnect => true,
- :database => 'tokyo_project_production',
- :pool => 5,
- :username => 'root',
- :password => '',
- :host => 'localhost',
- :socket => '/tmp/mysql.sock'
-
+ :database => cleardb.path[1..-1],
+ :username => cleardb.user,
+ :password => cleardb.password,
+ :host => cleardb.host
}
ActiveRecord::Base.configurations[:test] = {
- :adapter => 'mysql',
+ :adapter => 'mysql2',
:encoding => 'utf8',
:reconnect => true,
:database => 'tokyo_project_test',
View
16 db/migrate/001_create_accounts.rb
@@ -0,0 +1,16 @@
+class CreateAccounts < ActiveRecord::Migration
+ def self.up
+ create_table :accounts do |t|
+ t.string :name
+ t.string :surname
+ t.string :email
+ t.string :crypted_password
+ t.string :role
+ t.timestamps
+ end
+ end
+
+ def self.down
+ drop_table :accounts
+ end
+end
View
26 db/schema.rb
@@ -0,0 +1,26 @@
+# encoding: UTF-8
+# This file is auto-generated from the current state of the database. Instead
+# of editing this file, please use the migrations feature of Active Record to
+# incrementally modify your database, and then regenerate this schema definition.
+#
+# Note that this schema.rb definition is the authoritative source for your
+# database schema. If you need to create the application database on another
+# system, you should be using db:schema:load, not running all the migrations
+# from scratch. The latter is a flawed and unsustainable approach (the more migrations
+# you'll amass, the slower it'll run and the greater likelihood for issues).
+#
+# It's strongly recommended to check this file into your version control system.
+
+ActiveRecord::Schema.define(:version => 1) do
+
+ create_table "accounts", :force => true do |t|
+ t.string "name"
+ t.string "surname"
+ t.string "email"
+ t.string "crypted_password"
+ t.string "role"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+end
View
28 db/seeds.rb
@@ -0,0 +1,28 @@
+# Seed add you the ability to populate your db.
+# We provide you a basic shell for interaction with the end user.
+# So try some code like below:
+#
+# name = shell.ask("What's your name?")
+# shell.say name
+#
+email = shell.ask "Which email do you want use for logging into admin?"
+password = shell.ask "Tell me the password to use:"
+
+shell.say ""
+
+account = Account.create(:email => email, :name => "Foo", :surname => "Bar", :password => password, :password_confirmation => password, :role => "admin")
+
+if account.valid?
+ shell.say "================================================================="
+ shell.say "Account has been successfully created, now you can login with:"
+ shell.say "================================================================="
+ shell.say " email: #{email}"
+ shell.say " password: #{password}"
+ shell.say "================================================================="
+else
+ shell.say "Sorry but some thing went wrong!"
+ shell.say ""
+ account.errors.full_messages.each { |m| shell.say " - #{m}" }
+end
+
+shell.say ""
View
38 models/account.rb
@@ -0,0 +1,38 @@
+class Account < ActiveRecord::Base
+ attr_accessor :password, :password_confirmation
+
+ # Validations
+ validates_presence_of :email, :role
+ validates_presence_of :password, :if => :password_required
+ validates_presence_of :password_confirmation, :if => :password_required
+ validates_length_of :password, :within => 4..40, :if => :password_required
+ validates_confirmation_of :password, :if => :password_required
+ validates_length_of :email, :within => 3..100
+ validates_uniqueness_of :email, :case_sensitive => false
+ validates_format_of :email, :with => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i
+ validates_format_of :role, :with => /[A-Za-z]/
+
+ # Callbacks
+ before_save :encrypt_password, :if => :password_required
+
+ ##
+ # This method is for authentication purpose
+ #
+ def self.authenticate(email, password)
+ account = first(:conditions => { :email => email }) if email.present?
+ account && account.has_password?(password) ? account : nil
+ end
+
+ def has_password?(password)
+ ::BCrypt::Password.new(crypted_password) == password
+ end
+
+ private
+ def encrypt_password
+ self.crypted_password = ::BCrypt::Password.create(password)
+ end
+
+ def password_required
+ crypted_password.blank? || password.present?
+ end
+end
View
95 public/admin/stylesheets/base.css
@@ -0,0 +1,95 @@
+*{margin:0;padding:0}
+.clear{clear:both;height:0;}
+.wat-cf:after{content:".";display:block;height:0;clear:both;visibility:hidden;}
+.wat-cf{display:inline-block;}
+/* Hides from IE-mac \*/
+* html .wat-cf{height:1%;}
+.wat-cf{display:block;}
+/* End hide from IE-mac */
+h1{margin:15px 0;font-size:22px;font-weight:normal;}
+h2{font-size:22px;margin:15px 0;font-weight:normal;}
+h3{font-size:18px;margin:10px 0;font-weight:normal;}
+h4{font-size:16px;margin:10px 0;font-weight:normal;}
+hr{height:1px;border:0;}
+p{margin:15px 0;}
+a img{border:none;}
+body{font-size:12px;font-family:sans-serif;}
+#container{min-width:960px;}
+#header,#wrapper{padding:0 20px;}
+#header{position:relative;padding-top:1px;}
+#header h1{margin:0;padding:10px 0;font-size:26px;}
+#header h1 a:link,#header h1 a:active,#header h1 a:hover,#header h1 a:visited{text-decoration:none;}
+#main{width:73%;float:left;}
+.actions-bar{padding:10px 1px;}
+.actions-bar .actions{float:left;}
+.actions-bar .pagination{float:right;padding:1px 0;}
+#sidebar{width:25%;float:right;}
+#sidebar h3{padding:10px 15px;margin:0;font-size:13px;}
+#sidebar .block{margin-bottom:20px;padding-bottom:10px;}
+#sidebar .block .content{padding:0 15px;}
+#sidebar ul.navigation li a:link,#sidebar ul.navigation li a:visited{display:block;padding:10px 15px;}
+#sidebar .block .sidebar-block,#sidebar .notice{padding:10px;}
+.message.notice,.message.warning,.message.error{padding:10px;}
+#wrapper{padding-top:20px;}
+#main .block{margin-bottom:20px;padding-top:1px;}
+#main .block .content .inner{padding:0 15px 15px;}
+#main .block .content .inner .navform{text-align:right;}
+#main .main p.first{margin-top:0;}
+#user-navigation{position:absolute;top:0px;right:20px;}
+#main-navigation{width:100%;}
+#user-navigation ul,#main-navigation ul,.secondary-navigation ul,#sidebar ul.navigation{margin:0;padding:0;list-style-type:none;}
+#user-navigation ul li,#main-navigation ul li,.secondary-navigation ul li{float:left;}
+#main-navigation ul li{margin-right:5px;}
+#user-navigation ul li{padding:5px 10px;}
+#main-navigation ul li a:link,#main-navigation ul li a:visited,#main-navigation ul li a:hover,#main-navigation ul li a:active,
+.secondary-navigation ul li a:link,.secondary-navigation ul li a:visited,.secondary-navigation ul li a:hover,.secondary-navigation ul li a:active,
+#user-navigation ul li a:link,#user-navigation ul li a:visited,#user-navigation ul li a:hover,#user-navigation ul li a:active{text-decoration:none;}
+#main-navigation ul li a{font-size:14px;line-height:14px;display:block;padding:8px 15px;}
+.secondary-navigation{font-size:13px;border-bottom-width:10px;border-bottom-style:solid;}
+.secondary-navigation ul li a{display:block;padding:10px 15px;}
+#footer{padding-bottom:20px;}
+/* pagination */
+.pagination a,.pagination span{padding:2px 5px;margin-right:5px;display:block;float:left;border-style:solid;border-width:1px;}
+.pagination span.current{font-weight:bold;}
+.pagination a{text-decoration:none;}
+/* tables */
+.table{width:100%;border-collapse:collapse;margin-bottom:15px;}
+.table th{padding:10px;font-weight:bold;text-align:left;}
+/*.table th.first{width:30px;}*/
+.table th.last{width:80px;}
+.table .checkbox{margin-left:10px;}
+.table td{padding:10px;}
+.table td.last{text-align:right;}
+/* forms */
+input.check_box{margin:0;padding:0;}
+.form .group{margin-bottom:15px;}
+.form div.left{width:20%;float:left;}
+.form div.right{width:75%;float:right;}
+.form .columns .column{width:48%;}
+.form .columns .left{float:left;}
+.form .columns .right{float:right;}
+.form label,.form input.text_field,.form input.password_field,.form textarea.text_area{font-size:1.0em;padding:2px 0;margin:0;color:#36393D;}
+.form label.right{text-align:right;}
+.form input.check_box,.form input.radio{margin-right:5px;}
+.form label.check_box,.form label.radio{line-height:1.5em;}
+.form label{padding-bottom:2px;font-weight:bold;}
+.form .error{color:red;}
+.form a{color:red;font-size:14px;}
+.form input.text_field,.form input.password_field,.form textarea.text_area{width:100%;border-width:1px;border-style:solid;}
+.button_to{display:inline;}
+.button_to input{background:none;border:none;display:inline;font-size:12px;color:#A72D2E;cursor:pointer;font-family: helvetica, arial, sans-serif;}
+#user-navigation .button_to input{color:#FFFFFF;}
+/* lists */
+ul.list{margin:0;padding:0;list-style-type:none;}
+ul.list li{clear:left;padding-bottom:5px;}
+ul.list li .left{float:left;}
+ul.list li .left .avatar{width:50px;height:50px;}
+ul.list li .item{margin-left:80px;}
+ul.list li .item .avatar{float:left;margin:0 5px 5px 0;width:30px;height:30px;}
+/* box */
+#box{width:500px;margin:50px auto;}
+#box .block{margin-bottom:20px;}
+#box .block h2{padding:10px 15px;margin:0;}
+#box .block .content{padding:10px 20px;}
+/* custom */
+.code{font-family: Courier, 'Courier New', monospace;color:#36393D;}
View
364 public/admin/stylesheets/themes/amro/style.css
@@ -0,0 +1,364 @@
+/*
+
+ Amro
+ by Sandro Duarte
+ sandro[at]gmail.com
+
+ dark green #008080
+ light yellow #F6F5CD
+ orange #E8C53B
+ light green #76BBA5
+ light #F3F4EC
+
+*/
+
+.small {
+ font-size: 11px;
+ font-style: normal;
+ font-weight: normal;
+ text-transform: normal;
+ letter-spacing: normal;
+ line-height: 1.4em;
+}
+
+.gray {
+ color:#999999;
+ font-family: Georgia, serif;
+ font-size: 13px;
+ font-style: italic;
+ font-weight: normal;
+ text-transform: normal;
+ letter-spacing: normal;
+ line-height: 1.6em;
+}
+
+.hightlight {
+ background-color: #ffff88;
+ font-weight: bold;
+ color: #36393d;
+}
+
+a:link, a:visited, a:hover, a:active, h1, h2, h3 { color: #008080; }
+a { -moz-outline: none; }
+
+body {
+ color: #222;
+ background: #F6F5CD;
+ font-family: helvetica,Arial,sans-serif;
+}
+
+hr {
+ background: #f0f0ee;
+ color: #f0f0ee;
+}
+
+p {
+ margin: 10px 0;
+
+}
+
+#header {
+ background: #008080;
+}
+
+#header h1 {
+ padding: 15px 0;
+ font-size: 28px;
+ font-style: normal;
+ font-weight: bold;
+ text-transform: normal;
+ letter-spacing: -1px;
+ line-height: 1.2em;
+}
+
+#header h1 a:link, #header h1 a:active, #header h1 a:hover, #header h1 a:visited {
+ color: #FFF;
+}
+
+#user-navigation {
+ top: auto;
+ bottom: 5px;
+ right: 25px;
+}
+
+#main .block .content {
+ background: #FFF;
+ padding-top: 1px;
+}
+
+#main .block .content h2 {
+ margin-left: 15px;
+}
+
+#main .block .content p {
+ font-size:13px;
+ line-height:1.45em;
+}
+
+#main .block .content h2 {
+ font-size:22px;
+ font-style:normal;
+ font-weight:bold;
+ letter-spacing:-1px;
+ line-height:1.2em;
+ margin-left:15px;
+}
+
+#sidebar .block {
+ background: #FFF;
+}
+
+#sidebar .notice {
+ background: #76BBA5;
+ color: #fff;
+}
+
+#sidebar h3 {
+ background: #008080;
+ color: #FFF;
+ border-bottom: 6px solid #E8C53B;
+}
+
+#main-navigation ul li {
+ padding-left: 15px;
+}
+
+#main-navigation ul li a {
+ padding: 8px 0;
+}
+
+#main-navigation ul li.active {
+ padding: 0;
+ margin-left: 15px;
+}
+
+#main-navigation ul li.active {
+ margin-left: 15px;
+}
+
+#main-navigation ul li.active a {
+ padding: 8px 15px;
+}
+
+#sidebar ul li a:link, #sidebar ul li a:visited {
+ background: #FFF;
+ border-bottom: 1px solid #F0F0EE;
+ text-decoration: none;
+}
+
+#sidebar ul li a:hover, #sidebar ul li a:active {
+ background: #76BBA5;
+ color: #FFF;
+}
+
+#main-navigation {
+ background: #E8C53B;
+}
+
+#main-navigation ul li {
+ background: #E8C53B;
+ margin-right: 0;
+}
+
+#main-navigation ul li.active {
+ background: #F6F5CD;
+}
+
+#main-navigation ul li a:link, #main-navigation ul li a:visited, #main-navigation ul li a:hover, #main-navigation ul li a:active,
+#user-navigation ul li a:link, #user-navigation ul li a:visited, #user-navigation ul li a:hover, #user-navigation ul li a:active {
+ text-decoration: none;
+ color: #fff;
+}
+
+
+.secondary-navigation ul li a:link, .secondary-navigation ul li a:visited, .secondary-navigation ul li a:hover, .secondary-navigation ul li a:active {
+ text-decoration: none;
+ color: #FFF;
+}
+
+#user-navigation a.logout {
+ background: #cc0000;
+ padding: 2px 6px;
+ -moz-border-radius: 4px;
+ -webkit-border-radius: 3px;
+}
+
+.secondary-navigation li a:hover {
+ background: #76BBA5;
+}
+
+#main-navigation ul li.active a:link, #main-navigation ul li.active a:visited, #main-navigation ul li.active a:hover, #main-navigation ul li.active a:active {
+ color: #008080;
+}
+
+.secondary-navigation {
+ background: #008080;
+ border-bottom: 6px solid #E8C53B;
+}
+
+.secondary-navigation ul li.active, .secondary-navigation ul li.active a {
+ background-color: #E8C53B;
+}
+
+.secondary-navigation ul li a {
+ padding:8px 12px;
+}
+
+#footer .block {
+ color: #FFF;
+ background: #E8C53B;
+}
+
+#footer .block p {
+ margin: 0;
+ padding: 10px;
+}
+
+/* pagination */
+
+.pagination span.disabled {
+ color: #bbb;
+ border-color: #bbb;
+}
+
+.pagination span.current {
+ background: #008080;
+ color: #FFF;
+ border-color: #008080;
+}
+
+.pagination a, .pagination span {
+ color: #008080;
+ border-color: #008080;
+}
+
+.pagination a:hover {
+ color: #FFF;
+ background: #008080;
+}
+
+/* tables */
+
+.table th {
+ background: #008080;
+ color: #FFF;
+}
+
+.table td {
+ border-bottom:1px solid #F0F0EE;
+}
+
+.table tr.even {
+ background: #EFF3E4;
+}
+/* forms */
+
+.form input.text_field, .form input.password_field, .form textarea.text_area {
+ width: 100%;
+ border:1px solid #CFCFCF;
+}
+
+.form input.button {
+ padding: 5px 10px 5px 10px;
+ background-color:#008080;
+ text-decoration:none;
+ cursor: pointer;
+ color: #FFF;
+ font-size: 14px;
+ border:0px;
+ margin:0px;
+}
+
+.form .button:hover {
+ background: #E8C53B;
+}
+
+.form .description {
+ font-style: italic;
+ color: #8C8C8C;
+ font-size: .9em;
+}
+
+/* flash-messages */
+.flash .message {
+ -moz-border-radius: 3px;
+ -webkit-border-radius: 3px;
+ text-align:center;
+ margin: 0 auto 15px;
+
+}
+
+.flash .message p {
+ margin:8px;
+}
+.flash .error {
+ border: 1px solid #fbb;
+ background-color: #fdd;
+}
+.flash .warning {
+ border: 1px solid #fffaaa;
+ background-color: #ffffcc;
+}
+.flash .notice {
+ border: 1px solid #1FDF00;
+ background-color: #BBFFB6;
+}
+
+/* lists */
+
+ul.list li {
+ border-bottom-color: #F0F0EE;
+ border-bottom-width: 1px;
+ border-bottom-style: solid;
+}
+
+ul.list li .item .avatar {
+ border-color: #F0F0EE;
+ border-width: 1px;
+ border-style: solid;
+ padding: 2px;
+}
+
+/* box */
+
+#box .block {
+ background: #FFF;
+}
+
+#box .block h2 {
+ background: #008080;
+ color: #FFF;
+}
+
+
+/* rounded borders */
+
+#main, #main-navigation, #main-navigation li, .secondary-navigation, #main .block, #sidebar .block, #sidebar h3, ul.list li,
+#footer .block, .form input.button, #box .block, #box .block h2 {
+ -moz-border-radius-topleft: 4px;
+ -webkit-border-top-left-radius: 4px;
+ -moz-border-radius-topright: 4px;
+ -webkit-border-top-right-radius: 4px;
+}
+
+.secondary-navigation li.first a, .secondary-navigation ul li.first, .table th.first, .table th.first {
+ -moz-border-radius-topleft: 4px;
+ -webkit-border-top-left-radius: 4px;
+}
+
+.table th.last {
+ -moz-border-radius-topright: 4px;
+ -webkit-border-top-right-radius: 4px;
+}
+
+.secondary-navigation ul li.first {
+ -moz-border-radius-topleft: 4px;
+ -webkit-border-top-left-radius: 4px;
+}
+
+#sidebar, #sidebar .block, #main .block, #sidebar ul.navigation, ul.list li, #footer .block, .form input.button, #box .block {
+ -moz-border-radius-bottomleft: 4px;
+ -webkit-border-bottom-left-radius: 4px;
+ -moz-border-radius-bottomright: 4px;
+ -webkit-border-bottom-right-radius: 4px;
+}
View
290 public/admin/stylesheets/themes/bec-green/style.css
@@ -0,0 +1,290 @@
+a:link, a:visited, a:hover, a:active { color: #33f; }
+h1, h2, h3 {color:#444}
+
+body {
+ color: #222;
+ background: #e5e5e5;
+ font-family: "Bitstream Vera Sans", verdana, sans-serif;
+}
+
+hr {
+ background: #f0f0ee;
+}
+
+p {
+ font-size: 14px;
+ line-height: 20px;
+}
+
+input.check_box {
+ vertical-align:middle;
+}
+
+#header h1 {
+ font-size: 28px;
+ padding: 5px 0;
+ margin: 5px 0;
+}
+
+.hightlight {
+ background-color: #ffc;
+}
+.small {
+ font-size: 11px;
+}
+.gray {
+ color: #999;
+}
+#header {
+ background: #48625B;
+}
+
+#header h1 a:link, #header h1 a:active, #header h1 a:hover, #header h1 a:visited {
+ color: #FFF;
+}
+
+#main {
+ background: #e5e5e5;
+ width: 69%;
+}
+
+#main .block {
+ -moz-border-radius-topleft: 4px;
+ -moz-border-radius-topright: 4px;
+ padding: 0;
+ margin-bottom:20px;
+ padding-bottom: 20px;
+ background: #fff;
+}
+
+#main .block h2.title {
+ margin: 0 0 20px 0;
+ background-color: #E9FAE6;
+ padding: 5px 5px 5px 15px;
+ font-size:18px;
+}
+
+.main_container {
+ padding:10px;
+}
+
+/* #sidebar .block { background: #FFF; padding-bottom:0px; } */
+
+#sidebar .notice {
+ background-color: #ffc;
+ padding: 0 10px;
+ border-bottom:1px solid #ddd;
+ border-right:1px solid #ddd;
+ border-top:1px solid #fff;
+ border-left:1px solid #fff;
+}
+#sidebar .notice h2 {
+ font-size:16px;
+ margin: 5px 0;
+ border-bottom:1px solid #aaa;
+}
+#sidebar .notice p {
+ font-size:12px;
+}
+
+#sidebar .block {
+ padding-bottom: 0;
+}
+
+#sidebar .block .content {
+ padding: 0 10px;
+}
+
+
+#sidebar h3 {
+ background: #c7d8d8;
+ border-bottom:1px solid #999;
+ padding: 5px 10px;
+}
+
+#sidebar ul li a:link, #sidebar ul li a:visited {
+ font-size:14px;
+}
+
+#sidebar ul li a:hover, #sidebar ul li a:active {
+ background: #E9FAE6;
+ color: #444;
+ font-size:14px;
+ text-decoration:underline;
+}
+#sidebar ul.navigation li.last a {
+ border-bottom: none;
+}
+
+#sidebar ul.navigation li a:link,#sidebar ul.navigation li a:visited {
+ padding: 5px 10px;
+ color:#444;
+ text-decoration: none;
+}
+#sidebar ul.navigation li a:hover {
+ text-decoration:underline;
+}
+#sidebar .block .sidebar-block h4 {
+ border-bottom: 1px solid #bbb;
+}
+#main-navigation ul li {
+ background: #30423E;
+}
+
+#main-navigation ul li:hover {
+ background: #23302D;
+}
+
+#main-navigation ul li.active {
+ background: #e5e5e5;
+}
+
+#main-navigation ul li a:link, #main-navigation ul li a:visited, #main-navigation ul li a:hover, #main-navigation ul li a:active,
+.secondary-navigation ul li a:link, .secondary-navigation ul li a:visited, .secondary-navigation ul li a:hover, .secondary-navigation ul li a:active,
+#user-navigation ul li a:link, #user-navigation ul li a:visited, #user-navigation ul li a:hover, #user-navigation ul li a:active {
+ text-decoration: none;
+ color: #FFF;
+}
+
+#main-navigation ul li a {
+ font-size: 14px;
+ padding: 4px 10px;
+}
+
+#main-navigation ul li.active a:link, #main-navigation ul li.active a:visited, #main-navigation ul li.active a:hover, #main-navigation ul li.active a:active {
+ color: #333;
+}
+#user-navigation ul li a:hover {
+ text-decoration: underline;
+}
+.secondary-navigation {
+ background: #48625B;
+ border-bottom-color: #30423e;
+ border-bottom: 5px solid #30423e;
+}
+
+.secondary-navigation ul li.active {
+ background-color: #30423e;
+}
+
+.secondary-navigation ul li:hover {
+ background-color: #23302d;
+}
+
+/* pagination */
+
+.pagination span.current {
+ background: #30423e;
+ color: #FFF;
+ border: 1px solid #30423e;
+ -moz-border-radius:5px;
+}
+
+.pagination a {
+ color: #364B69;
+ border: 1px solid #ddd;
+ -moz-border-radius:5px;
+}
+
+.pagination a:hover {
+ color: #444;
+ background: #E9FAE6;
+}
+
+/* tables */
+
+.table th {
+ background: #48625B;
+ color: #FFF;
+ font-weight:normal;
+ padding:3px;
+}
+
+.table th a.toggle {
+ display: block;
+ width: 12px;
+ height: 12px;
+ background: transparent url('images/tick.png') center no-repeat;
+ text-indent: -9999px;
+ -moz-outline: none;
+}
+
+.table th.first {
+ width: 30px;
+ text-align: center;
+}
+
+.table td {
+ border-bottom: 1px solid #F0F0EE;
+}
+
+/* forms */
+
+.form input.text, .form textarea.textarea {
+ border: 1px solid #ddd;
+ padding: 5px;
+ width: 95%;
+}
+
+.form .navform {
+ padding:10px;
+ background-color: #E9FAE6;
+ font-size:14px;
+ border-bottom:1px solid #ddd;
+ border-right:1px solid #ddd;
+ border-top:1px solid #eee;
+ border-left:1px solid #eee;
+}
+.form .navform input {
+ font-size:14px;
+}
+
+/* flash-messages */
+.flash .message {
+ -moz-border-radius: 3px;
+ -webkit-border-radius: 3px;
+ text-align:center;
+ margin:0 auto 5px;
+ width:80%;
+}
+.flash .message p {
+ margin:8px;
+}
+.flash .error {
+ border: 1px solid #fbb;
+ background-color: #fdd;
+}
+.flash .warning {
+ border: 1px solid #fffaaa;
+ background-color: #ffffcc;
+}
+.flash .notice {
+ border: 1px solid #ddf;
+ background-color: #eef;
+}
+
+/* lists */
+
+ul.list li {
+ border-bottom-color: #F0F0EE;
+}
+
+ul.list li .item .avatar {
+ border-color: #F0F0EE;
+ margin: 3px 10px 0 0;
+}
+
+ul.list li .left {
+ padding: 5px 5px;
+}
+
+/* box */
+
+#box .block {
+ background: #FFF;
+}
+
+#box .block h2 {
+ background: #48625B;
+ color: #FFF;
+}
View
301 public/admin/stylesheets/themes/bec/style.css
@@ -0,0 +1,301 @@
+a:link, a:visited, a:hover, a:active { color: #33f; }
+h1, h2, h3 {color:#444}
+
+body {
+ color: #333;
+ background: #e5e5e5;
+ font-family: Verdana, Arial, "Bitstream Vera Sans", sans-serif;
+}
+
+hr {
+ background: #f0f0ee;
+}
+
+p {
+ font-size: 12px;
+ line-height: 20px;
+}
+
+input.check_box {
+ vertical-align:middle;
+}
+
+#header h1 {
+ font-size: 28px;
+ padding: 5px 0;
+ margin: 5px 0;
+}
+
+.hightlight {
+ background-color: #ffc;
+}
+.small {
+ font-size: 11px;
+}
+.gray {
+ color: #999;
+}
+#header {
+ background: #006666;
+}
+
+#header h1 a:link, #header h1 a:active, #header h1 a:hover, #header h1 a:visited {
+ color: #FFF;
+}
+
+#main {
+ background: #e5e5e5;
+ width: 73%;
+}
+
+#main .block {
+ -moz-border-radius-topleft: 4px;
+ -moz-border-radius-topright: 4px;
+ padding: 0;
+ margin-bottom:20px;
+ padding-bottom: 20px;
+ background: #fff;
+}
+
+#main .block h2.title {
+ margin: 0 0 20px 0;
+ background-color: #E6FAFA;
+ padding: 5px 5px 5px 15px;
+ font-size:18px;
+}
+
+.main_container {
+ padding:10px;
+}
+
+#footer .block p {
+ color:#aaa;
+ font-size:11px;
+}
+
+/* #sidebar .block { background: #FFF; padding-bottom:0px; } */
+
+#sidebar .notice {
+ background-color: #ffc;
+ padding: 0 10px;
+ border-bottom:1px solid #ddd;
+ border-right:1px solid #ddd;
+ border-top:1px solid #fff;
+ border-left:1px solid #fff;
+}
+#sidebar .notice h2 {
+ font-size:16px;
+ margin: 5px 0;
+ border-bottom:1px solid #aaa;
+}
+#sidebar .notice p {
+ font-size:12px;
+}
+
+#sidebar .block {
+ padding-bottom: 0;
+}
+
+#sidebar .block .content {
+ padding: 0 10px;
+}
+
+
+#sidebar h3 {
+ background: #c7d8d8;
+ border-bottom:1px solid #999;
+ padding: 5px 10px;
+}
+
+#sidebar ul li a:link, #sidebar ul li a:visited {
+ font-size:12px;
+}
+
+#sidebar ul li a:hover, #sidebar ul li a:active {
+ background: #e1efef;
+ color: #444;
+ font-size:12px;
+ text-decoration:underline;
+}
+#sidebar ul.navigation li.last a {
+ border-bottom: none;
+}
+
+#sidebar ul.navigation li a:link,#sidebar ul.navigation li a:visited {
+ padding: 5px 10px;
+ color:#444;
+ text-decoration: none;
+}
+#sidebar ul.navigation li a:hover {
+ text-decoration:underline;
+}
+#sidebar .block .sidebar-block h4 {
+ border-bottom: 1px solid #bbb;
+}
+#main-navigation ul li {
+ background: #008c8c;
+}
+
+#main-navigation ul li:hover {
+ background: #00b2b2;
+}
+
+#main-navigation ul li.active {
+ background: #f0f0ee;
+}
+
+#main-navigation ul li a:link, #main-navigation ul li a:visited, #main-navigation ul li a:hover, #main-navigation ul li a:active,
+.secondary-navigation ul li a:link, .secondary-navigation ul li a:visited, .secondary-navigation ul li a:hover, .secondary-navigation ul li a:active,
+#user-navigation ul li a:link, #user-navigation ul li a:visited, #user-navigation ul li a:hover, #user-navigation ul li a:active {
+ text-decoration: none;
+ color: #FFF;
+}
+
+#main-navigation ul li a {
+ font-size: 12px;
+ padding: 4px 10px;
+}
+
+#main-navigation ul li.active a:link, #main-navigation ul li.active a:visited, #main-navigation ul li.active a:hover, #main-navigation ul li.active a:active {
+ color: #364b69;
+}
+#user-navigation ul li a:hover {
+ text-decoration: underline;
+}
+.secondary-navigation {
+ background: #006666;
+ border-bottom-color: #008c8c;
+ border-bottom: 5px solid #008c8c;
+}
+
+.secondary-navigation ul li.active {
+ background-color: #008c8c;
+}
+
+.secondary-navigation ul li:hover {
+ background-color: #00b2b2;
+}
+
+/* pagination */
+
+.pagination span.current {
+ background: #008c8c;
+ color: #FFF;
+ border: 1px solid #008c8c;
+ -moz-border-radius:5px;
+}
+
+.pagination a {
+ color: #364B69;
+ border: 1px solid #ddd;
+ -moz-border-radius:5px;
+ font-size:11px;
+}
+
+.pagination a:hover {
+ color: #444;
+ background: #E6FAFA;
+}
+
+/* tables */
+
+.table th {
+ background: #006666;
+ color: #FFF;
+ font-weight:normal;
+ padding:3px;
+}
+
+.table th a.toggle {
+ display: block;
+ width: 12px;
+ height: 12px;
+ background: transparent url('images/tick.png') center no-repeat;
+ text-indent: -9999px;
+ -moz-outline: none;
+}
+
+.table th.first {
+ width: 30px;
+ text-align: center;
+}
+
+.table td {
+ border-bottom: 1px solid #F0F0EE;
+}
+
+/* forms */
+
+.form input.text, .form textarea.textarea {
+ border: 1px solid #ddd;
+ padding: 5px;
+ width:99%;
+}
+
+.form .navform {
+ padding:10px;
+ background-color: #f1f8f8;
+ font-size:14px;
+ border-bottom:1px solid #ddd;
+ border-right:1px solid #ddd;
+ border-top:1px solid #eee;
+ border-left:1px solid #eee;
+}
+.form .navform input {
+ font-size:14px;
+}
+
+.description {
+ color:#aaa;
+ font-family:Georgia, serif;
+}
+
+/* flash-messages */
+.flash .message {
+ -moz-border-radius: 3px;
+ -webkit-border-radius: 3px;
+ text-align:center;
+ margin:0 auto 5px;
+ width:80%;
+}
+.flash .message p {
+ margin:8px;
+}
+.flash .error {
+ border: 1px solid #fbb;
+ background-color: #fdd;
+}
+.flash .warning {
+ border: 1px solid #fffaaa;
+ background-color: #ffffcc;
+}
+.flash .notice {
+ border: 1px solid #ddf;
+ background-color: #eef;
+}
+
+/* lists */
+
+ul.list li {
+ border-bottom-color: #F0F0EE;
+}
+
+ul.list li .item .avatar {
+ border-color: #F0F0EE;
+ margin: 3px 10px 0 0;
+}
+
+ul.list li .left {
+ padding: 5px 5px;
+}
+
+/* box */
+
+#box .block {
+ background: #FFF;
+}
+
+#box .block h2 {
+ background: #006666;
+ color: #FFF;
+}
View
287 public/admin/stylesheets/themes/blue/style.css
@@ -0,0 +1,287 @@
+.small { font-size:12px; }
+.gray { color:#999999; }
+.hightlight { background-color:#FFFFCC; }
+
+a:link, a:visited, a:hover, a:active, h1, h2, h3 { color: #2F427A; }
+a { -moz-outline: none; }
+
+body {
+ color: #222;
+ background: #f0f0ee;
+ font-family: helvetica, arial, sans-serif;
+ font-size: 14px;
+}
+
+hr {
+ background: #f0f0ee;
+ color: #f0f0ee;
+}
+
+#header {
+ background: #2F427A;
+}
+
+#header h1 {
+ padding: 20px 0;
+}
+
+#header h1 a:link, #header h1 a:active, #header h1 a:hover, #header h1 a:visited {
+ color: #FFF;
+}
+
+#user-navigation {
+ top: auto;
+ bottom: 5px;
+ right: 25px;
+}
+
+#main .block .content {
+ background: #FFF;
+ padding-top: 1px;
+}
+
+#main .block .content h2 {
+ margin-left: 15px;
+}
+
+#sidebar .block {
+ background: #FFF;
+}
+
+#sidebar .notice {
+ background: #FFFFCC;
+}
+
+#sidebar h3 {
+ background: #2F427A;
+ color: #FFF;
+ border-bottom: 10px solid #262626;
+ font-size: 15px;
+}
+
+#main-navigation ul li {
+ padding-left: 15px;
+}
+
+#main-navigation ul li a {
+ padding: 8px 0;
+}
+
+#main-navigation ul li.active {
+ padding: 0;
+ margin-left: 15px;
+}
+
+#main-navigation ul li.active {
+ margin-left: 15px;
+}
+
+#main-navigation ul li.active a {
+ padding: 8px 15px;
+}
+
+#sidebar ul li a:link, #sidebar ul li a:visited {
+ background: #FFF;
+ border-bottom: 1px solid #F0F0EE;
+ text-decoration: none;
+}
+
+#sidebar ul li a:hover, #sidebar ul li a:active {
+ background: #316291;
+ color: #FFF;
+}
+
+#main-navigation {
+ background: #262626;
+}
+
+#main-navigation ul li {
+ background: #262626;
+ margin-right: 0;
+}
+
+#main-navigation ul li.active {
+ background: #f0f0ee;
+}
+
+#main-navigation ul li a:link, #main-navigation ul li a:visited, #main-navigation ul li a:hover, #main-navigation ul li a:active,
+.secondary-navigation ul li a:link, .secondary-navigation ul li a:visited, .secondary-navigation ul li a:hover, .secondary-navigation ul li a:active,
+#user-navigation ul li a:link, #user-navigation ul li a:visited, #user-navigation ul li a:hover, #user-navigation ul li a:active {
+ text-decoration: none;
+ color: #FFF;
+}
+
+.secondary-navigation li a:hover {
+ background: #5C637A;
+}
+
+#main-navigation ul li.active a:link, #main-navigation ul li.active a:visited, #main-navigation ul li.active a:hover, #main-navigation ul li.active a:active {
+ color: #262626;
+}
+
+.secondary-navigation {
+ background: #2F427A;
+ border-bottom-color: #262626;
+ font-size: 15px;
+}
+
+.secondary-navigation ul li.active, .secondary-navigation ul li.active a:hover {
+ background-color: #262626;
+}
+
+#footer .block {
+ color: #FFF;
+ background: #262626;
+}
+
+#footer .block p {
+ margin: 0;
+ padding: 10px;
+}
+
+/* pagination */
+
+.pagination span, .pagination a {
+ -moz-border-radius: 3px;
+ -webkit-border-radius: 3px;
+ padding-top: 4px;
+}
+
+.pagination span.current {
+ background: #262626;
+ color: #FFF;
+ border-color: #262626;
+}
+
+.pagination a {
+ color: #262626;
+ border-color: #262626;
+}
+
+.pagination a:hover {
+ color: #FFF;
+ background: #262626;
+}
+
+/* tables */
+
+.table th {
+ background: #262626;
+ color: #FFF;
+}
+
+.table td {
+ border-bottom:1px solid #F0F0EE;
+}
+
+/* forms */
+
+.form input.text_field, .form input.password_field, .form textarea.text_area {
+ width: 100%;
+ border: 1px solid #262626;
+}
+
+.form input.button {
+ padding: 5px 10px 5px 10px;
+ background-color:#2F427A;
+ text-decoration:none;
+ cursor: pointer;
+ color: #FFF;
+ font-size: 14px;
+ border:0px;
+ margin:0px;
+}
+
+.form .button:hover {
+ background: #262626;
+}
+
+.form .description {
+ font-style: italic;
+ color: #8C8C8C;
+ font-size: .9em;
+}
+
+/* flash-messages */
+.flash .message {
+ -moz-border-radius: 3px;
+ -webkit-border-radius: 3px;
+ text-align:center;
+ margin: 0 auto 15px;
+
+}
+
+.flash .message p {
+ margin:8px;
+}
+.flash .error {
+ border: 1px solid #fbb;
+ background-color: #fdd;
+}
+.flash .warning {
+ border: 1px solid #fffaaa;
+ background-color: #ffffcc;
+}
+.flash .notice {
+ border: 1px solid #1FDF00;
+ background-color: #BBFFB6;
+}
+
+/* lists */
+
+ul.list li {
+ border-bottom-color: #F0F0EE;
+ border-bottom-width: 1px;
+ border-bottom-style: solid;
+}
+
+ul.list li .item .avatar {
+ border-color: #F0F0EE;
+ border-width: 1px;
+ border-style: solid;
+ padding: 2px;
+}
+
+/* box */
+
+#box .block {
+ background: #FFF;
+}
+
+#box .block h2 {
+ background: #2F427A;
+ color: #FFF;
+}
+
+
+/* rounded borders */
+
+#main, #main-navigation, #main-navigation li, .secondary-navigation, #main .block, #sidebar .block, #sidebar h3, ul.list li,
+#footer .block, .form input.button, #box .block, #box .block h2 {
+ -moz-border-radius-topleft: 4px;
+ -webkit-border-top-left-radius: 4px;
+ -moz-border-radius-topright: 4px;
+ -webkit-border-top-right-radius: 4px;
+}
+
+.secondary-navigation li.first a, .secondary-navigation ul li.first, .table th.first, .table th.first {
+ -moz-border-radius-topleft: 4px;
+ -webkit-border-top-left-radius: 4px;
+}
+
+.table th.last {
+ -moz-border-radius-topright: 4px;
+ -webkit-border-top-right-radius: 4px;
+}
+
+.secondary-navigation ul li.first {
+ -moz-border-radius-topleft: 4px;
+ -webkit-border-top-left-radius: 4px;
+}
+
+#sidebar, #sidebar .block, #main .block, #sidebar ul.navigation, ul.list li, #footer .block, .form input.button, #box .block {
+ -moz-border-radius-bottomleft: 4px;
+ -webkit-border-bottom-left-radius: 4px;
+ -moz-border-radius-bottomright: 4px;
+ -webkit-border-bottom-right-radius: 4px;
+}
View
373 public/admin/stylesheets/themes/default/style.css
@@ -0,0 +1,373 @@
+/*
+
+ Drastic Dark
+ by Juan Maria Martinez Arce
+ juan[at]insignia4u.com
+
+ light grey: #cfcfcf
+ medium grey: #36393d
+ dark grey: #1a1a1a
+ interactive action yellow #ffff88
+ red #cc0000
+ light blue #E6EEFC
+ dark blue #0B43A8
+
+*/
+
+.small {
+ font-size: 11px;
+ font-style: normal;
+ font-weight: normal;
+ text-transform: normal;
+ letter-spacing: normal;
+ line-height: 1.4em;
+}
+
+.gray {
+ color:#999999;
+ font-family: Georgia, serif;
+ font-size: 13px;
+ font-style: italic;
+ font-weight: normal;
+ text-transform: normal;
+ letter-spacing: normal;
+ line-height: 1.6em;
+}
+
+.hightlight {
+ background-color: #ffff88;
+ font-weight: bold;
+ color: #36393d;
+}
+
+a:link, a:visited, a:hover, a:active, h1, h2, h3 { color: #36393d; }
+a { -moz-outline: none; }
+
+body {
+ color: #222;
+ background: #cfcfcf;
+ font-family: helvetica, arial, sans-serif;
+}
+
+hr {
+ background: #f0f0ee;
+ color: #f0f0ee;
+}
+
+#header {
+ background: #36393d;
+}
+
+#header h1 {
+ padding: 15px 0;
+ font-size: 28px;
+ font-style: normal;
+ font-weight: bold;
+ text-transform: normal;
+ letter-spacing: -1px;
+ line-height: 1.2em;
+}
+
+#header h1 a:link, #header h1 a:active, #header h1 a:hover, #header h1 a:visited {
+ color: #FFF;
+}
+
+#user-navigation {
+ top: auto;
+ bottom: 5px;
+ right: 25px;
+}
+
+#user-navigation a.logout {
+ background: #cc0000;
+ padding: 1px 4px;
+ -moz-border-radius: 4px;
+ -webkit-border-radius: 3px;
+}
+
+#main .block .content {
+ background: #FFF;
+ padding-top: 1px;
+}
+
+#main .block .content h2 {
+ margin-left: 15px;
+ font-size: 22px;
+ font-style: normal;
+ font-weight: bold;
+ text-transform: normal;
+ letter-spacing: -1px;
+ line-height: 1.2em;
+}
+
+#main .block .content p {
+ font-size: 13px;
+ font-style: normal;
+ font-weight: normal;
+ text-transform: normal;
+ letter-spacing: normal;
+ line-height: 1.45em;
+}
+
+#sidebar .block {
+ background: #FFF;
+}
+
+#sidebar .block h4 {
+ font-weight: bold;
+}
+
+#sidebar .notice {
+ background: #E6EEFC;
+}
+
+#sidebar .notice h4 {
+ color: #0B43A8;
+}
+
+#sidebar h3 {
+ background: #36393d;
+ color: #FFF;
+ border-bottom: 5px solid #1a1a1a;
+}
+
+#main-navigation ul li {
+ padding-left: 15px;
+}
+
+#main-navigation ul li a {
+ padding: 8px 0;
+}
+
+#main-navigation ul li.active {
+ padding: 0;
+ margin-left: 15px;
+}
+
+#main-navigation ul li.active {
+ margin-left: 15px;
+}
+
+#main-navigation ul li.active a {
+ padding: 8px 15px;
+}
+
+#sidebar ul li a:link, #sidebar ul li a:visited {
+ background: #FFF;
+ border-bottom: 1px solid #F0F0EE;
+ text-decoration: none;
+}
+
+#sidebar ul li a:hover, #sidebar ul li a:active {
+ background: #666666;
+ color: #ffffff;;
+}
+
+#main-navigation {
+ background: #1a1a1a;
+}
+
+#main-navigation ul li {
+ background: #1a1a1a;
+ margin-right: 0;
+}
+
+#main-navigation ul li.active {
+ background: #f0f0ee;
+}
+
+#main-navigation ul li a:link, #main-navigation ul li a:visited, #main-navigation ul li a:hover, #main-navigation ul li a:active,
+.secondary-navigation ul li a:link, .secondary-navigation ul li a:visited, .secondary-navigation ul li a:hover, .secondary-navigation ul li a:active,
+#user-navigation ul li a:link, #user-navigation ul li a:visited, #user-navigation ul li a:hover, #user-navigation ul li a:active {
+ text-decoration: none;