Skip to content

Commit

Permalink
Tons of work on new Admin interface
Browse files Browse the repository at this point in the history
  • Loading branch information
Winton Welsh committed Jul 1, 2008
1 parent f96d0b7 commit 43311cd
Show file tree
Hide file tree
Showing 37 changed files with 4,148 additions and 10 deletions.
5 changes: 4 additions & 1 deletion init.rb
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
require 'admin'
require 'admin'

ActionView::Base.send :include, Admin::Helpers
ActionController::Base.send :include, Admin::Actions
8 changes: 8 additions & 0 deletions lib/admin.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
Dir[File.expand_path('*/*.rb', File.dirname(__FILE__))].each do |f|
require [ File.dirname(f), File.basename(f, '.rb') ].join('/')
end

module Admin
class << self
def routes
ActionController::Routing::Routes.add_route '/admin/:action/:id', :controller => 'admin'
end
end
end
34 changes: 33 additions & 1 deletion lib/admin/actions.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,34 @@
module AdminActions
module Admin
module Actions

def self.included(base)
base.extend ClassMethods
end

module ClassMethods
def acts_as_admin(*actions)
self.class_eval do
cattr_accessor :admin_sections
helper_method :admin_sections
self.admin_sections = actions

actions.each do |action|
define_method action do
@title ||= [ 'Admin' ]
@title << action.to_s.capitalize.gsub('_', '')
render :layout => false
end
end
end
include Admin::Actions::InstanceMethods
end
end

module InstanceMethods
def index
@title ||= [ 'Admin' ]
render :layout => 'admin/system/layout'
end
end
end
end
4 changes: 3 additions & 1 deletion lib/admin/helpers.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
module AdminHelpers
module Admin
module Helpers
end
end
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/bg/nav.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/bg/table_header_blue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/bg/table_header_orange.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/bg/top.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed resources/images/bg/top.png
Binary file not shown.
Binary file added resources/images/bg/top2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/bg/top3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed resources/images/icons/category/article.png
Binary file not shown.
Binary file removed resources/images/icons/category/comment.png
Binary file not shown.
Binary file removed resources/images/icons/row/delete.png
Binary file not shown.
Binary file removed resources/images/icons/row/edit.png
Binary file not shown.
Binary file removed resources/images/icons/row/view.png
Binary file not shown.
Binary file added resources/images/indicator/nav.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/indicator/table.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/system_status.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/title.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file added resources/javascripts/base.js
Empty file.
101 changes: 101 additions & 0 deletions resources/stylesheets/base.sass
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
body
:font-family Helvetica, Arial, sans-serif
:margin 0px
:color #6F687A

.row
:overflow hidden
.parent
:float left
:display block

#top
:height 150px
:background-color #101D40
:background-image url('/images/admin/system/bg/top.jpg')
:background-repeat no-repeat
:background-position top center
.content
:width 970px
:margin 0px auto
:padding 112px 0px 0px

#top2
:height 35px
:border-top 1px solid #F5F6F9
:background #ACBCCF url('/images/admin/system/bg/top2.png')

#top3
:height 100px
:background #F5F6F9 url('/images/admin/system/bg/top3.png')
.content
:width 970px
:margin 0px auto
:padding-top 14px
.system_status1 .cell
:padding-top 15px
:color #26416E
:font-size 16px
:font-weight bold
.system_status2 .cell
:padding 11px 0px 0px 15px
:line-height 24px
:font-size 14px

#content
.content
:width 970px
:margin 0px auto
:padding-top 15px
.box
.blue, .light_blue, .grey, .orange, .table_rows_cell
:font-size 12px
:padding-left 10px
.blue, .light_blue, .grey, .orange
:height 25px
:line-height 25px
.blue, .light_blue, .orange
:font-weight bold
.blue
:background #F5F6F9 url('/images/admin/system/bg/nav_header.png')
:color #fff
.light_blue
:background #F5F6F9 url('/images/admin/system/bg/table_header_blue.png')
:color #fff
.grey
:border-left 1px solid #CBCFD6
:border-right 1px solid #CBCFD6
.orange
:background #F5F6F9 url('/images/admin/system/bg/table_header_orange.png')
:color #fff
.nav
.blue
:font-size 13px
.grey, .light_blue, .orange
:cursor pointer
.grey
:background #F5F6F9 url('/images/admin/system/bg/nav.png')
.table
.grey
:background #F5F6F9 url('/images/admin/system/bg/table_header.png')
:font-weight bold
:font-size 13px
.zebra .table_rows_cell
:background #F1F4F9
.zebra_orange .table_rows_cell
:background #F9F6F0
.table_rows
.table_rows_cell
:height 24px
:line-height 24px
:border-right 1px solid #CCCFD7
:border-bottom 1px solid #CCCFD7
.table_rows0 .cell
:border-left 1px solid #CCCFD7
.indicator
:float right
:padding 4px 5px 0px 0px
:line-height 0px
:opacity 0
.body1 .body_cell
:padding-left 15px
38 changes: 38 additions & 0 deletions resources/views/layout.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
!!! Strict
%html
%head
%title= @title.join(' - ')
- stylesheets 'admin/system/base'
= stylesheets
%body
#top
.content= image_tag 'admin/system/title.png'
#top2
#top3
.content
- tbl :row, :system_status, :px, 75, 115, 780 do
- tbl :cell, :system_status do
= image_tag 'admin/system/system_status.png'
- tbl :cell, :system_status do
System status
- tbl :cell, :system_status do
You’ll be happy to know that your
%b 3 mongrels (2 production, 1 staging)
are running at
%b 3% of capacity.
%br/
You had
%b 10 sign ups, 1234 unique hits,
and
%b 10 account cancellations
in the past 24 hours.
#content
.content
- tbl :row, :body, :px, 190, 780 do
- tbl :cell, :body do
= widget :admin, :nav
- tbl :cell, :body do
- widget :admin, :table, :dependencies_only => true
= yield
- javascripts 'admin/system/base'
= javascripts
Loading

0 comments on commit 43311cd

Please sign in to comment.