Skip to content

Commit

Permalink
refactored theme layout
Browse files Browse the repository at this point in the history
  • Loading branch information
michel committed Oct 27, 2009
1 parent 6f378e9 commit 9e8e8fd
Show file tree
Hide file tree
Showing 46 changed files with 33 additions and 65 deletions.
Binary file modified .DS_Store
Binary file not shown.
37 changes: 1 addition & 36 deletions interfacelift.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Gem::Specification.new do |s|

s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Michel de Graaf"]
s.date = %q{2009-10-23}
s.date = %q{2009-10-27}
s.default_executable = %q{interfacelift}
s.description = %q{Collection of cool layouts to use in your rails apps.}
s.email = %q{michel@re-invention.nl}
Expand All @@ -31,41 +31,6 @@ Gem::Specification.new do |s|
"lib/interfacelift.rb",
"lib/templates/.DS_Store",
"lib/templates/bright_admin/.DS_Store",
"lib/templates/bright_admin/images/.DS_Store",
"lib/templates/bright_admin/images/add_icon.png",
"lib/templates/bright_admin/images/arrow_left.png",
"lib/templates/bright_admin/images/bg_btn.gif",
"lib/templates/bright_admin/images/edit_icon.png",
"lib/templates/bright_admin/images/file.gif",
"lib/templates/bright_admin/images/folder-closed.gif",
"lib/templates/bright_admin/images/folder.gif",
"lib/templates/bright_admin/images/hint.png",
"lib/templates/bright_admin/images/invert.png",
"lib/templates/bright_admin/images/loadingAnimation.gif",
"lib/templates/bright_admin/images/logout.png",
"lib/templates/bright_admin/images/minus.gif",
"lib/templates/bright_admin/images/plus.gif",
"lib/templates/bright_admin/images/rails.png",
"lib/templates/bright_admin/images/remove_icon.png",
"lib/templates/bright_admin/images/select_all.png",
"lib/templates/bright_admin/images/spinner.gif",
"lib/templates/bright_admin/images/tick.png",
"lib/templates/bright_admin/images/warning.png",
"lib/templates/bright_admin/javascripts/.DS_Store",
"lib/templates/bright_admin/javascripts/application.js",
"lib/templates/bright_admin/javascripts/controls.js",
"lib/templates/bright_admin/javascripts/dragdrop.js",
"lib/templates/bright_admin/javascripts/effects.js",
"lib/templates/bright_admin/javascripts/formfocus.js",
"lib/templates/bright_admin/javascripts/jquery-1.3.2.min.js",
"lib/templates/bright_admin/javascripts/jquery.form.js",
"lib/templates/bright_admin/javascripts/jquery.livequery.js",
"lib/templates/bright_admin/javascripts/prototype.js",
"lib/templates/bright_admin/layouts/application.html.haml",
"lib/templates/bright_admin/stylesheets/bright_admin.css",
"lib/templates/bright_admin/stylesheets/formtastic.css",
"lib/templates/bright_admin/stylesheets/formtastic_changes.css",
"lib/templates/bright_admin/stylesheets/reset.css",
"lib/templates/shared/.DS_Store",
"lib/templates/shared/icons/.DS_Store",
"lib/templates/shared/icons/diagona/.DS_Store",
Expand Down
Binary file modified lib/.DS_Store
Binary file not shown.
8 changes: 4 additions & 4 deletions lib/installer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@ def install!

private
def install_images
FileUtils.cp_r "#{@theme_path}/images","#{path}/public" if File.directory? "#{@theme_path}/images"
FileUtils.cp_r "#{@theme_path}/public/images","#{path}/public" if File.directory? "#{@theme_path}/public/images"
end

def install_stylesheets
FileUtils.cp_r "#{@theme_path}/stylesheets","#{path}/public" if File.directory? "#{@theme_path}/stylesheets"
FileUtils.cp_r "#{@theme_path}/public/stylesheets","#{path}/public" if File.directory? "#{@theme_path}/public/stylesheets"
end

def install_layouts
FileUtils.cp_r "#{@theme_path}/layouts","#{path}/app/views" if File.directory? "#{@theme_path}/layouts"
FileUtils.cp_r "#{@theme_path}/app/views/layouts","#{path}/app/views" if File.directory? "#{@theme_path}/views/layouts"
end

