pbw 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. checksums.yaml +8 -8
  2. data/lib/generators/pbw/area/area_generator.rb +1 -2
  3. data/lib/generators/pbw/install/install_generator.rb +18 -10
  4. data/lib/generators/pbw/item/item_generator.rb +1 -2
  5. data/lib/generators/pbw/model_generator.rb +1 -1
  6. data/lib/generators/pbw/resource_helpers.rb +13 -9
  7. data/lib/generators/pbw/rules/capability/capability_generator.rb +5 -2
  8. data/lib/generators/pbw/rules/command/command_generator.rb +12 -16
  9. data/lib/generators/pbw/rules/constraint/constraint_generator.rb +5 -2
  10. data/lib/generators/pbw/rules/process/process_generator.rb +5 -2
  11. data/lib/generators/pbw/rules/trigger/trigger_generator.rb +5 -2
  12. data/lib/generators/pbw/scaffold_generator.rb +75 -8
  13. data/lib/generators/pbw/{install/templates → templates}/app.coffee +0 -0
  14. data/lib/generators/pbw/{area/templates → templates}/index.erb +1 -1
  15. data/lib/generators/pbw/{install/templates → templates}/lifecycle.rb +0 -0
  16. data/lib/generators/pbw/{rules/capability/templates → templates}/model.coffee +4 -4
  17. data/lib/generators/pbw/templates/router.coffee +11 -0
  18. data/lib/generators/pbw/templates/templates/edit.jst +23 -0
  19. data/lib/generators/pbw/templates/templates/home.jst +1 -0
  20. data/lib/generators/pbw/{area/templates → templates}/templates/index.jst +2 -4
  21. data/lib/generators/pbw/templates/templates/model.jst +7 -0
  22. data/lib/generators/pbw/templates/templates/new.jst +23 -0
  23. data/lib/generators/pbw/templates/templates/show.jst +16 -0
  24. data/lib/generators/pbw/{rules/capability/templates → templates}/views/edit_view.coffee +8 -1
  25. data/lib/generators/pbw/templates/views/home.coffee +8 -0
  26. data/lib/generators/pbw/{area/templates → templates}/views/index_view.coffee +0 -0
  27. data/lib/generators/pbw/{area/templates → templates}/views/model_view.coffee +0 -0
  28. data/lib/generators/pbw/{area/templates → templates}/views/new_view.coffee +9 -4
  29. data/lib/generators/pbw/{area/templates → templates}/views/show_view.coffee +0 -0
  30. data/lib/generators/pbw/token/token_generator.rb +2 -3
  31. data/lib/pbw/engine.rb +0 -4
  32. data/lib/pbw/version.rb +1 -1
  33. metadata +18 -101
  34. data/lib/generators/pbw/area/templates/model.coffee +0 -14
  35. data/lib/generators/pbw/area/templates/router.coffee +0 -31
  36. data/lib/generators/pbw/area/templates/templates/edit.jst +0 -21
  37. data/lib/generators/pbw/area/templates/templates/model.jst +0 -8
  38. data/lib/generators/pbw/area/templates/templates/new.jst +0 -21
  39. data/lib/generators/pbw/area/templates/templates/show.jst +0 -14
  40. data/lib/generators/pbw/area/templates/views/edit_view.coffee +0 -24
  41. data/lib/generators/pbw/install/templates/application.html.erb +0 -47
  42. data/lib/generators/pbw/install/templates/pbw.rb +0 -12
  43. data/lib/generators/pbw/item/templates/index.erb +0 -6
  44. data/lib/generators/pbw/item/templates/model.coffee +0 -14
  45. data/lib/generators/pbw/item/templates/router.coffee +0 -31
  46. data/lib/generators/pbw/item/templates/templates/edit.jst +0 -21
  47. data/lib/generators/pbw/item/templates/templates/index.jst +0 -17
  48. data/lib/generators/pbw/item/templates/templates/model.jst +0 -8
  49. data/lib/generators/pbw/item/templates/templates/new.jst +0 -21
  50. data/lib/generators/pbw/item/templates/templates/show.jst +0 -14
  51. data/lib/generators/pbw/item/templates/views/edit_view.coffee +0 -24
  52. data/lib/generators/pbw/item/templates/views/index_view.coffee +0 -20
  53. data/lib/generators/pbw/item/templates/views/model_view.coffee +0 -19
  54. data/lib/generators/pbw/item/templates/views/new_view.coffee +0 -37
  55. data/lib/generators/pbw/item/templates/views/show_view.coffee +0 -8
  56. data/lib/generators/pbw/rules/capability/templates/index.erb +0 -6
  57. data/lib/generators/pbw/rules/capability/templates/router.coffee +0 -31
  58. data/lib/generators/pbw/rules/capability/templates/templates/edit.jst +0 -21
  59. data/lib/generators/pbw/rules/capability/templates/templates/index.jst +0 -17
  60. data/lib/generators/pbw/rules/capability/templates/templates/model.jst +0 -8
  61. data/lib/generators/pbw/rules/capability/templates/templates/new.jst +0 -21
  62. data/lib/generators/pbw/rules/capability/templates/templates/show.jst +0 -14
  63. data/lib/generators/pbw/rules/capability/templates/views/index_view.coffee +0 -20
  64. data/lib/generators/pbw/rules/capability/templates/views/model_view.coffee +0 -19
  65. data/lib/generators/pbw/rules/capability/templates/views/new_view.coffee +0 -37
  66. data/lib/generators/pbw/rules/capability/templates/views/show_view.coffee +0 -8
  67. data/lib/generators/pbw/rules/command/templates/model.coffee +0 -14
  68. data/lib/generators/pbw/rules/command/templates/templates/model.jst +0 -7
  69. data/lib/generators/pbw/rules/command/templates/templates/new.jst +0 -17
  70. data/lib/generators/pbw/rules/command/templates/views/model_view.coffee +0 -19
  71. data/lib/generators/pbw/rules/command/templates/views/new_view.coffee +0 -37
  72. data/lib/generators/pbw/rules/constraint/templates/index.erb +0 -6
  73. data/lib/generators/pbw/rules/constraint/templates/model.coffee +0 -14
  74. data/lib/generators/pbw/rules/constraint/templates/router.coffee +0 -31
  75. data/lib/generators/pbw/rules/constraint/templates/templates/edit.jst +0 -21
  76. data/lib/generators/pbw/rules/constraint/templates/templates/index.jst +0 -17
  77. data/lib/generators/pbw/rules/constraint/templates/templates/model.jst +0 -8
  78. data/lib/generators/pbw/rules/constraint/templates/templates/new.jst +0 -21
  79. data/lib/generators/pbw/rules/constraint/templates/templates/show.jst +0 -14
  80. data/lib/generators/pbw/rules/constraint/templates/views/edit_view.coffee +0 -24
  81. data/lib/generators/pbw/rules/constraint/templates/views/index_view.coffee +0 -20
  82. data/lib/generators/pbw/rules/constraint/templates/views/model_view.coffee +0 -19
  83. data/lib/generators/pbw/rules/constraint/templates/views/new_view.coffee +0 -37
  84. data/lib/generators/pbw/rules/constraint/templates/views/show_view.coffee +0 -8
  85. data/lib/generators/pbw/rules/process/templates/index.erb +0 -6
  86. data/lib/generators/pbw/rules/process/templates/model.coffee +0 -14
  87. data/lib/generators/pbw/rules/process/templates/router.coffee +0 -31
  88. data/lib/generators/pbw/rules/process/templates/templates/edit.jst +0 -21
  89. data/lib/generators/pbw/rules/process/templates/templates/index.jst +0 -17
  90. data/lib/generators/pbw/rules/process/templates/templates/model.jst +0 -8
  91. data/lib/generators/pbw/rules/process/templates/templates/new.jst +0 -21
  92. data/lib/generators/pbw/rules/process/templates/templates/show.jst +0 -14
  93. data/lib/generators/pbw/rules/process/templates/views/edit_view.coffee +0 -24
  94. data/lib/generators/pbw/rules/process/templates/views/index_view.coffee +0 -20
  95. data/lib/generators/pbw/rules/process/templates/views/model_view.coffee +0 -19
  96. data/lib/generators/pbw/rules/process/templates/views/new_view.coffee +0 -37
  97. data/lib/generators/pbw/rules/process/templates/views/show_view.coffee +0 -8
  98. data/lib/generators/pbw/rules/trigger/templates/index.erb +0 -6
  99. data/lib/generators/pbw/rules/trigger/templates/model.coffee +0 -14
  100. data/lib/generators/pbw/rules/trigger/templates/router.coffee +0 -31
  101. data/lib/generators/pbw/rules/trigger/templates/templates/edit.jst +0 -21
  102. data/lib/generators/pbw/rules/trigger/templates/templates/index.jst +0 -17
  103. data/lib/generators/pbw/rules/trigger/templates/templates/model.jst +0 -8
  104. data/lib/generators/pbw/rules/trigger/templates/templates/new.jst +0 -21
  105. data/lib/generators/pbw/rules/trigger/templates/templates/show.jst +0 -14
  106. data/lib/generators/pbw/rules/trigger/templates/views/edit_view.coffee +0 -24
  107. data/lib/generators/pbw/rules/trigger/templates/views/index_view.coffee +0 -20
  108. data/lib/generators/pbw/rules/trigger/templates/views/model_view.coffee +0 -19
  109. data/lib/generators/pbw/rules/trigger/templates/views/new_view.coffee +0 -37
  110. data/lib/generators/pbw/rules/trigger/templates/views/show_view.coffee +0 -8
  111. data/lib/generators/pbw/token/templates/index.erb +0 -6
  112. data/lib/generators/pbw/token/templates/model.coffee +0 -14
  113. data/lib/generators/pbw/token/templates/router.coffee +0 -31
  114. data/lib/generators/pbw/token/templates/templates/edit.jst +0 -21
  115. data/lib/generators/pbw/token/templates/templates/index.jst +0 -17
  116. data/lib/generators/pbw/token/templates/templates/model.jst +0 -8
  117. data/lib/generators/pbw/token/templates/templates/new.jst +0 -21
  118. data/lib/generators/pbw/token/templates/templates/show.jst +0 -14
  119. data/lib/generators/pbw/token/templates/views/edit_view.coffee +0 -24
  120. data/lib/generators/pbw/token/templates/views/index_view.coffee +0 -20
  121. data/lib/generators/pbw/token/templates/views/model_view.coffee +0 -19
  122. data/lib/generators/pbw/token/templates/views/new_view.coffee +0 -37
  123. data/lib/generators/pbw/token/templates/views/show_view.coffee +0 -8
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pbw
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seyed P. Razavi
@@ -248,125 +248,42 @@ files:
248
248
  - config/locales/devise.en.yml
