locomotivecms 3.0.0.rc2 → 3.0.0.rc3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -2
- data/README.md +2 -1
- data/app/api/locomotive/api/entities/site_entity.rb +8 -0
- data/app/api/locomotive/api/exception_rescuers.rb +1 -1
- data/app/api/locomotive/api/forms/content_entry_form.rb +4 -3
- data/app/api/locomotive/api/helpers/params_helper.rb +21 -3
- data/app/api/locomotive/api/resources/current_site_resource.rb +1 -1
- data/app/api/locomotive/api/resources/site_resource.rb +2 -2
- data/app/assets/images/locomotive/deadend.png +0 -0
- data/app/assets/javascripts/locomotive/not_logged_in.js.coffee +1 -1
- data/app/assets/javascripts/locomotive/utils/core_ext.js +1 -1
- data/app/assets/javascripts/locomotive/utils/wysihtml5.js.coffee +43 -17
- data/app/assets/javascripts/locomotive/views/application_view.js.coffee +5 -1
- data/app/assets/javascripts/locomotive/views/editable_elements/edit_view.js.coffee +47 -0
- data/app/assets/javascripts/locomotive/views/editable_elements/iframe_view.js.coffee +59 -0
- data/app/assets/javascripts/locomotive/views/editable_elements/index_view.js.coffee +19 -92
- data/app/assets/javascripts/locomotive/views/editable_elements/page_view.js.coffee +81 -0
- data/app/assets/javascripts/locomotive/views/editable_elements/text_highlighter_view.js.coffee +76 -0
- data/app/assets/javascripts/locomotive/views/inputs/rte/edit_table_view.js.coffee +35 -0
- data/app/assets/javascripts/locomotive/views/inputs/rte/file_view.js.coffee +14 -10
- data/app/assets/javascripts/locomotive/views/inputs/rte/link_view.js.coffee +25 -15
- data/app/assets/javascripts/locomotive/views/inputs/rte/table_view.js.coffee +82 -0
- data/app/assets/javascripts/locomotive/views/inputs/rte_view.js.coffee.erb +64 -23
- data/app/assets/javascripts/locomotive/views/inputs/text_view.js.coffee +11 -6
- data/app/assets/javascripts/locomotive.js +2 -2
- data/app/assets/stylesheets/locomotive/application.scss +1 -3
- data/app/assets/stylesheets/locomotive/base/_form.scss +2 -1
- data/app/assets/stylesheets/locomotive/base/_typography.scss +3 -2
- data/app/assets/stylesheets/locomotive/base/form/_base.scss +5 -0
- data/app/assets/stylesheets/locomotive/base/form/_rte.scss +42 -0
- data/app/assets/stylesheets/locomotive/error.scss +1 -1
- data/app/assets/stylesheets/locomotive/globals/_mixins.scss +41 -48
- data/app/assets/stylesheets/locomotive/globals/_variables.scss +202 -121
- data/app/assets/stylesheets/locomotive/layouts/_not_logged_in.scss +8 -9
- data/app/assets/stylesheets/locomotive/live_editing_error.scss +19 -0
- data/app/assets/stylesheets/locomotive/live_editing_iframe.scss +84 -0
- data/app/assets/stylesheets/locomotive/unauthorized/_forms.scss +63 -0
- data/app/assets/stylesheets/locomotive/unauthorized/_keyframes.scss +31 -0
- data/app/assets/stylesheets/locomotive/unauthorized/_notify.scss +85 -0
- data/app/assets/stylesheets/locomotive/unauthorized/_public.scss +129 -0
- data/app/assets/stylesheets/locomotive/unauthorized/_type.scss +14 -0
- data/app/assets/stylesheets/locomotive/unauthorized/_variables.scss +54 -0
- data/app/assets/stylesheets/locomotive/unauthorized.scss +34 -0
- data/app/helpers/locomotive/dashboard_helper.rb +1 -1
- data/app/inputs/locomotive/rte_input.rb +12 -0
- data/app/models/locomotive/concerns/page/editable_elements.rb +0 -2
- data/app/models/locomotive/editable_element.rb +1 -1
- data/app/services/locomotive/content_asset_service.rb +1 -1
- data/app/services/locomotive/page_parsing_service.rb +4 -2
- data/app/views/locomotive/editable_elements/index.html.slim +1 -1
- data/app/views/locomotive/layouts/not_logged_in.html.slim +13 -9
- data/app/views/locomotive/passwords/edit.html.slim +13 -13
- data/app/views/locomotive/passwords/new.html.slim +14 -11
- data/app/views/locomotive/registrations/new.html.slim +14 -13
- data/app/views/locomotive/sessions/new.html.slim +14 -13
- data/app/views/locomotive/shared/rte/_markdown_toolbar.html.slim +0 -30
- data/app/views/locomotive/shared/rte/_table_popover.html.slim +17 -0
- data/app/views/locomotive/shared/rte/_toolbar.html.slim +48 -11
- data/config/initializers/simple_form.rb +2 -0
- data/config/locales/carrierwave.lt.yml +4 -0
- data/config/locales/carrierwave.nl.yml +4 -0
- data/config/locales/carrierwave.ru.yml +4 -0
- data/config/locales/default.nl.yml +13 -0
- data/config/locales/devise.nl.yml +61 -0
- data/config/locales/en.yml +28 -10
- data/config/locales/flash.nl.yml +79 -0
- data/config/locales/inputs.lt.yml +18 -0
- data/config/locales/inputs.nl.yml +18 -0
- data/config/locales/mongoid.nl.yml +47 -0
- data/config/locales/nl.yml +316 -0
- data/config/locales/simple_form.en.yml +6 -0
- data/config/locales/simple_form.nl.yml +148 -0
- data/lib/locomotive/carrierwave/asset.rb +5 -1
- data/lib/locomotive/dependencies.rb +0 -1
- data/lib/locomotive/engine.rb +7 -1
- data/lib/locomotive/middlewares/site.rb +14 -2
- data/lib/locomotive/mongoid/patches.rb +29 -0
- data/lib/locomotive/steam/middlewares/catch_error.rb +78 -0
- data/lib/locomotive/steam/middlewares/wysihtml_css.rb +32 -0
- data/lib/locomotive/steam_adaptor.rb +4 -7
- data/lib/locomotive/version.rb +1 -1
- data/spec/requests/locomotive/steam/cache_spec.rb +3 -3
- data/spec/requests/locomotive/steam/wysihtml_css_spec.rb +42 -0
- data/spec/requests/site_spec.rb +13 -2
- data/spec/support/features/session_helpers.rb +3 -3
- data/vendor/assets/components/locomotive/backbone/backbone.js +1894 -0
- data/vendor/assets/components/locomotive/underscore/underscore.js +1548 -0
- data/vendor/assets/components/locomotive_sources/backbone/LICENSE +22 -0
- data/vendor/assets/components/locomotive_sources/backbone/backbone-min.js +2 -0
- data/vendor/assets/components/locomotive_sources/backbone/backbone-min.map +1 -0
- data/vendor/assets/components/locomotive_sources/backbone/backbone.js +1894 -0
- data/vendor/assets/components/locomotive_sources/backbone/bower.json +8 -0
- data/vendor/assets/components/locomotive_sources/underscore/LICENSE +23 -0
- data/vendor/assets/components/locomotive_sources/underscore/README.md +22 -0
- data/vendor/assets/components/locomotive_sources/underscore/bower.json +7 -0
- data/vendor/assets/components/locomotive_sources/underscore/underscore-min.js +6 -0
- data/vendor/assets/components/locomotive_sources/underscore/underscore-min.map +1 -0
- data/vendor/assets/components/locomotive_sources/underscore/underscore.js +1548 -0
- data/vendor/assets/javascripts/locomotive/wysihtml5/parser_rules/advanced.js +22 -48
- data/vendor/assets/javascripts/locomotive/wysihtml5/parser_rules/advanced_unwrap.js +13 -12
- data/vendor/assets/javascripts/locomotive/wysihtml5x-toolbar.js +7324 -3862
- data/vendor/assets/stylesheets/locomotive/wysihtml5_editor.css +27 -1
- metadata +53 -28
- data/app/assets/stylesheets/locomotive/globals/_all.scss +0 -3
- data/app/assets/stylesheets/locomotive/globals/_bootstrap.scss +0 -841
- data/app/assets/stylesheets/locomotive/globals/_colors.scss +0 -1
- data/app/assets/stylesheets/locomotive/globals/_nprogress.scss +0 -3
- data/app/assets/stylesheets/locomotive/not_logged_in.scss +0 -15
@@ -0,0 +1,31 @@
|
|
1
|
+
// =============================================================================
|
2
|
+
// Keyframes
|
3
|
+
// =============================================================================
|
4
|
+
|
5
|
+
// Fades a element down while increasing its opacity.
|
6
|
+
|
7
|
+
@keyframes fade-down {
|
8
|
+
0% {
|
9
|
+
opacity: .5;
|
10
|
+
transform: translateY(-10px);
|
11
|
+
}
|
12
|
+
|
13
|
+
100% {
|
14
|
+
opacity: 1;
|
15
|
+
transform: translateY(0);
|
16
|
+
}
|
17
|
+
}
|
18
|
+
|
19
|
+
// Fades a element to the left while increasing its opacity.
|
20
|
+
|
21
|
+
@keyframes fade-left {
|
22
|
+
0% {
|
23
|
+
opacity: .5;
|
24
|
+
transform: translateX(10px);
|
25
|
+
}
|
26
|
+
|
27
|
+
100% {
|
28
|
+
opacity: 1;
|
29
|
+
transform: translateX(0);
|
30
|
+
}
|
31
|
+
}
|
@@ -0,0 +1,85 @@
|
|
1
|
+
// =============================================================================
|
2
|
+
// Notify
|
3
|
+
// =============================================================================
|
4
|
+
|
5
|
+
// Notifies the user with success messages or errors in the right bottom of the
|
6
|
+
// page.
|
7
|
+
|
8
|
+
// Settings
|
9
|
+
// =============================================================================
|
10
|
+
|
11
|
+
// Scaffolding notifications with a given color.
|
12
|
+
// @param {Hex} $color color background and font.
|
13
|
+
|
14
|
+
@mixin notification-generator($color) {
|
15
|
+
color: $color;
|
16
|
+
background-color: rgba(lighten($color, 55), .8);
|
17
|
+
.close {
|
18
|
+
color: rgba($color, .3);
|
19
|
+
&:hover {
|
20
|
+
color: rgba($color, .6);
|
21
|
+
}
|
22
|
+
}
|
23
|
+
[data-notify="icon"] {
|
24
|
+
color: $color;
|
25
|
+
}
|
26
|
+
}
|
27
|
+
|
28
|
+
// Components
|
29
|
+
// =============================================================================
|
30
|
+
|
31
|
+
[data-notify="container"] {
|
32
|
+
position: relative;
|
33
|
+
font-size: 0;
|
34
|
+
border: none;
|
35
|
+
box-shadow: 0 1px 10px rgba($black, .2);
|
36
|
+
animation: fade-left .5s ease-out;
|
37
|
+
.close {
|
38
|
+
position: absolute;
|
39
|
+
top: 50%;
|
40
|
+
right: 15px;
|
41
|
+
padding: 0;
|
42
|
+
margin-top: -12px;
|
43
|
+
font-size: 24px;
|
44
|
+
line-height: 1;
|
45
|
+
background: none;
|
46
|
+
border: 0;
|
47
|
+
&:focus,
|
48
|
+
&:active {
|
49
|
+
outline: none;
|
50
|
+
}
|
51
|
+
}
|
52
|
+
}
|
53
|
+
|
54
|
+
[data-notify="icon"] {
|
55
|
+
display: inline-block;
|
56
|
+
width: 15%;
|
57
|
+
margin-left: -7.5px;
|
58
|
+
font-size: 18px;
|
59
|
+
text-align: center;
|
60
|
+
vertical-align: middle;
|
61
|
+
}
|
62
|
+
|
63
|
+
[data-notify="message"] {
|
64
|
+
display: inline-block;
|
65
|
+
width: 85%;
|
66
|
+
padding-right: 5%;
|
67
|
+
font-size: $font-size-base;
|
68
|
+
vertical-align: middle;
|
69
|
+
}
|
70
|
+
|
71
|
+
// Descendants
|
72
|
+
// =============================================================================
|
73
|
+
|
74
|
+
[data-notify="container"].alert-danger,
|
75
|
+
[data-notify="container"].alert-error {
|
76
|
+
@include notification-generator($brand-danger);
|
77
|
+
}
|
78
|
+
|
79
|
+
[data-notify="container"].alert-success {
|
80
|
+
@include notification-generator($brand-success);
|
81
|
+
}
|
82
|
+
|
83
|
+
[data-notify="container"].alert-warning {
|
84
|
+
@include notification-generator($brand-warning);
|
85
|
+
}
|
@@ -0,0 +1,129 @@
|
|
1
|
+
// =============================================================================
|
2
|
+
// Public
|
3
|
+
// =============================================================================
|
4
|
+
|
5
|
+
// Adds an outer div which is fixed and spans the entire viewport.
|
6
|
+
|
7
|
+
.public-background {
|
8
|
+
position: fixed;
|
9
|
+
top: 0;
|
10
|
+
right: 0;
|
11
|
+
bottom: 0;
|
12
|
+
left: 0;
|
13
|
+
overflow: auto;
|
14
|
+
text-align: center;
|
15
|
+
background: linear-gradient(to bottom, $brand-primary 60px, $brand-primary 20%, $brand-primary-alt);
|
16
|
+
}
|
17
|
+
|
18
|
+
// Centers the content of a public page.
|
19
|
+
.public-container {
|
20
|
+
height: 100%;
|
21
|
+
width: 100%;
|
22
|
+
text-align: center;
|
23
|
+
animation: fade-down 1s ease-out;
|
24
|
+
&:before {
|
25
|
+
content: ' ';
|
26
|
+
display: inline-block;
|
27
|
+
vertical-align: middle;
|
28
|
+
height: 100%;
|
29
|
+
}
|
30
|
+
}
|
31
|
+
|
32
|
+
// Wraps and centers all content of the public forms.
|
33
|
+
|
34
|
+
.public-form-wrapper {
|
35
|
+
width: 480px;
|
36
|
+
display: inline-block;
|
37
|
+
vertical-align: middle;
|
38
|
+
}
|
39
|
+
|
40
|
+
// Adds a logo above the public form.
|
41
|
+
|
42
|
+
.public-logo {
|
43
|
+
display: inline-block;
|
44
|
+
img,
|
45
|
+
span {
|
46
|
+
display: inline-block;
|
47
|
+
vertical-align: middle;
|
48
|
+
}
|
49
|
+
img {
|
50
|
+
display: inline-block;
|
51
|
+
height: 26px;
|
52
|
+
margin-right: 10px;
|
53
|
+
vertical-align: middle;
|
54
|
+
}
|
55
|
+
span {
|
56
|
+
margin-top: 2px;
|
57
|
+
font-family: $font-family-sans-serif-brand;
|
58
|
+
font-size: 20px;
|
59
|
+
line-height: 1.6;
|
60
|
+
color: $white;
|
61
|
+
}
|
62
|
+
}
|
63
|
+
|
64
|
+
// Contains the form styling. Note that each form should have a different
|
65
|
+
// height calculated.
|
66
|
+
|
67
|
+
.public-form {
|
68
|
+
display: block;
|
69
|
+
padding: 50px;
|
70
|
+
margin: 25px 0 20px;
|
71
|
+
background: $white;
|
72
|
+
border-radius: $border-radius-base;
|
73
|
+
box-shadow: 0 1px 10px rgba($black, .2);
|
74
|
+
form {
|
75
|
+
display: block;
|
76
|
+
width: 100%;
|
77
|
+
text-align: left;
|
78
|
+
}
|
79
|
+
.btn {
|
80
|
+
margin-top: 22px;
|
81
|
+
}
|
82
|
+
}
|
83
|
+
|
84
|
+
// Styles intro title and text above the public form.
|
85
|
+
|
86
|
+
.public-form-text {
|
87
|
+
display: block;
|
88
|
+
margin-bottom: 20px;
|
89
|
+
text-align: center;
|
90
|
+
h3 {
|
91
|
+
margin-bottom: 15px;
|
92
|
+
}
|
93
|
+
p {
|
94
|
+
margin-bottom: 30px;
|
95
|
+
color: $gray-light;
|
96
|
+
}
|
97
|
+
}
|
98
|
+
|
99
|
+
// Creates a link below the public form.
|
100
|
+
|
101
|
+
.public-link {
|
102
|
+
display: inline-block;
|
103
|
+
font-size: 14px;
|
104
|
+
font-weight: 400;
|
105
|
+
color: rgba($white, .7);
|
106
|
+
transition: color $base-transition-speed linear;
|
107
|
+
&:hover,
|
108
|
+
&:active,
|
109
|
+
&:focus {
|
110
|
+
color: $white;
|
111
|
+
text-decoration: none;
|
112
|
+
outline: none;
|
113
|
+
}
|
114
|
+
}
|
115
|
+
|
116
|
+
// Responsive
|
117
|
+
// =============================================================================
|
118
|
+
|
119
|
+
@media (max-width: $screen-xs-min) {
|
120
|
+
.public-form-wrapper {
|
121
|
+
left: 0;
|
122
|
+
padding: 20px 10px;
|
123
|
+
margin-left: 0;
|
124
|
+
}
|
125
|
+
.public-form {
|
126
|
+
display: inline-block;
|
127
|
+
padding: 50px 20px;
|
128
|
+
}
|
129
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
// =============================================================================
|
2
|
+
// Type
|
3
|
+
// =============================================================================
|
4
|
+
|
5
|
+
@import "bootstrap/type";
|
6
|
+
|
7
|
+
h1,
|
8
|
+
h2,
|
9
|
+
h3,
|
10
|
+
h4,
|
11
|
+
h5,
|
12
|
+
h6 {
|
13
|
+
margin: 0;
|
14
|
+
}
|
@@ -0,0 +1,54 @@
|
|
1
|
+
// =============================================================================
|
2
|
+
// Variables
|
3
|
+
// =============================================================================
|
4
|
+
|
5
|
+
// Shades of gray
|
6
|
+
|
7
|
+
$black: #000;
|
8
|
+
$gray-darkest: #232528;
|
9
|
+
$gray-darker: lighten($gray-darkest, 15);
|
10
|
+
$gray-dark: lighten($gray-darkest, 30);
|
11
|
+
$gray: lighten($gray-darkest, 45);
|
12
|
+
$gray-light: lighten($gray-darkest, 65);
|
13
|
+
$gray-lighter: lighten($gray-darkest, 75);
|
14
|
+
$gray-lightest: lighten($gray-darkest, 85);
|
15
|
+
$white: #fff;
|
16
|
+
|
17
|
+
// Colors
|
18
|
+
|
19
|
+
$brand-primary: #54b9cd;
|
20
|
+
$brand-primary-alt: #5488cc;
|
21
|
+
$brand-success: #00aa8f;
|
22
|
+
$brand-warning: #f0ad4e;
|
23
|
+
$brand-danger: #d9684c;
|
24
|
+
|
25
|
+
// Fonts
|
26
|
+
|
27
|
+
$font-family-sans-serif: "Noto Sans", sans-serif;
|
28
|
+
$font-family-sans-serif-brand: "Muli", sans-serif;
|
29
|
+
$font-size-base: 14px;
|
30
|
+
|
31
|
+
// Common
|
32
|
+
|
33
|
+
$border-radius-base: 3px;
|
34
|
+
$border-color-base: $gray-lighter;
|
35
|
+
$padding-base-vertical: 12px;
|
36
|
+
$padding-base-horizontal: 15px;
|
37
|
+
$base-transition-speed: .3s;
|
38
|
+
|
39
|
+
// Headings
|
40
|
+
|
41
|
+
$headings-font-family: $font-family-sans-serif-brand;
|
42
|
+
$headings-color: $gray-dark;
|
43
|
+
|
44
|
+
// Forms
|
45
|
+
|
46
|
+
$input-bg: $white;
|
47
|
+
$input-color: $gray-dark;
|
48
|
+
$input-border: $gray-lighter;
|
49
|
+
$input-border-focus: $gray;
|
50
|
+
$input-box-shadow-focus: 0;
|
51
|
+
$input-color-placeholder: $gray-light;
|
52
|
+
$state-danger-text: $brand-danger;
|
53
|
+
|
54
|
+
@import "bootstrap/variables";
|
@@ -0,0 +1,34 @@
|
|
1
|
+
// =============================================================================
|
2
|
+
// Unauthorized
|
3
|
+
// =============================================================================
|
4
|
+
|
5
|
+
// Stylesheet for all un-authorized pages like register, sign in, ...
|
6
|
+
|
7
|
+
// Core variables and mixins
|
8
|
+
|
9
|
+
@import "unauthorized/variables";
|
10
|
+
@import "bootstrap/mixins";
|
11
|
+
@import "unauthorized/keyframes";
|
12
|
+
|
13
|
+
// Reset and dependencies
|
14
|
+
|
15
|
+
@import "bootstrap/normalize";
|
16
|
+
@import "font-awesome-sprockets";
|
17
|
+
@import "font-awesome";
|
18
|
+
|
19
|
+
// Core CSS
|
20
|
+
|
21
|
+
@import "bootstrap/scaffolding";
|
22
|
+
@import "unauthorized/type";
|
23
|
+
@import "bootstrap/grid";
|
24
|
+
@import "unauthorized/forms";
|
25
|
+
@import "bootstrap/buttons";
|
26
|
+
|
27
|
+
// Components
|
28
|
+
|
29
|
+
@import "bootstrap/alerts";
|
30
|
+
|
31
|
+
// Custom components
|
32
|
+
|
33
|
+
@import "unauthorized/notify";
|
34
|
+
@import "unauthorized/public";
|
@@ -89,7 +89,7 @@ module Locomotive
|
|
89
89
|
|
90
90
|
def activity_bulk_content_assets(params)
|
91
91
|
list = params[:assets].map do |asset|
|
92
|
-
if asset[:image]
|
92
|
+
if asset[:image] && asset[:id] && current_site.content_assets.where(_id: asset[:id]).exists?
|
93
93
|
content_tag(:li, link_to(image_tag(Locomotive::Dragonfly.resize_url(asset[:url], '60x60#'), alt: asset[:name]), asset[:url]))
|
94
94
|
else
|
95
95
|
content_tag(:li, link_to(truncate(asset[:name], length: 20), asset[:url]))
|
@@ -15,6 +15,7 @@ module Locomotive
|
|
15
15
|
wysihtml5_prefix: wysihtml5_prefix,
|
16
16
|
link_popover: link_popover,
|
17
17
|
image_popover: image_popover,
|
18
|
+
table_popover: table_popover
|
18
19
|
})
|
19
20
|
end
|
20
21
|
|
@@ -37,6 +38,13 @@ module Locomotive
|
|
37
38
|
)).html_safe
|
38
39
|
end
|
39
40
|
|
41
|
+
def table_popover
|
42
|
+
remove_form(template.render(
|
43
|
+
partial: 'locomotive/shared/rte/table_popover',
|
44
|
+
locals: { table_form: TableForm.new }
|
45
|
+
)).html_safe
|
46
|
+
end
|
47
|
+
|
40
48
|
def remove_form(template)
|
41
49
|
template.gsub(/<form([^<]*)>/, '')
|
42
50
|
.gsub(/<input name="(utf8|authenticity_token)"([^<]*)>/, '')
|
@@ -50,5 +58,9 @@ module Locomotive
|
|
50
58
|
class ImageForm < Struct.new(:src, :title, :alignment)
|
51
59
|
include ActiveModel::Model
|
52
60
|
end
|
61
|
+
|
62
|
+
class TableForm < Struct.new(:cols, :rows, :class_name, :head)
|
63
|
+
include ActiveModel::Model
|
64
|
+
end
|
53
65
|
end
|
54
66
|
end
|
@@ -20,7 +20,7 @@ module Locomotive
|
|
20
20
|
site.content_assets.create(params)
|
21
21
|
end
|
22
22
|
|
23
|
-
valid_assets = assets.map { |a| a.errors.empty? ? { name: a.source_filename, url: a.source.url, image: a.image
|
23
|
+
valid_assets = assets.map { |a| a.errors.empty? ? { name: a.source_filename, url: a.source.url, image: a.image?, id: a._id } : nil }.compact
|
24
24
|
track_activity 'content_asset.created_bulk', parameters: { assets: valid_assets } unless valid_assets.empty?
|
25
25
|
|
26
26
|
assets
|
@@ -35,8 +35,8 @@ module Locomotive
|
|
35
35
|
|
36
36
|
element = elements.first.last
|
37
37
|
|
38
|
-
{ name: block, label: element.block_label, priority: element.block_priority }
|
39
|
-
end.sort { |a, b| b[:priority] <=> a[:priority] }
|
38
|
+
{ name: block, label: element.block_label, priority: element.block_priority || 0 }
|
39
|
+
end.compact.sort { |a, b| b[:priority] <=> a[:priority] }
|
40
40
|
end
|
41
41
|
|
42
42
|
private
|
@@ -147,6 +147,8 @@ module Locomotive
|
|
147
147
|
|
148
148
|
def add_or_modify_editable_element(page, attributes)
|
149
149
|
if element = page.editable_elements.by_block_and_slug(attributes[:block], attributes[:slug]).first
|
150
|
+
# FIXME: we don't want to deal here with the generic Locomotive::EditableElement class
|
151
|
+
element = page.editable_elements.with_same_class!(element, "Locomotive::#{attributes[:type].to_s.classify}".constantize)
|
150
152
|
element.attributes = attributes
|
151
153
|
element
|
152
154
|
else
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
- content_for :preview do
|
4
4
|
.embed-responsive.embed-page
|
5
|
-
iframe.embed-responsive-item src=(preview_path(current_site) + '/' + (params[:preview_path] || current_site.localized_page_fullpath(@page, current_content_locale))) data-redirection-error=t('.redirection_error')
|
5
|
+
iframe.embed-responsive-item src=(preview_path(current_site) + '/' + (params[:preview_path] || current_site.localized_page_fullpath(@page, current_content_locale))) data-redirection-error=t('.redirection_error') data-style-path=stylesheet_path('locomotive/live_editing_iframe') data-edit-label=t('.iframe.buttons.edit')
|
6
6
|
|
7
7
|
|
8
8
|
|
@@ -1,14 +1,19 @@
|
|
1
|
-
doctype XML
|
2
1
|
doctype html
|
3
2
|
html xmlns='http://www.w3.org/1999/xhtml' lang=I18n.locale
|
4
3
|
head
|
5
|
-
|
4
|
+
meta charset="utf-8"
|
5
|
+
meta http-equiv="x-ua-compatible" content="ie=edge"
|
6
|
+
|
7
|
+
title= escape_once(strip_tags(title) + " | Locomotive")
|
8
|
+
|
6
9
|
meta name="viewport" content="width=device-width, initial-scale=1"
|
7
10
|
|
8
11
|
link rel="icon" type="image/png" href="#{asset_url('locomotive/favicon.png')}" sizes="32x32"
|
9
12
|
|
13
|
+
link href="https://fonts.googleapis.com/css?family=Muli:400,300|Noto+Sans:400,700" rel="stylesheet" type="text/css"
|
14
|
+
|
10
15
|
= javascript_include_tag 'locomotive/not_logged_in'
|
11
|
-
= stylesheet_link_tag 'locomotive/
|
16
|
+
= stylesheet_link_tag 'locomotive/unauthorized', media: 'screen'
|
12
17
|
|
13
18
|
javascript:
|
14
19
|
window.flash_messages = #{{flash_messages_to_json}};
|
@@ -16,11 +21,10 @@ html xmlns='http://www.w3.org/1999/xhtml' lang=I18n.locale
|
|
16
21
|
= yield :head
|
17
22
|
|
18
23
|
body class=[controller.controller_name, flash.empty? ? '' : 'with-flash'].join(' ')
|
19
|
-
.
|
20
|
-
.
|
21
|
-
.
|
22
|
-
|
24
|
+
.public-background
|
25
|
+
.public-container
|
26
|
+
.public-form-wrapper
|
27
|
+
= link_to root_path, class: 'public-logo' do
|
23
28
|
= image_tag 'locomotive/logo.png'
|
24
|
-
|
25
|
-
== title
|
29
|
+
span Locomotive
|
26
30
|
= yield
|
@@ -1,18 +1,18 @@
|
|
1
|
-
- title
|
1
|
+
- title t('locomotive.passwords.edit.title')
|
2
2
|
|
3
|
-
|
3
|
+
.public-form
|
4
|
+
.public-form-text
|
5
|
+
h3= t('locomotive.passwords.edit.title')
|
6
|
+
p= t('locomotive.passwords.edit.description')
|
4
7
|
|
5
|
-
=
|
8
|
+
= locomotive_form_for(resource, as: resource_name, url: locomotive_account_password_path, html: { method: :put }) do |f|
|
9
|
+
= f.hidden_field :reset_password_token
|
6
10
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
= f.actions do
|
12
|
-
= f.button :submit, t('.submit'), class: 'btn'
|
13
|
-
|
14
|
-
br
|
15
|
-
|
16
|
-
p= link_to t('.link').html_safe, new_locomotive_account_session_path
|
11
|
+
= f.inputs do
|
12
|
+
= f.input :password, label: t('.password'), required: false
|
13
|
+
= f.input :password_confirmation, required: false, label: false, placeholder: t('locomotive.passwords.edit.password_confirmation')
|
17
14
|
|
15
|
+
= f.actions do
|
16
|
+
= f.button :submit, t('.submit'), class: 'btn btn-primary'
|
18
17
|
|
18
|
+
= link_to t('.link').html_safe, new_locomotive_account_session_path, class: "public-link"
|
@@ -1,17 +1,20 @@
|
|
1
|
-
- title
|
1
|
+
- title t('locomotive.passwords.new.title')
|
2
2
|
|
3
|
-
|
3
|
+
.public-form
|
4
|
+
.public-form-text
|
5
|
+
h3= t('locomotive.passwords.new.title')
|
6
|
+
p= t('locomotive.passwords.new.description')
|
4
7
|
|
5
|
-
=
|
8
|
+
= locomotive_form_for(resource, as: resource_name, url: locomotive_account_password_path) do |f|
|
6
9
|
|
7
|
-
|
8
|
-
= flash_message
|
9
|
-
= f.input :email, label: t('.email'), required: false
|
10
|
+
= f.hidden_field :reset_password_token
|
10
11
|
|
11
|
-
|
12
|
-
|
12
|
+
= f.inputs do
|
13
|
+
= flash_message
|
14
|
+
= f.input :email, label: t('.email'), required: false
|
13
15
|
|
14
|
-
|
16
|
+
= f.actions do
|
17
|
+
= f.button :submit, t('.submit'), class: 'btn btn-primary'
|
15
18
|
|
16
|
-
|
17
|
-
|
19
|
+
|
20
|
+
= link_to t('.link').html_safe, new_locomotive_account_session_path, class: "public-link"
|
@@ -1,17 +1,18 @@
|
|
1
|
-
- title t('locomotive.
|
1
|
+
- title t('locomotive.registrations.new.title')
|
2
2
|
|
3
|
-
|
3
|
+
.public-form
|
4
|
+
.public-form-text
|
5
|
+
h3= t('locomotive.registrations.new.title')
|
6
|
+
p= t('locomotive.registrations.new.description')
|
4
7
|
|
5
|
-
=
|
6
|
-
= f.
|
7
|
-
|
8
|
-
|
9
|
-
|
8
|
+
= locomotive_form_for resource, as: resource_name, url: sign_up_path do |f|
|
9
|
+
= f.inputs do
|
10
|
+
= f.input :name, required: true, autofocus: true
|
11
|
+
= f.input :email, required: true
|
12
|
+
= f.input :password, required: true, hint: !@minimum_password_length.nil?
|
13
|
+
= f.input :password_confirmation, required: true, label: false, placeholder: t('locomotive.registrations.new.confirm_password')
|
10
14
|
|
11
|
-
|
12
|
-
|
15
|
+
= f.actions do
|
16
|
+
= f.button :submit, t('.submit'), class: 'btn btn-primary'
|
13
17
|
|
14
|
-
|
15
|
-
|
16
|
-
p
|
17
|
-
= link_to t('.sign_in'), new_locomotive_account_session_path
|
18
|
+
= link_to t('.sign_in'), new_locomotive_account_session_path, class: 'public-link'
|
@@ -1,20 +1,21 @@
|
|
1
|
-
- title
|
1
|
+
- title t('locomotive.sessions.new.title')
|
2
2
|
|
3
|
-
-
|
3
|
+
.public-form
|
4
|
+
.public-form-text
|
5
|
+
h3= t('locomotive.sessions.new.title')
|
4
6
|
|
5
|
-
|
7
|
+
- set_error_from_flash(resource, :email)
|
6
8
|
|
7
|
-
=
|
9
|
+
= locomotive_form_for(resource, as: resource_name, url: locomotive_account_session_path) do |f|
|
8
10
|
|
9
|
-
|
10
|
-
= f.input :email, label: t('.email'), required: false, input_html: { tabindex: 1 }
|
11
|
-
= f.input :password, label: t('.password'), hint: link_to(t('.link'), new_locomotive_account_password_path).html_safe, required: false, input_html: { tabindex: 2 }
|
11
|
+
= f.hidden_field :remember_me, value: 'true'
|
12
12
|
|
13
|
-
|
14
|
-
|
13
|
+
= f.inputs do
|
14
|
+
= f.input :email, label: t('.email'), required: false, input_html: { tabindex: 1 }
|
15
|
+
= f.input :password, label: t('.password'), hint: link_to(t('.link'), new_locomotive_account_password_path).html_safe, required: false, input_html: { tabindex: 2 }
|
15
16
|
|
16
|
-
|
17
|
+
= f.actions do
|
18
|
+
= f.button :submit, t('.submit'), class: 'btn btn-primary'
|
17
19
|
|
18
|
-
|
19
|
-
|
20
|
-
p= link_to t('.sign_up').html_safe, sign_up_path
|
20
|
+
- if current_site.nil?
|
21
|
+
= link_to t('.sign_up').html_safe, sign_up_path, class: 'public-link'
|
@@ -7,36 +7,6 @@
|
|
7
7
|
i.fa.fa-italic
|
8
8
|
|
9
9
|
span.wysihtml5-toolbar-group
|
10
|
-
/ a data-markdown-command='insertUnorderedList'
|
11
|
-
/ i.fa.fa-list-ul
|
12
|
-
/ a data-markdown-command='insertOrderedList'
|
13
|
-
/ i.fa.fa-list-ol
|
14
|
-
/ a.style
|
15
|
-
/ i.fa.fa-paragraph
|
16
|
-
|
17
|
-
/ .style-dialog-content style='display: none'
|
18
|
-
/ a data-markdown-command='formatBlock' data-markdown-command-value='h1' H1
|
19
|
-
/ br
|
20
|
-
/ a data-markdown-command='formatBlock' data-markdown-command-value='h2' H2
|
21
|
-
/ br
|
22
|
-
/ a data-markdown-command='formatBlock' data-markdown-command-value='h3' H3
|
23
|
-
/ br
|
24
|
-
/ a data-markdown-command='formatBlock' data-markdown-command-value='h3' H4
|
25
|
-
/ br
|
26
|
-
/ a data-markdown-command='formatBlock' data-markdown-command-value='h3' H5
|
27
|
-
/ br
|
28
|
-
/ a data-markdown-command='formatBlock' data-markdown-command-value='h3' H6
|
29
|
-
/ br
|
30
|
-
/ a data-markdown-command='formatBlock' data-markdown-command-value='blockquote'
|
31
|
-
/ i.fa.fa-quote-right
|
32
|
-
/ br
|
33
|
-
|
34
|
-
/ a data-markdown-command='createLink'
|
35
|
-
/ i.fa.fa-chain
|
36
|
-
/ = link_popover
|
37
|
-
/ a data-markdown-command='removeLink'
|
38
|
-
/ i.fa.fa-chain-broken
|
39
|
-
|
40
10
|
a data-url=content_assets_path data-markdown-command='insertFile'
|
41
11
|
i.fa.fa-file-o
|
42
12
|
= image_popover
|