dougo_layout 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2009 Chris Douglas
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,17 @@
1
+ = dougo_layout
2
+
3
+ Description goes here.
4
+
5
+ == Note on Patches/Pull Requests
6
+
7
+ * Fork the project.
8
+ * Make your feature addition or bug fix.
9
+ * Add tests for it. This is important so I don't break it in a
10
+ future version unintentionally.
11
+ * Commit, do not mess with rakefile, version, or history.
12
+ (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
13
+ * Send me a pull request. Bonus points for topic branches.
14
+
15
+ == Copyright
16
+
17
+ Copyright (c) 2010 Chris Douglas. See LICENSE for details.
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.0.1
File without changes
@@ -0,0 +1,22 @@
1
+ require File.expand_path(File.dirname(__FILE__) + "/generator_manifest")
2
+
3
+ class DougoLayoutGenerator < Rails::Generator::Base
4
+
5
+ def initialize(runtime_args, runtime_options = {})
6
+ super
7
+ end
8
+
9
+ def after_generate
10
+ end
11
+
12
+
13
+ def manifest
14
+ puts "Installing"
15
+ record do |m|
16
+
17
+ GeneratorManifest.populate_record(m)
18
+
19
+ m.readme 'USAGE'
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,12 @@
1
+ directories :
2
+
3
+
4
+ files :
5
+ - app/views/layouts/_footer.html.erb
6
+ - app/views/layouts/_header.html.erb
7
+ - app/views/layouts/_navigate.html.erb
8
+ - public/stylesheets/layout.css
9
+ - public/stylesheets/layout/bg_header.gif
10
+ - public/stylesheets/layout/bg_highlight.png
11
+ - public/stylesheets/layout/footer.png
12
+ - public/stylesheets/layout/nav-bg.png
@@ -0,0 +1,30 @@
1
+ class GeneratorManifest
2
+ def self.populate_record(m)
3
+
4
+ %w(
5
+ public
6
+ public/stylesheets
7
+ public/stylesheets/layout
8
+ app
9
+ app/views
10
+ app/views/layouts
11
+ ).each do |dirname|
12
+ m.directory dirname
13
+ end
14
+
15
+ %w(
16
+ USAGE
17
+ public/stylesheets/layout.css
18
+ public/stylesheets/layout/nav-bg.png
19
+ public/stylesheets/layout/footer.png
20
+ public/stylesheets/layout/bg_highlight.png
21
+ public/stylesheets/layout/bg_header.gif
22
+ app/views/layouts/_navigate.html.erb
23
+ app/views/layouts/_header.html.erb
24
+ app/views/layouts/_footer.html.erb
25
+ ).each do |filename|
26
+ m.file filename, filename
27
+ end
28
+
29
+ end
30
+ end
@@ -0,0 +1,30 @@
1
+ **************************************************************************
2
+
3
+ *** EDIT config/environment.rb
4
+ config.gem 'will_paginate'
5
+ config.gem 'dougo_view_helpers'
6
+
7
+
8
+ *** EDIT app/views/layouts/application.html.erb
9
+
10
+ <%= stylesheet_link_tag ..., 'layout', :cache => true %>
11
+
12
+ <body>
13
+ <div class="container">
14
+ <%= render :partial => '/layouts/header' %>
15
+ <%= render :partial => '/layouts/navigate' %>
16
+
17
+ <%= yield :defer_breadcrumbs %>
18
+ <%= yield :defer_subnav %>
19
+ <%= view_alert %>
20
+
21
+ <%= yield %>
22
+ <div class="clear"></div>
23
+ <%= render :partial => '/layouts/footer' %>
24
+ </div>
25
+ </body>
26
+
27
+ restart app and goto http://localhost:3000/preview
28
+
29
+ **************************************************************************
30
+
@@ -0,0 +1,30 @@
1
+ <div class="footer">
2
+ <a href="/">Home</a> &middot;
3
+ <%= link_to "Contact Us", root_path %> &middot;
4
+ <%= link_to "About Us", root_path %>
5
+ </div>
6
+
7
+
8
+ <% if RAILS_ENV == 'development' %>
9
+ <div style ="background:white;">
10
+ <hr/>
11
+ <h3> Development Details </h3>
12
+ <hr/>
13
+ <pre>
14
+ :controller = <%= @controller.class.to_s %>
15
+ :action = <%= params[:action] %>
16
+
17
+ :logged_in? = <%=logged_in?%>
18
+ :full_name = <%="#{current_user.full_name}" if logged_in?%>
19
+
20
+ :host = <%=request.host%>
21
+ :path = <%=request.path%>
22
+ :referer = <%=request.env['HTTP_REFERER']%>
23
+ :controller = <%=params[:controller] %>
24
+ :action = <%=params[:action] %>
25
+
26
+ :return_to = <%= session[:return_to] %>
27
+ :auth_token = <%= cookies[:auth_token] %>
28
+ </pre>
29
+ </div>
30
+ <% end %>
@@ -0,0 +1,4 @@
1
+ <div class="header">
2
+ <h1>My Cool New App</h1>
3
+ </div>
4
+
@@ -0,0 +1,26 @@
1
+ <div class="navigate">
2
+ <ul>
3
+ <li class="first">
4
+ <%= link_to 'Home', root_path, :class => if_action('PreviewController', 'index') ? 'active' : ''%>
5
+ </li>
6
+ <li>
7
+ <%= link_to 'Pipelines', re_pipelines_path %>
8
+ </li>
9
+ <li>
10
+ <%= link_to 'Projects', root_path %>
11
+ </li>
12
+ <li>
13
+ <%= link_to "About Us", root_path %>
14
+ </li>
15
+ <li>
16
+ <%= link_to 'Contact Us', root_path %>
17
+ </li>
18
+ <li class="last">
19
+ <% if logged_in? %>
20
+ <%= link_to 'Control Panel', root_path, :class => !if_action('PreviewController') ? 'active' : ''%> %>
21
+ <% else %>
22
+ <%= link_to 'Login', user_login_path, :class => if_action('UsersController') ? 'active' : ''%> %>
23
+ <% end %>
24
+ </li>
25
+ </ul>
26
+ </div>
@@ -0,0 +1,88 @@
1
+ .header {
2
+ background: #171717 url(./layout/bg_highlight.png) no-repeat top center;
3
+ color: #fff;
4
+ padding: 8px 0 8px 50px;
5
+ height: 100px;
6
+ height: 80px;
7
+ }
8
+
9
+ .header h1 {
10
+ margin: 0;
11
+ color: #fff;
12
+ /* font-family: helvetica, arial, sans-serif;*/
13
+ font-size: 470%;
14
+ margin: 9px 0 10px 60px;
15
+ }
16
+
17
+ .navigate {
18
+ overflow: hidden;
19
+ background: url(./layout/nav-bg.png) bottom left repeat-x;
20
+ border-top: solid #000 1px;
21
+ border-bottom: solid #600 1px;
22
+ padding-left: 100px;
23
+ font-size: 15px;
24
+ max-height: 30px;
25
+ }
26
+ .navigate ul {
27
+ list-style: none;
28
+ padding: 0;
29
+ margin: 0;
30
+ }
31
+ .navigate li {
32
+ float: left;
33
+ line-height: 30px;
34
+ border-right: solid #900 1px;
35
+ }
36
+
37
+ .navigate li a {
38
+ color: #fff;
39
+ text-decoration: none;
40
+ display: block;
41
+ padding: 0 15px;
42
+ /* height: 33px;*/
43
+ font-weight: normal;
44
+ }
45
+
46
+ .navigate li a:hover {
47
+ color: #fff;
48
+ background: #900;
49
+ }
50
+
51
+ .navigate li a.active {
52
+ color: #fff;
53
+ background: #a00;
54
+ }
55
+
56
+ .navigate li a.active:hover {
57
+ background: #900;
58
+ }
59
+
60
+ .navigate li.first {
61
+ border-left: solid #900 1px;
62
+ }
63
+
64
+
65
+ .footer {
66
+ border-top: solid #aaa 1px;
67
+ background: #ccc url(./layout/footer.png) bottom left repeat-x;
68
+ color: #333;
69
+ font-size: 12px;
70
+ padding: 5px 0;
71
+ margin: 25px 0 0 0;
72
+ text-align: center;
73
+ }
74
+
75
+ .footer a {
76
+ color: #036;
77
+ text-decoration: none;
78
+ font-weight: normal;
79
+ }
80
+
81
+ .footer a:hover {
82
+ color: #900;
83
+ }
84
+
85
+ .footer li.first {
86
+ padding-left: 0;
87
+ }
88
+
@@ -0,0 +1,7 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+
3
+ describe "DougoLayout" do
4
+ it "fails" do
5
+ fail "hey buddy, you should probably rename this file and start specing for real"
6
+ end
7
+ end
data/spec/spec.opts ADDED
@@ -0,0 +1 @@
1
+ --color
@@ -0,0 +1,9 @@
1
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
2
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
3
+ require 'dougo_layout'
4
+ require 'spec'
5
+ require 'spec/autorun'
6
+
7
+ Spec::Runner.configure do |config|
8
+
9
+ end
data/tasks/rspec.rake ADDED
@@ -0,0 +1,18 @@
1
+ require 'spec/rake/spectask'
2
+
3
+ desc "Run all specs in spec directory"
4
+ Spec::Rake::SpecTask.new(:spec) do |t|
5
+ t.spec_files = FileList['spec/**/*_spec.rb']
6
+ end
7
+
8
+ namespace :spec do
9
+ desc "Run all specs in spec directory with RCov (excluding plugin specs)"
10
+ Spec::Rake::SpecTask.new(:rcov) do |t|
11
+ t.spec_opts = ['--options', "\"#{File.dirname(__FILE__)}/../spec/spec.opts\""]
12
+ t.spec_files = FileList['spec/**/*_spec.rb']
13
+ t.rcov = true
14
+ t.rcov_opts = lambda do
15
+ IO.readlines("#{File.dirname(__FILE__)}/../spec/rcov.opts").map {|l| l.chomp.split " "}.flatten
16
+ end
17
+ end
18
+ end
metadata ADDED
@@ -0,0 +1,96 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: dougo_layout
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 0
8
+ - 1
9
+ version: 0.0.1
10
+ platform: ruby
11
+ authors:
12
+ - Chris Douglas
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2010-03-25 00:00:00 +11:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: rspec
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ segments:
28
+ - 1
29
+ - 2
30
+ - 9
31
+ version: 1.2.9
32
+ type: :development
33
+ version_requirements: *id001
34
+ description: Simple layout manager
35
+ email: dougo.chris@gmail.com
36
+ executables: []
37
+
38
+ extensions: []
39
+
40
+ extra_rdoc_files:
41
+ - LICENSE
42
+ - README.rdoc
43
+ files:
44
+ - LICENSE
45
+ - README.rdoc
46
+ - VERSION
47
+ - lib/dougo_layout.rb
48
+ - rails_generators/dougo_layout_generator.rb
49
+ - rails_generators/generator.yml
50
+ - rails_generators/generator_manifest.rb
51
+ - rails_generators/templates/USAGE
52
+ - rails_generators/templates/app/views/layouts/_footer.html.erb
53
+ - rails_generators/templates/app/views/layouts/_header.html.erb
54
+ - rails_generators/templates/app/views/layouts/_navigate.html.erb
55
+ - rails_generators/templates/public/stylesheets/layout.css
56
+ - rails_generators/templates/public/stylesheets/layout/bg_header.gif
57
+ - rails_generators/templates/public/stylesheets/layout/bg_highlight.png
58
+ - rails_generators/templates/public/stylesheets/layout/footer.png
59
+ - rails_generators/templates/public/stylesheets/layout/nav-bg.png
60
+ - spec/dougo_layout_spec.rb
61
+ - spec/spec.opts
62
+ - spec/spec_helper.rb
63
+ - tasks/rspec.rake
64
+ has_rdoc: true
65
+ homepage: http://github.com/dougochris/dougo_layout
66
+ licenses: []
67
+
68
+ post_install_message: "\n *** RUN script/generate dougo_layout\n "
69
+ rdoc_options:
70
+ - --charset=UTF-8
71
+ require_paths:
72
+ - lib
73
+ required_ruby_version: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ segments:
78
+ - 0
79
+ version: "0"
80
+ required_rubygems_version: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ segments:
85
+ - 0
86
+ version: "0"
87
+ requirements: []
88
+
89
+ rubyforge_project:
90
+ rubygems_version: 1.3.6
91
+ signing_key:
92
+ specification_version: 3
93
+ summary: Simple layout manager
94
+ test_files:
95
+ - spec/dougo_layout_spec.rb
96
+ - spec/spec_helper.rb