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.
- checksums.yaml +4 -4
- data/app/assets/images/.keep +0 -0
- data/app/assets/javascripts/constructor_core/application.js.coffee +15 -18
- data/app/assets/javascripts/constructor_core/expandable_tree/hashchange.js.coffee +33 -0
- data/app/assets/javascripts/constructor_core/expandable_tree/initializer.js.coffee +106 -0
- data/app/assets/javascripts/constructor_core/expandable_tree/jquery.cookie.coffee +68 -0
- data/app/assets/javascripts/constructor_core/expandable_tree/restorable.js.coffee +122 -0
- data/app/assets/javascripts/constructor_core/jquery.ui.nestedSortable.js +429 -0
- data/app/assets/javascripts/constructor_core/jquery_bundle.js.coffee +2 -1
- data/app/assets/javascripts/constructor_core/render_tree_helper.js.coffee +82 -0
- data/app/assets/javascripts/constructor_core/sortable_tree/initializer.js.coffee +54 -0
- data/app/assets/stylesheets/constructor_core/application.css.scss +24 -1
- data/app/assets/stylesheets/constructor_core/framework/all.scss +4 -0
- data/app/assets/stylesheets/constructor_core/framework/classes.scss +4 -0
- data/app/assets/stylesheets/constructor_core/framework/globals.scss +49 -0
- data/app/assets/stylesheets/constructor_core/framework/grid.scss +33 -0
- data/app/assets/stylesheets/constructor_core/framework/mixin.scss +193 -0
- data/app/assets/stylesheets/constructor_core/project/blocks/b-button/_color/b-button_color_light.scss +12 -0
- data/app/assets/stylesheets/constructor_core/project/blocks/b-button/_size/b-button_size_small.scss +7 -0
- data/app/assets/stylesheets/constructor_core/project/blocks/b-button/b-button.scss +29 -0
- data/app/assets/stylesheets/constructor_core/project/blocks/b-form/__actions/b-form__actions.scss +3 -0
- data/app/assets/stylesheets/constructor_core/project/blocks/b-form/__field/b-form__field.scss +12 -0
- data/app/assets/stylesheets/constructor_core/project/blocks/b-form/__file/b-form__file.scss +12 -0
- data/app/assets/stylesheets/constructor_core/project/blocks/b-form/__label/b-form__label.scss +7 -0
- data/app/assets/stylesheets/constructor_core/project/blocks/b-form/__row/b-form__row.scss +4 -0
- data/app/assets/stylesheets/constructor_core/project/blocks/b-form/b-form.scss +1 -0
- data/app/assets/stylesheets/constructor_core/project/blocks/b-form/b-full-url/__icon/b-full-url__icon.scss +5 -0
- data/app/assets/stylesheets/constructor_core/project/blocks/b-form/b-full-url/__path/b-full-url__path.scss +4 -0
- data/app/assets/stylesheets/constructor_core/project/blocks/b-form/b-full-url/__url/b-full-url__url.scss +8 -0
- data/app/assets/stylesheets/constructor_core/project/blocks/b-form/b-full-url/b-full-url.scss +11 -0
- data/app/assets/stylesheets/constructor_core/project/blocks/b-header/b-header.scss +6 -0
- data/app/assets/stylesheets/constructor_core/project/blocks/b-login/__field/b-login__field.scss +13 -0
- data/app/assets/stylesheets/constructor_core/project/blocks/b-login/__label/b-login__label.scss +6 -0
- data/app/assets/stylesheets/constructor_core/project/blocks/b-login/__remember/b-login__remember.scss +4 -0
- data/app/assets/stylesheets/constructor_core/project/blocks/b-login/b-login.scss +8 -0
- data/app/assets/stylesheets/constructor_core/project/blocks/b-logo/b-logo.scss +15 -0
- data/app/assets/stylesheets/constructor_core/project/blocks/b-menu/__item-icon/b-menu__item-icon.scss +3 -0
- data/app/assets/stylesheets/constructor_core/project/blocks/b-menu/__item-link/_active/b-menu__item-link_active.scss +10 -0
- data/app/assets/stylesheets/constructor_core/project/blocks/b-menu/__item-link/b-menu__item-link.scss +13 -0
- data/app/assets/stylesheets/constructor_core/project/blocks/b-menu/__item/b-menu__item.scss +4 -0
- data/app/assets/stylesheets/constructor_core/project/blocks/b-menu/b-menu.scss +5 -0
- data/app/assets/stylesheets/constructor_core/project/blocks/b-profile/b-profile.scss +3 -0
- data/app/assets/stylesheets/constructor_core/project/blocks/b-tree/__expand/b-tree__expand.scss +10 -0
- data/app/assets/stylesheets/constructor_core/project/blocks/b-tree/__handle/b-tree__handle.scss +8 -0
- data/app/assets/stylesheets/constructor_core/project/blocks/b-tree/__item/b-tree__item.scss +5 -0
- data/app/assets/stylesheets/constructor_core/project/blocks/b-tree/__li/b-tree__li.scss +4 -0
- data/app/assets/stylesheets/constructor_core/project/blocks/b-tree/__link/b-tree__link.scss +14 -0
- data/app/assets/stylesheets/constructor_core/project/blocks/b-tree/__nested-set/b-tree__nested-set.scss +6 -0
- data/app/assets/stylesheets/constructor_core/project/blocks/b-tree/__url/b-tree__url.scss +5 -0
- data/app/assets/stylesheets/constructor_core/project/blocks/b-tree/b-tree.scss +5 -0
- data/app/assets/stylesheets/constructor_core/project/layouts/l-all/l-all.scss +4 -0
- data/app/assets/stylesheets/constructor_core/project/layouts/l-content/l-content.scss +3 -0
- data/app/assets/stylesheets/constructor_core/project/layouts/l-header/__avatar/l-header__avatar.scss +5 -0
- data/app/assets/stylesheets/constructor_core/project/layouts/l-header/__email/l-header__email.scss +12 -0
- data/app/assets/stylesheets/constructor_core/project/layouts/l-header/__link-icon/l-header__link-icon.scss +4 -0
- data/app/assets/stylesheets/constructor_core/project/layouts/l-header/__link/l-header__link.scss +12 -0
- data/app/assets/stylesheets/constructor_core/project/layouts/l-header/__logout/l-header__logout.scss +11 -0
- data/app/assets/stylesheets/constructor_core/project/layouts/l-header/__profile/l-header__profile.scss +4 -0
- data/app/assets/stylesheets/constructor_core/project/layouts/l-header/l-header.scss +7 -0
- data/app/assets/stylesheets/constructor_core/project/layouts/l-pages/l-pages.scss +3 -0
- data/app/assets/stylesheets/constructor_core/project/layouts/l-sidebar/l-sidebar.scss +7 -0
- data/app/controllers/constructor_core/sessions_controller.rb +1 -1
- data/app/helpers/constructor_core/application_helper.rb +6 -0
- data/app/helpers/render_expandable_tree_helper.rb +51 -0
- data/app/views/constructor_core/sessions/new.html.slim +11 -20
- data/app/views/constructor_core/users/profile.html.slim +11 -17
- data/app/views/layouts/constructor_core/application_core.html.slim +44 -70
- data/app/views/layouts/constructor_core/login.html.slim +27 -0
- data/config/locales/en.yml +3 -2
- data/config/locales/fr.yml +3 -2
- data/config/locales/ru.yml +2 -1
- data/constructor-core.gemspec +4 -3
- data/lib/constructor-core.rb +5 -2
- data/lib/constructor_core/version.rb +1 -1
- data/{app → vendor}/assets/javascripts/constructor_core/jquery.cookie.js +0 -0
- data/{app → vendor}/assets/javascripts/constructor_core/keys_snippet.js +0 -0
- data/{app → vendor}/assets/javascripts/constructor_core/retina.js +0 -0
- data/vendor/assets/stylesheets/constructor_core/framework/all.scss +4 -0
- data/vendor/assets/stylesheets/constructor_core/framework/classes.scss +4 -0
- data/vendor/assets/stylesheets/constructor_core/framework/globals.scss +49 -0
- data/vendor/assets/stylesheets/constructor_core/framework/grid.scss +33 -0
- data/vendor/assets/stylesheets/constructor_core/framework/mixin.scss +193 -0
- metadata +94 -45
- 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/bootstrap.js +0 -2276
- data/app/assets/stylesheets/constructor_core/main.css.scss.erb +0 -233
- data/app/views/constructor_core/devise/confirmations/new.html.slim +0 -10
- data/app/views/constructor_core/devise/mailer/confirmation_instructions.html.slim +0 -5
- data/app/views/constructor_core/devise/mailer/reset_password_instructions.html.slim +0 -7
- data/app/views/constructor_core/devise/mailer/unlock_instructions.html.slim +0 -5
- data/app/views/constructor_core/devise/passwords/edit.html.slim +0 -21
- data/app/views/constructor_core/devise/passwords/new.html.slim +0 -13
- data/app/views/constructor_core/devise/registrations/edit.html.slim +0 -28
- data/app/views/constructor_core/devise/registrations/new.html.slim +0 -20
- data/app/views/constructor_core/devise/shared/_links.html.slim +0 -19
- 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,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 @@
|
|
1
|
+
.b-form {}
|
@@ -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,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
|
+
}
|
@@ -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
|