249
249
  - config/routes.rb
250
250
  - lib/generators/pbw/area/area_generator.rb
251
- - lib/generators/pbw/area/templates/index.erb
252
- - lib/generators/pbw/area/templates/model.coffee
253
- - lib/generators/pbw/area/templates/router.coffee
254
- - lib/generators/pbw/area/templates/templates/edit.jst
255
- - lib/generators/pbw/area/templates/templates/index.jst
256
- - lib/generators/pbw/area/templates/templates/model.jst
257
- - lib/generators/pbw/area/templates/templates/new.jst
258
- - lib/generators/pbw/area/templates/templates/show.jst
259
- - lib/generators/pbw/area/templates/views/edit_view.coffee
260
- - lib/generators/pbw/area/templates/views/index_view.coffee
261
- - lib/generators/pbw/area/templates/views/model_view.coffee
262
- - lib/generators/pbw/area/templates/views/new_view.coffee
263
- - lib/generators/pbw/area/templates/views/show_view.coffee
264
251
  - lib/generators/pbw/area/USAGE
265
252
  - lib/generators/pbw/install/install_generator.rb
266
- - lib/generators/pbw/install/templates/app.coffee
267
- - lib/generators/pbw/install/templates/application.html.erb
268
- - lib/generators/pbw/install/templates/lifecycle.rb
269
- - lib/generators/pbw/install/templates/pbw.rb
270
253
  - lib/generators/pbw/install/USAGE
