pageflow 15.1.0 → 15.2.2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of pageflow might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +92 -161
- data/README.md +1 -2
- data/admins/pageflow/accounts.rb +94 -19
- data/app/assets/javascripts/pageflow/admin/accounts.js +3 -3
- data/app/assets/javascripts/pageflow/dist/frontend.js +2 -0
- data/app/assets/javascripts/pageflow/dist/ui.js +9 -0
- data/app/assets/stylesheets/pageflow/themes/default/logo/variant/background_image.scss +4 -0
- data/app/assets/stylesheets/pageflow/themes/default/logo/variant/watermark.scss +5 -0
- data/app/controllers/pageflow/editor/widgets_controller.rb +1 -1
- data/app/helpers/pageflow/pages_helper.rb +1 -0
- data/app/models/pageflow/account.rb +6 -0
- data/app/models/pageflow/draft_entry.rb +13 -3
- data/app/models/pageflow/entry.rb +8 -1
- data/app/models/pageflow/entry_template.rb +55 -0
- data/app/models/pageflow/published_entry.rb +13 -3
- data/app/models/pageflow/revision.rb +1 -1
- data/app/models/pageflow/theming.rb +8 -47
- data/app/policies/pageflow/entry_template_policy.rb +18 -0
- data/app/policies/pageflow/theming_policy.rb +0 -4
- data/app/views/admin/accounts/_configuration_label.html.erb +5 -0
- data/app/views/admin/accounts/_entry_template_details.html.arb +17 -0
- data/app/views/admin/accounts/_form.html.erb +43 -23
- data/app/views/admin/accounts/_share_providers_label.html.erb +5 -0
- data/app/views/admin/accounts/_theming_details.html.arb +0 -12
- data/app/views/pageflow/themes/_theme.json.jbuilder +1 -0
- data/config/locales/de.yml +12 -7
- data/config/locales/en.yml +12 -7
- data/db/migrate/20200122115400_create_pageflow_entry_templates.rb +75 -0
- data/db/migrate/20200206134400_convert_legacy_scrolled_content_element_types.rb +48 -0
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/editor.js +42 -4
- data/entry_types/scrolled/app/controllers/pageflow_scrolled/editor/content_elements_controller.rb +1 -0
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/editor/seed_html_helper.rb +4 -1
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/entry_json_seed_helper.rb +2 -1
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/i18n_helper.rb +35 -0
- data/entry_types/scrolled/app/views/pageflow_scrolled/editor/entries/_seed.json.jbuilder +1 -1
- data/entry_types/scrolled/app/views/pageflow_scrolled/entries/show.html.erb +14 -2
- data/entry_types/scrolled/app/views/pageflow_scrolled/entry_json_seed/_entry.json.jbuilder +10 -1
- data/entry_types/scrolled/config/locales/new/de.yml +231 -8
- data/entry_types/scrolled/config/locales/new/en.yml +228 -10
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/install_generator.rb +3 -0
- data/entry_types/scrolled/lib/pageflow_scrolled/seeds.rb +9 -4
- data/entry_types/scrolled/lib/tasks/pageflow_scrolled_tasks.rake +96 -0
- data/entry_types/scrolled/package/contentElements-editor.js +410 -0
- data/entry_types/scrolled/package/contentElements-frontend.js +533 -0
- data/entry_types/scrolled/package/editor.js +498 -2561
- data/entry_types/scrolled/package/frontend.js +713 -1238
- data/entry_types/scrolled/package/package.json +12 -2
- data/lib/pageflow/ability_mixin.rb +3 -2
- data/lib/pageflow/seeds.rb +0 -2
- data/lib/pageflow/theme.rb +4 -0
- data/lib/pageflow/themes.rb +5 -1
- data/lib/pageflow/version.rb +1 -1
- data/packages/pageflow/config/jest/index.js +0 -1
- data/packages/pageflow/config/jest/transformers/jst.js +1 -1
- data/packages/pageflow/config/webpack.js +0 -1
- data/packages/pageflow/editor.js +33 -4
- data/packages/pageflow/package.json +2 -1
- data/packages/pageflow/testHelpers.js +367 -4
- data/packages/pageflow/ui.js +9 -0
- data/spec/factories/accounts.rb +6 -0
- data/spec/factories/entry_templates.rb +8 -0
- data/spec/factories/published_entries.rb +3 -1
- data/spec/factories/themings.rb +0 -1
- metadata +14 -4
- data/app/assets/javascripts/pageflow/dist/editor.js +0 -11881
- data/app/assets/javascripts/pageflow/dist/index.js +0 -3
@@ -2,16 +2,4 @@ extensible_attributes_table_for(account.default_theming,
|
|
2
2
|
Pageflow.config_for(account)
|
3
3
|
.admin_attributes_table_rows.for(:theming)) do
|
4
4
|
row :cname, class: 'cname'
|
5
|
-
row :theme, class: 'theme' do
|
6
|
-
account.default_theming.theme.name
|
7
|
-
end
|
8
|
-
row :default_locale, class: 'default_locale' do
|
9
|
-
t('pageflow.public._language', locale: account.default_theming.default_locale)
|
10
|
-
end
|
11
|
-
row :default_author, class: 'default_author'
|
12
|
-
row :default_publisher, class: 'default_publisher'
|
13
|
-
row :default_keywords, class: 'default_keywords'
|
14
|
-
row :default_share_providers, class: 'default_share_providers' do
|
15
|
-
account.default_theming.default_share_providers.keys.map(&:camelize).join(', ')
|
16
|
-
end
|
17
5
|
end
|
@@ -11,3 +11,4 @@ json.hide_text_on_swipe theme.hide_text_on_swipe?
|
|
11
11
|
json.emphasized_pages theme.supports_emphasized_pages?
|
12
12
|
json.scroll_indicator_modes theme.supports_scroll_indicator_modes?
|
13
13
|
json.change_to_parent_page_at_storyline_boundary theme.change_to_parent_page_at_storyline_boundary?
|
14
|
+
json.hide_logo_option theme.supports_hide_logo_on_pages?
|
data/config/locales/de.yml
CHANGED
@@ -198,6 +198,16 @@ de:
|
|
198
198
|
updated_at: Geändert am
|
199
199
|
url: Permalink
|
200
200
|
with_publication_state: Veröffentlichungsstatus
|
201
|
+
pageflow/entry_template:
|
202
|
+
configuration:
|
203
|
+
group_label: Konfiguration
|
204
|
+
home_button_enabled: Home-Button in neuen Beiträgen anzeigen
|
205
|
+
default_author: Standard-Autor
|
206
|
+
default_keywords: Standard-Schlüsselwörter
|
207
|
+
default_locale: Standard-Sprache
|
208
|
+
default_publisher: Standard-Herausgeber
|
209
|
+
default_share_providers: Standard-Share-Links
|
210
|
+
theme_name: Theme
|
201
211
|
pageflow/folder:
|
202
212
|
account: Konto
|
203
213
|
name: Name
|
@@ -226,6 +236,7 @@ de:
|
|
226
236
|
display_in_navigation: In Navigationsleiste anzeigen
|
227
237
|
emphasize_in_navigation: In Navigationsleiste hervorheben
|
228
238
|
gradient_opacity: Intensität der Abblendung
|
239
|
+
hide_logo: Logo ausblenden
|
229
240
|
hide_title: Titel ausblenden
|
230
241
|
invert: Farben invertieren
|
231
242
|
linked_page_ids: Seiten verknüpfen
|
@@ -260,18 +271,11 @@ de:
|
|
260
271
|
cname: CNAME
|
261
272
|
copyright_link_label: Copyright-Link Text
|
262
273
|
copyright_link_url: Copyright-Link URL
|
263
|
-
default_author: Standard Autor
|
264
|
-
default_keywords: Standard Schlüsselwörter
|
265
|
-
default_locale: Standard Sprache
|
266
|
-
default_publisher: Standard Herausgeber
|
267
|
-
default_share_providers: Standard Share Links
|
268
|
-
home_button_enabled_by_default: Home-Button in neuen Beiträgen anzeigen
|
269
274
|
home_url: Redirect URL
|
270
275
|
imprint_link_label: Impressum-Link Text
|
271
276
|
imprint_link_url: Impressum-Link URL
|
272
277
|
privacy_link_url: Datenschutz-Link URL
|
273
278
|
share_providers: Standard Share Links
|
274
|
-
theme_name: Theme
|
275
279
|
pageflow/video_file:
|
276
280
|
dimensions: Maße
|
277
281
|
duration: Länge
|
@@ -1884,6 +1888,7 @@ de:
|
|
1884
1888
|
Die Intensität des Farbverlaufs dient der Lesbarkeit von Texten auf Videos oder Bildern.
|
1885
1889
|
|
1886
1890
|
Durch den Schieberegler kann der Bildhintergrund so stark abgedunkelt bzw. aufgehellt werden, bis der Kontrast zwischen Bild und Text ausreichend ist.
|
1891
|
+
hide_logo: Logo auf dieser Seite ausblenden
|
1887
1892
|
invert: "Beim Invertieren werden „hell“ und „dunkel“ vertauscht, die sonst weiße Schrift ändert sich dabei automatisch in schwarz. \n\nGrundsätzlich gilt: Helle Schrift für dunkle Bilder, dunkle Schrift für helle Bilder."
|
1888
1893
|
mobile_poster_image_id: Dieses Bild wird in der Mobilvariante der Seite als Posterbild gezeigt.
|
1889
1894
|
text: |-
|
data/config/locales/en.yml
CHANGED
@@ -198,6 +198,16 @@ en:
|
|
198
198
|
updated_at: Updated at
|
199
199
|
url: Permalink
|
200
200
|
with_publication_state: Publication state
|
201
|
+
pageflow/entry_template:
|
202
|
+
configuration:
|
203
|
+
group_label: Configuration
|
204
|
+
home_button_enabled: "'Home'-Button enabled by default"
|
205
|
+
default_author: Default author
|
206
|
+
default_keywords: Default keywords
|
207
|
+
default_locale: Default locale
|
208
|
+
default_publisher: Default publisher
|
209
|
+
default_share_providers: Default share links
|
210
|
+
theme_name: Theme
|
201
211
|
pageflow/folder:
|
202
212
|
account: Account
|
203
213
|
name: Name
|
@@ -226,6 +236,7 @@ en:
|
|
226
236
|
display_in_navigation: Show in navigationbar
|
227
237
|
emphasize_in_navigation: Emphasize in navigationbar
|
228
238
|
gradient_opacity: Gradient opacity
|
239
|
+
hide_logo: Hide logo
|
229
240
|
hide_title: Hide titles
|
230
241
|
invert: Invert colors
|
231
242
|
linked_page_ids: Link pages
|
@@ -260,18 +271,11 @@ en:
|
|
260
271
|
cname: CNAME
|
261
272
|
copyright_link_label: Copyright link Text
|
262
273
|
copyright_link_url: Copyright link URL
|
263
|
-
default_author: Default author
|
264
|
-
default_keywords: Default keywords
|
265
|
-
default_locale: Default locale
|
266
|
-
default_publisher: Default publisher
|
267
|
-
default_share_providers: Default Share Links
|
268
|
-
home_button_enabled_by_default: "'Home'-Button enabled by default"
|
269
274
|
home_url: Redirect URL
|
270
275
|
imprint_link_label: Legal notice link label
|
271
276
|
imprint_link_url: Legal notice link URL
|
272
277
|
privacy_link_url: Privacy link URL
|
273
278
|
share_providers: Default Share Links
|
274
|
-
theme_name: Theme
|
275
279
|
pageflow/video_file:
|
276
280
|
dimensions: Dimensions
|
277
281
|
duration: Duration
|
@@ -1854,6 +1858,7 @@ en:
|
|
1854
1858
|
The opacity of the gradient improves the legibility of the text on background-videos or pictures.
|
1855
1859
|
|
1856
1860
|
You can use the slider to darken or lighten up the background until the contrast between text and background is optimal.
|
1861
|
+
hide_logo: Hide logo on current page
|
1857
1862
|
invert: |-
|
1858
1863
|
If you invert the colors, „bright“ and „dark“ are interchanged. Thus the normally white font changes into black.
|
1859
1864
|
|
@@ -0,0 +1,75 @@
|
|
1
|
+
# Create entry templates, which hold template data for new
|
2
|
+
# entries. Data can be entry type-specific
|
3
|
+
class CreatePageflowEntryTemplates < ActiveRecord::Migration[5.2]
|
4
|
+
def up
|
5
|
+
create_table :pageflow_entry_templates do |t|
|
6
|
+
t.references :account
|
7
|
+
t.string :entry_type
|
8
|
+
t.string :theme_name, default: 'default'
|
9
|
+
t.string :default_author
|
10
|
+
t.string :default_publisher
|
11
|
+
t.string :default_keywords
|
12
|
+
t.string :default_locale, default: 'de'
|
13
|
+
t.text :default_share_providers
|
14
|
+
t.text :configuration
|
15
|
+
end
|
16
|
+
|
17
|
+
execute('INSERT INTO pageflow_entry_templates '\
|
18
|
+
'(account_id, entry_type, theme_name, default_author, default_publisher, '\
|
19
|
+
'default_keywords, default_locale, default_share_providers, configuration) '\
|
20
|
+
"SELECT account_id, 'paged', theme_name, default_author, default_publisher, "\
|
21
|
+
'default_keywords, default_locale, default_share_providers, '\
|
22
|
+
"CONCAT('{\"home_button_enabled\":', "\
|
23
|
+
"home_button_enabled_by_default, '}') "\
|
24
|
+
'FROM pageflow_themings;')
|
25
|
+
|
26
|
+
execute('UPDATE pageflow_widgets w, pageflow_entry_templates et, pageflow_themings t '\
|
27
|
+
"SET w.subject_type='Pageflow::EntryTemplate', w.subject_id = et.id "\
|
28
|
+
"WHERE et.account_id = t.account_id and et.entry_type = 'paged' "\
|
29
|
+
"and w.subject_id = t.id and w.subject_type = 'Pageflow::Theming';")
|
30
|
+
|
31
|
+
remove_column :pageflow_themings, :theme_name
|
32
|
+
remove_column :pageflow_themings, :default_author
|
33
|
+
remove_column :pageflow_themings, :default_publisher
|
34
|
+
remove_column :pageflow_themings, :default_keywords
|
35
|
+
remove_column :pageflow_themings, :default_locale
|
36
|
+
remove_column :pageflow_themings, :default_share_providers
|
37
|
+
remove_column :pageflow_themings, :home_button_enabled_by_default
|
38
|
+
end
|
39
|
+
|
40
|
+
def down
|
41
|
+
add_column :pageflow_themings, :theme_name, :string
|
42
|
+
add_column :pageflow_themings, :default_author, :string
|
43
|
+
add_column :pageflow_themings, :default_publisher, :string
|
44
|
+
add_column :pageflow_themings, :default_keywords, :string
|
45
|
+
add_column :pageflow_themings, :default_locale, :string, default: 'de'
|
46
|
+
add_column :pageflow_themings, :default_share_providers, :text
|
47
|
+
add_column :pageflow_themings, :home_button_enabled_by_default, :boolean, default: true
|
48
|
+
|
49
|
+
execute('UPDATE pageflow_themings t, pageflow_entry_templates et '\
|
50
|
+
'SET t.theme_name = et.theme_name, t.default_author = et.default_author, '\
|
51
|
+
't.default_publisher = et.default_publisher, '\
|
52
|
+
't.default_keywords = et.default_keywords, '\
|
53
|
+
't.default_locale = et.default_locale, '\
|
54
|
+
't.default_share_providers = et.default_share_providers, '\
|
55
|
+
't.home_button_enabled_by_default = et.configuration '\
|
56
|
+
"REGEXP 'home_button_enabled\":1' "\
|
57
|
+
"WHERE et.entry_type='paged' and t.account_id = et.account_id;")
|
58
|
+
|
59
|
+
execute('UPDATE pageflow_themings SET home_button_enabled_by_default = 0 '\
|
60
|
+
'WHERE home_button_enabled_by_default IS NULL;')
|
61
|
+
|
62
|
+
change_column :pageflow_themings,
|
63
|
+
:home_button_enabled_by_default,
|
64
|
+
:boolean,
|
65
|
+
null: false,
|
66
|
+
default: true
|
67
|
+
|
68
|
+
execute('UPDATE pageflow_widgets w, pageflow_entry_templates et, pageflow_themings t '\
|
69
|
+
"SET w.subject_type='Pageflow::Theming', w.subject_id = t.id "\
|
70
|
+
"WHERE et.account_id = t.account_id and et.entry_type = 'paged' "\
|
71
|
+
"and w.subject_id = et.id and w.subject_type = 'Pageflow::EntryTemplate';")
|
72
|
+
|
73
|
+
drop_table :pageflow_entry_templates
|
74
|
+
end
|
75
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
class ConvertLegacyScrolledContentElementTypes < ActiveRecord::Migration[5.2]
|
2
|
+
def up
|
3
|
+
lorem_ipsum1 = 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam ' \
|
4
|
+
'nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam ' \
|
5
|
+
'erat, sed diam voluptua. '
|
6
|
+
|
7
|
+
lorem_ipsum2 = 'At vero eos et accusam et justo duo dolores et ea rebum. Stet clita ' \
|
8
|
+
'kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. ' \
|
9
|
+
'Lorem ipsum dolor sit amet, consetetur sadipscing elitr. Sed diam nonumy ' \
|
10
|
+
'eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam ' \
|
11
|
+
'voluptua. At vero eos et accusam et justo duo dolores et ea rebum. ' \
|
12
|
+
'Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum ' \
|
13
|
+
'dolor sit amet. Lorem ipsum dolor sit amet.'
|
14
|
+
|
15
|
+
lorem_ipsum3 = 'Consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ' \
|
16
|
+
'ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero ' \
|
17
|
+
'eos et accusam et justo duo dolores et ea rebum. Stet clita kasd ' \
|
18
|
+
'gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. '\
|
19
|
+
'Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse ' \
|
20
|
+
'molestie consequat, vel illum dolore eu feugiat nulla facilisis at ' \
|
21
|
+
'vero eros et accumsan et iusto odio dignissim qui blandit praesent ' \
|
22
|
+
'luptatum zzril delenit augue duis dolore te feugait nulla facilisi.'
|
23
|
+
|
24
|
+
execute(<<-SQL)
|
25
|
+
UPDATE pageflow_scrolled_content_elements
|
26
|
+
SET type_name = "inlineImage"
|
27
|
+
WHERE type_name = "stickyImage";
|
28
|
+
SQL
|
29
|
+
|
30
|
+
execute(<<-SQL)
|
31
|
+
UPDATE pageflow_scrolled_content_elements
|
32
|
+
SET type_name = "textBlock", configuration = '{"children": "#{lorem_ipsum1}", "dummy": true}'
|
33
|
+
WHERE type_name = "loremIpsum1";
|
34
|
+
SQL
|
35
|
+
|
36
|
+
execute(<<-SQL)
|
37
|
+
UPDATE pageflow_scrolled_content_elements
|
38
|
+
SET type_name = "textBlock", configuration = '{"children": "#{lorem_ipsum2}", "dummy": true}'
|
39
|
+
WHERE type_name = "loremIpsum2";
|
40
|
+
SQL
|
41
|
+
|
42
|
+
execute(<<-SQL)
|
43
|
+
UPDATE pageflow_scrolled_content_elements
|
44
|
+
SET type_name = "textBlock", configuration = '{"children": "#{lorem_ipsum3}", "dummy": true}'
|
45
|
+
WHERE type_name = "loremIpsum3";
|
46
|
+
SQL
|
47
|
+
end
|
48
|
+
end
|
@@ -1141,6 +1141,7 @@ var pageflow_paged = (function (exports, Backbone, _$1, Marionette, $, I18n$1, C
|
|
1141
1141
|
|
1142
1142
|
var inputView = {
|
1143
1143
|
ui: {
|
1144
|
+
label: 'label',
|
1144
1145
|
labelText: 'label .name',
|
1145
1146
|
inlineHelp: 'label .inline_help'
|
1146
1147
|
},
|
@@ -1186,6 +1187,7 @@ var pageflow_paged = (function (exports, Backbone, _$1, Marionette, $, I18n$1, C
|
|
1186
1187
|
this.ui.inlineHelp.hide();
|
1187
1188
|
}
|
1188
1189
|
|
1190
|
+
this.setLabelFor();
|
1189
1191
|
this.updateDisabled();
|
1190
1192
|
this.setupVisibleBinding();
|
1191
1193
|
},
|
@@ -1221,6 +1223,13 @@ var pageflow_paged = (function (exports, Backbone, _$1, Marionette, $, I18n$1, C
|
|
1221
1223
|
html: true
|
1222
1224
|
}), this.options.additionalInlineHelpText]).join(' ');
|
1223
1225
|
},
|
1226
|
+
setLabelFor: function setLabelFor() {
|
1227
|
+
if (this.ui.input && this.ui.label.length === 1 && !this.ui.input.attr('id')) {
|
1228
|
+
var id = 'input_' + this.model.modelName + '_' + this.options.propertyName;
|
1229
|
+
this.ui.input.attr('id', id);
|
1230
|
+
this.ui.label.attr('for', id);
|
1231
|
+
}
|
1232
|
+
},
|
1224
1233
|
updateDisabled: function updateDisabled() {
|
1225
1234
|
if (this.ui.input) {
|
1226
1235
|
this.updateDisabledAttribute(this.ui.input);
|
@@ -3917,7 +3926,9 @@ var pageflow_paged = (function (exports, Backbone, _$1, Marionette, $, I18n$1, C
|
|
3917
3926
|
}
|
3918
3927
|
|
3919
3928
|
var payloadJson = JSON.parse(decodeURIComponent(encodedPayload));
|
3920
|
-
return new this.fileSelectionHandlers[handlerName](payloadJson
|
3929
|
+
return new this.fileSelectionHandlers[handlerName](_objectSpread({}, payloadJson, {
|
3930
|
+
entry: state.entry
|
3931
|
+
}));
|
3921
3932
|
},
|
3922
3933
|
createPageConfigurationEditorView: function createPageConfigurationEditorView(page, options) {
|
3923
3934
|
var view = this.pageTypes.findByPage(page).createConfigurationEditorView(_$1.extend(options, {
|
@@ -3930,6 +3941,13 @@ var pageflow_paged = (function (exports, Backbone, _$1, Marionette, $, I18n$1, C
|
|
3930
3941
|
var editor$1 = new EditorApi();
|
3931
3942
|
|
3932
3943
|
var startEditor = function startEditor(options) {
|
3944
|
+
// In Webpack builds, I18n object from the i18n-js module is not
|
3945
|
+
// identical to window.I18n which is provided by the i18n-js gem via
|
3946
|
+
// the asset pipeline. Make translations provided via the asset
|
3947
|
+
// pipeline available in Webpack bundle.
|
3948
|
+
I18n$1.defaultLocale = window.I18n.defaultLocale;
|
3949
|
+
I18n$1.locale = window.I18n.locale;
|
3950
|
+
I18n$1.translations = window.I18n.translations;
|
3933
3951
|
$(function () {
|
3934
3952
|
$.when($.getJSON('/editor/entries/' + options.entryId + '/seed'), pageflow.browser.detectFeatures()).done(function (result) {
|
3935
3953
|
app.start(result[0]);
|
@@ -5038,6 +5056,9 @@ var pageflow_paged = (function (exports, Backbone, _$1, Marionette, $, I18n$1, C
|
|
5038
5056
|
},
|
5039
5057
|
supportsScrollIndicatorModes: function supportsScrollIndicatorModes() {
|
5040
5058
|
return this.get('scroll_indicator_modes');
|
5059
|
+
},
|
5060
|
+
supportsHideLogoOnPages: function supportsHideLogoOnPages() {
|
5061
|
+
return this.get('hide_logo_option');
|
5041
5062
|
}
|
5042
5063
|
});
|
5043
5064
|
var WidgetConfiguration = Configuration.extend({
|
@@ -6048,7 +6069,16 @@ var pageflow_paged = (function (exports, Backbone, _$1, Marionette, $, I18n$1, C
|
|
6048
6069
|
initialize: function initialize(attributes, options) {
|
6049
6070
|
options = options || {};
|
6050
6071
|
this.metadata = new EntryMetadata(this.get('metadata') || {});
|
6051
|
-
this.metadata.parent = this;
|
6072
|
+
this.metadata.parent = this; // In 15.1 `entry.configuration` was turned into a new `Metadata`
|
6073
|
+
// model. Some of the entry type specific data (like
|
6074
|
+
// `home_button_enabled`) was extraced into
|
6075
|
+
// `entry.metadata.configuration`. Attributes like `title` or `locale`
|
6076
|
+
// which used to live in `entry.configuration` now live in
|
6077
|
+
// entry.metadata. Since some plugins (e.g. `pageflow-vr`) depend on
|
6078
|
+
// reading the locale from `entry.configuration`, this `configuration`
|
6079
|
+
// keeps backwards compatibility.
|
6080
|
+
|
6081
|
+
this.configuration = this.metadata;
|
6052
6082
|
this.themes = options.themes || state.themes;
|
6053
6083
|
this.files = options.files || state.files;
|
6054
6084
|
this.fileTypes = options.fileTypes || editor$1.fileTypes;
|
@@ -6631,6 +6661,7 @@ var pageflow_paged = (function (exports, Backbone, _$1, Marionette, $, I18n$1, C
|
|
6631
6661
|
this.outlet.show(this.options.view);
|
6632
6662
|
},
|
6633
6663
|
goBack: function goBack() {
|
6664
|
+
this.options.view.onGoBack && this.options.view.onGoBack();
|
6634
6665
|
editor$1.navigate('/', {
|
6635
6666
|
trigger: true
|
6636
6667
|
});
|
@@ -8152,6 +8183,8 @@ var pageflow_paged = (function (exports, Backbone, _$1, Marionette, $, I18n$1, C
|
|
8152
8183
|
'change:template': 'load'
|
8153
8184
|
},
|
8154
8185
|
onRender: function onRender() {
|
8186
|
+
var _this = this;
|
8187
|
+
|
8155
8188
|
this.pageTypeContainer.show(new ExtendedSelectInputView({
|
8156
8189
|
model: this.model,
|
8157
8190
|
propertyName: 'template',
|
@@ -8162,7 +8195,8 @@ var pageflow_paged = (function (exports, Backbone, _$1, Marionette, $, I18n$1, C
|
|
8162
8195
|
descriptionTranslationKeyProperty: 'description_translation_key',
|
8163
8196
|
pictogramClass: 'type_pictogram',
|
8164
8197
|
helpLinkClicked: function helpLinkClicked(value) {
|
8165
|
-
var pageType =
|
8198
|
+
var pageType = _this.options.api.pageTypes.findByName(value);
|
8199
|
+
|
8166
8200
|
app.trigger('toggle-help', pageType.seed.help_entry_translation_key);
|
8167
8201
|
}
|
8168
8202
|
}));
|
@@ -10635,7 +10669,7 @@ var pageflow_paged = (function (exports, Backbone, _$1, Marionette, $, I18n$1, C
|
|
10635
10669
|
typeName: this.options.itemTypeName,
|
10636
10670
|
typeDescription: this.options.itemTypeDescription,
|
10637
10671
|
isInvalid: this.options.itemIsInvalid
|
10638
|
-
}, _$1(this.options).pick('onEdit', '
|
10672
|
+
}, _$1(this.options).pick('onEdit', 'onRemove', 'highlight')),
|
10639
10673
|
blankSlateViewConstructor: Marionette.ItemView.extend({
|
10640
10674
|
tagName: 'li',
|
10641
10675
|
className: 'list_blank_slate',
|
@@ -11011,6 +11045,10 @@ var pageflow_paged = (function (exports, Backbone, _$1, Marionette, $, I18n$1, C
|
|
11011
11045
|
collection: state.audioFiles
|
11012
11046
|
});
|
11013
11047
|
|
11048
|
+
if (theme.supportsHideLogoOnPages()) {
|
11049
|
+
this.input('hide_logo', CheckBoxInputView);
|
11050
|
+
}
|
11051
|
+
|
11014
11052
|
if (options.canPauseAtmo) {
|
11015
11053
|
this.input('atmo_during_playback', SelectInputView, {
|
11016
11054
|
values: pageflow.Atmo.duringPlaybackModes
|
data/entry_types/scrolled/app/controllers/pageflow_scrolled/editor/content_elements_controller.rb
CHANGED
@@ -53,6 +53,7 @@ module PageflowScrolled
|
|
53
53
|
def content_element_params
|
54
54
|
configuration = params.require(:content_element)[:configuration].try(:permit!) || {}
|
55
55
|
params.require(:content_element)
|
56
|
+
.transform_keys(&:underscore)
|
56
57
|
.permit(:type_name, :position)
|
57
58
|
.merge(configuration: configuration)
|
58
59
|
end
|
@@ -8,7 +8,10 @@ module PageflowScrolled
|
|
8
8
|
html = render(template: 'pageflow_scrolled/entries/show',
|
9
9
|
locals: {
|
10
10
|
:@entry => entry,
|
11
|
-
:@seed_options => {
|
11
|
+
:@seed_options => {
|
12
|
+
skip_collections: true,
|
13
|
+
translations: {include_inline_editing: true}
|
14
|
+
}
|
12
15
|
})
|
13
16
|
|
14
17
|
content_tag(:script,
|
@@ -8,6 +8,7 @@ module PageflowScrolled
|
|
8
8
|
include Pageflow::FilesHelper
|
9
9
|
include Pageflow::EntriesHelper
|
10
10
|
include Pageflow::SocialShareLinksHelper
|
11
|
+
include PageflowScrolled::I18nHelper
|
11
12
|
|
12
13
|
def scrolled_entry_json_seed_script_tag(scrolled_entry, options = {})
|
13
14
|
seed_json = render_json do |json|
|
@@ -15,7 +16,7 @@ module PageflowScrolled
|
|
15
16
|
end
|
16
17
|
|
17
18
|
content_tag(:script, <<-JS.html_safe)
|
18
|
-
|
19
|
+
pageflowScrolledRender(#{sanitize_json(seed_json)});
|
19
20
|
JS
|
20
21
|
end
|
21
22
|
|
@@ -0,0 +1,35 @@
|
|
1
|
+
module PageflowScrolled
|
2
|
+
# @api private
|
3
|
+
module I18nHelper
|
4
|
+
def scrolled_i18n_translations(entry, include_inline_editing: false)
|
5
|
+
result = scrolled_i18n_public_translations(entry)
|
6
|
+
|
7
|
+
return result unless include_inline_editing
|
8
|
+
|
9
|
+
result.deep_merge(I18n.locale.to_s => {
|
10
|
+
pageflow_scrolled: {
|
11
|
+
inline_editing: I18n.t('pageflow_scrolled.inline_editing')
|
12
|
+
}
|
13
|
+
})
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
MERGE_IGNORING_NIL = lambda do |_, fallback, value|
|
19
|
+
value.presence || fallback
|
20
|
+
end
|
21
|
+
|
22
|
+
def scrolled_i18n_public_translations(entry)
|
23
|
+
translations =
|
24
|
+
I18n.t('pageflow_scrolled.public', locale: I18n.default_locale, default: {})
|
25
|
+
.deep_merge(I18n.t('pageflow_scrolled.public', locale: entry.locale, default: {}),
|
26
|
+
&MERGE_IGNORING_NIL)
|
27
|
+
|
28
|
+
{
|
29
|
+
entry.locale => {
|
30
|
+
pageflow_scrolled: {public: translations}
|
31
|
+
}
|
32
|
+
}
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|