constructor-cms 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (305) hide show
  1. data/.idea/.name +1 -0
  2. data/.idea/constructor.iml +62 -0
  3. data/.idea/encodings.xml +5 -0
  4. data/.idea/misc.xml +5 -0
  5. data/.idea/modules.xml +9 -0
  6. data/.idea/scopes/scope_settings.xml +5 -0
  7. data/.idea/vcs.xml +7 -0
  8. data/.idea/workspace.xml +873 -0
  9. data/.rspec +2 -0
  10. data/cap/app/assets/images/constructor_cap/cross.png +0 -0
  11. data/cap/app/assets/images/constructor_cap/page_white_edit.png +0 -0
  12. data/cap/app/controllers/constructor_cap/emails_controller.rb +71 -0
  13. data/cap/app/models/constructor_cap/email.rb +15 -0
  14. data/cap/app/views/constructor_cap/emails/_form.haml +17 -0
  15. data/cap/app/views/constructor_cap/emails/edit.haml +5 -0
  16. data/cap/app/views/constructor_cap/emails/index.haml +27 -0
  17. data/cap/app/views/constructor_cap/emails/new.haml +5 -0
  18. data/cap/app/views/constructor_cap/emails/show.haml +54 -0
  19. data/cap/config/initializers/admin_menu.rb +4 -0
  20. data/cap/config/locales/ru.yml +23 -0
  21. data/cap/config/routes.rb +9 -0
  22. data/cap/constructor-cap.gemspec +19 -0
  23. data/cap/db/migrate/20110510182404_create_emails.rb +12 -0
  24. data/cap/lib/constructor-cap.rb +2 -0
  25. data/cap/lib/constructor_cap/engine.rb +6 -0
  26. data/config/routes.rb +4 -0
  27. data/constructor-cms.gemspec +21 -0
  28. data/core/app/assets/images/constructor_core/glyphicons-halflings-white.png +0 -0
  29. data/core/app/assets/images/constructor_core/glyphicons-halflings.png +0 -0
  30. data/core/app/assets/images/constructor_core/minus.gif +0 -0
  31. data/core/app/assets/images/constructor_core/plus.gif +0 -0
  32. data/core/app/assets/images/constructor_core/rss.png +0 -0
  33. data/core/app/assets/images/constructor_core/treeview-black-line.gif +0 -0
  34. data/core/app/assets/images/constructor_core/treeview-black.gif +0 -0
  35. data/core/app/assets/images/constructor_core/treeview-default-line.gif +0 -0
  36. data/core/app/assets/images/constructor_core/treeview-default.gif +0 -0
  37. data/core/app/assets/images/constructor_core/treeview-famfamfam-line.gif +0 -0
  38. data/core/app/assets/images/constructor_core/treeview-famfamfam.gif +0 -0
  39. data/core/app/assets/images/constructor_core/treeview-gray-line.gif +0 -0
  40. data/core/app/assets/images/constructor_core/treeview-gray.gif +0 -0
  41. data/core/app/assets/images/constructor_core/treeview-red-line.gif +0 -0
  42. data/core/app/assets/images/constructor_core/treeview-red.gif +0 -0
  43. data/core/app/assets/images/constructor_core/twitter.png +0 -0
  44. data/core/app/assets/images/constructor_core/widgets.png +0 -0
  45. data/core/app/assets/javascripts/constructor_core/application.js.coffee +57 -0
  46. data/core/app/assets/javascripts/constructor_core/bootstrap.js +2276 -0
  47. data/core/app/assets/javascripts/constructor_core/jquery.cookie.js +92 -0
  48. data/core/app/assets/javascripts/constructor_core/jquery.treeview.js +256 -0
  49. data/core/app/assets/javascripts/constructor_core/jquery_bundle.js.coffee +4 -0
  50. data/core/app/assets/javascripts/constructor_core/urlify.js +82 -0
  51. data/core/app/assets/stylesheets/constructor_core/application.css.scss +57 -0
  52. data/core/app/assets/stylesheets/constructor_core/bootstrap-responsive.css +1109 -0
  53. data/core/app/assets/stylesheets/constructor_core/bootstrap.css +6158 -0
  54. data/core/app/assets/stylesheets/constructor_core/jquery.treeview.css +73 -0
  55. data/core/app/controllers/constructor_core/admin_controller.rb +6 -0
  56. data/core/app/controllers/constructor_core/sessions_controller.rb +15 -0
  57. data/core/app/helpers/constructor_core/devise_helper.rb +24 -0
  58. data/core/app/models/constructor_core/user.rb +10 -0
  59. data/core/app/views/constructor_core/devise/confirmations/new.html.haml +10 -0
  60. data/core/app/views/constructor_core/devise/mailer/confirmation_instructions.html.haml +5 -0
  61. data/core/app/views/constructor_core/devise/mailer/reset_password_instructions.html.haml +7 -0
  62. data/core/app/views/constructor_core/devise/mailer/unlock_instructions.html.haml +5 -0
  63. data/core/app/views/constructor_core/devise/passwords/edit.html.haml +21 -0
  64. data/core/app/views/constructor_core/devise/passwords/new.html.haml +13 -0
  65. data/core/app/views/constructor_core/devise/registrations/edit.html.haml +28 -0
  66. data/core/app/views/constructor_core/devise/registrations/new.html.haml +20 -0
  67. data/core/app/views/constructor_core/devise/shared/_links.html.haml +19 -0
  68. data/core/app/views/constructor_core/devise/unlocks/new.html.haml +9 -0
  69. data/core/app/views/constructor_core/sessions/new.html.haml +24 -0
  70. data/core/app/views/layouts/constructor_core/application_admin.haml +65 -0
  71. data/core/config/environments/production.rb +3 -0
  72. data/core/config/initializers/devise.rb +223 -0
  73. data/core/config/locales/devise.en.yml +56 -0
  74. data/core/config/locales/devise.ru.yml +52 -0
  75. data/core/config/locales/ru.yml +12 -0
  76. data/core/config/routes.rb +9 -0
  77. data/core/constructor-core.gemspec +16 -0
  78. data/core/db/migrate/1_devise_users.rb +56 -0
  79. data/core/db/migrate/2_add_default_user.rb +9 -0
  80. data/core/lib/constructor-core.rb +23 -0
  81. data/core/lib/constructor_core/engine.rb +6 -0
  82. data/core/spec/factories.rb +2 -0
  83. data/core/spec/lib/nav/group_spec.rb +61 -0
  84. data/core/spec/lib/nav/item_spec.rb +151 -0
  85. data/core/spec/lib/nav_lib_spec.rb +60 -0
  86. data/core/spec/spec_helper.rb +34 -0
  87. data/core/vendor/assets/javascripts/.gitkeep +0 -0
  88. data/core/vendor/assets/javascripts/ckeditor/ckeditor.js +913 -0
  89. data/core/vendor/assets/javascripts/ckeditor/config.js +38 -0
  90. data/core/vendor/assets/javascripts/ckeditor/lang/en.js +5 -0
  91. data/core/vendor/assets/javascripts/ckeditor/lang/ru.js +5 -0
  92. data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js +10 -0
  93. data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/_translationstatus.txt +25 -0
  94. data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ar.js +9 -0
  95. data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/bg.js +9 -0
  96. data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ca.js +9 -0
  97. data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/cs.js +10 -0
  98. data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/cy.js +9 -0
  99. data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/da.js +9 -0
  100. data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/de.js +10 -0
  101. data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/el.js +10 -0
  102. data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/en.js +9 -0
  103. data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/eo.js +10 -0
  104. data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/es.js +10 -0
  105. data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/et.js +9 -0
  106. data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/fa.js +9 -0
  107. data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/fi.js +10 -0
  108. data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/fr.js +10 -0
  109. data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/gu.js +9 -0
  110. data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/he.js +9 -0
  111. data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/hi.js +9 -0
  112. data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/hr.js +9 -0
  113. data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/hu.js +9 -0
  114. data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/it.js +10 -0
  115. data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ja.js +9 -0
  116. data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/km.js +9 -0
  117. data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ku.js +10 -0
  118. data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/lt.js +9 -0
  119. data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/lv.js +10 -0
  120. data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/mk.js +9 -0
  121. data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/mn.js +9 -0
  122. data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/nb.js +9 -0
  123. data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/nl.js +10 -0
  124. data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/no.js +9 -0
  125. data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/pl.js +10 -0
  126. data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/pt-br.js +9 -0
  127. data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/pt.js +9 -0
  128. data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ro.js +9 -0
  129. data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ru.js +9 -0
  130. data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/sk.js +10 -0
  131. data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/sl.js +9 -0
  132. data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/sv.js +10 -0
  133. data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/th.js +9 -0
  134. data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/tr.js +10 -0
  135. data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ug.js +9 -0
  136. data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/uk.js +9 -0
  137. data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/vi.js +9 -0
  138. data/core/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/zh-cn.js +7 -0
  139. data/core/vendor/assets/javascripts/ckeditor/plugins/about/dialogs/about.js +6 -0
  140. data/core/vendor/assets/javascripts/ckeditor/plugins/about/dialogs/logo_ckeditor.png +0 -0
  141. data/core/vendor/assets/javascripts/ckeditor/plugins/clipboard/dialogs/paste.js +11 -0
  142. data/core/vendor/assets/javascripts/ckeditor/plugins/colordialog/dialogs/colordialog.js +13 -0
  143. data/core/vendor/assets/javascripts/ckeditor/plugins/dialog/dialogDefinition.js +4 -0
  144. data/core/vendor/assets/javascripts/ckeditor/plugins/div/dialogs/div.js +9 -0
  145. data/core/vendor/assets/javascripts/ckeditor/plugins/fakeobjects/images/spacer.gif +0 -0
  146. data/core/vendor/assets/javascripts/ckeditor/plugins/find/dialogs/find.js +24 -0
  147. data/core/vendor/assets/javascripts/ckeditor/plugins/icons.png +0 -0
  148. data/core/vendor/assets/javascripts/ckeditor/plugins/iframe/dialogs/iframe.js +10 -0
  149. data/core/vendor/assets/javascripts/ckeditor/plugins/iframe/images/placeholder.png +0 -0
  150. data/core/vendor/assets/javascripts/ckeditor/plugins/image/dialogs/image.js +43 -0
  151. data/core/vendor/assets/javascripts/ckeditor/plugins/image/images/noimage.png +0 -0
  152. data/core/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/anchor.js +8 -0
  153. data/core/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/link.js +36 -0
  154. data/core/vendor/assets/javascripts/ckeditor/plugins/link/images/anchor.png +0 -0
  155. data/core/vendor/assets/javascripts/ckeditor/plugins/liststyle/dialogs/liststyle.js +10 -0
  156. data/core/vendor/assets/javascripts/ckeditor/plugins/magicline/images/icon.png +0 -0
  157. data/core/vendor/assets/javascripts/ckeditor/plugins/pastefromword/filter/default.js +31 -0
  158. data/core/vendor/assets/javascripts/ckeditor/plugins/preview/preview.html +10 -0
  159. data/core/vendor/assets/javascripts/ckeditor/plugins/scayt/LICENSE.md +28 -0
  160. data/core/vendor/assets/javascripts/ckeditor/plugins/scayt/README.md +25 -0
  161. data/core/vendor/assets/javascripts/ckeditor/plugins/scayt/dialogs/options.js +20 -0
  162. data/core/vendor/assets/javascripts/ckeditor/plugins/scayt/dialogs/toolbar.css +71 -0
  163. data/core/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_address.png +0 -0
  164. data/core/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_blockquote.png +0 -0
  165. data/core/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_div.png +0 -0
  166. data/core/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h1.png +0 -0
  167. data/core/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h2.png +0 -0
  168. data/core/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h3.png +0 -0
  169. data/core/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h4.png +0 -0
  170. data/core/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h5.png +0 -0
  171. data/core/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h6.png +0 -0
  172. data/core/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_p.png +0 -0
  173. data/core/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_pre.png +0 -0
  174. data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/_translationstatus.txt +20 -0
  175. data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/ca.js +13 -0
  176. data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/cs.js +13 -0
  177. data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/cy.js +14 -0
  178. data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/de.js +13 -0
  179. data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/el.js +13 -0
  180. data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/en.js +13 -0
  181. data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/eo.js +12 -0
  182. data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/et.js +13 -0
  183. data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/fa.js +12 -0
  184. data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/fi.js +13 -0
  185. data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/fr.js +11 -0
  186. data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/he.js +13 -0
  187. data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/hr.js +13 -0
  188. data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/it.js +14 -0
  189. data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/ku.js +13 -0
  190. data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/lv.js +13 -0
  191. data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/nb.js +11 -0
  192. data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/nl.js +13 -0
  193. data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/no.js +11 -0
  194. data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/pl.js +12 -0
  195. data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/pt-br.js +11 -0
  196. data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/sk.js +13 -0
  197. data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/sv.js +11 -0
  198. data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/th.js +13 -0
  199. data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/tr.js +12 -0
  200. data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/ug.js +13 -0
  201. data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/zh-cn.js +9 -0
  202. data/core/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/specialchar.js +14 -0
  203. data/core/vendor/assets/javascripts/ckeditor/plugins/table/dialogs/table.js +21 -0
  204. data/core/vendor/assets/javascripts/ckeditor/plugins/tabletools/dialogs/tableCell.js +16 -0
  205. data/core/vendor/assets/javascripts/ckeditor/plugins/templates/dialogs/templates.css +84 -0
  206. data/core/vendor/assets/javascripts/ckeditor/plugins/templates/dialogs/templates.js +10 -0
  207. data/core/vendor/assets/javascripts/ckeditor/plugins/templates/templates/default.js +6 -0
  208. data/core/vendor/assets/javascripts/ckeditor/plugins/templates/templates/images/template1.gif +0 -0
  209. data/core/vendor/assets/javascripts/ckeditor/plugins/templates/templates/images/template2.gif +0 -0
  210. data/core/vendor/assets/javascripts/ckeditor/plugins/templates/templates/images/template3.gif +0 -0
  211. data/core/vendor/assets/javascripts/ckeditor/plugins/wsc/LICENSE.md +28 -0
  212. data/core/vendor/assets/javascripts/ckeditor/plugins/wsc/README.md +25 -0
  213. data/core/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/ciframe.html +49 -0
  214. data/core/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/tmpFrameset.html +52 -0
  215. data/core/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.css +82 -0
  216. data/core/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.js +11 -0
  217. data/core/vendor/assets/javascripts/ckeditor/styles.js +111 -0
  218. data/core/vendor/assets/stylesheets/.gitkeep +0 -0
  219. data/core/vendor/assets/stylesheets/ckeditor/contents.css +103 -0
  220. data/core/vendor/assets/stylesheets/ckeditor/skins/moono/dialog.css +5 -0
  221. data/core/vendor/assets/stylesheets/ckeditor/skins/moono/dialog_ie.css +5 -0
  222. data/core/vendor/assets/stylesheets/ckeditor/skins/moono/dialog_ie7.css +5 -0
  223. data/core/vendor/assets/stylesheets/ckeditor/skins/moono/dialog_ie8.css +5 -0
  224. data/core/vendor/assets/stylesheets/ckeditor/skins/moono/dialog_opera.css +5 -0
  225. data/core/vendor/assets/stylesheets/ckeditor/skins/moono/editor.css +5 -0
  226. data/core/vendor/assets/stylesheets/ckeditor/skins/moono/editor_gecko.css +5 -0
  227. data/core/vendor/assets/stylesheets/ckeditor/skins/moono/editor_ie.css +5 -0
  228. data/core/vendor/assets/stylesheets/ckeditor/skins/moono/editor_ie7.css +5 -0
  229. data/core/vendor/assets/stylesheets/ckeditor/skins/moono/editor_ie8.css +5 -0
  230. data/core/vendor/assets/stylesheets/ckeditor/skins/moono/icons.png +0 -0
  231. data/core/vendor/assets/stylesheets/ckeditor/skins/moono/images/arrow.png +0 -0
  232. data/core/vendor/assets/stylesheets/ckeditor/skins/moono/images/close.png +0 -0
  233. data/core/vendor/assets/stylesheets/ckeditor/skins/moono/images/mini.png +0 -0
  234. data/core/vendor/assets/stylesheets/ckeditor/skins/moono/readme.md +51 -0
  235. data/lib/constructor/engine.rb +6 -0
  236. data/lib/constructor-cms.rb +3 -0
  237. data/pages/app/assets/images/constructor_pages/arrow_down.png +0 -0
  238. data/pages/app/assets/images/constructor_pages/arrow_up.png +0 -0
  239. data/pages/app/assets/images/constructor_pages/information.png +0 -0
  240. data/pages/app/assets/images/constructor_pages/page_white_edit.png +0 -0
  241. data/pages/app/assets/images/constructor_pages/photos.png +0 -0
  242. data/pages/app/controllers/constructor_pages/fields_controller.rb +60 -0
  243. data/pages/app/controllers/constructor_pages/pages_controller.rb +207 -0
  244. data/pages/app/controllers/constructor_pages/templates_controller.rb +71 -0
  245. data/pages/app/helpers/constructor_pages/fields_helper.rb +18 -0
  246. data/pages/app/helpers/constructor_pages/pages_helper.rb +15 -0
  247. data/pages/app/helpers/constructor_pages/templates_helper.rb +11 -0
  248. data/pages/app/models/constructor_pages/field.rb +60 -0
  249. data/pages/app/models/constructor_pages/page.rb +117 -0
  250. data/pages/app/models/constructor_pages/template.rb +30 -0
  251. data/pages/app/models/constructor_pages/types/boolean_type.rb +12 -0
  252. data/pages/app/models/constructor_pages/types/date_type.rb +16 -0
  253. data/pages/app/models/constructor_pages/types/float_type.rb +12 -0
  254. data/pages/app/models/constructor_pages/types/html_type.rb +12 -0
  255. data/pages/app/models/constructor_pages/types/image_type.rb +18 -0
  256. data/pages/app/models/constructor_pages/types/integer_type.rb +12 -0
  257. data/pages/app/models/constructor_pages/types/string_type.rb +12 -0
  258. data/pages/app/models/constructor_pages/types/text_type.rb +12 -0
  259. data/pages/app/views/constructor_pages/fields/_form.haml +28 -0
  260. data/pages/app/views/constructor_pages/fields/edit.haml +6 -0
  261. data/pages/app/views/constructor_pages/fields/new.haml +6 -0
  262. data/pages/app/views/constructor_pages/fields/types/_boolean.haml +1 -0
  263. data/pages/app/views/constructor_pages/fields/types/_date.haml +1 -0
  264. data/pages/app/views/constructor_pages/fields/types/_float.haml +1 -0
  265. data/pages/app/views/constructor_pages/fields/types/_html.haml +1 -0
  266. data/pages/app/views/constructor_pages/fields/types/_image.haml +4 -0
  267. data/pages/app/views/constructor_pages/fields/types/_integer.haml +1 -0
  268. data/pages/app/views/constructor_pages/fields/types/_string.haml +1 -0
  269. data/pages/app/views/constructor_pages/fields/types/_text.haml +1 -0
  270. data/pages/app/views/constructor_pages/pages/_breadcrumbs.haml +7 -0
  271. data/pages/app/views/constructor_pages/pages/_form.haml +98 -0
  272. data/pages/app/views/constructor_pages/pages/_menu.haml +8 -0
  273. data/pages/app/views/constructor_pages/pages/_submenu.haml +6 -0
  274. data/pages/app/views/constructor_pages/pages/edit.haml +6 -0
  275. data/pages/app/views/constructor_pages/pages/error_404.haml +23 -0
  276. data/pages/app/views/constructor_pages/pages/index.haml +50 -0
  277. data/pages/app/views/constructor_pages/pages/new.haml +6 -0
  278. data/pages/app/views/constructor_pages/pages/show.haml +5 -0
  279. data/pages/app/views/constructor_pages/pages/sitemap.haml +12 -0
  280. data/pages/app/views/constructor_pages/templates/_form.haml +48 -0
  281. data/pages/app/views/constructor_pages/templates/edit.haml +6 -0
  282. data/pages/app/views/constructor_pages/templates/index.haml +38 -0
  283. data/pages/app/views/constructor_pages/templates/new.haml +6 -0
  284. data/pages/config/initializers/dragonfly.rb +9 -0
  285. data/pages/config/locales/ru.yml +39 -0
  286. data/pages/config/routes.rb +34 -0
  287. data/pages/constructor-pages.gemspec +21 -0
  288. data/pages/db/migrate/10_create_html_types.rb +15 -0
  289. data/pages/db/migrate/11_create_image_types.rb +16 -0
  290. data/pages/db/migrate/12_add_default_template.rb +13 -0
  291. data/pages/db/migrate/1_create_pages.rb +27 -0
  292. data/pages/db/migrate/2_create_templates.rb +18 -0
  293. data/pages/db/migrate/3_create_fields.rb +17 -0
  294. data/pages/db/migrate/4_create_string_types.rb +15 -0
  295. data/pages/db/migrate/5_create_float_types.rb +15 -0
  296. data/pages/db/migrate/6_create_boolean_types.rb +15 -0
  297. data/pages/db/migrate/7_create_integer_types.rb +15 -0
  298. data/pages/db/migrate/8_create_text_types.rb +15 -0
  299. data/pages/db/migrate/9_create_date_types.rb +15 -0
  300. data/pages/lib/constructor-pages.rb +7 -0
  301. data/pages/lib/constructor_pages/engine.rb +6 -0
  302. data/pages/public/hello.txt +1 -0
  303. data/pages/spec/factories.rb +7 -0
  304. data/pages/spec/models/page_model_spec.rb +113 -0
  305. metadata +396 -0
