constructor-core 0.9.1 → 1.0.0beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (112) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/.keep +0 -0
  3. data/app/assets/javascripts/constructor_core/application.js.coffee +15 -18
  4. data/app/assets/javascripts/constructor_core/expandable_tree/hashchange.js.coffee +33 -0
  5. data/app/assets/javascripts/constructor_core/expandable_tree/initializer.js.coffee +106 -0
  6. data/app/assets/javascripts/constructor_core/expandable_tree/jquery.cookie.coffee +68 -0
  7. data/app/assets/javascripts/constructor_core/expandable_tree/restorable.js.coffee +122 -0
  8. data/app/assets/javascripts/constructor_core/jquery.ui.nestedSortable.js +429 -0
  9. data/app/assets/javascripts/constructor_core/jquery_bundle.js.coffee +2 -1
  10. data/app/assets/javascripts/constructor_core/render_tree_helper.js.coffee +82 -0
  11. data/app/assets/javascripts/constructor_core/sortable_tree/initializer.js.coffee +54 -0
  12. data/app/assets/stylesheets/constructor_core/application.css.scss +24 -1
  13. data/app/assets/stylesheets/constructor_core/framework/all.scss +4 -0
  14. data/app/assets/stylesheets/constructor_core/framework/classes.scss +4 -0
  15. data/app/assets/stylesheets/constructor_core/framework/globals.scss +49 -0
  16. data/app/assets/stylesheets/constructor_core/framework/grid.scss +33 -0
  17. data/app/assets/stylesheets/constructor_core/framework/mixin.scss +193 -0
  18. data/app/assets/stylesheets/constructor_core/project/blocks/b-button/_color/b-button_color_light.scss +12 -0
  19. data/app/assets/stylesheets/constructor_core/project/blocks/b-button/_size/b-button_size_small.scss +7 -0
  20. data/app/assets/stylesheets/constructor_core/project/blocks/b-button/b-button.scss +29 -0
  21. data/app/assets/stylesheets/constructor_core/project/blocks/b-form/__actions/b-form__actions.scss +3 -0
  22. data/app/assets/stylesheets/constructor_core/project/blocks/b-form/__field/b-form__field.scss +12 -0
  23. data/app/assets/stylesheets/constructor_core/project/blocks/b-form/__file/b-form__file.scss +12 -0
  24. data/app/assets/stylesheets/constructor_core/project/blocks/b-form/__label/b-form__label.scss +7 -0
  25. data/app/assets/stylesheets/constructor_core/project/blocks/b-form/__row/b-form__row.scss +4 -0
  26. data/app/assets/stylesheets/constructor_core/project/blocks/b-form/b-form.scss +1 -0
  27. data/app/assets/stylesheets/constructor_core/project/blocks/b-form/b-full-url/__icon/b-full-url__icon.scss +5 -0
  28. data/app/assets/stylesheets/constructor_core/project/blocks/b-form/b-full-url/__path/b-full-url__path.scss +4 -0
  29. data/app/assets/stylesheets/constructor_core/project/blocks/b-form/b-full-url/__url/b-full-url__url.scss +8 -0
  30. data/app/assets/stylesheets/constructor_core/project/blocks/b-form/b-full-url/b-full-url.scss +11 -0
  31. data/app/assets/stylesheets/constructor_core/project/blocks/b-header/b-header.scss +6 -0
  32. data/app/assets/stylesheets/constructor_core/project/blocks/b-login/__field/b-login__field.scss +13 -0
  33. data/app/assets/stylesheets/constructor_core/project/blocks/b-login/__label/b-login__label.scss +6 -0
  34. data/app/assets/stylesheets/constructor_core/project/blocks/b-login/__remember/b-login__remember.scss +4 -0
  35. data/app/assets/stylesheets/constructor_core/project/blocks/b-login/b-login.scss +8 -0
  36. data/app/assets/stylesheets/constructor_core/project/blocks/b-logo/b-logo.scss +15 -0
  37. data/app/assets/stylesheets/constructor_core/project/blocks/b-menu/__item-icon/b-menu__item-icon.scss +3 -0
  38. data/app/assets/stylesheets/constructor_core/project/blocks/b-menu/__item-link/_active/b-menu__item-link_active.scss +10 -0
  39. data/app/assets/stylesheets/constructor_core/project/blocks/b-menu/__item-link/b-menu__item-link.scss +13 -0
  40. data/app/assets/stylesheets/constructor_core/project/blocks/b-menu/__item/b-menu__item.scss +4 -0
  41. data/app/assets/stylesheets/constructor_core/project/blocks/b-menu/b-menu.scss +5 -0
  42. data/app/assets/stylesheets/constructor_core/project/blocks/b-profile/b-profile.scss +3 -0
  43. data/app/assets/stylesheets/constructor_core/project/blocks/b-tree/__expand/b-tree__expand.scss +10 -0
  44. data/app/assets/stylesheets/constructor_core/project/blocks/b-tree/__handle/b-tree__handle.scss +8 -0
  45. data/app/assets/stylesheets/constructor_core/project/blocks/b-tree/__item/b-tree__item.scss +5 -0
  46. data/app/assets/stylesheets/constructor_core/project/blocks/b-tree/__li/b-tree__li.scss +4 -0
  47. data/app/assets/stylesheets/constructor_core/project/blocks/b-tree/__link/b-tree__link.scss +14 -0
  48. data/app/assets/stylesheets/constructor_core/project/blocks/b-tree/__nested-set/b-tree__nested-set.scss +6 -0
  49. data/app/assets/stylesheets/constructor_core/project/blocks/b-tree/__url/b-tree__url.scss +5 -0
  50. data/app/assets/stylesheets/constructor_core/project/blocks/b-tree/b-tree.scss +5 -0
  51. data/app/assets/stylesheets/constructor_core/project/layouts/l-all/l-all.scss +4 -0
  52. data/app/assets/stylesheets/constructor_core/project/layouts/l-content/l-content.scss +3 -0
  53. data/app/assets/stylesheets/constructor_core/project/layouts/l-header/__avatar/l-header__avatar.scss +5 -0
  54. data/app/assets/stylesheets/constructor_core/project/layouts/l-header/__email/l-header__email.scss +12 -0
  55. data/app/assets/stylesheets/constructor_core/project/layouts/l-header/__link-icon/l-header__link-icon.scss +4 -0
  56. data/app/assets/stylesheets/constructor_core/project/layouts/l-header/__link/l-header__link.scss +12 -0
  57. data/app/assets/stylesheets/constructor_core/project/layouts/l-header/__logout/l-header__logout.scss +11 -0
  58. data/app/assets/stylesheets/constructor_core/project/layouts/l-header/__profile/l-header__profile.scss +4 -0
  59. data/app/assets/stylesheets/constructor_core/project/layouts/l-header/l-header.scss +7 -0
  60. data/app/assets/stylesheets/constructor_core/project/layouts/l-pages/l-pages.scss +3 -0
  61. data/app/assets/stylesheets/constructor_core/project/layouts/l-sidebar/l-sidebar.scss +7 -0
  62. data/app/controllers/constructor_core/sessions_controller.rb +1 -1
  63. data/app/helpers/constructor_core/application_helper.rb +6 -0
  64. data/app/helpers/render_expandable_tree_helper.rb +51 -0
  65. data/app/views/constructor_core/sessions/new.html.slim +11 -20
  66. data/app/views/constructor_core/users/profile.html.slim +11 -17
  67. data/app/views/layouts/constructor_core/application_core.html.slim +44 -70
  68. data/app/views/layouts/constructor_core/login.html.slim +27 -0
  69. data/config/locales/en.yml +3 -2
  70. data/config/locales/fr.yml +3 -2
  71. data/config/locales/ru.yml +2 -1
  72. data/constructor-core.gemspec +4 -3
  73. data/lib/constructor-core.rb +5 -2
  74. data/lib/constructor_core/version.rb +1 -1
  75. data/{app → vendor}/assets/javascripts/constructor_core/jquery.cookie.js +0 -0
  76. data/{app → vendor}/assets/javascripts/constructor_core/keys_snippet.js +0 -0
  77. data/{app → vendor}/assets/javascripts/constructor_core/retina.js +0 -0
  78. data/vendor/assets/stylesheets/constructor_core/framework/all.scss +4 -0
  79. data/vendor/assets/stylesheets/constructor_core/framework/classes.scss +4 -0
  80. data/vendor/assets/stylesheets/constructor_core/framework/globals.scss +49 -0
  81. data/vendor/assets/stylesheets/constructor_core/framework/grid.scss +33 -0
  82. data/vendor/assets/stylesheets/constructor_core/framework/mixin.scss +193 -0
  83. metadata +94 -45
  84. data/app/assets/images/constructor_core/glyphicons-halflings-white.png +0 -0
  85. data/app/assets/images/constructor_core/glyphicons-halflings.png +0 -0
  86. data/app/assets/images/constructor_core/minus.gif +0 -0
  87. data/app/assets/images/constructor_core/plus.gif +0 -0
  88. data/app/assets/images/constructor_core/rss.png +0 -0
  89. data/app/assets/images/constructor_core/treeview-black-line.gif +0 -0
  90. data/app/assets/images/constructor_core/treeview-black.gif +0 -0
  91. data/app/assets/images/constructor_core/treeview-default-line.gif +0 -0
  92. data/app/assets/images/constructor_core/treeview-default.gif +0 -0
  93. data/app/assets/images/constructor_core/treeview-famfamfam-line.gif +0 -0
  94. data/app/assets/images/constructor_core/treeview-famfamfam.gif +0 -0
  95. data/app/assets/images/constructor_core/treeview-gray-line.gif +0 -0
  96. data/app/assets/images/constructor_core/treeview-gray.gif +0 -0
  97. data/app/assets/images/constructor_core/treeview-red-line.gif +0 -0
  98. data/app/assets/images/constructor_core/treeview-red.gif +0 -0
  99. data/app/assets/images/constructor_core/twitter.png +0 -0
  100. data/app/assets/images/constructor_core/widgets.png +0 -0
  101. data/app/assets/javascripts/constructor_core/bootstrap.js +0 -2276
  102. data/app/assets/stylesheets/constructor_core/main.css.scss.erb +0 -233
  103. data/app/views/constructor_core/devise/confirmations/new.html.slim +0 -10
  104. data/app/views/constructor_core/devise/mailer/confirmation_instructions.html.slim +0 -5
  105. data/app/views/constructor_core/devise/mailer/reset_password_instructions.html.slim +0 -7
  106. data/app/views/constructor_core/devise/mailer/unlock_instructions.html.slim +0 -5
  107. data/app/views/constructor_core/devise/passwords/edit.html.slim +0 -21
  108. data/app/views/constructor_core/devise/passwords/new.html.slim +0 -13
  109. data/app/views/constructor_core/devise/registrations/edit.html.slim +0 -28
  110. data/app/views/constructor_core/devise/registrations/new.html.slim +0 -20
  111. data/app/views/constructor_core/devise/shared/_links.html.slim +0 -19
  112. data/app/views/constructor_core/devise/unlocks/new.html.slim +0 -9