271
254
  - lib/generators/pbw/item/item_generator.rb
272
- - lib/generators/pbw/item/templates/index.erb
273
- - lib/generators/pbw/item/templates/model.coffee
274
- - lib/generators/pbw/item/templates/router.coffee
275
- - lib/generators/pbw/item/templates/templates/edit.jst
276
- - lib/generators/pbw/item/templates/templates/index.jst
277
- - lib/generators/pbw/item/templates/templates/model.jst
278
- - lib/generators/pbw/item/templates/templates/new.jst
279
- - lib/generators/pbw/item/templates/templates/show.jst
280
- - lib/generators/pbw/item/templates/views/edit_view.coffee
281
- - lib/generators/pbw/item/templates/views/index_view.coffee
282
- - lib/generators/pbw/item/templates/views/model_view.coffee
283
- - lib/generators/pbw/item/templates/views/new_view.coffee
284
- - lib/generators/pbw/item/templates/views/show_view.coffee
285
255
  - lib/generators/pbw/item/USAGE
286
256
  - lib/generators/pbw/model_generator.rb
287
257
  - lib/generators/pbw/resource_helpers.rb
288
258
  - lib/generators/pbw/rules/capability/capability_generator.rb
289
- - lib/generators/pbw/rules/capability/templates/index.erb
290
- - lib/generators/pbw/rules/capability/templates/model.coffee
291
- - lib/generators/pbw/rules/capability/templates/router.coffee
292
- - lib/generators/pbw/rules/capability/templates/templates/edit.jst
293
- - lib/generators/pbw/rules/capability/templates/templates/index.jst
294
- - lib/generators/pbw/rules/capability/templates/templates/model.jst
295
- - lib/generators/pbw/rules/capability/templates/templates/new.jst
296
- - lib/generators/pbw/rules/capability/templates/templates/show.jst
297
- - lib/generators/pbw/rules/capability/templates/views/edit_view.coffee
298
- - lib/generators/pbw/rules/capability/templates/views/index_view.coffee
299
- - lib/generators/pbw/rules/capability/templates/views/model_view.coffee
300
- - lib/generators/pbw/rules/capability/templates/views/new_view.coffee
301
- - lib/generators/pbw/rules/capability/templates/views/show_view.coffee
302
259
  - lib/generators/pbw/rules/capability/USAGE
