constructor-core 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (208) hide show
  1. data/app/assets/images/constructor_core/glyphicons-halflings-white.png +0 -0
  2. data/app/assets/images/constructor_core/glyphicons-halflings.png +0 -0
  3. data/app/assets/images/constructor_core/minus.gif +0 -0
  4. data/app/assets/images/constructor_core/plus.gif +0 -0
  5. data/app/assets/images/constructor_core/rss.png +0 -0
  6. data/app/assets/images/constructor_core/treeview-black-line.gif +0 -0
  7. data/app/assets/images/constructor_core/treeview-black.gif +0 -0
  8. data/app/assets/images/constructor_core/treeview-default-line.gif +0 -0
  9. data/app/assets/images/constructor_core/treeview-default.gif +0 -0
  10. data/app/assets/images/constructor_core/treeview-famfamfam-line.gif +0 -0
  11. data/app/assets/images/constructor_core/treeview-famfamfam.gif +0 -0
  12. data/app/assets/images/constructor_core/treeview-gray-line.gif +0 -0
  13. data/app/assets/images/constructor_core/treeview-gray.gif +0 -0
  14. data/app/assets/images/constructor_core/treeview-red-line.gif +0 -0
  15. data/app/assets/images/constructor_core/treeview-red.gif +0 -0
  16. data/app/assets/images/constructor_core/twitter.png +0 -0
  17. data/app/assets/images/constructor_core/widgets.png +0 -0
  18. data/app/assets/javascripts/constructor_core/application.js.coffee +57 -0
  19. data/app/assets/javascripts/constructor_core/bootstrap.js +2276 -0
  20. data/app/assets/javascripts/constructor_core/jquery.cookie.js +92 -0
  21. data/app/assets/javascripts/constructor_core/jquery.treeview.js +256 -0
  22. data/app/assets/javascripts/constructor_core/jquery_bundle.js.coffee +4 -0
  23. data/app/assets/javascripts/constructor_core/urlify.js +82 -0
  24. data/app/assets/stylesheets/constructor_core/application.css.scss +57 -0
  25. data/app/assets/stylesheets/constructor_core/bootstrap-responsive.css +1109 -0
  26. data/app/assets/stylesheets/constructor_core/bootstrap.css +6158 -0
  27. data/app/assets/stylesheets/constructor_core/jquery.treeview.css +73 -0
  28. data/app/controllers/constructor_core/admin_controller.rb +6 -0
  29. data/app/controllers/constructor_core/sessions_controller.rb +15 -0
  30. data/app/helpers/constructor_core/devise_helper.rb +24 -0
  31. data/app/models/constructor_core/user.rb +10 -0
  32. data/app/views/constructor_core/devise/confirmations/new.html.haml +10 -0
  33. data/app/views/constructor_core/devise/mailer/confirmation_instructions.html.haml +5 -0
  34. data/app/views/constructor_core/devise/mailer/reset_password_instructions.html.haml +7 -0
  35. data/app/views/constructor_core/devise/mailer/unlock_instructions.html.haml +5 -0
  36. data/app/views/constructor_core/devise/passwords/edit.html.haml +21 -0
  37. data/app/views/constructor_core/devise/passwords/new.html.haml +13 -0
  38. data/app/views/constructor_core/devise/registrations/edit.html.haml +28 -0
  39. data/app/views/constructor_core/devise/registrations/new.html.haml +20 -0
  40. data/app/views/constructor_core/devise/shared/_links.html.haml +19 -0
  41. data/app/views/constructor_core/devise/unlocks/new.html.haml +9 -0
  42. data/app/views/constructor_core/sessions/new.html.haml +24 -0
  43. data/app/views/layouts/constructor_core/application_admin.haml +65 -0
  44. data/config/environments/production.rb +3 -0
  45. data/config/initializers/devise.rb +223 -0
  46. data/config/locales/devise.en.yml +56 -0
  47. data/config/locales/devise.ru.yml +52 -0
  48. data/config/locales/ru.yml +12 -0
  49. data/config/routes.rb +9 -0
  50. data/constructor-core.gemspec +16 -0
  51. data/db/migrate/1_devise_users.rb +56 -0
  52. data/db/migrate/2_add_default_user.rb +9 -0
  53. data/lib/constructor-core.rb +23 -0
  54. data/lib/constructor_core/engine.rb +6 -0
  55. data/spec/factories.rb +2 -0
  56. data/spec/lib/nav/group_spec.rb +61 -0
  57. data/spec/lib/nav/item_spec.rb +151 -0
  58. data/spec/lib/nav_lib_spec.rb +60 -0
  59. data/spec/spec_helper.rb +34 -0
  60. data/vendor/assets/javascripts/.gitkeep +0 -0
  61. data/vendor/assets/javascripts/ckeditor/ckeditor.js +913 -0
  62. data/vendor/assets/javascripts/ckeditor/config.js +38 -0
  63. data/vendor/assets/javascripts/ckeditor/lang/en.js +5 -0
  64. data/vendor/assets/javascripts/ckeditor/lang/ru.js +5 -0
  65. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js +10 -0
  66. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/_translationstatus.txt +25 -0
  67. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ar.js +9 -0
  68. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/bg.js +9 -0
  69. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ca.js +9 -0
  70. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/cs.js +10 -0
  71. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/cy.js +9 -0
  72. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/da.js +9 -0
  73. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/de.js +10 -0
  74. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/el.js +10 -0
  75. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/en.js +9 -0
  76. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/eo.js +10 -0
  77. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/es.js +10 -0
  78. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/et.js +9 -0
  79. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/fa.js +9 -0
  80. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/fi.js +10 -0
  81. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/fr.js +10 -0
  82. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/gu.js +9 -0
  83. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/he.js +9 -0
  84. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/hi.js +9 -0
  85. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/hr.js +9 -0
  86. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/hu.js +9 -0
  87. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/it.js +10 -0
  88. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ja.js +9 -0
  89. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/km.js +9 -0
  90. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ku.js +10 -0
  91. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/lt.js +9 -0
  92. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/lv.js +10 -0
  93. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/mk.js +9 -0
  94. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/mn.js +9 -0
  95. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/nb.js +9 -0
  96. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/nl.js +10 -0
  97. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/no.js +9 -0
  98. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/pl.js +10 -0
  99. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/pt-br.js +9 -0
  100. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/pt.js +9 -0
  101. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ro.js +9 -0
  102. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ru.js +9 -0
  103. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/sk.js +10 -0
  104. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/sl.js +9 -0
  105. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/sv.js +10 -0
  106. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/th.js +9 -0
  107. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/tr.js +10 -0
  108. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ug.js +9 -0
  109. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/uk.js +9 -0
  110. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/vi.js +9 -0
  111. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/zh-cn.js +7 -0
  112. data/vendor/assets/javascripts/ckeditor/plugins/about/dialogs/about.js +6 -0
  113. data/vendor/assets/javascripts/ckeditor/plugins/about/dialogs/logo_ckeditor.png +0 -0
  114. data/vendor/assets/javascripts/ckeditor/plugins/clipboard/dialogs/paste.js +11 -0
  115. data/vendor/assets/javascripts/ckeditor/plugins/colordialog/dialogs/colordialog.js +13 -0
  116. data/vendor/assets/javascripts/ckeditor/plugins/dialog/dialogDefinition.js +4 -0
  117. data/vendor/assets/javascripts/ckeditor/plugins/div/dialogs/div.js +9 -0
  118. data/vendor/assets/javascripts/ckeditor/plugins/fakeobjects/images/spacer.gif +0 -0
  119. data/vendor/assets/javascripts/ckeditor/plugins/find/dialogs/find.js +24 -0
  120. data/vendor/assets/javascripts/ckeditor/plugins/icons.png +0 -0
  121. data/vendor/assets/javascripts/ckeditor/plugins/iframe/dialogs/iframe.js +10 -0
  122. data/vendor/assets/javascripts/ckeditor/plugins/iframe/images/placeholder.png +0 -0
  123. data/vendor/assets/javascripts/ckeditor/plugins/image/dialogs/image.js +43 -0
  124. data/vendor/assets/javascripts/ckeditor/plugins/image/images/noimage.png +0 -0
  125. data/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/anchor.js +8 -0
  126. data/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/link.js +36 -0
  127. data/vendor/assets/javascripts/ckeditor/plugins/link/images/anchor.png +0 -0
  128. data/vendor/assets/javascripts/ckeditor/plugins/liststyle/dialogs/liststyle.js +10 -0
  129. data/vendor/assets/javascripts/ckeditor/plugins/magicline/images/icon.png +0 -0
  130. data/vendor/assets/javascripts/ckeditor/plugins/pastefromword/filter/default.js +31 -0
  131. data/vendor/assets/javascripts/ckeditor/plugins/preview/preview.html +10 -0
  132. data/vendor/assets/javascripts/ckeditor/plugins/scayt/LICENSE.md +28 -0
  133. data/vendor/assets/javascripts/ckeditor/plugins/scayt/README.md +25 -0
  134. data/vendor/assets/javascripts/ckeditor/plugins/scayt/dialogs/options.js +20 -0
  135. data/vendor/assets/javascripts/ckeditor/plugins/scayt/dialogs/toolbar.css +71 -0
  136. data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_address.png +0 -0
  137. data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_blockquote.png +0 -0
  138. data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_div.png +0 -0
  139. data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h1.png +0 -0
  140. data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h2.png +0 -0
  141. data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h3.png +0 -0
  142. data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h4.png +0 -0
  143. data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h5.png +0 -0
  144. data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h6.png +0 -0
  145. data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_p.png +0 -0
  146. data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_pre.png +0 -0
  147. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/_translationstatus.txt +20 -0
  148. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/ca.js +13 -0
  149. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/cs.js +13 -0
  150. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/cy.js +14 -0
  151. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/de.js +13 -0
  152. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/el.js +13 -0
  153. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/en.js +13 -0
  154. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/eo.js +12 -0
  155. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/et.js +13 -0
  156. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/fa.js +12 -0
  157. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/fi.js +13 -0
  158. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/fr.js +11 -0
  159. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/he.js +13 -0
  160. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/hr.js +13 -0
  161. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/it.js +14 -0
  162. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/ku.js +13 -0
  163. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/lv.js +13 -0
  164. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/nb.js +11 -0
  165. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/nl.js +13 -0
  166. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/no.js +11 -0
  167. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/pl.js +12 -0
  168. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/pt-br.js +11 -0
  169. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/sk.js +13 -0
  170. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/sv.js +11 -0
  171. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/th.js +13 -0
  172. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/tr.js +12 -0
  173. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/ug.js +13 -0
  174. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/zh-cn.js +9 -0
  175. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/specialchar.js +14 -0
  176. data/vendor/assets/javascripts/ckeditor/plugins/table/dialogs/table.js +21 -0
  177. data/vendor/assets/javascripts/ckeditor/plugins/tabletools/dialogs/tableCell.js +16 -0
  178. data/vendor/assets/javascripts/ckeditor/plugins/templates/dialogs/templates.css +84 -0
  179. data/vendor/assets/javascripts/ckeditor/plugins/templates/dialogs/templates.js +10 -0
  180. data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/default.js +6 -0
  181. data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/images/template1.gif +0 -0
  182. data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/images/template2.gif +0 -0
  183. data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/images/template3.gif +0 -0
  184. data/vendor/assets/javascripts/ckeditor/plugins/wsc/LICENSE.md +28 -0
  185. data/vendor/assets/javascripts/ckeditor/plugins/wsc/README.md +25 -0
  186. data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/ciframe.html +49 -0
  187. data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/tmpFrameset.html +52 -0
  188. data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.css +82 -0
  189. data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.js +11 -0
  190. data/vendor/assets/javascripts/ckeditor/styles.js +111 -0
  191. data/vendor/assets/stylesheets/.gitkeep +0 -0
  192. data/vendor/assets/stylesheets/ckeditor/contents.css +103 -0
  193. data/vendor/assets/stylesheets/ckeditor/skins/moono/dialog.css +5 -0
  194. data/vendor/assets/stylesheets/ckeditor/skins/moono/dialog_ie.css +5 -0
  195. data/vendor/assets/stylesheets/ckeditor/skins/moono/dialog_ie7.css +5 -0
  196. data/vendor/assets/stylesheets/ckeditor/skins/moono/dialog_ie8.css +5 -0
  197. data/vendor/assets/stylesheets/ckeditor/skins/moono/dialog_opera.css +5 -0
  198. data/vendor/assets/stylesheets/ckeditor/skins/moono/editor.css +5 -0
  199. data/vendor/assets/stylesheets/ckeditor/skins/moono/editor_gecko.css +5 -0
  200. data/vendor/assets/stylesheets/ckeditor/skins/moono/editor_ie.css +5 -0
  201. data/vendor/assets/stylesheets/ckeditor/skins/moono/editor_ie7.css +5 -0
  202. data/vendor/assets/stylesheets/ckeditor/skins/moono/editor_ie8.css +5 -0
  203. data/vendor/assets/stylesheets/ckeditor/skins/moono/icons.png +0 -0
  204. data/vendor/assets/stylesheets/ckeditor/skins/moono/images/arrow.png +0 -0
  205. data/vendor/assets/stylesheets/ckeditor/skins/moono/images/close.png +0 -0
  206. data/vendor/assets/stylesheets/ckeditor/skins/moono/images/mini.png +0 -0
  207. data/vendor/assets/stylesheets/ckeditor/skins/moono/readme.md +51 -0
  208. metadata +272 -0
