page_engine 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (162) hide show
  1. data/README.markdown +43 -33
  2. data/Rakefile +0 -13
  3. data/app/assets/javascripts/page_engine.js +36 -9
  4. data/app/assets/stylesheets/page_engine.css +0 -224
  5. data/app/controllers/admin/page_snippets_controller.rb +1 -3
  6. data/app/controllers/admin/pages_controller.rb +7 -6
  7. data/app/helpers/pages_helper.rb +29 -16
  8. data/app/models/page.rb +25 -34
  9. data/app/models/page_role.rb +7 -5
  10. data/app/views/admin/page_snippets/_form.html.haml +2 -2
  11. data/app/views/admin/pages/_form.html.haml +13 -11
  12. data/app/views/admin/pages/_page_part_fields.html.haml +2 -4
  13. data/db/seed.rb +1 -6
  14. data/lib/generators/page_engine/install/install_generator.rb +10 -10
  15. data/lib/generators/page_engine/templates/page_engine.rb +34 -0
  16. data/lib/page_engine.rb +59 -18
  17. data/lib/page_engine/extensions.rb +1 -15
  18. data/lib/page_engine/instance_methods.rb +14 -10
  19. data/lib/page_engine/version.rb +3 -0
  20. data/{vendor → spec/dummy/app}/assets/images/jquery-ui/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  21. data/{vendor → spec/dummy/app}/assets/images/jquery-ui/ui-bg_flat_75_ffffff_40x100.png +0 -0
  22. data/{vendor → spec/dummy/app}/assets/images/jquery-ui/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  23. data/{vendor → spec/dummy/app}/assets/images/jquery-ui/ui-bg_glass_65_ffffff_1x400.png +0 -0
  24. data/{vendor → spec/dummy/app}/assets/images/jquery-ui/ui-bg_glass_75_dadada_1x400.png +0 -0
  25. data/{vendor → spec/dummy/app}/assets/images/jquery-ui/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  26. data/{vendor → spec/dummy/app}/assets/images/jquery-ui/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  27. data/{vendor → spec/dummy/app}/assets/images/jquery-ui/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  28. data/{vendor → spec/dummy/app}/assets/images/jquery-ui/ui-icons_222222_256x240.png +0 -0
  29. data/{vendor → spec/dummy/app}/assets/images/jquery-ui/ui-icons_2e83ff_256x240.png +0 -0
  30. data/{vendor → spec/dummy/app}/assets/images/jquery-ui/ui-icons_454545_256x240.png +0 -0
  31. data/{vendor → spec/dummy/app}/assets/images/jquery-ui/ui-icons_888888_256x240.png +0 -0
  32. data/{vendor → spec/dummy/app}/assets/images/jquery-ui/ui-icons_cd0a0a_256x240.png +0 -0
  33. data/{app → spec/dummy/app}/assets/images/page_engine/add.png +0 -0
  34. data/{app → spec/dummy/app}/assets/images/page_engine/bullet_add.png +0 -0
  35. data/{app → spec/dummy/app}/assets/images/page_engine/bullet_go.png +0 -0
  36. data/{app → spec/dummy/app}/assets/images/page_engine/delete.png +0 -0
  37. data/{app → spec/dummy/app}/assets/images/page_engine/page_add.png +0 -0
  38. data/{app → spec/dummy/app}/assets/images/page_engine/page_copy.png +0 -0
  39. data/{app → spec/dummy/app}/assets/images/page_engine/page_delete.png +0 -0
  40. data/{app → spec/dummy/app}/assets/images/page_engine/page_edit.png +0 -0
  41. data/{app → spec/dummy/app}/assets/images/page_engine/page_gear.png +0 -0
  42. data/{app → spec/dummy/app}/assets/images/page_engine/page_green.png +0 -0
  43. data/{app → spec/dummy/app}/assets/images/page_engine/page_hidden.png +0 -0
  44. data/{app → spec/dummy/app}/assets/images/page_engine/page_lightning.png +0 -0
  45. data/{app → spec/dummy/app}/assets/images/page_engine/page_line.jpg +0 -0
  46. data/{app → spec/dummy/app}/assets/images/page_engine/page_red.png +0 -0
  47. data/{app → spec/dummy/app}/assets/images/page_engine/pencil.png +0 -0
  48. data/{app → spec/dummy/app}/assets/images/page_engine/waiting.gif +0 -0
  49. data/{app → spec/dummy/app}/assets/images/page_engine/zoom.png +0 -0
  50. data/spec/dummy/app/assets/stylesheets/application.css +133 -2
  51. data/{app → spec/dummy/app}/assets/stylesheets/jquery-ui.css +0 -0
  52. data/spec/dummy/app/controllers/application_controller.rb +17 -0
  53. data/spec/dummy/app/models/odd_role.rb +5 -0
  54. data/spec/dummy/app/models/weird_user.rb +8 -0
  55. data/spec/dummy/app/views/layouts/admin/application.html.haml +15 -0
  56. data/spec/dummy/app/views/layouts/trouble.html.haml +29 -0
  57. data/spec/dummy/config/initializers/page_engine.rb +25 -4
  58. data/spec/dummy/db/development.sqlite3 +0 -0
  59. data/spec/dummy/db/migrate/20111002171742_add_odd_roles.rb +16 -0
  60. data/spec/dummy/db/migrate/20111002230859_add_users.rb +21 -0
  61. data/spec/dummy/db/schema.rb +14 -1
  62. data/spec/dummy/log/development.log +24264 -0
  63. data/spec/dummy/tmp/cache/assets/C1F/4A0/sprockets%2Fb257125f39b2a708d678262f26152408 +0 -0
  64. data/spec/dummy/tmp/cache/assets/C4A/E50/sprockets%2Ff1447b533430f0b0366994087c742f1a +0 -0
  65. data/spec/dummy/tmp/cache/assets/C50/9E0/sprockets%2F5273207c05e438fab77180339ef07418 +0 -0
  66. data/spec/dummy/tmp/cache/assets/C5C/BA0/sprockets%2Fe97992f1040b2aa956168498b5e56142 +0 -0
  67. data/spec/dummy/tmp/cache/assets/C83/E20/sprockets%2F2d6f03d170965f27d7626502373e8cd2 +0 -0
  68. data/spec/dummy/tmp/cache/assets/CAA/DD0/sprockets%2F45aba9186167d40fb01c6213bd693559 +0 -0
  69. data/spec/dummy/tmp/cache/assets/CB1/EE0/sprockets%2F9610f802b5b028336d81cf3f019e7e66 +0 -0
  70. data/spec/dummy/tmp/cache/assets/CB8/880/sprockets%2F3b651a5763758db2fc0347488e69a3e1 +0 -0
  71. data/spec/dummy/tmp/cache/assets/CBA/0A0/sprockets%2F2983f7dd6130a7c24892da333c18d779 +0 -0
  72. data/spec/dummy/tmp/cache/assets/CBC/870/sprockets%2Fd85b473139826715974f58b6a6aa29aa +0 -0
  73. data/spec/dummy/tmp/cache/assets/CD1/EB0/sprockets%2Fba17700b36ee975c05d06042a6af9631 +0 -0
  74. data/spec/dummy/tmp/cache/assets/CDA/A30/sprockets%2Fd1a7692303d59c495dd61cd1d41246b5 +0 -0
  75. data/spec/dummy/tmp/cache/assets/CE0/CD0/sprockets%2Fd206c4ec51748382823dee1e7f28055a +0 -0
  76. data/spec/dummy/tmp/cache/assets/CE3/C10/sprockets%2F05a63f093f971cd73662695fab452b0f +0 -0
  77. data/spec/dummy/tmp/cache/assets/CE7/5E0/sprockets%2F520141de9bf7351de829ee484b761d37 +0 -0
  78. data/spec/dummy/tmp/cache/assets/CEE/2B0/sprockets%2F75f58ee42279991f91ac43260b9b0fe3 +0 -0
  79. data/spec/dummy/tmp/cache/assets/CF3/CF0/sprockets%2Fb9232c5dfbe22949e8559fc03898242e +0 -0
  80. data/spec/dummy/tmp/cache/assets/CF8/730/sprockets%2F2e8b471c690843c889c86cef3273fd19 +0 -0
  81. data/spec/dummy/tmp/cache/assets/D04/230/sprockets%2F3081bc655eafedc2c77018c5b9000385 +0 -0
  82. data/spec/dummy/tmp/cache/assets/D0B/B40/sprockets%2Fb7d60dd0218956953d1afbb4d6d95220 +0 -0
  83. data/spec/dummy/tmp/cache/assets/D0D/000/sprockets%2Fbb689a9183e1482be8c02ab4f536083b +0 -0
  84. data/spec/dummy/tmp/cache/assets/D0D/3C0/sprockets%2F09db8b6dc9be3a7645321407ecf74313 +0 -0
  85. data/spec/dummy/tmp/cache/assets/D10/500/sprockets%2F14244cebaa065f6e0c461f88521d89e7 +0 -0
  86. data/spec/dummy/tmp/cache/assets/D13/FF0/sprockets%2Fd62e2814c718d1a22c84c7b3a78eb948 +0 -0
  87. data/spec/dummy/tmp/cache/assets/D1A/140/sprockets%2Fe5dbcc46887452182b85e8da04994ea0 +0 -0
  88. data/spec/dummy/tmp/cache/assets/D1B/490/sprockets%2Fe37c84afab109b736f593d271f94916c +0 -0
  89. data/spec/dummy/tmp/cache/assets/D22/630/sprockets%2F96268b95a26ee16a7b2d169e78af38c4 +0 -0
  90. data/spec/dummy/tmp/cache/assets/D27/2F0/sprockets%2F6b6e52b5006574d3fef8d34ef639978d +0 -0
  91. data/spec/dummy/tmp/cache/assets/D2F/D10/sprockets%2Fdcfcecea73a06520b314144da9180748 +0 -0
  92. data/spec/dummy/tmp/cache/assets/D30/ED0/sprockets%2Fea74cc14e1532ac70f928d8d205c5a13 +0 -0
  93. data/spec/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
  94. data/spec/dummy/tmp/cache/assets/D35/4A0/sprockets%2F1b20d80f1d472f213983c30fc7a8d8ad +0 -0
  95. data/spec/dummy/tmp/cache/assets/D3B/4D0/sprockets%2Faf8a08611a00ade8c7f16d626708eb67 +0 -0
  96. data/spec/dummy/tmp/cache/assets/D3B/BA0/sprockets%2F7b8e66f1a87012c23d18d5c80a518adf +0 -0
  97. data/spec/dummy/tmp/cache/assets/D3D/A00/sprockets%2Fe3c096ab6843a7f814bebf45b743316b +0 -0
  98. data/spec/dummy/tmp/cache/assets/D3F/1E0/sprockets%2F39fbfd2f4caf4d71b4232cf516175574 +0 -0
  99. data/spec/dummy/tmp/cache/assets/D40/720/sprockets%2Fe798537f2ae8abbbac509070c9e06506 +0 -0
  100. data/spec/dummy/tmp/cache/assets/D40/A70/sprockets%2Fffa6c67811911b1a6624281ce7e7dea6 +0 -0
  101. data/spec/dummy/tmp/cache/assets/D47/1D0/sprockets%2F904ef275b101c77ee529b4fe7cf323f7 +0 -0
  102. data/spec/dummy/tmp/cache/assets/D4C/EE0/sprockets%2F7ee487bf0d625668f3fcb075c89a420d +0 -0
  103. data/spec/dummy/tmp/cache/assets/D4D/6A0/sprockets%2F34ff66b81d54df8b855b5ad0609d384f +0 -0
  104. data/spec/dummy/tmp/cache/assets/D52/ED0/sprockets%2F7d4cc173f38eb1746547ac686f80ffd6 +0 -0
  105. data/spec/dummy/tmp/cache/assets/D54/ED0/sprockets%2F71c9fa01091d432b131da3bb73faf3d4 +0 -0
  106. data/spec/dummy/tmp/cache/assets/D58/450/sprockets%2F9bdf9046afa29f99222ffadf85572089 +0 -0
  107. data/spec/dummy/tmp/cache/assets/D58/B30/sprockets%2F211e7cc7898367fb09c489d4a8ccdd59 +0 -0
  108. data/spec/dummy/tmp/cache/assets/D59/BE0/sprockets%2Fb60619702caaaa748c6404a3a05fa7fc +0 -0
  109. data/spec/dummy/tmp/cache/assets/D5D/740/sprockets%2F7cfc90aad94f2822a4ce02701ca834b2 +0 -0
  110. data/spec/dummy/tmp/cache/assets/D63/F80/sprockets%2F9e27b3ca9c333b4cac10427d5524f3df +0 -0
  111. data/spec/dummy/tmp/cache/assets/D67/0C0/sprockets%2Fee349089edd8715f0039b0a1dd4fba30 +0 -0
  112. data/spec/dummy/tmp/cache/assets/D69/7E0/sprockets%2F95dc7c01f25afc8afc40e4353395cb15 +0 -0
  113. data/spec/dummy/tmp/cache/assets/D69/910/sprockets%2F05abeb33740bac77bef60b5445695c8c +0 -0
  114. data/spec/dummy/tmp/cache/assets/D6B/E70/sprockets%2F30cda0697c0ea9dc88d4aa885d00582c +0 -0
  115. data/spec/dummy/tmp/cache/assets/D6C/7E0/sprockets%2Fd3abe581052fc2ffd33b9f465b477b14 +0 -0
  116. data/spec/dummy/tmp/cache/assets/D70/280/sprockets%2F99a543e2b6be1d37c3ccc8a90261f87a +0 -0
  117. data/spec/dummy/tmp/cache/assets/D70/730/sprockets%2F626ce09065ee0bde629097e4a3e9faa1 +0 -0
  118. data/spec/dummy/tmp/cache/assets/D70/B60/sprockets%2F79c6e65f6ae3ca5d1f2791e304a6e4b1 +0 -0
  119. data/spec/dummy/tmp/cache/assets/D73/830/sprockets%2F38d93d829b7d163c372f3acd557c2eab +0 -0
  120. data/spec/dummy/tmp/cache/assets/D74/120/sprockets%2Ffbe442bef82371edd6525fe5622de319 +0 -0
  121. data/spec/dummy/tmp/cache/assets/D76/270/sprockets%2F7fa38bbc51591249e64f86df7da17d0a +0 -0
  122. data/spec/dummy/tmp/cache/assets/D76/F30/sprockets%2Fe47ed642049b57cdf8b9a48b00a9c7e2 +0 -0
  123. data/spec/dummy/tmp/cache/assets/D77/7C0/sprockets%2Fcf660249e6eb81370e70cfe24d771dfe +0 -0
  124. data/spec/dummy/tmp/cache/assets/D7A/710/sprockets%2F082db977dca9043b3cf64dd7b9a1799b +0 -0
  125. data/spec/dummy/tmp/cache/assets/D7C/660/sprockets%2Fbb4ce966494c0b544c7ea5f4e9c2b866 +0 -0
  126. data/spec/dummy/tmp/cache/assets/D7E/BE0/sprockets%2F336d946cd6267eee56681fcee16faa71 +0 -0
  127. data/spec/dummy/tmp/cache/assets/D84/210/sprockets%2Fabd0103ccec2b428ac62c94e4c40b384 +0 -0
  128. data/spec/dummy/tmp/cache/assets/D87/FA0/sprockets%2Fed7ffae98375a3c9819ee641f00e388d +0 -0
  129. data/spec/dummy/tmp/cache/assets/D89/AA0/sprockets%2Fd214a96f1dca3c24f09149acd0acb390 +0 -0
  130. data/spec/dummy/tmp/cache/assets/D92/E50/sprockets%2F09a8ce459d99efe497507cad2ed88f56 +0 -0
  131. data/spec/dummy/tmp/cache/assets/D93/670/sprockets%2Fdf4cd8447459d7b31b077d0af7aba00b +0 -0
  132. data/spec/dummy/tmp/cache/assets/D96/510/sprockets%2F400b6fa7eb374fe27379be14bfb5ad13 +0 -0
  133. data/spec/dummy/tmp/cache/assets/D96/AE0/sprockets%2F6c450fd116d891f54a32bcfcbd4b762b +0 -0
  134. data/spec/dummy/tmp/cache/assets/D99/2A0/sprockets%2Fb758a4b47a5ef2e0a7c21478d0ca48ec +0 -0
  135. data/spec/dummy/tmp/cache/assets/D9A/F50/sprockets%2Fbd3168f97958b4fceaccd13f33aa2412 +0 -0
  136. data/spec/dummy/tmp/cache/assets/D9D/5E0/sprockets%2F405561b1dd3d76d9f2e1fcb0fd45c9f2 +0 -0
  137. data/spec/dummy/tmp/cache/assets/DA0/940/sprockets%2F9e3e91e2e1bee749a3a7b2ac62eb5294 +0 -0
  138. data/spec/dummy/tmp/cache/assets/DA2/0E0/sprockets%2F71a404ff712a059b23edee96c9bfcd75 +0 -0
  139. data/spec/dummy/tmp/cache/assets/DA2/410/sprockets%2F536cbf8fb330ef944baf1d7e45364fa4 +0 -0
  140. data/spec/dummy/tmp/cache/assets/DA6/860/sprockets%2Ff5526cc6647cdd14b05aed999377abbc +0 -0
  141. data/spec/dummy/tmp/cache/assets/DA7/5F0/sprockets%2Fe92688bcadd7fcddd86227c04b9712e1 +0 -0
  142. data/spec/dummy/tmp/cache/assets/DAB/C00/sprockets%2Fe755d63d3a434bd07ffc887af6aca398 +0 -0
  143. data/spec/dummy/tmp/cache/assets/DAB/E90/sprockets%2F7c1bf428eb83b9b91e619f5ae6cd3e73 +0 -0
  144. data/spec/dummy/tmp/cache/assets/DAF/F20/sprockets%2Ffefb6dc410d3c50be89565fb3e8e3788 +0 -0
  145. data/spec/dummy/tmp/cache/assets/DC6/630/sprockets%2F3098ccedf5502a0cd6e25aaeb8e9e232 +0 -0
  146. data/spec/dummy/tmp/cache/assets/DCA/BB0/sprockets%2F1a792cae50966aef0d0d4131fe5fafd9 +0 -0
  147. data/spec/dummy/tmp/cache/assets/DD9/E90/sprockets%2Fd44526e0ec17dcbbccf7e14db768e869 +0 -0
  148. data/spec/dummy/tmp/cache/assets/DDC/270/sprockets%2Fadb8f369db4f8784c76fd2ee1d3633ac +0 -0
  149. data/spec/dummy/tmp/cache/assets/DDE/420/sprockets%2F69cf180e779eb3095cebe85edbfc22b7 +0 -0
  150. data/spec/dummy/tmp/cache/assets/DE0/250/sprockets%2F1559ff83d17dd6b788d6ab7fada65ee1 +0 -0
  151. data/spec/dummy/tmp/cache/assets/DE1/B40/sprockets%2F9c7deec5e90b5957c6d5b31ded7fe074 +0 -0
  152. data/spec/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
  153. data/spec/dummy/tmp/cache/assets/E17/820/sprockets%2F37aabaff64eddfc141bc07013ad183fc +0 -0
  154. data/spec/dummy/tmp/cache/assets/E32/C40/sprockets%2Faade2bb8a94be3f057fe7d4a6fd65a84 +0 -0
  155. data/spec/dummy/tmp/cache/assets/E59/310/sprockets%2Fbc56e556d3e7aae7c8bf341d3dcea2bd +0 -0
  156. data/spec/dummy/tmp/cache/assets/E70/2B0/sprockets%2F7eedcfada8bf8bff28c96d9ea93521d3 +0 -0
  157. data/spec/dummy/tmp/cache/assets/E8B/160/sprockets%2Fe6d7a8c67d36fddcd9aaa40e10ade4ee +0 -0
  158. data/spec/dummy/tmp/cache/assets/E95/DC0/sprockets%2F7f2f99b25afac7fbe91a83f0cebcbcd8 +0 -0
  159. data/spec/dummy/tmp/pids/server.pid +1 -1
  160. metadata +465 -354
  161. data/app/views/layouts/admin.html.haml +0 -20
  162. data/lib/page_engine/routes_finder.rb +0 -23