303
260
  - lib/generators/pbw/rules/command/command_generator.rb
304
- - lib/generators/pbw/rules/command/templates/model.coffee
305
- - lib/generators/pbw/rules/command/templates/templates/model.jst
306
- - lib/generators/pbw/rules/command/templates/templates/new.jst
307
- - lib/generators/pbw/rules/command/templates/views/model_view.coffee
308
- - lib/generators/pbw/rules/command/templates/views/new_view.coffee
309
261
  - lib/generators/pbw/rules/command/USAGE
310
262
  - lib/generators/pbw/rules/constraint/constraint_generator.rb
311
- - lib/generators/pbw/rules/constraint/templates/index.erb
312
- - lib/generators/pbw/rules/constraint/templates/model.coffee
313
- - lib/generators/pbw/rules/constraint/templates/router.coffee
314
- - lib/generators/pbw/rules/constraint/templates/templates/edit.jst
315
- - lib/generators/pbw/rules/constraint/templates/templates/index.jst
316
- - lib/generators/pbw/rules/constraint/templates/templates/model.jst
317
- - lib/generators/pbw/rules/constraint/templates/templates/new.jst
318
- - lib/generators/pbw/rules/constraint/templates/templates/show.jst
319
- - lib/generators/pbw/rules/constraint/templates/views/edit_view.coffee
320
- - lib/generators/pbw/rules/constraint/templates/views/index_view.coffee
321
- - lib/generators/pbw/rules/constraint/templates/views/model_view.coffee
322
- - lib/generators/pbw/rules/constraint/templates/views/new_view.coffee
323
- - lib/generators/pbw/rules/constraint/templates/views/show_view.coffee
324
263
  - lib/generators/pbw/rules/constraint/USAGE
325
264
  - lib/generators/pbw/rules/process/process_generator.rb
326
- - lib/generators/pbw/rules/process/templates/index.erb
327
- - lib/generators/pbw/rules/process/templates/model.coffee
328
- - lib/generators/pbw/rules/process/templates/router.coffee
329
- - lib/generators/pbw/rules/process/templates/templates/edit.jst
330
- - lib/generators/pbw/rules/process/templates/templates/index.jst
331
- - lib/generators/pbw/rules/process/templates/templates/model.jst
332
- - lib/generators/pbw/rules/process/templates/templates/new.jst
333
- - lib/generators/pbw/rules/process/templates/templates/show.jst
334
- - lib/generators/pbw/rules/process/templates/views/edit_view.coffee
335
- - lib/generators/pbw/rules/process/templates/views/index_view.coffee
336
- - lib/generators/pbw/rules/process/templates/views/model_view.coffee
337
- - lib/generators/pbw/rules/process/templates/views/new_view.coffee
338
- - lib/generators/pbw/rules/process/templates/views/show_view.coffee
339
265
  - lib/generators/pbw/rules/process/USAGE
340
266
  - lib/generators/pbw/rules/rules.rb
341
- - lib/generators/pbw/rules/trigger/templates/index.erb
342
- - lib/generators/pbw/rules/trigger/templates/model.coffee
343
- - lib/generators/pbw/rules/trigger/templates/router.coffee
344
- - lib/generators/pbw/rules/trigger/templates/templates/edit.jst
345
- - lib/generators/pbw/rules/trigger/templates/templates/index.jst
346
- - lib/generators/pbw/rules/trigger/templates/templates/model.jst
347
- - lib/generators/pbw/rules/trigger/templates/templates/new.jst
348
- - lib/generators/pbw/rules/trigger/templates/templates/show.jst
349
- - lib/generators/pbw/rules/trigger/templates/views/edit_view.coffee
350
- - lib/generators/pbw/rules/trigger/templates/views/index_view.coffee
351
- - lib/generators/pbw/rules/trigger/templates/views/model_view.coffee
352
- - lib/generators/pbw/rules/trigger/templates/views/new_view.coffee
353
- - lib/generators/pbw/rules/trigger/templates/views/show_view.coffee
354
267
  - lib/generators/pbw/rules/trigger/trigger_generator.rb
355
268
  - lib/generators/pbw/rules/trigger/USAGE
356
269
  - lib/generators/pbw/scaffold_generator.rb
