forked from gravityblast/web-app-theme
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of git://github.com/pilu/web-app-theme
- Loading branch information
Showing
21 changed files
with
1,408 additions
and
245 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
./script/generate theme | ||
./script/generate theme LayoutName | ||
./script/generate theme --theme=ThemeName | ||
./script/generate theme --no-layout |
41 changes: 41 additions & 0 deletions
41
rails_generators/theme/templates/view_layout_administration.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<!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><%= options[:app_name] %></title> | ||
<%%= stylesheet_link_tag 'web_app_theme', "themes/<%= options[:theme] %>/style" %> | ||
</head> | ||
<body> | ||
<div id="container"> | ||
<div id="header"> | ||
<h1><a href="/"><%= options[:app_name] %></a></h1> | ||
<div id="user-navigation"> | ||
<ul> | ||
<li><a href="#">Profile</a></li> | ||
<li><a href="#">Settings</a></li> | ||
<li><a href="/logout">Logout</a></li> | ||
</ul> | ||
<div class="clear"></div> | ||
</div> | ||
<div id="main-navigation"> | ||
<ul></ul> | ||
<div class="clear"></div> | ||
</div> | ||
</div> | ||
<div id="wrapper"> | ||
<div id="main"> | ||
<%%= yield %> | ||
<div id="footer"> | ||
<div class="block"> | ||
<p>Copyright © 2009 Your Site.</p> | ||
</div> | ||
</div> | ||
</div> | ||
<div id="sidebar"> | ||
<%%= yield :sidebar %> | ||
</div> | ||
<div class="clear"></div> | ||
</div> | ||
</div> | ||
</body> | ||
</html> |
15 changes: 15 additions & 0 deletions
15
rails_generators/theme/templates/view_layout_sign.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!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><%= options[:app_name] %></title> | ||
<%%= stylesheet_link_tag 'web_app_theme', "themes/<%= options[:theme] %>/style" %> | ||
</head> | ||
<body> | ||
<div id="container"> | ||
<div id="box"> | ||
<%%= yield %> | ||
</div> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
class ThemeGenerator < Rails::Generator::Base | ||
|
||
default_options :app_name => 'Web App', | ||
:layout_type => :administration, | ||
:theme => :default, | ||
:no_layout => false | ||
|
||
def initialize(runtime_args, runtime_options = {}) | ||
super | ||
@name = @args.first || 'application' | ||
end | ||
|
||
def manifest | ||
record do |m| | ||
m.directory("app/views/layouts") | ||
m.directory("public/stylesheets/themes/#{options[:theme]}/") | ||
m.template("view_layout_#{options[:layout_type]}.html.erb", File.join("app/views/layouts", "#{@name}.html.erb")) unless options[:no_layout] | ||
m.template("../../../stylesheets/base.css", File.join("public/stylesheets", "web_app_theme.css")) | ||
m.template("../../../stylesheets/themes/#{options[:theme]}/style.css", File.join("public/stylesheets/themes/#{options[:theme]}", "style.css")) | ||
end | ||
end | ||
|
||
def banner | ||
"Usage: #{$0} theme [layout_name] [options]" | ||
end | ||
|
||
protected | ||
|
||
def add_options!(opt) | ||
opt.separator '' | ||
opt.separator 'Options:' | ||
opt.on("--app_name=app_name", String, "") { |v| options[:app_name] = v } | ||
opt.on("--type=layout_type", String, "Specify the layout type") { |v| options[:layout_type] = v } | ||
opt.on("--theme=theme", String, "Specify the theme") { |v| options[:theme] = v } | ||
opt.on("--no-layout", "Don't create layout") { |v| options[:no_layout] = true } | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
./script/generate themed ControllerPath | ||
./script/generate themed ControllerPath ModelName | ||
./script/generate themed ControllerPath ModelName --layout=application | ||
./script/generate themed ControllerPath ModelName --with_will_paginate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<div class="block"> | ||
<div class="secondary-navigation"> | ||
<ul> | ||
<li class="first"><%%= link_to 'List', <%= controller_routing_path %>_path %></li> | ||
<li><%%= link_to 'New', new_<%= singular_controller_routing_path %>_path %></li> | ||
<li class="active"><%%= link_to 'Edit', edit_<%= singular_controller_routing_path %>_path %></li> | ||
</ul> | ||
<div class="clear"></div> | ||
</div> | ||
<div class="content"> | ||
<h2 class="title">Edit <%= model_name %></h2> | ||
<div class="inner"> | ||
<%% form_for @<%= model_name.downcase %>, :url => <%= singular_controller_routing_path %>_path(@<%= resource_name %>), :html => { :class => :form } do |f| -%> | ||
<% columns.each do |column| %> | ||
<div class="group"> | ||
<%%= f.label :<%= column.name %>, "<%= column.name %>", :class => :label %> | ||
<%%= f.<%= column.field_type %> :<%= column.name %>, :class => '<%= column.field_type %>' %> | ||
<span class="description">Ex: a simple text</span> | ||
</div> | ||
<%- end -%> | ||
<div class="group navform"> | ||
<input type="submit" class="button" value="Save →" /> or <%%= link_to 'Cancel', <%= controller_routing_path %>_path %> | ||
</div> | ||
<%% end -%> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<%% content_for :sidebar, render(:partial => 'sidebar') -%> |
Oops, something went wrong.