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.
- data/app/assets/images/constructor_core/glyphicons-halflings-white.png +0 -0
- data/app/assets/images/constructor_core/glyphicons-halflings.png +0 -0
- data/app/assets/images/constructor_core/minus.gif +0 -0
- data/app/assets/images/constructor_core/plus.gif +0 -0
- data/app/assets/images/constructor_core/rss.png +0 -0
- data/app/assets/images/constructor_core/treeview-black-line.gif +0 -0
- data/app/assets/images/constructor_core/treeview-black.gif +0 -0
- data/app/assets/images/constructor_core/treeview-default-line.gif +0 -0
- data/app/assets/images/constructor_core/treeview-default.gif +0 -0
- data/app/assets/images/constructor_core/treeview-famfamfam-line.gif +0 -0
- data/app/assets/images/constructor_core/treeview-famfamfam.gif +0 -0
- data/app/assets/images/constructor_core/treeview-gray-line.gif +0 -0
- data/app/assets/images/constructor_core/treeview-gray.gif +0 -0
- data/app/assets/images/constructor_core/treeview-red-line.gif +0 -0
- data/app/assets/images/constructor_core/treeview-red.gif +0 -0
- data/app/assets/images/constructor_core/twitter.png +0 -0
- data/app/assets/images/constructor_core/widgets.png +0 -0
- data/app/assets/javascripts/constructor_core/application.js.coffee +57 -0
- data/app/assets/javascripts/constructor_core/bootstrap.js +2276 -0
- data/app/assets/javascripts/constructor_core/jquery.cookie.js +92 -0
- data/app/assets/javascripts/constructor_core/jquery.treeview.js +256 -0
- data/app/assets/javascripts/constructor_core/jquery_bundle.js.coffee +4 -0
- data/app/assets/javascripts/constructor_core/urlify.js +82 -0
- data/app/assets/stylesheets/constructor_core/application.css.scss +57 -0
- data/app/assets/stylesheets/constructor_core/bootstrap-responsive.css +1109 -0
- data/app/assets/stylesheets/constructor_core/bootstrap.css +6158 -0
- data/app/assets/stylesheets/constructor_core/jquery.treeview.css +73 -0
- data/app/controllers/constructor_core/admin_controller.rb +6 -0
- data/app/controllers/constructor_core/sessions_controller.rb +15 -0
- data/app/helpers/constructor_core/devise_helper.rb +24 -0
- data/app/models/constructor_core/user.rb +10 -0
- data/app/views/constructor_core/devise/confirmations/new.html.haml +10 -0
- data/app/views/constructor_core/devise/mailer/confirmation_instructions.html.haml +5 -0
- data/app/views/constructor_core/devise/mailer/reset_password_instructions.html.haml +7 -0
- data/app/views/constructor_core/devise/mailer/unlock_instructions.html.haml +5 -0
- data/app/views/constructor_core/devise/passwords/edit.html.haml +21 -0
- data/app/views/constructor_core/devise/passwords/new.html.haml +13 -0
- data/app/views/constructor_core/devise/registrations/edit.html.haml +28 -0
- data/app/views/constructor_core/devise/registrations/new.html.haml +20 -0
- data/app/views/constructor_core/devise/shared/_links.html.haml +19 -0
- data/app/views/constructor_core/devise/unlocks/new.html.haml +9 -0
- data/app/views/constructor_core/sessions/new.html.haml +24 -0
- data/app/views/layouts/constructor_core/application_admin.haml +65 -0
- data/config/environments/production.rb +3 -0
- data/config/initializers/devise.rb +223 -0
- data/config/locales/devise.en.yml +56 -0
- data/config/locales/devise.ru.yml +52 -0
- data/config/locales/ru.yml +12 -0
- data/config/routes.rb +9 -0
- data/constructor-core.gemspec +16 -0
- data/db/migrate/1_devise_users.rb +56 -0
- data/db/migrate/2_add_default_user.rb +9 -0
- data/lib/constructor-core.rb +23 -0
- data/lib/constructor_core/engine.rb +6 -0
- data/spec/factories.rb +2 -0
- data/spec/lib/nav/group_spec.rb +61 -0
- data/spec/lib/nav/item_spec.rb +151 -0
- data/spec/lib/nav_lib_spec.rb +60 -0
- data/spec/spec_helper.rb +34 -0
- data/vendor/assets/javascripts/.gitkeep +0 -0
- data/vendor/assets/javascripts/ckeditor/ckeditor.js +913 -0
- data/vendor/assets/javascripts/ckeditor/config.js +38 -0
- data/vendor/assets/javascripts/ckeditor/lang/en.js +5 -0
- data/vendor/assets/javascripts/ckeditor/lang/ru.js +5 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js +10 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/_translationstatus.txt +25 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ar.js +9 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/bg.js +9 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ca.js +9 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/cs.js +10 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/cy.js +9 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/da.js +9 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/de.js +10 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/el.js +10 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/en.js +9 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/eo.js +10 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/es.js +10 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/et.js +9 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/fa.js +9 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/fi.js +10 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/fr.js +10 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/gu.js +9 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/he.js +9 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/hi.js +9 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/hr.js +9 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/hu.js +9 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/it.js +10 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ja.js +9 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/km.js +9 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ku.js +10 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/lt.js +9 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/lv.js +10 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/mk.js +9 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/mn.js +9 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/nb.js +9 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/nl.js +10 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/no.js +9 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/pl.js +10 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/pt-br.js +9 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/pt.js +9 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ro.js +9 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ru.js +9 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/sk.js +10 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/sl.js +9 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/sv.js +10 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/th.js +9 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/tr.js +10 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ug.js +9 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/uk.js +9 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/vi.js +9 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/zh-cn.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/about/dialogs/about.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/about/dialogs/logo_ckeditor.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/clipboard/dialogs/paste.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/colordialog/dialogs/colordialog.js +13 -0
- data/vendor/assets/javascripts/ckeditor/plugins/dialog/dialogDefinition.js +4 -0
- data/vendor/assets/javascripts/ckeditor/plugins/div/dialogs/div.js +9 -0
- data/vendor/assets/javascripts/ckeditor/plugins/fakeobjects/images/spacer.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/find/dialogs/find.js +24 -0
- data/vendor/assets/javascripts/ckeditor/plugins/icons.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/iframe/dialogs/iframe.js +10 -0
- data/vendor/assets/javascripts/ckeditor/plugins/iframe/images/placeholder.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/image/dialogs/image.js +43 -0
- data/vendor/assets/javascripts/ckeditor/plugins/image/images/noimage.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/anchor.js +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/link.js +36 -0
- data/vendor/assets/javascripts/ckeditor/plugins/link/images/anchor.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/liststyle/dialogs/liststyle.js +10 -0
- data/vendor/assets/javascripts/ckeditor/plugins/magicline/images/icon.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/pastefromword/filter/default.js +31 -0
- data/vendor/assets/javascripts/ckeditor/plugins/preview/preview.html +10 -0
- data/vendor/assets/javascripts/ckeditor/plugins/scayt/LICENSE.md +28 -0
- data/vendor/assets/javascripts/ckeditor/plugins/scayt/README.md +25 -0
- data/vendor/assets/javascripts/ckeditor/plugins/scayt/dialogs/options.js +20 -0
- data/vendor/assets/javascripts/ckeditor/plugins/scayt/dialogs/toolbar.css +71 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_address.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_blockquote.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_div.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h1.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h2.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h3.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h4.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h5.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h6.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_p.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_pre.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/_translationstatus.txt +20 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/ca.js +13 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/cs.js +13 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/cy.js +14 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/de.js +13 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/el.js +13 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/en.js +13 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/eo.js +12 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/et.js +13 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/fa.js +12 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/fi.js +13 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/fr.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/he.js +13 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/hr.js +13 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/it.js +14 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/ku.js +13 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/lv.js +13 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/nb.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/nl.js +13 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/no.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/pl.js +12 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/pt-br.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/sk.js +13 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/sv.js +11 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/th.js +13 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/tr.js +12 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/ug.js +13 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/zh-cn.js +9 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/specialchar.js +14 -0
- data/vendor/assets/javascripts/ckeditor/plugins/table/dialogs/table.js +21 -0
- data/vendor/assets/javascripts/ckeditor/plugins/tabletools/dialogs/tableCell.js +16 -0
- data/vendor/assets/javascripts/ckeditor/plugins/templates/dialogs/templates.css +84 -0
- data/vendor/assets/javascripts/ckeditor/plugins/templates/dialogs/templates.js +10 -0
- data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/default.js +6 -0
- data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/images/template1.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/images/template2.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/images/template3.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/wsc/LICENSE.md +28 -0
- data/vendor/assets/javascripts/ckeditor/plugins/wsc/README.md +25 -0
- data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/ciframe.html +49 -0
- data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/tmpFrameset.html +52 -0
- data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.css +82 -0
- data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.js +11 -0
- data/vendor/assets/javascripts/ckeditor/styles.js +111 -0
- data/vendor/assets/stylesheets/.gitkeep +0 -0
- data/vendor/assets/stylesheets/ckeditor/contents.css +103 -0
- data/vendor/assets/stylesheets/ckeditor/skins/moono/dialog.css +5 -0
- data/vendor/assets/stylesheets/ckeditor/skins/moono/dialog_ie.css +5 -0
- data/vendor/assets/stylesheets/ckeditor/skins/moono/dialog_ie7.css +5 -0
- data/vendor/assets/stylesheets/ckeditor/skins/moono/dialog_ie8.css +5 -0
- data/vendor/assets/stylesheets/ckeditor/skins/moono/dialog_opera.css +5 -0
- data/vendor/assets/stylesheets/ckeditor/skins/moono/editor.css +5 -0
- data/vendor/assets/stylesheets/ckeditor/skins/moono/editor_gecko.css +5 -0
- data/vendor/assets/stylesheets/ckeditor/skins/moono/editor_ie.css +5 -0
- data/vendor/assets/stylesheets/ckeditor/skins/moono/editor_ie7.css +5 -0
- data/vendor/assets/stylesheets/ckeditor/skins/moono/editor_ie8.css +5 -0
- data/vendor/assets/stylesheets/ckeditor/skins/moono/icons.png +0 -0
- data/vendor/assets/stylesheets/ckeditor/skins/moono/images/arrow.png +0 -0
- data/vendor/assets/stylesheets/ckeditor/skins/moono/images/close.png +0 -0
- data/vendor/assets/stylesheets/ckeditor/skins/moono/images/mini.png +0 -0
- data/vendor/assets/stylesheets/ckeditor/skins/moono/readme.md +51 -0
- 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}".'
|
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,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
|
data/spec/factories.rb
ADDED
@@ -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
|