def install_javascript
FileUtils.cp_r "#{@theme_path}/javascripts","#{path}/public" if File.directory? "#{@theme_path}/javascripts"
FileUtils.cp_r "#{@theme_path}/public/javascripts","#{path}/public" if File.directory? "#{@theme_path}/public/javascripts"
end

def install_shared
Expand Down
Binary file modified lib/templates/.DS_Store
Binary file not shown.
Binary file modified lib/templates/bright_admin/.DS_Store
Binary file not shown.
Binary file added lib/templates/bright_admin/app/.DS_Store
Binary file not shown.
12 changes: 12 additions & 0 deletions lib/templates/bright_admin/app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Methods added to this helper will be available to all templates in the application.
module ApplicationHelper

def dasboard_tab?
"current"
end

def on_tab_for?(controller)
params[:controller] == controller ? "current" : ""
end

end
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
%html{html_attrs}
%head
%meta{"http-equiv" => 'Content-Type', :content => 'text/html;charset=utf-8'}
%title= h(@site_name || "Kabisa Admin")
%title= h(Settings.sitename || "Kabisa Admin")
%meta{ :name => "author", :content => "Michel de Graaf" }
%meta{ :name => "keywords", :content => "rails rumble" }
%meta{ :name => "description", :content => "rails rumble" }
Expand All @@ -21,36 +21,27 @@
#container
#header
#panel-top
%h1#logo= link_to h(@site_name || "Kabisa Admin") , "/", :title => "Home"
%h1#logo= link_to h(Settings.sitename || "Kabisa Admin") , "/", :title => "Home"
#nav
%ul
%li.current= link_to "Dashboard", "/"
%li= link_to "pages", "#"
%li= link_to "posts", "#"
%li= link_to "comments", "#"
%li= link_to "users", "#"
%li= link_to "settings", "#"

%li{:class => dasboard_tab?}= link_to "Dashboard", "/"
#session
%ul
%li
Logged in as
%span.user= "Admin"
%li.logout= "( #{link_to "Logout", "/logout"} )"
- if current_user
Logged in as
= link_to current_user.login, edit_user_path(current_user)
|
= link_to "Logout" , logout_path
- else
= link_to "login", login_path
.clear

#panel-middle
#subnav
%ul
%li.current= link_to "Users", "/"
%li= link_to "Customers", "/"



%li{:class => on_tab_for?("users") }= link_to "Users", users_path
#panel-bottom
#headline
%h3= @page_title || params[:controller].capitalize

%h3= @page_title || params[:controller].humanize

#application
#flash
Expand Down
Binary file added lib/templates/bright_admin/public/.DS_Store
Binary file not shown.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file modified pkg/interfacelift-0.0.0.gem
Binary file not shown.
8 changes: 4 additions & 4 deletions spec/installer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,19 @@ def valid_arguments
end

it "Should copy over existing images to the RAILS_ROOT/public folder" do
FileUtils.should_receive(:cp_r).with("#{@theme_path}/images","#{@path}/public")
FileUtils.should_receive(:cp_r).with("#{@theme_path}/public/images","#{@path}/public")
end

it "Should copy over existing stylesheets to the RAILS_ROOT/public folder" do
FileUtils.should_receive(:cp_r).with("#{@theme_path}/stylesheets","#{@path}/public")
FileUtils.should_receive(:cp_r).with("#{@theme_path}/public/stylesheets","#{@path}/public")
end

it "Should copy over templates to the RAILS_ROOT/app/views/layout folder" do
FileUtils.should_receive(:cp_r).with("#{@theme_path}/layouts","#{@path}/app/views")
FileUtils.should_receive(:cp_r).with("#{@theme_path}/app/views/layouts","#{@path}/app/views")
end

it "Should copy over javascripts to the RAILS_ROOT/public folder" do
FileUtils.should_receive(:cp_r).with("#{@theme_path}/javascripts","#{@path}/public")
FileUtils.should_receive(:cp_r).with("#{@theme_path}/public/javascripts","#{@path}/public")
end

it "Should copy over shared resources to the RAILS_ROOT/public folder" do
Expand Down

0 comments on commit 9e8e8fd

Please sign in to comment.