@@ -0,0 +1,12 @@
1
+ .b-button.b-button_color_light {
2
+ font-weight: 300;
3
+ color: #555;
4
+ background: #ddd;
5
+ border: 1px solid #ddd;
6
+ @include gradient-vertical(#f5f5f5, #f1f1f1);
7
+
8
+ &:hover, &:active, &:focus {
9
+ border: 1px solid #ccc;
10
+ @include gradient-vertical(#f1f1f1, #f5f5f5);
11
+ }
12
+ }
@@ -0,0 +1,7 @@
1
+ .b-button.b-button_size_small {
2
+ @include display-inline;
3
+ margin-top: 7px;
4
+ padding: 4px 8px;
5
+ font-weight: 400;
6
+ font-size: 11px;
7
+ }
@@ -0,0 +1,29 @@
1
+ .b-button {
2
+ @include display-inline;
3
+ margin: 2px;
4
+ padding: 8px 15px;
5
+ border: none;
6
+ color: #fff;
7
+ font-weight: 700;
8
+ font-size: 13px;
9
+ line-height: 14px;
10
+ text-decoration: none;
11
+ background: #dd4b39;
12
+ border: 1px solid #dd4b39;
13
+ @include gradient-vertical(#dd4b39, #d14836);
14
+ outline: none;
15
+
16
+ -webkit-appearance: none;
17
+ appearance: none;
18
+
19
+ @include border-radius(2px);
20
+
21
+ &:focus, &:active, &:hover {
22
+ cursor: pointer;
23
+ @include gradient-vertical(#d74937, #bf4231);
24
+ }
25
+
26
+ &:active {
27
+ @include box-shadow(inset 0 2px 3px rgba(0,0,0,0.2));
28
+ }
29
+ }
@@ -0,0 +1,12 @@
1
+ .b-form__field {
2
+ width: 300px;
3
+ padding: 3px;
4
+ font-size: 14px;
5
+ color: #444;
6
+ border: 1px solid #ddd;
7
+ outline: none;
8
+
9
+ &:focus, &:active, &:hover {
10
+ border-color: #aaa;
11
+ }
12
+ }
@@ -0,0 +1,12 @@
1
+ .b-form__file {
2
+ width: 300px;
3
+ padding: 3px;
4
+ font-size: 14px;
5
+ color: #444;
6
+ border: none;
7
+ outline: none;
8
+
9
+ &:focus, &:active, &:hover {
10
+ border-color: #aaa;
11
+ }
12
+ }
@@ -0,0 +1,7 @@
1
+ .b-form__label {
2
+ @include display-inline;
3
+ width: 200px;
4
+ padding-left: 15px;
5
+ font-size: 15px;
6
+ color: #555;
7
+ }
@@ -0,0 +1,4 @@
1
+ .b-form__row {
2
+ line-height: 38px;
3
+ border-bottom: 1px solid #eee;
4
+ }
@@ -0,0 +1,5 @@
1
+ .b-full-url__icon {
2
+ color: #555;
3
+ margin-left: 7px;
4
+ cursor: pointer;
5
+ }
@@ -0,0 +1,4 @@
1
+ .b-full-url__path {
2
+ font-size: 13px;
3
+ color: #555;
4
+ }
@@ -0,0 +1,8 @@
1
+ .b-full-url__url {
2
+ font-weight: 400;
3
+ font-size: 14px;
4
+
5
+ &:hover {
6
+ background: #eee;
7
+ }
8
+ }
@@ -0,0 +1,11 @@
1
+ .b-full-url {
2
+ .fa-pencil {
3
+ display: none;
4
+ }
5
+
6
+ &:hover {
7
+ .fa-pencil {
8
+ display: inline;
9
+ }
10
+ }
11
+ }
@@ -0,0 +1,6 @@
1
+ .b-header {
2
+ margin: 0;
3
+ padding: 15px;
4
+ font-size: 24px;
5
+ color: #333;
6
+ }
@@ -0,0 +1,13 @@
1
+ .b-login__field {
2
+ display: block;
3
+ width: 250px;
4
+ margin-bottom: 20px;
5
+ padding: 8px;
6
+ font-size: 14px;
7
+ border: 1px solid #ddd;
8
+ outline: none;
9
+
10
+ &:focus, &:active, &:hover {
11
+ border-color: #aaa;
12
+ }
13
+ }
@@ -0,0 +1,6 @@
1
+ .b-login__label {
2
+ display: block;
3
+ margin-bottom: 4px;
4
+ font-size: 14px;
5
+ font-weight: 400;
6
+ }
@@ -0,0 +1,4 @@
1
+ .b-login__remember {
2
+ margin-bottom: 15px;
3
+ font-size: 14px;
4
+ }
@@ -0,0 +1,8 @@
1
+ .b-login {
2
+ position: relative;
3
+ width: 268px;
4
+ margin: 100px auto 0;
5
+ padding: 20px;
6
+ border: 1px solid #ddd;
7
+ background: #eee;
8
+ }
@@ -0,0 +1,15 @@
1
+ .b-logo {
2
+ @include display-block;
3
+ height: 36px;
4
+ padding-top: 10px;
5
+ margin-bottom: 20px;
6
+ font-weight: bold;
7
+ font-size: 20px;
8
+ color: #444;
9
+ text-shadow: 0 1px 0 rgba(255,255,255,0.9);
10
+ text-decoration: none;
11
+ text-align: center;
12
+ border-bottom: 1px solid rgba(0,0,0,0.1);
13
+ background: #eee;
14
+ @include gradient-vertical(#f9f9f9, #f3f3f3);
15
+ }
@@ -0,0 +1,10 @@
1
+ .b-menu__item-link_active {
2
+ padding-left: 16px !important;
3
+ color: #dd4b39 !important;
4
+ font-weight: 700;
5
+ border-left: 4px solid #dd4b39;
6
+
7
+ &:hover {
8
+ background: #fff !important;
9
+ }
10
+ }
@@ -0,0 +1,13 @@
1
+ .b-menu__item-link {
2
+ @include display-block;
3
+ padding: 15px 20px;
4
+ font-size: 14px;
5
+ color: #555;
6
+ text-decoration: none;
7
+
8
+ &:hover {
9
+ background: #f3f3f3;
10
+ }
11
+
12
+ @include transition(border-width .2s linear);
13
+ }
@@ -0,0 +1,4 @@
1
+ .b-menu__item {
2
+ padding: 0;
3
+ margin: 0;
4
+ }
@@ -0,0 +1,5 @@
1
+ .b-menu {
2
+ margin: 0;
3
+ padding: 0;
4
+ list-style: none;
5
+ }
@@ -0,0 +1,10 @@
1
+ .b-tree__expand {
2
+ position: absolute;
3
+ left: 28px;
4
+ color: #555;
5
+ line-height: 44px;
6
+ -webkit-user-select: none;
7
+ -moz-user-select: none;
8
+ -ms-user-select: none;
9
+ user-select: none;
10
+ }
@@ -0,0 +1,8 @@
1
+ .b-tree__handle {
2
+ position: absolute;
3
+ color: #bbb;
4
+ font-size: 12px;
5
+ line-height: 42px;
6
+ cursor: move;
7
+ background: none !important;
8
+ }
@@ -0,0 +1,5 @@
1
+ .b-tree__item {
2
+ position: relative;
3
+ padding: 0 0 0 8px;
4
+ border-bottom: 1px solid #ddd;
5
+ }
@@ -0,0 +1,4 @@
1
+ .b-tree__li {
2
+ margin-bottom: 0 !important;
3
+ background: #eee;
4
+ }
@@ -0,0 +1,14 @@
1
+ .b-tree__link {
2
+ display: block;
3
+ padding: 10px 10px 10px 0;
4
+ color: #333;
5
+ font-weight: 300 !important;
6
+ font-size: 14px !important;
7
+ line-height: 150%;
8
+ margin-left: 40px;
9
+ text-decoration: none !important;
10
+
11
+ &:hover {
12
+ color: #dd4b39;
13
+ }
14
+ }
@@ -0,0 +1,6 @@
1
+ .b-tree__nested-set {
2
+ margin: 0 0 0 13px;
3
+ padding: 0 0 0 15px;
4
+ list-style: none;
5
+ border-left: 1px dotted #bbb !important;
6
+ }
@@ -0,0 +1,5 @@
1
+ .b-tree__url {
2
+ margin-left: 10px;
3
+ font-size: 11px;
4
+ color: #777;
5
+ }
@@ -0,0 +1,5 @@
1
+ .b-tree {
2
+ margin: 20px 0 0;
3
+ padding: 0;
4
+ list-style: none;
5
+ }
@@ -0,0 +1,4 @@
1
+ .l-all {
2
+ padding-bottom: 50px;
3
+ background: #fff;
4
+ }
@@ -0,0 +1,5 @@
1
+ .l-header__avatar {
2
+ @include display-inline;
3
+ margin-right: 10px;
4
+ @include border-radius(50%);
5
+ }
@@ -0,0 +1,12 @@
1
+ .l-header__email {
2
+ @include display-inline;
3
+ margin-right: 20px;
4
+ font-size: 14px;
5
+ line-height: 25px;
6
+ color: #333;
7
+ text-decoration: none;
8
+
9
+ &:hover {
10
+ color: #dd4b39;
11
+ }
12
+ }
@@ -0,0 +1,4 @@
1
+ .l-header__link-icon {
2
+ margin-left: 5px;
3
+ font-weight: bold;
4
+ }
@@ -0,0 +1,12 @@
1
+ .l-header__link {
2
+ @include display-inline;
3
+ padding: 10px 15px;
4
+ font-size: 14px;
5
+ line-height: 26px;
6
+ color: #333;
7
+ text-decoration: none;
8
+
9
+ &:hover {
10
+ color: #dd4b39;
11
+ }
12
+ }
@@ -0,0 +1,11 @@
1
+ .l-header__logout {
2
+ @include display-inline;
3
+ font-size: 14px;
4
+ line-height: 25px;
5
+ color: #333;
6
+ text-decoration: none;
7
+
8
+ &:hover {
9
+ color: #dd4b39;
10
+ }
11
+ }
@@ -0,0 +1,4 @@
1
+ .l-header__profile {
2
+ @include display-inline;
3
+ padding: 10px 20px;
4
+ }
@@ -0,0 +1,7 @@
1
+ .l-header {
2
+ height: 46px;
3
+ width: 840px;
4
+ background: #eee;
5
+ border-bottom: 1px solid #ddd;
6
+ @include gradient-vertical(#f9f9f9, #f3f3f3);
7
+ }
@@ -0,0 +1,7 @@
1
+ .l-sidebar {
2
+ height: 100%;
3
+ width: 159px;
4
+ background: #fff;
5
+ border-right: 1px solid #eee;
6
+ @include box-shadow(inset 1px 0 0 rgba(255, 255, 255, 0.15),1px 0 0 rgba(255, 255, 255, 0.15));
7
+ }
@@ -2,7 +2,7 @@
2
2
 
3
3
  module ConstructorCore
4
4
  class SessionsController < Devise::SessionsController
5
- layout 'constructor_core/application_core'
5
+ layout 'constructor_core/login'
6
6
 
7
7
  def after_sign_in_path_for(resource)
8
8
  return '/admin/pages'
@@ -1,5 +1,11 @@
1
1
  module ConstructorCore
2
2
  module ApplicationHelper
3
+ def menu_item(name, icon)
4
+ link_to "/admin/#{name}", class: "b-menu__item-link #{'b-menu__item-link_active' if request.path == "/admin/#{name}"}" do
5
+ "<i class='fa fa-#{icon} b-menu__item-icon'></i> #{t name.to_sym}".html_safe
6
+ end
7
+ end
8
+
3
9
  def gravatar_icon(user_email = '', size = 40)
4
10
  gravatar_url = 'http://www.gravatar.com/avatar/%{hash}?s=%{size}&d=mm'
5
11
  user_email.strip!
@@ -0,0 +1,51 @@
1
+ # DOC:
2
+ # We use Helper Methods for tree building,
3
+ # because it's faster than View Templates and Partials
4
+
5
+ # SECURITY note
6
+ # Prepare your data on server side for rendering
7
+ # or use h.html_escape(node.content)
8
+ # for escape potentially dangerous content
9
+ module RenderExpandableTreeHelper
10
+ module Render
11
+ class << self
12
+ attr_accessor :h, :options
13
+
14
+ def render_node(h, options)
15
+ @h, @options = h, options
16
+ node = options[:node]
17
+
18
+ "<li class='b-tree__li' data-node-id='#{ node.id }'>" +
19
+ "<div class='b-tree__item'>" +
20
+ "<i class='fa fa-bars b-tree__handle'></i>" +
21
+ "#{ show_plus }" +
22
+ "#{ show_link }" +
23
+ "</div>" +
24
+ "#{ children }" +
25
+ "</li>"
26
+ end
27
+
28
+ def show_plus
29
+ unless options[:node].leaf?
30
+ "<i class='fa fa-plus-square-o b-tree__expand b-tree__plus'></i>"
31
+ end
32
+ end
33
+
34
+ def show_link
35
+ node = options[:node]
36
+ ns = options[:namespace]
37
+ title_field = options[:title]
38
+ edit_path = h.url_for(controller: options[:klass].pluralize, action: :edit, id: node)
39
+
40
+ "#{ h.link_to(node.send(title_field), edit_path, class: 'b-tree__link') }"
41
+ end
42
+
43
+ def children
44
+ unless options[:children].blank?
45
+ "<ol class='b-tree__nested-set'>#{ options[:children] }</ol>"
46
+ end
47
+ end
48
+
49
+ end
50
+ end
51
+ end