tigger 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/generators/tigger/backbone/backbone_generator.rb +1 -1
- data/lib/generators/tigger/layout/layout_generator.rb +23 -0
- data/lib/generators/tigger/layout/templates/layout.html.erb +108 -0
- data/lib/generators/tigger/plugins/plugins_generator.rb +1 -1
- data/lib/tigger/engine.rb +7 -1
- data/lib/tigger/version.rb +1 -1
- metadata +3 -1
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'rails/generators'
|
2
|
+
|
3
|
+
module Tigger
|
4
|
+
module Generators
|
5
|
+
class LayoutGenerator < ::Rails::Generators::Base
|
6
|
+
source_root File.expand_path("../templates", __FILE__)
|
7
|
+
desc "This generator generates an application layout file with navigation."
|
8
|
+
argument :layout_name, :type => :string, :default => "application-tb"
|
9
|
+
argument :layout_type, :type => :string, :default => "fixed",
|
10
|
+
:banner => "*fixed or fluid"
|
11
|
+
|
12
|
+
attr_reader :app_name, :container_class
|
13
|
+
|
14
|
+
def generate_layout
|
15
|
+
app = ::Rails.application
|
16
|
+
@app_name = app.class.to_s.split("::").first
|
17
|
+
@container_class = layout_type == "fluid" ? "container-fluid" : "container"
|
18
|
+
ext = app.config.generators.options[:rails][:template_engine] || :erb
|
19
|
+
template "layout.html.#{ext}", "app/views/layouts/#{layout_name}.html.#{ext}"
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,108 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang="en">
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
7
|
+
<title><%%= content_for?(:title) ? yield(:title) : "<%= app_name %>" %></title>
|
8
|
+
<%%= csrf_meta_tags %>
|
9
|
+
|
10
|
+
<!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
|
11
|
+
<!--[if lt IE 9]>
|
12
|
+
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js" type="text/javascript"></script>
|
13
|
+
<![endif]-->
|
14
|
+
|
15
|
+
<%%= stylesheet_link_tag "application", :media => "all" %>
|
16
|
+
|
17
|
+
<!-- For third-generation iPad with high-resolution Retina display: -->
|
18
|
+
<!-- Size should be 144 x 144 pixels -->
|
19
|
+
<%%= favicon_link_tag 'images/apple-touch-icon-144x144-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png', :sizes => '144x144' %>
|
20
|
+
|
21
|
+
<!-- For iPhone with high-resolution Retina display: -->
|
22
|
+
<!-- Size should be 114 x 114 pixels -->
|
23
|
+
<%%= favicon_link_tag 'images/apple-touch-icon-114x114-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png', :sizes => '114x114' %>
|
24
|
+
|
25
|
+
<!-- For first- and second-generation iPad: -->
|
26
|
+
<!-- Size should be 72 x 72 pixels -->
|
27
|
+
<%%= favicon_link_tag 'images/apple-touch-icon-72x72-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png', :sizes => '72x72' %>
|
28
|
+
|
29
|
+
<!-- For non-Retina iPhone, iPod Touch, and Android 2.1+ devices: -->
|
30
|
+
<!-- Size should be 57 x 57 pixels -->
|
31
|
+
<%%= favicon_link_tag 'images/apple-touch-icon-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png' %>
|
32
|
+
|
33
|
+
<!-- For all other devices -->
|
34
|
+
<!-- Size should be 32 x 32 pixels -->
|
35
|
+
<%%= favicon_link_tag 'images/favicon.ico', :rel => 'shortcut icon' %>
|
36
|
+
</head>
|
37
|
+
<body>
|
38
|
+
|
39
|
+
<div class="navbar navbar-fixed-top">
|
40
|
+
<div class="navbar-inner">
|
41
|
+
<div class="<%= container_class %>">
|
42
|
+
<a class="btn btn-navbar" data-target=".nav-collapse" data-toggle="collapse">
|
43
|
+
<span class="icon-bar"></span>
|
44
|
+
<span class="icon-bar"></span>
|
45
|
+
<span class="icon-bar"></span>
|
46
|
+
</a>
|
47
|
+
<a class="brand" href="#"><%= app_name %></a>
|
48
|
+
<div class="<%= container_class %> nav-collapse">
|
49
|
+
<ul class="nav">
|
50
|
+
<li><%%= link_to "Link1", "/path1" %></li>
|
51
|
+
<li><%%= link_to "Link2", "/path2" %></li>
|
52
|
+
<li><%%= link_to "Link3", "/path3" %></li>
|
53
|
+
</ul>
|
54
|
+
</div><!--/.nav-collapse -->
|
55
|
+
</div>
|
56
|
+
</div>
|
57
|
+
</div>
|
58
|
+
|
59
|
+
<div class="<%= container_class %>">
|
60
|
+
<%- if layout_type == "fluid" -%>
|
61
|
+
<div class="row-fluid">
|
62
|
+
<div class="span3">
|
63
|
+
<div class="well sidebar-nav">
|
64
|
+
<ul class="nav nav-list">
|
65
|
+
<li class="nav-header">Sidebar</li>
|
66
|
+
<li><%%= link_to "Link1", "/path1" %></li>
|
67
|
+
<li><%%= link_to "Link2", "/path2" %></li>
|
68
|
+
<li><%%= link_to "Link3", "/path3" %></li>
|
69
|
+
</ul>
|
70
|
+
</div><!--/.well -->
|
71
|
+
</div><!--/span-->
|
72
|
+
<div class="span9">
|
73
|
+
<%%= bootstrap_flash %>
|
74
|
+
<%%= yield %>
|
75
|
+
</div>
|
76
|
+
</div><!--/row-->
|
77
|
+
<%- else -%>
|
78
|
+
<div class="row">
|
79
|
+
<div class="span9">
|
80
|
+
<%%= yield %>
|
81
|
+
</div>
|
82
|
+
<div class="span3">
|
83
|
+
<div class="well sidebar-nav">
|
84
|
+
<h3>Sidebar</h3>
|
85
|
+
<ul class="nav nav-list">
|
86
|
+
<li class="nav-header">Sidebar</li>
|
87
|
+
<li><%%= link_to "Link1", "/path1" %></li>
|
88
|
+
<li><%%= link_to "Link2", "/path2" %></li>
|
89
|
+
<li><%%= link_to "Link3", "/path3" %></li>
|
90
|
+
</ul>
|
91
|
+
</div><!--/.well -->
|
92
|
+
</div><!--/span-->
|
93
|
+
</div><!--/row-->
|
94
|
+
<%- end -%>
|
95
|
+
|
96
|
+
<footer>
|
97
|
+
<p>© Company 2012</p>
|
98
|
+
</footer>
|
99
|
+
|
100
|
+
</div> <!-- /container -->
|
101
|
+
|
102
|
+
<!-- Javascripts
|
103
|
+
================================================== -->
|
104
|
+
<!-- Placed at the end of the document so the pages load faster -->
|
105
|
+
<%%= javascript_include_tag "application" %>
|
106
|
+
|
107
|
+
</body>
|
108
|
+
</html>
|
data/lib/tigger/engine.rb
CHANGED
data/lib/tigger/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tigger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -72,6 +72,8 @@ files:
|
|
72
72
|
- Gemfile
|
73
73
|
- Rakefile
|
74
74
|
- lib/generators/tigger/backbone/backbone_generator.rb
|
75
|
+
- lib/generators/tigger/layout/layout_generator.rb
|
76
|
+
- lib/generators/tigger/layout/templates/layout.html.erb
|
75
77
|
- lib/generators/tigger/plugins/plugins_generator.rb
|
76
78
|
- lib/tigger.rb
|
77
79
|
- lib/tigger/engine.rb
|