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,56 @@
1
+ # Additional translations at https://github.com/plataformatec/devise/wiki/I18n
2
+
3
+ en:
4
+ errors:
5
+ messages:
6
+ expired: "has expired, please request a new one"
7
+ not_found: "not found"
8
+ already_confirmed: "was already confirmed, please try signing in"
9
+ not_locked: "was not locked"
10
+ not_saved:
11
+ one: "1 error prohibited this %{resource} from being saved:"
12
+ other: "%{count} errors prohibited this %{resource} from being saved:"
13
+
14
+ devise:
15
+ failure:
16
+ already_authenticated: 'You are already signed in.'
17
+ unauthenticated: 'You need to sign in or sign up before continuing.'
18
+ unconfirmed: 'You have to confirm your account before continuing.'
19
+ locked: 'Your account is locked.'
20
+ invalid: 'Invalid email or password.'
21
+ invalid_token: 'Invalid authentication token.'
22
+ timeout: 'Your session expired, please sign in again to continue.'
23
+ inactive: 'Your account was not activated yet.'
24
+ sessions:
25
+ signed_in: 'Signed in successfully.'
26
+ signed_out: 'Signed out successfully.'
27
+ passwords:
28
+ send_instructions: 'You will receive an email with instructions about how to reset your password in a few minutes.'
29
+ updated: 'Your password was changed successfully. You are now signed in.'
30
+ updated_not_active: 'Your password was changed successfully.'
31
+ send_paranoid_instructions: "If your e-mail exists on our database, you will receive a password recovery link on your e-mail"
32
+ confirmations:
33
+ send_instructions: 'You will receive an email with instructions about how to confirm your account in a few minutes.'
34
+ send_paranoid_instructions: 'If your e-mail exists on our database, you will receive an email with instructions about how to confirm your account in a few minutes.'
35
+ confirmed: 'Your account was successfully confirmed. You are now signed in.'
36
+ registrations:
37
+ signed_up: 'Welcome! You have signed up successfully.'
38
+ updated: 'You updated your account successfully.'
39
+ destroyed: 'Bye! Your account was successfully cancelled. We hope to see you again soon.'
40
+ signed_up_but_inactive: 'You have signed up successfully. However, we could not sign you in because your account is not yet activated.'
41
+ signed_up_but_unconfirmed: 'A message with a confirmation link has been sent to your email address. Please open the link to activate your account.'
42
+ signed_up_but_locked: 'You have signed up successfully. However, we could not sign you in because your account is locked.'
43
+ unlocks:
44
+ send_instructions: 'You will receive an email with instructions about how to unlock your account in a few minutes.'
45
+ unlocked: 'Your account was successfully unlocked. You are now signed in.'
46
+ send_paranoid_instructions: 'If your account exists, you will receive an email with instructions about how to unlock it in a few minutes.'
47
+ omniauth_callbacks:
48
+ success: 'Successfully authorized from %{kind} account.'
49
+ failure: 'Could not authorize you from %{kind} because "%{reason}".'
50
+ mailer:
51
+ confirmation_instructions:
52
+ subject: 'Confirmation instructions'
53
+ reset_password_instructions:
54
+ subject: 'Reset password instructions'
55
+ unlock_instructions:
56
+ subject: 'Unlock Instructions'
@@ -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: "Сохранить"
data/config/routes.rb ADDED
@@ -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
data/spec/factories.rb ADDED
@@ -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