batman-rails 0.0.9 → 0.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/Gemfile +1 -1
- data/LICENSE.txt +22 -0
- data/README.md +43 -39
- data/Rakefile +2 -9
- data/batman-rails.gemspec +20 -21
- data/lib/batman-rails.rb +8 -1
- data/lib/batman-rails/version.rb +6 -0
- data/lib/generators/batman/app_generator.rb +117 -0
- data/lib/generators/batman/controller_generator.rb +8 -17
- data/lib/generators/batman/html_generator.rb +42 -0
- data/lib/generators/batman/model_generator.rb +2 -2
- data/lib/generators/batman/scaffold_generator.rb +14 -4
- data/lib/generators/batman/view_generator.rb +18 -0
- data/lib/generators/{batman/common.rb → common.rb} +19 -5
- data/lib/templates/batman/application_controller.coffee +1 -0
- data/lib/templates/batman/batman_app.coffee +20 -0
- data/lib/templates/batman/controller.coffee +7 -0
- data/lib/templates/batman/html/edit.html +2 -0
- data/lib/templates/batman/html/index.html +2 -0
- data/lib/templates/batman/html/main_index.html +259 -0
- data/lib/templates/batman/html/show.html +2 -0
- data/lib/templates/batman/main_controller.coffee +8 -0
- data/lib/templates/batman/model.coffee +13 -0
- data/lib/templates/batman/view.coffee +7 -0
- data/lib/templates/rails/controller.rb +7 -0
- data/lib/templates/rails/index.html +0 -0
- data/lib/templates/rails/layout.html +15 -0
- data/test/app_generator_test.rb +111 -0
- data/test/controller_generator_test.rb +41 -15
- data/test/model_generator_test.rb +47 -16
- data/test/test_helper.rb +3 -3
- data/test/view_generator_test.rb +36 -0
- data/vendor/assets/images/batman/bullet.png +0 -0
- data/vendor/assets/images/batman/content-bg-fade.png +0 -0
- data/vendor/assets/images/batman/content-bg.png +0 -0
- data/vendor/assets/images/batman/header-wrapper-bg.jpg +0 -0
- data/vendor/assets/images/batman/logo.png +0 -0
- data/vendor/assets/javascripts/batman/batman.jquery.js +16 -74
- data/vendor/assets/javascripts/batman/batman.js +8951 -8551
- data/vendor/assets/javascripts/batman/batman.paginator.js +216 -0
- data/vendor/assets/javascripts/batman/batman.rails.js +78 -33
- data/vendor/assets/javascripts/batman/es5-shim.js +0 -0
- metadata +76 -57
- data/lib/batman/rails.rb +0 -6
- data/lib/batman/rails/engine.rb +0 -6
- data/lib/batman/rails/version.rb +0 -6
- data/lib/generators/batman/helper_generator.rb +0 -14
- data/lib/generators/batman/install_generator.rb +0 -93
- data/lib/generators/batman/templates/batman_app.coffee +0 -24
- data/lib/generators/batman/templates/controller.coffee +0 -5
- data/lib/generators/batman/templates/helper.coffee +0 -5
- data/lib/generators/batman/templates/model.coffee +0 -7
- data/test/install_generator_test.rb +0 -105
- data/vendor/assets/javascripts/batman/batman.i18n.js +0 -116
- data/vendor/assets/javascripts/batman/batman.solo.js +0 -558
@@ -1,4 +1,4 @@
|
|
1
|
-
require 'generators/
|
1
|
+
require 'generators/common'
|
2
2
|
module Batman
|
3
3
|
module Generators
|
4
4
|
class ScaffoldGenerator < ::Rails::Generators::NamedBase
|
@@ -9,11 +9,21 @@ module Batman
|
|
9
9
|
|
10
10
|
def create_batman_model
|
11
11
|
with_app_name do
|
12
|
-
generate "batman:model #{singular_model_name}
|
13
|
-
generate "batman:controller #{
|
14
|
-
|
12
|
+
generate "batman:model #{singular_model_name} #{app_name_flag}"
|
13
|
+
generate "batman:controller #{plural_name} index show edit new create update destroy #{app_name_flag}"
|
14
|
+
|
15
|
+
inject_into_file "#{app_path}/#{application_name}.js.coffee", :after => "class #{js_application_name} extends Batman.App\n" do
|
16
|
+
route_resource
|
17
|
+
end
|
15
18
|
end
|
16
19
|
end
|
20
|
+
|
21
|
+
def route_resource
|
22
|
+
<<-CODE
|
23
|
+
\n @resources '#{plural_name}'\n
|
24
|
+
CODE
|
25
|
+
end
|
26
|
+
|
17
27
|
end
|
18
28
|
end
|
19
29
|
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'generators/common'
|
2
|
+
module Batman
|
3
|
+
module Generators
|
4
|
+
class ViewGenerator < ::Rails::Generators::NamedBase
|
5
|
+
include Common
|
6
|
+
requires_app_name
|
7
|
+
|
8
|
+
desc "This generator creates a Batman.View"
|
9
|
+
argument :actions, :type => :array, :default => [], :banner => "action action"
|
10
|
+
|
11
|
+
def create_batman_view
|
12
|
+
with_app_name do
|
13
|
+
template "batman/view.coffee", "#{app_path}/views/#{file_name.downcase}_view.js.coffee"
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -3,7 +3,7 @@ module Batman
|
|
3
3
|
module Common
|
4
4
|
def self.included(base)
|
5
5
|
base.send(:extend, ClassMethods)
|
6
|
-
base.source_root File.expand_path("
|
6
|
+
base.source_root File.expand_path("../../templates", __FILE__)
|
7
7
|
end
|
8
8
|
|
9
9
|
protected
|
@@ -17,21 +17,35 @@ module Batman
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def app_name
|
20
|
-
@app_name ||= options[:app_name] ||
|
20
|
+
@app_name ||= options[:app_name] || 'batman'
|
21
|
+
end
|
22
|
+
|
23
|
+
def js_application_name
|
24
|
+
application_name.camelize
|
21
25
|
end
|
22
26
|
|
23
27
|
def application_name
|
24
|
-
if defined?(::Rails) && ::Rails.application
|
28
|
+
rails_application_name = if defined?(::Rails) && ::Rails.application
|
25
29
|
::Rails.application.class.name.split('::').first.underscore
|
26
30
|
end
|
31
|
+
@application_name ||= options[:app_name] || rails_application_name
|
27
32
|
end
|
28
33
|
|
29
34
|
def js_path
|
30
|
-
"app/assets
|
35
|
+
"app/assets"
|
36
|
+
end
|
37
|
+
|
38
|
+
def app_path
|
39
|
+
"#{js_path}/#{app_name}"
|
31
40
|
end
|
32
41
|
|
33
42
|
def singular_model_name
|
34
|
-
|
43
|
+
singular_table_name.camelize
|
44
|
+
end
|
45
|
+
|
46
|
+
def app_name_flag
|
47
|
+
return if app_name == 'batman'
|
48
|
+
"--app_name #{options[:app_name] || app_name}"
|
35
49
|
end
|
36
50
|
|
37
51
|
module ClassMethods
|
@@ -0,0 +1 @@
|
|
1
|
+
class <%= js_application_name %>.ApplicationController extends Batman.Controller
|
@@ -0,0 +1,20 @@
|
|
1
|
+
Batman.config.pathToHTML = '/assets/html'
|
2
|
+
|
3
|
+
class <%= js_application_name %> extends Batman.App
|
4
|
+
# @resources 'products'
|
5
|
+
# @resources 'discounts', except: ['edit']
|
6
|
+
# @resources 'customers', only: ['new', 'show']
|
7
|
+
|
8
|
+
# @resources 'blogs', ->
|
9
|
+
# @resources 'articles'
|
10
|
+
|
11
|
+
# @resources 'pages', ->
|
12
|
+
# @collection 'count'
|
13
|
+
# @member 'duplicate'
|
14
|
+
|
15
|
+
# @route 'apps', 'apps#index'
|
16
|
+
# @route 'apps/private', 'apps#private', as: 'privateApps'
|
17
|
+
|
18
|
+
@root 'main#index'
|
19
|
+
|
20
|
+
(global ? window).<%= js_application_name %> = <%= js_application_name %>
|
@@ -0,0 +1,259 @@
|
|
1
|
+
<div id="sub">
|
2
|
+
<div id="header-wrapper">
|
3
|
+
<div id="header">
|
4
|
+
<!-- Begin logo -->
|
5
|
+
<h1 id="logo">
|
6
|
+
<a href="/">batman.js</a>
|
7
|
+
</h1>
|
8
|
+
<!-- End logo -->
|
9
|
+
</div>
|
10
|
+
</div>
|
11
|
+
<div id="content-wrapper">
|
12
|
+
<div id="content">
|
13
|
+
<!-- Begin left-sidebar -->
|
14
|
+
<div id="left-sidebar">
|
15
|
+
<ul class="subnav">
|
16
|
+
<li><a href="http://batmanjs.org/examples.html" target="_blank">Batman Examples</a></li>
|
17
|
+
<li><a href="http://batmanjs.org/docs/batman.html" target="_blank">Batman Documentation</a></li>
|
18
|
+
<li><a href="http://coffeescript.org/" target="_blank">CoffeeScript Documentation</a></li>
|
19
|
+
</ul>
|
20
|
+
</div>
|
21
|
+
<!-- End left-sidebar -->
|
22
|
+
<!-- Begin content-column-wrapper -->
|
23
|
+
<div id="content-column-wrapper">
|
24
|
+
<h2>Batman.js</h2>
|
25
|
+
<h3>A client-side framework for Rails developers</h3>
|
26
|
+
<p>This page aims to be a collection of everything that batman.js is capable of. Over time it will grow to include more comprehensive examples, in addition to live applications using batman.js.</p>
|
27
|
+
|
28
|
+
<h4>Generate your resources</h4>
|
29
|
+
<p>Nullam id dolor id nibh ultricies vehicula ut id elit. Nullam quis risus eget urna mollis ornare vel eu leo. Donec ullamcorper nulla non metus auctor fringilla. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.</p>
|
30
|
+
|
31
|
+
<div class="highlight">
|
32
|
+
rails generate batman:app<br />
|
33
|
+
rails generate batman:scaffold Post title:string content:string<br />
|
34
|
+
</div>
|
35
|
+
|
36
|
+
<h4>Create your bindings</h4>
|
37
|
+
<p>Nullam id dolor id nibh ultricies vehicula ut id elit. Nullam quis risus eget urna mollis ornare vel eu leo. Donec ullamcorper nulla non metus auctor fringilla. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.</p>
|
38
|
+
|
39
|
+
<div style="padding: 10px">
|
40
|
+
<span>First Name:</span><input type="text" data-bind="firstName"><br />
|
41
|
+
<span>Last Name:</span><input type="text" data-bind="lastName"><br />
|
42
|
+
<span>Hello, my name is <span data-bind="fullName"></span></span><br />
|
43
|
+
</div>
|
44
|
+
|
45
|
+
<h4>Connect to Rails</h4>
|
46
|
+
<p>Nullam id dolor id nibh ultricies vehicula ut id elit. Nullam quis risus eget urna mollis ornare vel eu leo. Donec ullamcorper nulla non metus auctor fringilla. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.</p>
|
47
|
+
</div>
|
48
|
+
<!-- End content-column-wrapper -->
|
49
|
+
</div>
|
50
|
+
</div>
|
51
|
+
</div>
|
52
|
+
<style type="text/css" media="screen">
|
53
|
+
/* ============= */
|
54
|
+
/* = CSS Reset = */
|
55
|
+
/* ============= */
|
56
|
+
|
57
|
+
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
58
|
+
a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp,
|
59
|
+
small, strike, strong, sub, sup, tt, var, dl, dt, dd, ol, ul, li,fieldset, form, label, legend,
|
60
|
+
table, caption, tbody, tfoot, thead, tr, th, td {
|
61
|
+
margin: 0;
|
62
|
+
padding: 0;
|
63
|
+
border: 0;q
|
64
|
+
outline: 0;
|
65
|
+
font-weight: inherit;
|
66
|
+
font-style: inherit;
|
67
|
+
font-size: 100%;
|
68
|
+
font-family: inherit;
|
69
|
+
vertical-align: baseline;
|
70
|
+
}
|
71
|
+
|
72
|
+
/* remember to define focus styles! */
|
73
|
+
:focus { outline: 0; }
|
74
|
+
body { line-height: 1; color: black; background: white; }
|
75
|
+
ol, ul { list-style: none; }
|
76
|
+
/* tables still need 'cellspacing="0"' in the markup */
|
77
|
+
table { border-collapse: separate; border-spacing: 0; }
|
78
|
+
caption, th, td { text-align: left; font-weight: normal; }
|
79
|
+
blockquote:before, blockquote:after, q:before, q:after { content: ""; }
|
80
|
+
blockquote, q { quotes: "" ""; }
|
81
|
+
|
82
|
+
/* ================= */
|
83
|
+
/* = Global Styles = */
|
84
|
+
/* ================= */
|
85
|
+
|
86
|
+
* { margin:0; padding:0; }
|
87
|
+
img { border:0px; }
|
88
|
+
html, body { height: 100%; }
|
89
|
+
body { background: url(/assets/batman/content-bg.png); font-family: "ff-meta-web-pro-1","ff-meta-web-pro-2", sans-serif; font-size:13px; font-style: normal; font-weight: 400; color:#222; }
|
90
|
+
body p { color: #222; line-height: 20px; margin-bottom: 20px; }
|
91
|
+
|
92
|
+
h1, h2, h3, h4, h5, h6 { font-family: "ff-meta-web-pro-1","ff-meta-web-pro-2", sans-serif; font-size:13px; font-style: normal; font-weight: 700; }
|
93
|
+
h2 { font-size: 30px; color: #373862; margin-bottom: 15px; }
|
94
|
+
#home h3 { font-size: 22px; color: #373862; margin-bottom: 30px; }
|
95
|
+
h3 { font-size: 22px; color: #373862; margin-bottom: 20px; }
|
96
|
+
h4 { font-size: 16px; color: #373862; line-height: 22px; margin-bottom: 15px; }
|
97
|
+
h5 { font-size: 14px; color: #000; line-height: 20px; margin-bottom: 15px; }
|
98
|
+
|
99
|
+
.clearfix:after { content:"."; display:block; height:0; clear:both; visibility:hidden; }
|
100
|
+
.clear { clear:both }
|
101
|
+
.float-right { float:right }
|
102
|
+
|
103
|
+
/* ========= */
|
104
|
+
/* = Links = */
|
105
|
+
/* ========= */
|
106
|
+
|
107
|
+
a:link { color: #373862; text-decoration: none; }
|
108
|
+
a:hover { color: #47497c; text-decoration: none; }
|
109
|
+
a:focus { color: #47497c; text-decoration: none; }
|
110
|
+
a:visited { color: #47497c; text-decoration: none; }
|
111
|
+
|
112
|
+
#intro-statement a:link { color: #fdf9cc; }
|
113
|
+
#intro-statement a:hover { color: #fffdec; }
|
114
|
+
#intro-statement a:focus { color: #fffdec; }
|
115
|
+
#intro-statement a:visited { color: #fffdec; }
|
116
|
+
|
117
|
+
#download-box a.release-links { text-decoration: underline; }
|
118
|
+
#download-box a.release-links:link { color: #fdf9cc; }
|
119
|
+
#download-box a.release-links:hover { color: #fffdec; }
|
120
|
+
#download-box a.release-links:focus { color: #fffdec; }
|
121
|
+
#download-box a.release-links:visited { color: #fffdec; }
|
122
|
+
|
123
|
+
#footer-content a:link { color: #8688a0; }
|
124
|
+
#footer-content a:hover { color: #9c9ebb; }
|
125
|
+
#footer-content a:focus { color: #9c9ebb; }
|
126
|
+
#footer-content a:visited { color: #9c9ebb; }
|
127
|
+
|
128
|
+
/* ================= */
|
129
|
+
/* = Global Layout = */
|
130
|
+
/* ================= */
|
131
|
+
|
132
|
+
#logo { float: left; margin-left: -30px; }
|
133
|
+
#logo a { display: block; background: url(/assets/batman/logo.png) top left no-repeat; width: 276px; height: 65px; text-indent: -999px; }
|
134
|
+
|
135
|
+
#content-wrapper { min-height: 100%; padding-bottom: 32px; background: url(/assets/batman/content-bg-fade.png) top left repeat-x; }
|
136
|
+
#content { overflow:auto; margin: 0 auto; padding: 45px 32px 190px 32px; width: 932px; }
|
137
|
+
#right-sidebar { float: left; width: 267px; padding-left: 32px; border-left: 1px dashed #c6c7da; }
|
138
|
+
#left-sidebar { float: left; width: 267px; padding-right: 32px; }
|
139
|
+
|
140
|
+
ul.blog-list { margin-bottom: 32px; font-size: 13px; }
|
141
|
+
ul.blog-list li.blog-post-date { font-size: 13px; font-weight: bold; font-style: italic; margin-bottom: 12px; color: #000; }
|
142
|
+
ul.blog-list a.read-more { font-weight: bold; }
|
143
|
+
|
144
|
+
a.icon-rss { float: left; display: block; width: 16px; height: 20px; overflow: hidden; text-indent: -999px; margin-right: 14px; background: url(/assets/batman/icon-rss.png) 0 4px no-repeat; }
|
145
|
+
a.icon-twitter { float: left; display: block; width: 26px; height: 20px; overflow: hidden; text-indent: -999px; margin-right: 10px; background: url(/assets/batman/icon-twitter.png) 0 2px no-repeat; }
|
146
|
+
|
147
|
+
#footer-wrapper { position: relative; margin-top: -190px; /* negative value of footer height */ height: 190px; clear:both; background: #181818; }
|
148
|
+
#footer-content { width: 932px; margin: 0 auto; padding-top: 64px; color: #6c6d80; }
|
149
|
+
#footer-content ul li { line-height: 26px; }
|
150
|
+
#footer-content ul li a.inline-link { margin-left: 15px; }
|
151
|
+
#footer-content a.shopify-logo { float: right; }
|
152
|
+
|
153
|
+
/*Opera Fix*/
|
154
|
+
body:before { content:""; height:100%; float:left; width:0; margin-top:-32767px;/ }
|
155
|
+
|
156
|
+
#sub #header-wrapper { width: 100%; height: 155px; background: #1d1d2b url(/assets/batman/header-wrapper-bg.jpg) top center no-repeat; }
|
157
|
+
#sub #header-wrapper #header { margin: 0 auto; width: 932px; padding: 36px 32px 42px 32px; }
|
158
|
+
|
159
|
+
/* ============== */
|
160
|
+
/* = Navigation = */
|
161
|
+
/* ============== */
|
162
|
+
|
163
|
+
#navigation { float: right; }
|
164
|
+
#navigation ul { margin-top: 32px; color: #b3b3c3; font-size: 15px; text-shadow:1px 1px rgba(0,0,0,0.9)}
|
165
|
+
#navigation ul li { float: left; margin-right: 42px;}
|
166
|
+
#navigation ul li:last-child { float: left; margin-right: 0;}
|
167
|
+
#navigation ul li a { color: #b3b3c3; text-decoration: none; }
|
168
|
+
#navigation ul li a:hover { color: #fff; }
|
169
|
+
#navigation ul li.active a { color: #fff; background: #181826; padding: 6px 14px; cursor: default; border-bottom: 1px solid #333340; -moz-border-radius: 5px; border-radius: 5px; }
|
170
|
+
|
171
|
+
/* ======== */
|
172
|
+
/* = Home = */
|
173
|
+
/* ======== */
|
174
|
+
|
175
|
+
#home #header-wrapper { width: 100%; height: 470px; background: #1d1d2b url(/assets/batman/header-wrapper-bg.jpg) top center no-repeat; }
|
176
|
+
#home #header-wrapper #header { margin: 0 auto; width: 932px; padding: 36px 32px 42px 32px; }
|
177
|
+
#home #intro-statement { float: left; width: 600px; padding-top: 78px; margin-right: 32px; }
|
178
|
+
#home #intro-statement h2 { color: #b3b3c3; font-size: 30px; font-style: normal; font-weight: 400; margin-bottom: 26px; }
|
179
|
+
#home #intro-statement p { color: #b3b3c3; font-size: 18px; line-height: 28px; margin-bottom: 26px; }
|
180
|
+
#home #download-box { float: left; margin-top: 40px; width: 236px; min-height: 280px; padding: 32px; background: #181826 url(/assets/batman/download-box-top.png) center 1px no-repeat; -moz-border-radius:10px; -webkit-border-radius:10px; border-radius:10px; }
|
181
|
+
#home #download-box a.btn-download { display: block; text-indent: -999px; overflow: hidden; width: 235px; height: 50px; margin-bottom: 20px; cursor: pointer; background: url(/assets/batman/btn-download-batman.png) top left no-repeat; }
|
182
|
+
#home #download-box a.btn-download:hover { background-position: 0 -50px; }
|
183
|
+
#home #download-box p { font-size: 14px; line-height: 20px; margin-bottom: 18px; color: #fff; }
|
184
|
+
#home #download-box .title { color: #b3b3c3; }
|
185
|
+
|
186
|
+
#home #content-column-wrapper { float: left; width: 600px; padding-right: 32px; }
|
187
|
+
#home #content-column-1 { float: left; width: 268px; margin-right: 32px; }
|
188
|
+
#home #content-column-2 { float: left; width: 268px; margin-left: 32px; }
|
189
|
+
|
190
|
+
#home ul.feature-box { margin-bottom: 32px; }
|
191
|
+
#home ul.feature-box li.feature-image { margin-bottom: 20px; }
|
192
|
+
#home ul.feature-box li.feature-description { margin-bottom: 20px; }
|
193
|
+
|
194
|
+
input[type="text"].email-signup { font-size: 13px; text-align: left; width: 222px; padding: 4px; margin-top: 10px; margin-bottom: 10px; }
|
195
|
+
input[type="submit"].email-submit { font-size: 32px; margin-left: 15px; padding: 4px; }
|
196
|
+
|
197
|
+
/* ============ */
|
198
|
+
/* = Subpages = */
|
199
|
+
/* ============ */
|
200
|
+
|
201
|
+
#sub #content-column-wrapper-full { float: left; width: 100%; }
|
202
|
+
#sub #content-column-wrapper { float: left; width: 600px; padding-left: 32px; border-left: 1px dashed #d0d0d0; }
|
203
|
+
#sub #content-column-1 { float: left; width: 268px; margin-right: 32px; }
|
204
|
+
#sub #content-column-2 { float: left; width: 268px; margin-left: 32px; }
|
205
|
+
|
206
|
+
#sub ul.feature-box { margin-bottom: 32px; }
|
207
|
+
#sub ul.feature-box li.feature-image { margin-bottom: 20px; }
|
208
|
+
#sub ul.feature-box li.feature-description { margin-bottom: 20px; }
|
209
|
+
|
210
|
+
ul.subnav { margin-bottom: 32px; font-size: 14px; line-height: 20px; }
|
211
|
+
ul.subnav li { color: #8f90ac; padding-bottom: 15px; margin-top: 15px; border-bottom: 1px dashed #d0d0d0; }
|
212
|
+
ul.subnav li:first-child { margin-top: 0; }
|
213
|
+
ul.subnav li.active { font-weight: bold; color: #373862; }
|
214
|
+
ul.subnav a { color: #8f90ac; display: block; }
|
215
|
+
ul.subnav a:hover { color: #6d6e93; }
|
216
|
+
|
217
|
+
#sub #download-box { float: right; margin: 0 0 32px 32px; width: 236px; padding: 32px 32px 10px 32px; background: #303153 url(/assets/batman/download-box-top.png) center 1px no-repeat; -moz-border-radius:10px; -webkit-border-radius:10px; border-radius:10px; }
|
218
|
+
#sub #download-box a.btn-download { display: block; text-indent: -999px; overflow: hidden; width: 235px; height: 50px; margin-bottom: 20px; cursor: pointer; background: url(/assets/batman/btn-download-batman.png) top left no-repeat; }
|
219
|
+
#sub #download-box a.btn-download:hover { background-position: 0 -50px; }
|
220
|
+
#sub #download-box p { font-size: 14px; line-height: 20px; margin-bottom: 18px; color: #fff; }
|
221
|
+
#sub #download-box .title { color: #b3b3c3; }
|
222
|
+
|
223
|
+
ul.content { margin-bottom: 20px; }
|
224
|
+
ul.content li { background: url(/assets/batman/bullet.png) 0 8px no-repeat; margin-bottom: 10px; padding-left: 20px; line-height: 20px; }
|
225
|
+
|
226
|
+
ol.content { margin-bottom: 20px; list-style: decimal; padding-left: 20px; }
|
227
|
+
ol.content li { margin-bottom: 10px; line-height: 20px; }
|
228
|
+
|
229
|
+
.callout-box { padding: 20px; border: 1px dashed #d0d0d0; background: #eeeef7; }
|
230
|
+
|
231
|
+
/* =========== */
|
232
|
+
/* = Twitter = */
|
233
|
+
/* =========== */
|
234
|
+
|
235
|
+
.tweet, .query { font-size: 13px; }
|
236
|
+
.tweet .tweet_list, .query .tweet_list { list-style-type: none; margin: 0; padding: 0; overflow-y: hidden; }
|
237
|
+
.tweet .tweet_list .awesome, .tweet .tweet_list .epic, .query .tweet_list .awesome, .query .tweet_list .epic { text-transform: uppercase; }
|
238
|
+
.tweet .tweet_list li:first-child { margin-top: 0; }
|
239
|
+
.tweet .tweet_list li, .query .tweet_list li { line-height: 20px; padding-bottom: 15px; margin-top: 15px; border-bottom: 1px dashed #d0d0d0; }
|
240
|
+
.tweet .tweet_list li:last-child, .query .tweet_list li:last-child { border-bottom: none; }
|
241
|
+
.tweet .tweet_list li a, .query .tweet_list li a { text-decoration: none; }
|
242
|
+
.tweet .tweet_list .tweet_avatar, .query .tweet_list .tweet_avatar { padding: 0 15px 30px 0; margin-top: 7px; float: left; }
|
243
|
+
.tweet .tweet_list .tweet_avatar img, .query .tweet_list .tweet_avatar img { vertical-align: middle; }
|
244
|
+
.tweet .tweet_list .tweet_time a { font-size: 13px; font-style: italic; }
|
245
|
+
.tweet .tweet_list .tweet_text { margin-bottom: 20px; }
|
246
|
+
.tweet .tweet_list .tweet_text a { text-decoration: none; }
|
247
|
+
a.tweet_user { margin-bottom: 5px; font-size: 13px; font-style: italic; }
|
248
|
+
|
249
|
+
.listy ul { list-style: url(/assets/batman/bullet.png) inside; margin-bottom: 20px; }
|
250
|
+
|
251
|
+
|
252
|
+
/* ======== */
|
253
|
+
/* = Code = */
|
254
|
+
/* ======== */
|
255
|
+
|
256
|
+
|
257
|
+
div.highlight { background:#FFFFFF; border:1px solid #E0E0E0; font-family:"Courier New",Courier,monospace; overflow: hidden; padding: 7px; margin-bottom: 20px; }
|
258
|
+
|
259
|
+
</style>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
class <%= js_application_name %>.MainController extends <%= js_application_name %>.ApplicationController
|
2
|
+
routingKey: 'main'
|
3
|
+
|
4
|
+
index: (params) ->
|
5
|
+
@set 'firstName', 'James'
|
6
|
+
@set 'lastName', 'Bond'
|
7
|
+
|
8
|
+
@accessor 'fullName', -> "#{@get('firstName')} #{@get('lastName')}"
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class <%= js_application_name %>.<%= singular_model_name %> extends Batman.Model
|
2
|
+
@resourceName: '<%= plural_name %>'
|
3
|
+
@storageKey: '<%= plural_name %>'
|
4
|
+
|
5
|
+
@persist Batman.RailsStorage
|
6
|
+
|
7
|
+
# Use @encode to tell batman.js which properties Rails will send back with its JSON.
|
8
|
+
# @encode 'name'
|
9
|
+
@encodeTimestamps()
|
10
|
+
|
11
|
+
<% attributes.each do |attribute| -%>
|
12
|
+
@encode <%= render_attribute(attribute) %>
|
13
|
+
<% end -%>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
class <%= js_application_name %>.<%= file_name.camelize %>View extends Batman.View
|
2
|
+
|
3
|
+
<% actions.each do |action| -%>
|
4
|
+
class <%= js_application_name %>.<%= file_name.camelize %><%= action.camelize %>View extends <%= js_application_name %>.<%= file_name.camelize %>View
|
5
|
+
|
6
|
+
<% end -%>
|
7
|
+
|
File without changes
|