357
- - lib/generators/pbw/token/templates/index.erb
358
- - lib/generators/pbw/token/templates/model.coffee
359
- - lib/generators/pbw/token/templates/router.coffee
360
- - lib/generators/pbw/token/templates/templates/edit.jst
361
- - lib/generators/pbw/token/templates/templates/index.jst
362
- - lib/generators/pbw/token/templates/templates/model.jst
363
- - lib/generators/pbw/token/templates/templates/new.jst
364
- - lib/generators/pbw/token/templates/templates/show.jst
365
- - lib/generators/pbw/token/templates/views/edit_view.coffee
366
- - lib/generators/pbw/token/templates/views/index_view.coffee
367
- - lib/generators/pbw/token/templates/views/model_view.coffee
368
- - lib/generators/pbw/token/templates/views/new_view.coffee
369
- - lib/generators/pbw/token/templates/views/show_view.coffee
270
+ - lib/generators/pbw/templates/app.coffee
271
+ - lib/generators/pbw/templates/index.erb
272
+ - lib/generators/pbw/templates/lifecycle.rb
273
+ - lib/generators/pbw/templates/model.coffee
274
+ - lib/generators/pbw/templates/router.coffee
275
+ - lib/generators/pbw/templates/templates/edit.jst
276
+ - lib/generators/pbw/templates/templates/home.jst
277
+ - lib/generators/pbw/templates/templates/index.jst
278
+ - lib/generators/pbw/templates/templates/model.jst
279
+ - lib/generators/pbw/templates/templates/new.jst
280
+ - lib/generators/pbw/templates/templates/show.jst
281
+ - lib/generators/pbw/templates/views/edit_view.coffee
282
+ - lib/generators/pbw/templates/views/home.coffee
283
+ - lib/generators/pbw/templates/views/index_view.coffee
284
+ - lib/generators/pbw/templates/views/model_view.coffee
285
+ - lib/generators/pbw/templates/views/new_view.coffee
286
+ - lib/generators/pbw/templates/views/show_view.coffee
370
287
  - lib/generators/pbw/token/token_generator.rb
371
288
  - lib/generators/pbw/token/USAGE
372
289
  - lib/pbw/engine.rb