@@ -0,0 +1,52 @@
1
+ ru:
2
+ errors:
3
+ messages:
4
+ not_found: "не найдена"
5
+ already_confirmed: "уже подтверждена. Пожалуйста, попробуйте войти в систему"
6
+ not_locked: "не заблокирована"
7
+ not_saved: ""
8
+ devise:
9
+ sessions:
10
+ link: 'Войти'
11
+ signed_in: 'Вы вошли.'
12
+ signed_out: 'Вы вышли.'
13
+ unauthenticated: 'Вы должны войти или зарегистрироваться, прежде чем сможете продолжить.'
14
+ unconfirmed: 'Вы должны подтвердить Ваш аккаунт, прежде чем сможете продолжить.'
15
+ locked: 'Ваш аккаунт заблокирован.'
16
+ invalid: 'Неверный пароль или email.'
17
+ invalid_token: 'Неверный ключ аутентификации.'
18
+ timeout: 'Ваша сессия закончена, пожалуйста, войдите еще раз, чтобы продолжить.'
19
+ inactive: 'Ваш аккаунт еще не активирован.'
20
+ passwords:
21
+ link: 'Забыли пароль?'
22
+ send_instructions: 'Вы получите email с инструкциями о том, как сбросить Ваш пароль, через несколько минут.'
23
+ updated: 'Ваш пароль изменен. Сейчас Вы можете войти.'
24
+ confirmations:
25
+ link: "Не получили иструкции для подтверждения аккаунта?"
26
+ send_instructions: 'Вы получите письмо с инструкциями о том, как подтвердить Ваш аккаунт.'
27
+ confirmed: 'Ваш аккаунт успешно подтвержден. Вы вошли.'
28
+ registrations:
29
+ link: 'Регистрация'
30
+ signed_up: 'Вы успешно зарегистрировались.'
31
+ updated: 'Ваш аккаунт изменен.'
32
+ destroyed: 'До свидания! Ваш аккаунт удален. Мы надеемся вскоре снова Вас увидеть.'
33
+ unlocks:
34
+ link: "Не получили инструкции для разблокировки аккаунта?"
35
+ send_instructions: 'Вы получите письмо с инструкциями о том, как разблокировать Ваш аккаунт, через несколько минут.'
36
+ unlocked: 'Ваш аккаунт разблокирован. Вы вошли.'
37
+ mailer:
38
+ confirmation_instructions: 'Инструкции для подтверждения'
39
+ reset_password_instructions: 'Инструкции для сброса пароля'
40
+ unlock_instructions: 'Инструкции для разблокировки'
41
+ failure:
42
+ unauthenticated: "Вам необходимо войти в систему или зарегистрироваться."
43
+ unconfirmed: "Вы должны подтвердить вашу учётную запись."
44
+ locked: "Ваша учётная запись заблокирована."
45
+ invalid: "Неверный адрес эл. почты или пароль."
46
+ invalid_token: "Неверный ключ аутентификации."
47
+ timeout: "Ваш сеанс закончился. Пожалуйста, войдите в систему снова."
48
+ inactive: "Ваша учётная запись ещё не активирована."
49
+ already_authenticated: "Вы уже вошли."
50
+ omniauth_callbacks:
51
+ success: 'Successfully authorized from %{kind} account.'
52
+ failure: 'Could not authorize you from %{kind} because "%{reason}".'
@@ -0,0 +1,12 @@
1
+ ru:
2
+ activerecord:
3
+ attributes:
4
+ constructor_core/user:
5
+ email: "Эл. почта"
6
+ password: "Пароль"
7
+ password_confirmation: "Пароль, еще раз"
8
+ remember_me: "Запомнить меня"
9
+ helpers:
10
+ submit:
11
+ create: "Добавить"
12
+ update: "Сохранить"
@@ -0,0 +1,9 @@
1
+ ConstructorCore::Engine.routes.draw do
2
+ get '/admin' => redirect('/admin/pages')
3
+
4
+ devise_for "constructor_core/users", :skip => [:sessions, :passwords] do
5
+ get '/login' => 'sessions#new'
6
+ post '/login' => 'sessions#create'
7
+ get '/logout' => 'sessions#destroy'
8
+ end
9
+ end
@@ -0,0 +1,16 @@
1
+ # encoding: utf-8
2
+
3
+ Gem::Specification.new do |s|
4
+ s.platform = Gem::Platform::RUBY
5
+ s.name = %q{constructor-core}
6
+ s.version = '0.2.1'
7
+ s.summary = %q{Default for Constructor}
8
+ s.authors = ['Ivan Zotov']
9
+ s.require_paths = %w(lib)
10
+
11
+ s.files = `git ls-files`.split("\n")
12
+ s.test_files = `git ls-files -- spec/*`.split("\n")
13
+ s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
14
+
15
+ s.add_dependency 'devise'
16
+ end
@@ -0,0 +1,56 @@
1
+ class DeviseUsers < ActiveRecord::Migration
2
+ def self.up
3
+ create_table ConstructorCore::User.table_name do |t|
4
+ ## Database authenticatable
5
+ t.string :email, :null => false, :default => ""
6
+ t.string :encrypted_password, :null => false, :default => ""
7
+
8
+ ## Recoverable
9
+ t.string :reset_password_token
10
+ t.datetime :reset_password_sent_at
11
+
12
+ ## Rememberable
13
+ t.datetime :remember_created_at
14
+
15
+ ## Trackable
16
+ t.integer :sign_in_count, :default => 0
17
+ t.datetime :current_sign_in_at
18
+ t.datetime :last_sign_in_at
19
+ t.string :current_sign_in_ip
20
+ t.string :last_sign_in_ip
21
+
22
+ ## Encryptable
23
+ # t.string :password_salt
24
+
25
+ ## Confirmable
26
+ # t.string :confirmation_token
27
+ # t.datetime :confirmed_at
28
+ # t.datetime :confirmation_sent_at
29
+ # t.string :unconfirmed_email # Only if using reconfirmable
30
+
31
+ ## Lockable
32
+ # t.integer :failed_attempts, :default => 0 # Only if lock strategy is :failed_attempts
33
+ # t.string :unlock_token # Only if unlock strategy is :email or :both
34
+ # t.datetime :locked_at
35
+
36
+ ## Token authenticatable
37
+ t.string :authentication_token
38
+
39
+
40
+ # Uncomment below if timestamps were not included in your original model.
41
+ # t.timestamps
42
+ end
43
+
44
+ add_index ConstructorCore::User.table_name, :email, :unique => true
45
+ add_index ConstructorCore::User.table_name, :reset_password_token, :unique => true
46
+ # add_index :users, :confirmation_token, :unique => true
47
+ # add_index :users, :unlock_token, :unique => true
48
+ # add_index :users, :authentication_token, :unique => true
49
+ end
50
+
51
+ def self.down
52
+ # By default, we don't want to make any assumption about how to roll back a migration when your
53
+ # model already existed. Please edit below which fields you would like to remove in this migration.
54
+ drop_table ConstructorCore::User.table_name
55
+ end
56
+ end
@@ -0,0 +1,9 @@
1
+ class AddDefaultUser < ActiveRecord::Migration
2
+ def self.up
3
+ ConstructorCore::User.create!(:email => "ivanzotov@gmail.com", :password => "123qweASD")
4
+ end
5
+
6
+ def self.down
7
+ ConstructorCore::User.delete_all
8
+ end
9
+ end
@@ -0,0 +1,23 @@
1
+ require 'devise'
2
+ require 'constructor_core/engine'
3
+
4
+ class String
5
+ def numeric?
6
+ return true if self =~ /^\d+$/
7
+ true if Float(self) rescue false
8
+ end
9
+
10
+ def boolean?
11
+ if self =~ (/(true|yes)$/i) || self =~ (/(false|no)$/i)
12
+ return true
13
+ else
14
+ return false
15
+ end
16
+ end
17
+
18
+ def to_bool
19
+ return true if self == true || self =~ (/(true|t|yes|y|1)$/i)
20
+ return false if self == false || self.blank? || self =~ (/(false|f|no|n|0)$/i)
21
+ raise ArgumentError.new("invalid value for Boolean: \"#{self}\"")
22
+ end
23
+ end
@@ -0,0 +1,6 @@
1
+ module ConstructorCore
2
+ class Engine < Rails::Engine
3
+ engine_name "constructor_core"
4
+ isolate_namespace ConstructorCore
5
+ end
6
+ end
@@ -0,0 +1,2 @@
1
+ FactoryGirl.define do
2
+ end
@@ -0,0 +1,61 @@
1
+ # encoding: utf-8
2
+
3
+ require 'spec_helper'
4
+
5
+ describe Nav::Group do
6
+ before :each do
7
+ @group = Nav::Group.new
8
+ @item = mock('Nav::Item')
9
+ end
10
+
11
+ describe "#items" do
12
+ it "read @items var" do
13
+ @group.instance_variable_set(:@items, "Hello world")
14
+ @group.items.should == "Hello world"
15
+ end
16
+
17
+ it "default is empty array" do
18
+ @group.instance_variable_get(:@items).should == []
19
+ end
20
+ end
21
+
22
+ describe "#add" do
23
+ context "when arg is Hash" do
24
+ it "create new item" do
25
+ Nav::Item.should_receive(:new).with(:name => "New item")
26
+ @group.add({:name => "New item"})
27
+ end
28
+
29
+ it "add created item to @items" do
30
+ Nav::Item.stub(:new).and_return(@item)
31
+ @group.add({:name => "New item"})
32
+ @group.instance_variable_get(:@items).should == [@item]
33
+ end
34
+ end
35
+
36
+ context "when arg is not Hash" do
37
+ it "add item to @items" do
38
+ @group.add(@item)
39
+ @group.instance_variable_get(:@items).should == [@item]
40
+ end
41
+ end
42
+
43
+ context "when multi-params given" do
44
+ it "add or create items" do
45
+ [@item, @item_2].each {|i| i = mock('Nav::Item') }
46
+
47
+ Nav::Item.should_receive(:new).with(:name => "New item").and_return(@item_2)
48
+ @group.add(@item, {:name => "New item"}, @item_3)
49
+
50
+ @group.instance_variable_get(:@items).should == [@item, @item_2, @item_3]
51
+ end
52
+ end
53
+ end
54
+
55
+ describe "#to_s" do
56
+ it "render joined items" do
57
+ @group.instance_variable_set(:@items, ["item", "item_2"])
58
+ @group.to_s.should == "itemitem_2"
59
+ end
60
+ end
61
+ end
@@ -0,0 +1,151 @@
1
+ # encoding: utf-8
2
+
3
+ require 'spec_helper'
4
+
5
+ describe Nav::Item do
6
+ describe "@@items" do
7
+ it "default is empty" do
8
+ Nav::Item.items.should == []
9
+ end
10
+
11
+ it "cattr_accessor :items" do
12
+ Nav::Item.items = ["items"]
13
+ Nav::Item.items.should == ["items"]
14
+ end
15
+ end
16
+
17
+ before :each do
18
+ Nav::Item.items.clear
19
+ end
20
+
21
+ describe "#initialize" do
22
+ context "when params not given" do
23
+ it "set @attrs default values" do
24
+ item = Nav::Item.new
25
+ item.instance_variable_get(:@attrs).should == {
26
+ :name => "New item",
27
+ :url => "/",
28
+ :options => {},
29
+ :active => false}
30
+ end
31
+ end
32
+
33
+ context "when params given" do
34
+ it "merge @attrs with params" do
35
+ item = Nav::Item.new(:name => "Another name", :url => '/another-url')
36
+ item.instance_variable_get(:@attrs).should == {
37
+ :name => "Another name",
38
+ :url => "/another-url",
39
+ :options => {},
40
+ :active => false}
41
+ end
42
+ end
43
+
44
+ context "when add is true (default)" do
45
+ it "add self to @@items" do
46
+ item = Nav::Item.new
47
+ Nav::Item.items.should == [item]
48
+ end
49
+ end
50
+
51
+ context "when add is false" do
52
+ it "doesn't add self to @@items" do
53
+ item = Nav::Item.new({}, false)
54
+ Nav::Item.items.should be_empty
55
+ end
56
+ end
57
+ end
58
+
59
+ describe "#attrs" do
60
+ it "returns @attrs" do
61
+ item = Nav::Item.new
62
+ item.instance_variable_set(:@attrs, "Attrs")
63
+ item.attrs.should == "Attrs"
64
+ end
65
+ end
66
+
67
+ describe "#active?" do
68
+ it "returns @attrs[:active]" do
69
+ item = Nav::Item.new
70
+ attrs = item.instance_variable_get(:@attrs)
71
+ attrs.merge!({:active => 'test'})
72
+ item.instance_variable_set(:@attrs, attrs)
73
+
74
+ item.active.should == 'test'
75
+ end
76
+ end
77
+
78
+ describe "#extract_options" do
79
+ before :each do
80
+ @item = Nav::Item.new
81
+ end
82
+
83
+ context "when options is empty" do
84
+ it "output nothing" do
85
+ @item.options = {}
86
+ @item.extract_options.should == ""
87
+ end
88
+ end
89
+
90
+ context "when options not is empty" do
91
+ it "extract options to html" do
92
+ @item.options = {:class => "active", :id => "item"}
93
+ @item.extract_options.should == " class='active' id='item'"
94
+ end
95
+ end
96
+
97
+ context "when item active" do
98
+ it "add 'active' to class " do
99
+ @item.active = true
100
+
101
+ @item.options = {}
102
+ @item.extract_options.should == " class='active'"
103
+
104
+ @item.options = {:class => 'default'}
105
+ @item.extract_options.should == " class='default active'"
106
+ end
107
+ end
108
+ end
109
+
110
+ describe "#to_s" do
111
+ before :each do
112
+ @item = Nav::Item.new
113
+ end
114
+
115
+ it "return link with extracted options" do
116
+ @item.active = false
117
+ @item.options[:id] = "item"
118
+ @item.to_s.should == "<li id='item'><a href='#{@item.url}'>#{@item.name}</a></li>"
119
+ end
120
+ end
121
+
122
+ describe "#method_missing" do
123
+ before :each do
124
+ @item = Nav::Item.new
125
+ end
126
+
127
+ context "when @attrs include called method name" do
128
+ context "when method name has equal sign" do
129
+ it "assign arg to @attrs[:method_name]" do
130
+ @item.name = "New name"
131
+ @item.instance_variable_get(:@attrs)[:name].should == "New name"
132
+ end
133
+ end
134
+
135
+ context "when method name has no equal sign" do
136
+ it "return @attrs[:method_name]" do
137
+ attrs = @item.instance_variable_get(:@attrs)
138
+ attrs.merge!({:name => "New name 2"})
139
+ @item.instance_variable_set(:@attrs, attrs)
140
+ @item.name.should == "New name 2"
141
+ end
142
+ end
143
+ end
144
+
145
+ context "when @attrs not include called method name" do
146
+ it "raise NoMethodError" do
147
+ expect {@item.no_method}.to raise_error(NoMethodError)
148
+ end
149
+ end
150
+ end
151
+ end
@@ -0,0 +1,60 @@
1
+ # encoding: utf-8
2
+
3
+ require 'spec_helper'
4
+
5
+ describe Nav do
6
+ before :each do
7
+ @item = stub('Nav::Item', :url => '/new-item', :name => "New item")
8
+ @item_2 = stub('Nav::Item', :url => '/new-item-2', :name => 'New item 2')
9
+
10
+ [@item, @item_2].each do |i|
11
+ i.stub(:attrs).and_return({:url => i.url, :name => i.name})
12
+ i.stub(:active=) do |arg|
13
+ i.stub(:active).and_return(arg)
14
+ end
15
+ end
16
+
17
+ @items = [@item, @item_2]
18
+ end
19
+
20
+ describe ".select" do
21
+ context "when request arg not given" do
22
+ before :each do
23
+ Nav.request = '/new-item'
24
+ Nav.select(@items)
25
+ end
26
+
27
+ it "select item if its url eql Nav.request" do
28
+ @item.active.should be_true
29
+ end
30
+
31
+ it "doesn't select item if its url not eql Nav.request" do
32
+ @item_2.active.should be_false
33
+ end
34
+ end
35
+
36
+ context "when request arg given" do
37
+ before :each do
38
+ Nav.select(@items, '/new-item-2')
39
+ end
40
+
41
+ it "select item if its url eql request arg" do
42
+ @item_2.active.should be_true
43
+ end
44
+
45
+ it "doesn't select item if its url not eql request arg" do
46
+ @item.active.should be_false
47
+ end
48
+ end
49
+ end
50
+
51
+ describe ".find" do
52
+ it "return found items" do
53
+ Nav.find(@items, {:name => "New item 2"}).should == [@item_2]
54
+ end
55
+
56
+ it "return [] if no found" do
57
+ Nav.find(@items, {:name => "There is no"}).should be_empty
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,34 @@
1
+ # This file is copied to spec/ when you run 'rails generate rspec:install'
2
+ ENV["RAILS_ENV"] ||= 'test'
3
+ require File.expand_path("../../config/environment", __FILE__)
4
+ require 'rspec/rails'
5
+ require 'rspec/autorun'
6
+ require 'nav'
7
+
8
+ # Requires supporting ruby files with custom matchers and macros, etc,
9
+ # in spec/support/ and its subdirectories.
10
+ Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
11
+
12
+ RSpec.configure do |config|
13
+ # == Mock Framework
14
+ #
15
+ # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
16
+ #
17
+ # config.mock_with :mocha
18
+ # config.mock_with :flexmock
19
+ # config.mock_with :rr
20
+ config.mock_with :rspec
21
+
22
+ # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
23
+ config.fixture_path = "#{::Rails.root}/spec/fixtures"
24
+
25
+ # If you're not using ActiveRecord, or you'd prefer not to run each of your
26
+ # examples within a transaction, remove the following line or assign false
27
+ # instead of true.
28
+ config.use_transactional_fixtures = true
29
+
30
+ # If true, the base class of anonymous controllers will be inferred
31
+ # automatically. This will be the default behavior in future versions of
32
+ # rspec-rails.
33
+ config.infer_base_class_for_anonymous_controllers = false
34
+ end
File without changes