@@ -0,0 +1,73 @@
1
+ .treeview, .treeview ul {
2
+ padding: 0;
3
+ margin: 0;
4
+ list-style: none;
5
+ }
6
+
7
+ .treeview ul {
8
+ margin-top: 4px;
9
+ }
10
+
11
+ .treeview .hitarea {
12
+ background: url(/assets/constructor_core/treeview-default.gif) -64px -25px no-repeat;
13
+ height: 16px;
14
+ width: 16px;
15
+ margin-left: -16px;
16
+ float: left;
17
+ cursor: pointer;
18
+ }
19
+ /* fix for IE6 */
20
+ * html .hitarea {
21
+ display: inline;
22
+ float:none;
23
+ }
24
+
25
+ .treeview li {
26
+ margin: 0;
27
+ padding: 3px 0pt 10px 16px;
28
+ }
29
+
30
+ .treeview a.selected {
31
+ background-color: #eee;
32
+ }
33
+
34
+ #treecontrol { margin: 1em 0; display: none; }
35
+
36
+ .treeview .hover { cursor: pointer; }
37
+
38
+ .treeview li { background: url(/assets/constructor_core/treeview-default-line.gif) 0 0 no-repeat; }
39
+ .treeview li.collapsable, .treeview li.expandable { background-position: 0 -176px; }
40
+
41
+ .treeview .expandable-hitarea { background-position: -80px -3px; }
42
+
43
+ .treeview li.last { background-position: 0 -1766px }
44
+ .treeview li.lastCollapsable, .treeview li.lastExpandable { background-image: url(/assets/constructor_core/treeview-default.gif); }
45
+ .treeview li.lastCollapsable { background-position: 0 -111px }
46
+ .treeview li.lastExpandable { background-position: -32px -67px }
47
+
48
+ .treeview div.lastCollapsable-hitarea, .treeview div.lastExpandable-hitarea { background-position: 0; }
49
+
50
+ .treeview-red li { background-image: url(/assets/constructor_core/treeview-red-line.gif); }
51
+ .treeview-red .hitarea, .treeview-red li.lastCollapsable, .treeview-red li.lastExpandable { background-image: url(/assets/constructor_core/treeview-red.gif); }
52
+
53
+ .treeview-black li { background-image: url(/assets/constructor_core/treeview-black-line.gif); }
54
+ .treeview-black .hitarea, .treeview-black li.lastCollapsable, .treeview-black li.lastExpandable { background-image: url(/assets/constructor_core/treeview-black.gif); }
55
+
56
+ .treeview-gray li { background-image: url(/assets/constructor_core/treeview-gray-line.gif); }
57
+ .treeview-gray .hitarea, .treeview-gray li.lastCollapsable, .treeview-gray li.lastExpandable { background-image: url(/assets/constructor_core/treeview-gray.gif); }
58
+
59
+ .treeview-famfamfam li { background-image: url(/assets/constructor_core/treeview-famfamfam-line.gif); }
60
+ .treeview-famfamfam .hitarea, .treeview-famfamfam li.lastCollapsable, .treeview-famfamfam li.lastExpandable { background-image: url(/assets/constructor_core/treeview-famfamfam.gif); }
61
+
62
+ .treeview .placeholder {
63
+ background: url(/assets/constructor_core/ajax-loader.gif) 0 0 no-repeat;
64
+ height: 16px;
65
+ width: 16px;
66
+ display: block;
67
+ }
68
+
69
+ .filetree li { padding: 3px 0 2px 16px; }
70
+ .filetree span.folder, .filetree span.file { padding: 1px 0 1px 16px; display: block; }
71
+ .filetree span.folder { background: url(/assets/constructor_core/folder.gif) 0 0 no-repeat; }
72
+ .filetree li.expandable span.folder { background: url(/assets/constructor_core/folder-closed.gif) 0 0 no-repeat; }
73
+ .filetree span.file { background: url(/assets/constructor_core/file.gif) 0 0 no-repeat; }
@@ -0,0 +1,6 @@
1
+ # encoding: utf-8
2
+
3
+ module ConstructorCore
4
+ class AdminController < ApplicationController
5
+ end
6
+ end
@@ -0,0 +1,15 @@
1
+ # encoding: utf-8
2
+
3
+ module ConstructorCore
4
+ class SessionsController < Devise::SessionsController
5
+ layout 'constructor_core/application_admin'
6
+
7
+ def after_sign_in_path_for(resource)
8
+ return '/admin/pages'
9
+ end
10
+
11
+ def after_sign_out_path_for(resource)
12
+ return '/'
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,24 @@
1
+ module ConstructorCore
2
+ # TODO
3
+ module DeviseHelper
4
+ def authenticate_user!
5
+ warden.authenticate!
6
+ end
7
+
8
+ def user_signed_in?
9
+ !!current_user
10
+ end
11
+
12
+ def current_user
13
+ @current_user ||= warden.authenticate(:scope => :constructor_auth_user)
14
+ end
15
+
16
+ def user_session
17
+ current_user && warden.session(:constructor_auth_user)
18
+ end
19
+
20
+ def warden
21
+ request.env['warden']
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,10 @@
1
+ # encoding: utf-8
2
+
3
+ module ConstructorCore
4
+ class User < ActiveRecord::Base
5
+ # Include default devise modules. Others available are:
6
+ devise :database_authenticatable, :recoverable, :rememberable, :trackable, :validatable, :token_authenticatable, :timeoutable #:confirmable, :registerable, :omniauthable, :lockable, :encryptable
7
+ # Setup accessible (or protected) attributes for your model
8
+ attr_accessible :email, :password, :password_confirmation, :remember_me
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ %h2 Отправить инструкцию активации
2
+ = form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post }) do |f|
3
+ = devise_error_messages!
4
+ %p
5
+ = f.label :email
6
+ %br/
7
+ = f.email_field :email
8
+ %p= f.submit "Отправить"
9
+ = render :partial => "devise/shared/links"
10
+
@@ -0,0 +1,5 @@
1
+ %p
2
+ Добро пожаловать, #{@resource.email}!
3
+ %p Для того чтобы подтвердить ваш аккаунт, пройдите по следующей ссылке:
4
+ %p= link_to 'Подтвердить аккаунт', confirmation_url(@resource, :confirmation_token => @resource.confirmation_token)
5
+
@@ -0,0 +1,7 @@
1
+ %p
2
+ Привет, #{@resource.email}!
3
+ %p Вы сделали запрос на смену пароля. Для того чтобы изменить пароль пройдите по следующей ссылке:
4
+ %p= link_to 'Изменить пароль', edit_password_url(@resource, :reset_password_token => @resource.reset_password_token)
5
+ %p Если Вы не делали запрос на изменение пароля, то проигнорируйте это письмо.
6
+ %p Ваш пароль останется прежним до тех пор пока вы не пройдете по ссылке.
7
+
@@ -0,0 +1,5 @@
1
+ %p
2
+ Hello #{@resource.email}!
3
+ %p Your account has been locked due to an excessive amount of unsuccessful sign in attempts.
4
+ %p Click the link below to unlock your account:
5
+ %p= link_to 'Unlock my account', unlock_url(@resource, :unlock_token => @resource.unlock_token)
@@ -0,0 +1,21 @@
1
+ - content_for :page_title do
2
+ Смена пароля
3
+
4
+ = form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put }) do |f|
5
+ = devise_error_messages!
6
+ = f.hidden_field :reset_password_token
7
+ .clearfix
8
+ = f.label :password, "Новый пароль"
9
+ .input
10
+ = f.password_field :password
11
+ .clearfix
12
+ = f.label :password_confirmation, "Еще раз"
13
+ .input
14
+ = f.password_field :password_confirmation
15
+ .clearfix
16
+ .input
17
+ = f.submit "Сменить пароль", :class => "btn primary"
18
+
19
+ - content_for :sidebar do
20
+ = render :partial => "devise/shared/links"
21
+
@@ -0,0 +1,13 @@
1
+ - content_for :page_title do
2
+ Восстановить пароль
3
+
4
+ = form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post }) do |f|
5
+ = devise_error_messages!
6
+ .clearfix
7
+ = f.label :email, "Электропочта"
8
+ .input
9
+ = f.email_field :email
10
+ .clearfix
11
+ .input
12
+ = f.submit "Отправить", :class => "btn primary"
13
+
@@ -0,0 +1,28 @@
1
+ %h2
2
+ Редактивароние аккаунта #{resource_name.to_s.humanize}
3
+ = form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f|
4
+ = devise_error_messages!
5
+ %p
6
+ = f.label :email
7
+ %br/
8
+ = f.email_field :email
9
+ %p
10
+ = f.label :password
11
+ %i (оставьте пустым, если хотите сохранить пароль прежним)
12
+ %br/
13
+ = f.password_field :password
14
+ %p
15
+ = f.label :password_confirmation
16
+ %br/
17
+ = f.password_field :password_confirmation
18
+ %p
19
+ = f.label :current_password
20
+ %i (необходимо ввести ваш текущий пароль для подтверждения изменений)
21
+ %br/
22
+ = f.password_field :current_password
23
+ %p= f.submit "Сохранить"
24
+ %h3 Удалить мой аккаунт
25
+ %p
26
+ #{link_to "Удалить", registration_path(resource_name), :confirm => "Вы уверены?", :method => :delete}.
27
+ = link_to "Назад", :back
28
+
@@ -0,0 +1,20 @@
1
+ .register_form
2
+ %h2 Регистрация
3
+ = form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f|
4
+ = devise_error_messages!
5
+ %p.email
6
+ = f.label :email
7
+ %br/
8
+ = f.email_field :email
9
+ %p
10
+ = f.label :password
11
+ %br/
12
+ = f.password_field :password
13
+ %p
14
+ = f.label :password_confirmation
15
+ %br/
16
+ = f.password_field :password_confirmation
17
+ %p.button= f.submit "Зарегистрироваться"
18
+
19
+ .links
20
+ = render :partial => "devise/shared/links"
@@ -0,0 +1,19 @@
1
+ - if controller_name != 'sessions'
2
+ = link_to "Вход с паролем", auth.new_session_path(resource_name)
3
+ %br/
4
+ - if devise_mapping.registerable? && controller_name != 'registrations'
5
+ = link_to "Регистрация", auth.new_registration_path(resource_name)
6
+ %br/
7
+ - if devise_mapping.recoverable? && controller_name != 'passwords'
8
+ = link_to "Восстановление пароля", auth.new_password_path(resource_name)
9
+ %br/
10
+ - if devise_mapping.confirmable? && controller_name != 'confirmations'
11
+ = link_to "Если вы не получили инструкцию о том как подтвердить адрес электронной почты", new_confirmation_path(resource_name)
12
+ %br/
13
+ - if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks'
14
+ = link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name)
15
+ %br/
16
+ - if devise_mapping.omniauthable?
17
+ - resource_class.omniauth_providers.each do |provider|
18
+ = link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider)
19
+ %br/
@@ -0,0 +1,9 @@
1
+ %h2 Resend unlock instructions
2
+ = form_for(resource, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post }) do |f|
3
+ = devise_error_messages!
4
+ %p
5
+ = f.label :email
6
+ %br/
7
+ = f.email_field :email
8
+ %p= f.submit "Resend unlock instructions"
9
+ = render :partial => "devise/shared/links"
@@ -0,0 +1,24 @@
1
+ - content_for :page_title do
2
+ Вход на сайт
3
+
4
+ = form_for(resource, :as => resource_name, :url => '/login') do |f|
5
+ .form-horizontal
6
+ .control-group
7
+ = f.label :email, :class => 'control-label'
8
+ .controls
9
+ = f.email_field :email
10
+ .control-group
11
+ = f.label :password, :class => 'control-label'
12
+ .controls
13
+ = f.password_field :password
14
+ - if devise_mapping.rememberable?
15
+ .control-group
16
+ .controls
17
+ %label.checkbox.inline{:for => 'remember_me'}
18
+ = f.check_box :remember_me
19
+ Запомнить меня
20
+ .controls
21
+ = f.submit "Войти", :class => "btn btn-primary"
22
+
23
+ - content_for :sidebar do
24
+ //= render :partial => "devise/shared/links"
@@ -0,0 +1,65 @@
1
+ !!!
2
+ %html{:lang => 'ru'}
3
+ %head
4
+ %meta{:charset => 'utf-8'}/
5
+ %meta{'http-equiv' => 'X-UA-Compatible', :content => 'IE=edge,chrome=1'}/
6
+ %title Панель управления
7
+
8
+ %meta{:name => 'viewport', :content => 'width=device-width,initial-scale=1'}/
9
+
10
+ / [if lt IE 9]
11
+ %script{:src => "http://html5shim.googlecode.com/svn/trunk/html5.js"}
12
+
13
+ :javascript
14
+ var CKEDITOR_BASEPATH = '/assets/ckeditor/'
15
+
16
+ = stylesheet_link_tag "constructor_core/application"
17
+ = javascript_include_tag "constructor_core/application"
18
+ = csrf_meta_tag
19
+ = favicon_link_tag
20
+
21
+ %link{:rel => "apple-touch-icon", :href => "images/apple-touch-icon.png"}
22
+ %link{:rel => "apple-touch-icon", :sizes => "72x72", :href => "images/apple-touch-icon-72x72.png"}
23
+ %link{:rel => "apple-touch-icon", :sizes => "114x114", :href => "images/apple-touch-icon-114x114.png"}
24
+
25
+ %body
26
+ .navbar.navbar-fixed-top
27
+ .navbar-inner
28
+ .container-fluid
29
+ = link_to "Главная страница", "/", :class => "brand"
30
+ %a.btn.btn-navbar{'data-toggle' => "collapse", 'data-target' => ".nav-collapse"}
31
+ %span.icon-bar
32
+ %span.icon-bar
33
+ %span.icon-bar
34
+ .nav-collapse
35
+ %ul.nav
36
+ %li= link_to "Структура", "/admin/pages"
37
+ %li= link_to "Шаблоны", "/admin/templates"
38
+ %ul.nav.pull-right
39
+ %li
40
+ = link_to "Выйти", "/logout"
41
+
42
+ .container-fluid
43
+ .page-header
44
+ .row-fluid
45
+ .span4
46
+ %h3.muted= yield :page_title
47
+ .span4
48
+ - unless notice.nil?
49
+ .alert.fade.in
50
+ = link_to "×", "#", :class => "close", 'data-dismiss' => "alert"
51
+ = notice
52
+ - unless alert.nil?
53
+ .alert.alert-error.fade.in
54
+ = link_to "×", "#", :class => "close", 'data-dismiss' => "alert"
55
+ = alert
56
+
57
+ = yield :actions
58
+ .content
59
+ .row-fluid
60
+ = yield
61
+
62
+ / [if lt IE 7 ]
63
+ %script{:src => '//ajax.googleapis.com/ajax/libs/chrome-frame/1.0.3/CFInstall.min.js'}
64
+ %script
65
+ window.attachEvent('onload',function(){CFInstall.check({mode:'overlay'})})
@@ -0,0 +1,3 @@
1
+ Rails.application.class.configure do
2
+ config.assets.precompile += ['ckeditor/*']
3
+ end
@@ -0,0 +1,223 @@
1
+ # Use this hook to configure devise mailer, warden hooks and so forth.
2
+ # Many of these configuration options can be set straight in your model.
3
+ Devise.setup do |config|
4
+ # ==> Mailer Configuration
5
+ # Configure the e-mail address which will be shown in Devise::Mailer,
6
+ # note that it will be overwritten if you use your own mailer class with default "from" parameter.
7
+ config.mailer_sender = "please-change-me-at-config-initializers-devise@example.com"
8
+
9
+ # Configure the class responsible to send e-mails.
10
+ # config.mailer = "Devise::Mailer"
11
+
12
+ # Automatically apply schema changes in tableless databases
13
+ config.apply_schema = false
14
+
15
+ # ==> ORM configuration
16
+ # Load and configure the ORM. Supports :active_record (default) and
17
+ # :mongoid (bson_ext recommended) by default. Other ORMs may be
18
+ # available as additional gems.
19
+ require 'devise/orm/active_record'
20
+
21
+ # ==> Configuration for any authentication mechanism
22
+ # Configure which keys are used when authenticating a user. The default is
23
+ # just :email. You can configure it to use [:username, :subdomain], so for
24
+ # authenticating a user, both parameters are required. Remember that those
25
+ # parameters are used only when authenticating and not when retrieving from
26
+ # session. If you need permissions, you should implement that in a before filter.
27
+ # You can also supply a hash where the value is a boolean determining whether
28
+ # or not authentication should be aborted when the value is not present.
29
+ # config.authentication_keys = [ :email ]
30
+
31
+ # Configure parameters from the request object used for authentication. Each entry
32
+ # given should be a request method and it will automatically be passed to the
33
+ # find_for_authentication method and considered in your model lookup. For instance,
34
+ # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
35
+ # The same considerations mentioned for authentication_keys also apply to request_keys.
36
+ # config.request_keys = []
37
+
38
+ # Configure which authentication keys should be case-insensitive.
39
+ # These keys will be downcased upon creating or modifying a user and when used
40
+ # to authenticate or find a user. Default is :email.
41
+ config.case_insensitive_keys = [ :email ]
42
+
43
+ # Configure which authentication keys should have whitespace stripped.
44
+ # These keys will have whitespace before and after removed upon creating or
45
+ # modifying a user and when used to authenticate or find a user. Default is :email.
46
+ config.strip_whitespace_keys = [ :email ]
47
+
48
+ # Tell if authentication through request.params is enabled. True by default.
49
+ # It can be set to an array that will enable params authentication only for the
50
+ # given strategies, for example, `config.params_authenticatable = [:database]` will
51
+ # enable it only for database (email + password) authentication.
52
+ # config.params_authenticatable = true
53
+
54
+ # Tell if authentication through HTTP Basic Auth is enabled. False by default.
55
+ # It can be set to an array that will enable http authentication only for the
56
+ # given strategies, for example, `config.http_authenticatable = [:token]` will
57
+ # enable it only for token authentication.
58
+ # config.http_authenticatable = false
59
+
60
+ # If http headers should be returned for AJAX requests. True by default.
61
+ # config.http_authenticatable_on_xhr = true
62
+
63
+ # The realm used in Http Basic Authentication. "Application" by default.
64
+ # config.http_authentication_realm = "Application"
65
+
66
+ # It will change confirmation, password recovery and other workflows
67
+ # to behave the same regardless if the e-mail provided was right or wrong.
68
+ # Does not affect registerable.
69
+ # config.paranoid = true
70
+
71
+ # By default Devise will store the user in session. You can skip storage for
72
+ # :http_auth and :token_auth by adding those symbols to the array below.
73
+ # Notice that if you are skipping storage for all authentication paths, you
74
+ # may want to disable generating routes to Devise's sessions controller by
75
+ # passing :skip => :sessions to `devise_for` in your config/routes.rb
76
+ config.skip_session_storage = [:http_auth]
77
+
78
+ # ==> Configuration for :database_authenticatable
79
+ # For bcrypt, this is the cost for hashing the password and defaults to 10. If
80
+ # using other encryptors, it sets how many times you want the password re-encrypted.
81
+ #
82
+ # Limiting the stretches to just one in testing will increase the performance of
83
+ # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
84
+ # a value less than 10 in other environments.
85
+ config.stretches = Rails.env.test? ? 1 : 10
86
+
87
+ # Setup a pepper to generate the encrypted password.
88
+ # config.pepper = "8101638e8d8142db6ce79325617afe094d9a69ca35fcdb1f7aacf4b0ba25bfacb0a57783d93a11829c309a3d4f05d104e22c4cd305ceec9f3f8a61d2389bb59b"
89
+
90
+ # ==> Configuration for :confirmable
91
+ # A period that the user is allowed to access the website even without
92
+ # confirming his account. For instance, if set to 2.days, the user will be
93
+ # able to access the website for two days without confirming his account,
94
+ # access will be blocked just in the third day. Default is 0.days, meaning
95
+ # the user cannot access the website without confirming his account.
96
+ # config.allow_unconfirmed_access_for = 2.days
97
+
98
+ # If true, requires any email changes to be confirmed (exctly the same way as
99
+ # initial account confirmation) to be applied. Requires additional unconfirmed_email
100
+ # db field (see migrations). Until confirmed new email is stored in
101
+ # unconfirmed email column, and copied to email column on successful confirmation.
102
+ config.reconfirmable = true
103
+
104
+ # Defines which key will be used when confirming an account
105
+ # config.confirmation_keys = [ :email ]
106
+
107
+ # ==> Configuration for :rememberable
108
+ # The time the user will be remembered without asking for credentials again.
109
+ # config.remember_for = 2.weeks
110
+
111
+ # If true, extends the user's remember period when remembered via cookie.
112
+ # config.extend_remember_period = false
113
+
114
+ # If true, uses the password salt as remember token. This should be turned
115
+ # to false if you are not using database authenticatable.
116
+ config.use_salt_as_remember_token = true
117
+
118
+ # Options to be passed to the created cookie. For instance, you can set
119
+ # :secure => true in order to force SSL only cookies.
120
+ # config.cookie_options = {}
121
+
122
+ # ==> Configuration for :validatable
123
+ # Range for password length. Default is 6..128.
124
+ # config.password_length = 6..128
125
+
126
+ # Email regex used to validate email formats. It simply asserts that
127
+ # an one (and only one) @ exists in the given string. This is mainly
128
+ # to give user feedback and not to assert the e-mail validity.
129
+ # config.email_regexp = /\A[^@]+@[^@]+\z/
130
+
131
+ # ==> Configuration for :timeoutable
132
+ # The time you want to timeout the user session without activity. After this
133
+ # time the user will be asked for credentials again. Default is 30 minutes.
134
+ # config.timeout_in = 30.minutes
135
+
136
+ # ==> Configuration for :lockable
137
+ # Defines which strategy will be used to lock an account.
138
+ # :failed_attempts = Locks an account after a number of failed attempts to sign in.
139
+ # :none = No lock strategy. You should handle locking by yourself.
140
+ # config.lock_strategy = :failed_attempts
141
+
142
+ # Defines which key will be used when locking and unlocking an account
143
+ # config.unlock_keys = [ :email ]
144
+
145
+ # Defines which strategy will be used to unlock an account.
146
+ # :email = Sends an unlock link to the user email
147
+ # :time = Re-enables login after a certain amount of time (see :unlock_in below)
148
+ # :both = Enables both strategies
149
+ # :none = No unlock strategy. You should handle unlocking by yourself.
150
+ # config.unlock_strategy = :both
151
+
152
+ # Number of authentication tries before locking an account if lock_strategy
153
+ # is failed attempts.
154
+ # config.maximum_attempts = 20
155
+
156
+ # Time interval to unlock the account if :time is enabled as unlock_strategy.
157
+ # config.unlock_in = 1.hour
158
+
159
+ # ==> Configuration for :recoverable
160
+ #
161
+ # Defines which key will be used when recovering the password for an account
162
+ # config.reset_password_keys = [ :email ]
163
+
164
+ # Time interval you can reset your password with a reset password key.
165
+ # Don't put a too small interval or your users won't have the time to
166
+ # change their passwords.
167
+ config.reset_password_within = 6.hours
168
+
169
+ # ==> Configuration for :encryptable
170
+ # Allow you to use another encryption algorithm besides bcrypt (default). You can use
171
+ # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
172
+ # :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
173
+ # and :restful_authentication_sha1 (then you should set stretches to 10, and copy
174
+ # REST_AUTH_SITE_KEY to pepper)
175
+ # config.encryptor = :sha512
176
+
177
+ # ==> Configuration for :token_authenticatable
178
+ # Defines name of the authentication token params key
179
+ # config.token_authentication_key = :auth_token
180
+
181
+ # ==> Scopes configuration
182
+ # Turn scoped views on. Before rendering "sessions/new", it will first check for
183
+ # "users/sessions/new". It's turned off by default because it's slower if you
184
+ # are using only default views.
185
+ # config.scoped_views = false
186
+
187
+ # Configure the default scope given to Warden. By default it's the first
188
+ # devise role declared in your routes (usually :user).
189
+ # config.default_scope = :user
190
+
191
+ # Configure sign_out behavior.
192
+ # Sign_out action can be scoped (i.e. /users/sign_out affects only :user scope).
193
+ # The default is true, which means any logout action will sign out all active scopes.
194
+ # config.sign_out_all_scopes = true
195
+
196
+ # ==> Navigation configuration
197
+ # Lists the formats that should be treated as navigational. Formats like
198
+ # :html, should redirect to the sign in page when the user does not have
199
+ # access, but formats like :xml or :json, should return 401.
200
+ #
201
+ # If you have any extra navigational formats, like :iphone or :mobile, you
202
+ # should add them to the navigational formats lists.
203
+ #
204
+ # The "*/*" below is required to match Internet Explorer requests.
205
+ # config.navigational_formats = ["*/*", :html]
206
+
207
+ # The default HTTP method used to sign out a resource. Default is :delete.
208
+ config.sign_out_via = :delete
209
+
210
+ # ==> OmniAuth
211
+ # Add a new OmniAuth provider. Check the wiki for more information on setting
212
+ # up on your models and hooks.
213
+ # config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo'
214
+
215
+ # ==> Warden configuration
216
+ # If you want to use other strategies, that are not supported by Devise, or
217
+ # change the failure app, you can configure them inside the config.warden block.
218
+ #
219
+ # config.warden do |manager|
220
+ # manager.intercept_401 = false
221
+ # manager.default_strategies(:scope => :user).unshift :some_external_strategy
222
+ # end
223
+ end