@@ -1,20 +0,0 @@
1
- !!!
2
- %html
3
- %head
4
- %title PageEngine Admin
5
- - if Rails.version.split('.')[1] == '1'
6
- = stylesheet_link_tag "application"
7
- = javascript_include_tag "application"
8
- = csrf_meta_tags
9
- - else
10
- = stylesheet_link_tag :page_engine
11
- = javascript_include_tag 'jquery.min', :page_engine
12
- = csrf_meta_tag
13
- %body
14
-
15
- %ul#nav
16
- %li= link_to('Pages', admin_pages_path)
17
- %li= link_to('Page snippets', admin_page_snippets_path)
18
-
19
- #content
20
- = yield
@@ -1,23 +0,0 @@
1
- module PageEngine
2
- class RoutesFinder
3
- def self.available
4
- available = {}
5
-
6
- Rails.application.routes.routes.each do |route|
7
- unless route.requirements.empty?
8
- unless ['DELETE'].include?(route.verb.to_s) || route.requirements[:controller].match(/^admin.*/) || ['delete', :delete].include?(route.requirements[:method].to_s)
9
- available[route.requirements[:controller]] = [] unless available[route.requirements[:controller]]
10
- unless route.requirements[:controller] == 'pages' && route.requirements[:action] == 'show'
11
- available[route.requirements[:controller]] << route.requirements[:action] unless available[route.requirements[:controller]].include?(route.requirements[:action])
12
- end
13
- end
14
-
15
- end
16
- end
17
-
18
- available.delete('rails/info')
19
- available
20
- end
21
- end
22
- end
23
-