@@ -1,14 +0,0 @@
1
- class <%= model_namespace %> extends Backbone.Model
2
- paramRoot: '<%= singular_table_name %>'
3
- urlRoot: '/pbw/areas/<%= class_name%>'
4
-
5
- defaults:
6
- name: null
7
- _type: '<%= class_name%>'
8
- <% attributes.each do |attribute| -%>
9
- <%= attribute.name %>: null
10
- <% end -%>
11
-
12
- class <%= collection_namespace %>Collection extends Backbone.Collection
13
- model: <%= model_namespace %>
14
- url: '/pbw/areas/<%= class_name%>'
@@ -1,31 +0,0 @@
1
- class <%= router_namespace %>Router extends Backbone.Router
2
- initialize: (options) ->
3
- @<%= plural_model_name %> = new <%= collection_namespace %>Collection()
4
- @<%= plural_model_name %>.reset options.<%= plural_model_name %>
5
-
6
- routes:
7
- "" : "index"
8
- "new" : "new<%= class_name %>"
9
- ":id/edit" : "edit"
10
- ":id" : "show"
11
- ".*" : "index"
12
-
13
- new<%= class_name %>: ->
14
- @view = new <%= "#{view_namespace}.NewView(collection: @#{plural_name})" %>
15
- $("#<%= plural_name %>").html(@view.render().el)
16
-
17
- index: ->
18
- @view = new <%= "#{view_namespace}.IndexView(#{plural_name}: @#{plural_name})" %>
19
- $("#<%= plural_name %>").html(@view.render().el)
20
-
21
- show: (id) ->
22
- <%= singular_name %> = @<%= plural_name %>.get(id)
23
-
24
- @view = new <%= "#{view_namespace}.ShowView(model: #{singular_name})" %>
25
- $("#<%= plural_name %>").html(@view.render().el)
26
-
27
- edit: (id) ->
28
- <%= singular_name %> = @<%= plural_name %>.get(id)
29
-
30
- @view = new <%= "#{view_namespace}.EditView(model: #{singular_name})" %>
31
- $("#<%= plural_name %>").html(@view.render().el)
@@ -1,21 +0,0 @@
1
- <h1>Edit <%= singular_table_name %></h1>
2
-
3
- <form id="edit-<%= singular_table_name %>" name="<%= singular_table_name %>">
4
- <div class="field">
5
- <label for="name">Name:</label>
6
- <input type="text" name="name" id="name" value="<%%= name %>" >
7
- </div>
8
- <% attributes.each do |attribute| -%>
9
- <div class="field">
10
- <label for="<%= attribute.name %>"> <%= attribute.human_name %>:</label>
11
- <input type="text" name="<%= attribute.name %>" id="<%= attribute.name %>" value="<%%= <%= attribute.name %> %>" >
12
- </div>
13
-
14
- <% end -%>
15
- <div class="actions">
16
- <input type="submit" value="Update <%= human_name %>" />
17
- </div>
18
-
19
- </form>
20
-
21
- <a href="#/">Back</a>
@@ -1,8 +0,0 @@
1
- <td><%%= name %></td>
2
- <% attributes.each do |attribute| -%>
3
- <td><%%= <%= attribute.name %> %></td>
4
- <% end -%>
5
-
6
- <td><a href="#/<%%= _id %>">Show</td>
7
- <td><a href="#/<%%= _id %>/edit">Edit</td>
8
- <td><a href="#/<%%= _id %>/destroy" class="destroy">Destroy</a></td>
@@ -1,21 +0,0 @@
1
- <h1>New <%= singular_table_name %></h1>
2
-
3
- <form id="new-<%= singular_table_name %>" name="<%= singular_table_name %>">
4
- <div class="field">
5
- <label for="name">Name:</label>
6
- <input type="text" name="name" id="name" value="<%%= name %>" >
7
- </div>
8
- <% attributes.each do |attribute| -%>
9
- <div class="field">
10
- <label for="<%= attribute.name %>"> <%= attribute.human_name %>:</label>
11
- <input type="text" name="<%= attribute.name %>" id="<%= attribute.name %>" value="<%%= <%= attribute.name %> %>" >
12
- </div>
13
-
14
- <% end -%>
15
- <div class="actions">
16
- <input type="submit" value="Create <%= human_name %>" />
17
- </div>
18
-
19
- </form>
20
-
21
- <a href="#/">Back</a>
@@ -1,14 +0,0 @@
1
- <p>
2
- <b>Name:</b>
3
- <%%= name %>
4
- </p>
5
-
6
- <% attributes.each do |attribute| -%>
7
- <p>
8
- <b><%= attribute.human_name %>:</b>
9
- <%%= <%= attribute.name %> %>
10
- </p>
11
-
12
- <% end -%>
13
-
14
- <a href="#/">Back</a>
@@ -1,24 +0,0 @@
1
- <%= view_namespace %> ||= {}
2
-
3
- class <%= view_namespace %>.EditView extends Backbone.View
4
- template: JST["<%= jst 'edit' %>"]
5
-
6
- events:
7
- "submit #edit-<%= singular_name %>": "update"
8
-
9
- update: (e) ->
10
- e.preventDefault()
11
- e.stopPropagation()
12
-
13
- @model.save(null,
14
- success: (<%= singular_name %>) =>
15
- @model = <%= singular_name %>
16
- window.location.hash = "/#{@model.id}"
17
- )
18
-
19
- render: ->
20
- @$el.html(@template(@model.toJSON() ))
21
-
22
- this.$("form").backboneLink(@model)
23
-
24
- return this
@@ -1,47 +0,0 @@
1
-
2
- <!DOCTYPE html>
3
- <!--[if IE 8]> <html class="no-js lt-ie9" lang="en" > <![endif]-->
4
- <!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
5
- <head>
6
- <meta charset="utf-8" />
7
- <meta name="viewport" content="width=device-width" />
8
- <title>PBW</title>
9
- <link rel="stylesheet" href="stylesheets/app.css" />
10
- <script src="javascripts/vendor/custom.modernizr.js"></script>
11
- </head>
12
- <body>
13
- <div class="row">
14
- <div class="large-12 columns">
15
- <h2>Welcome to PBW</h2>
16
- <p>This is version <%=Pbw::Engine.version%></p>
17
- <hr />
18
- </div>
19
- </div>
20
-
21
- <script>
22
- document.write('<script src=' +
23
- ('__proto__' in {} ? 'javascripts/vendor/zepto' : 'javascripts/vendor/jquery') +
24
- '.js><\/script>')
25
- </script>
26
- <script src="javascripts/foundation/foundation.js"></script>
27
- <script src="javascripts/foundation/foundation.alerts.js"></script>
28
- <script src="javascripts/foundation/foundation.clearing.js"></script>
29
- <script src="javascripts/foundation/foundation.cookie.js"></script>
30
- <script src="javascripts/foundation/foundation.dropdown.js"></script>
31
- <script src="javascripts/foundation/foundation.forms.js"></script>
32
- <script src="javascripts/foundation/foundation.interchange.js"></script>
33
- <script src="javascripts/foundation/foundation.joyride.js"></script>
34
- <script src="javascripts/foundation/foundation.magellan.js"></script>
35
- <script src="javascripts/foundation/foundation.orbit.js"></script>
36
- <script src="javascripts/foundation/foundation.placeholder.js"></script>
37
- <script src="javascripts/foundation/foundation.reveal.js"></script>
38
- <script src="javascripts/foundation/foundation.section.js"></script>
39
- <script src="javascripts/foundation/foundation.tooltips.js"></script>
40
- <script src="javascripts/foundation/foundation.topbar.js"></script>
41
-
42
-
43
- <script>
44
- $(document).foundation();
45
- </script>
46
- </body>
47
- </html>
@@ -1,12 +0,0 @@
1
- Pbw.setup do |config|
2
- # User lifecycle class
3
- # default is generated class from rails g pbw:install
4
- # if you use another class it needs to implement the following:
5
- # def self.after_signup(user)
6
- # # do anything that needs to happen immediately after a user signs up
7
- # end
8
- # def self.after_login(user)
9
- # # do anything that needs to happen immediately after a user logs in
10
- # end
11
- config.user_lifecycle_class = User::Lifecycle
12
- end
@@ -1,6 +0,0 @@
1
- <script type="text/javascript">
2
- $(function() {
3
- window.router = new <%= router_namespace %>Router;
4
- Backbone.history.start();
5
- });
6
- </script>
@@ -1,14 +0,0 @@
1
- class <%= model_namespace %> extends Backbone.Model
2
- paramRoot: '<%= singular_table_name %>'
3
- urlRoot: '/pbw/items/<%= class_name%>'
4
-
5
- defaults:
6
- name: null
7
- _type: '<%= class_name%>'
8
- <% attributes.each do |attribute| -%>
9
- <%= attribute.name %>: null
10
- <% end -%>
11
-
12
- class <%= collection_namespace %>Collection extends Backbone.Collection
13
- model: <%= model_namespace %>
14
- url: '/pbw/items/<%= class_name%>'
@@ -1,31 +0,0 @@
1
- class <%= router_namespace %>Router extends Backbone.Router
2
- initialize: (options) ->
3
- @<%= plural_model_name %> = new <%= collection_namespace %>Collection()
4
- @<%= plural_model_name %>.reset options.<%= plural_model_name %>
5
-
6
- routes:
7
- "" : "index"
8
- "new" : "new<%= class_name %>"
9
- ":id/edit" : "edit"
10
- ":id" : "show"
11
- ".*" : "index"
12
-
13
- new<%= class_name %>: ->
14
- @view = new <%= "#{view_namespace}.NewView(collection: @#{plural_name})" %>
15
- $("#<%= plural_name %>").html(@view.render().el)
16
-
17
- index: ->
18
- @view = new <%= "#{view_namespace}.IndexView(#{plural_name}: @#{plural_name})" %>
19
- $("#<%= plural_name %>").html(@view.render().el)
20
-
21
- show: (id) ->
22
- <%= singular_name %> = @<%= plural_name %>.get(id)
23
-
24
- @view = new <%= "#{view_namespace}.ShowView(model: #{singular_name})" %>
25
- $("#<%= plural_name %>").html(@view.render().el)
26
-
27
- edit: (id) ->
28
- <%= singular_name %> = @<%= plural_name %>.get(id)
29
-
30
- @view = new <%= "#{view_namespace}.EditView(model: #{singular_name})" %>
31
- $("#<%= plural_name %>").html(@view.render().el)
@@ -1,21 +0,0 @@
1
- <h1>Edit <%= singular_table_name %></h1>
2
-
3
- <form id="edit-<%= singular_table_name %>" name="<%= singular_table_name %>">
4
- <div class="field">
5
- <label for="name">Name:</label>
6
- <input type="text" name="name" id="name" value="<%%= name %>" >
7
- </div>
8
- <% attributes.each do |attribute| -%>
9
- <div class="field">
10
- <label for="<%= attribute.name %>"> <%= attribute.human_name %>:</label>
11
- <input type="text" name="<%= attribute.name %>" id="<%= attribute.name %>" value="<%%= <%= attribute.name %> %>" >
12
- </div>
13
-
14
- <% end -%>
15
- <div class="actions">
16
- <input type="submit" value="Update <%= human_name %>" />
17
- </div>
18
-
19
- </form>
20
-
21
- <a href="#/">Back</a>
@@ -1,17 +0,0 @@
1
- <h1>Listing <%= plural_table_name %></h1>
2
-
3
- <table id="<%= plural_name %>-table">
4
- <tr>
5
- <th>Name</th>
6
- <% attributes.each do |attribute| -%>
7
- <th><%= attribute.human_name %></th>
8
- <% end -%>
9
- <th></th>
10
- <th></th>
11
- <th></th>
12
- </tr>
13
- </table>
14
-
15
- <br/>
16
-
17
- <a href="#/new">New <%= human_name %></a>
@@ -1,8 +0,0 @@
1
- <td><%%= name %></td>
2
- <% attributes.each do |attribute| -%>
3
- <td><%%= <%= attribute.name %> %></td>
4
- <% end -%>
5
-
6
- <td><a href="#/<%%= _id %>">Show</td>
7
- <td><a href="#/<%%= _id %>/edit">Edit</td>
8
- <td><a href="#/<%%= _id %>/destroy" class="destroy">Destroy</a></td>
@@ -1,21 +0,0 @@
1
- <h1>New <%= singular_table_name %></h1>
2
-
3
- <form id="new-<%= singular_table_name %>" name="<%= singular_table_name %>">
4
- <div class="field">
5
- <label for="name">Name:</label>
6
- <input type="text" name="name" id="name" value="<%%= name %>" >
7
- </div>
8
- <% attributes.each do |attribute| -%>
9
- <div class="field">
10
- <label for="<%= attribute.name %>"> <%= attribute.human_name %>:</label>
11
- <input type="text" name="<%= attribute.name %>" id="<%= attribute.name %>" value="<%%= <%= attribute.name %> %>" >
12
- </div>
13
-
14
- <% end -%>
15
- <div class="actions">
16
- <input type="submit" value="Create <%= human_name %>" />
17
- </div>
18
-
19
- </form>
20
-
21
- <a href="#/">Back</a>
@@ -1,14 +0,0 @@
1
- <p>
2
- <b>Name:</b>
3
- <%%= name %>
4
- </p>
5
-
6
- <% attributes.each do |attribute| -%>
7
- <p>
8
- <b><%= attribute.human_name %>:</b>
9
- <%%= <%= attribute.name %> %>
10
- </p>
11
-
12
- <% end -%>
13
-
14
- <a href="#/">Back</a>
@@ -1,24 +0,0 @@
1
- <%= view_namespace %> ||= {}
2
-
3
- class <%= view_namespace %>.EditView extends Backbone.View
4
- template: JST["<%= jst 'edit' %>"]
5
-
6
- events:
7
- "submit #edit-<%= singular_name %>": "update"
8
-
9
- update: (e) ->
10
- e.preventDefault()
11
- e.stopPropagation()
12
-
13
- @model.save(null,
14
- success: (<%= singular_name %>) =>
15
- @model = <%= singular_name %>
16
- window.location.hash = "/#{@model.id}"
17
- )
18
-
19
- render: ->
20
- @$el.html(@template(@model.toJSON() ))
21
-
22
- this.$("form").backboneLink(@model)
23
-
24
- return this
@@ -1,20 +0,0 @@
1
- <%= view_namespace %> ||= {}
2
-
3
- class <%= view_namespace %>.IndexView extends Backbone.View
4
- template: JST["<%= jst 'index' %>"]
5
-
6
- initialize: () ->
7
- @options.<%= plural_model_name %>.bind('reset', @addAll)
8
-
9
- addAll: () =>
10
- @options.<%= plural_model_name %>.each(@addOne)
11
-
12
- addOne: (<%= singular_model_name %>) =>
13
- view = new <%= view_namespace %>.<%= singular_name.camelize %>View({model : <%= singular_model_name %>})
14
- @$("tbody").append(view.render().el)
15
-
16
- render: =>
17
- @$el.html(@template(<%= plural_model_name %>: @options.<%= plural_model_name %>.toJSON() ))
18
- @addAll()
19
-
20
- return this
@@ -1,19 +0,0 @@
1
- <%= view_namespace %> ||= {}
2
-
3
- class <%= view_namespace %>.<%= singular_name.camelize %>View extends Backbone.View
4
- template: JST["<%= jst singular_name %>"]
5
-
6
- events:
7
- "click .destroy" : "destroy"
8
-
9
- tagName: "tr"
10
-
11
- destroy: () ->
12
- @model.destroy()
13
- this.remove()
14
-
15
- return false
16
-
17
- render: ->
18
- @$el.html(@template(@model.toJSON() ))
19
- return this
@@ -1,37 +0,0 @@
1
- <%= view_namespace %> ||= {}
2
-
3
- class <%= view_namespace %>.NewView extends Backbone.View
4
- template: JST["<%= jst 'new' %>"]
5
-
6
- events:
7
- "submit #new-<%= singular_name %>": "save"
8
-
9
- constructor: (options) ->
10
- super(options)
11
- @model = new @collection.model()
12
-
13
- @model.bind("change:errors", () =>
14
- this.render()
15
- )
16
-
17
- save: (e) ->
18
- e.preventDefault()
19
- e.stopPropagation()
20
-
21
- @model.unset("errors")
22
-
23
- @collection.create(@model.toJSON(),
24
- success: (<%= singular_name %>) =>
25
- @model = <%= singular_name %>
26
- window.location.hash = "/#{@model.id}"
27
-
28
- error: (<%= singular_name %>, jqXHR) =>
29
- @model.set({errors: $.parseJSON(jqXHR.responseText)})
30
- )
31
-
32
- render: ->
33
- @$el.html(@template(@model.toJSON() ))
34
-
35
- this.$("form").backboneLink(@model)
36
-
37
- return this
@@ -1,8 +0,0 @@
1
- <%= view_namespace %> ||= {}
2
-
3
- class <%= view_namespace %>.ShowView extends Backbone.View
4
- template: JST["<%= jst 'show' %>"]
5
-
6
- render: ->
7
- @$el.html(@template(@model.toJSON() ))
8
- return this
@@ -1,6 +0,0 @@
1
- <script type="text/javascript">
2
- $(function() {
3
- window.router = new <%= router_namespace %>Router;
4
- Backbone.history.start();
5
- });
6
- </script>