pageflow 15.2.2 → 15.3.0

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.

Files changed (139) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +338 -85
  3. data/admins/pageflow/accounts.rb +1 -98
  4. data/admins/pageflow/entry.rb +21 -1
  5. data/admins/pageflow/entry_templates.rb +140 -0
  6. data/admins/pageflow/membership.rb +12 -0
  7. data/admins/pageflow/user.rb +5 -3
  8. data/app/assets/javascripts/pageflow/admin/entries.js +65 -0
  9. data/app/assets/javascripts/pageflow/admin/users.js +1 -1
  10. data/app/assets/javascripts/pageflow/asset_urls.js.erb +1 -0
  11. data/app/assets/javascripts/pageflow/base.js +0 -12
  12. data/app/assets/javascripts/pageflow/components.js +2 -6
  13. data/app/assets/javascripts/pageflow/dist/ui.js +47 -14
  14. data/app/assets/javascripts/pageflow/vendor.js +13 -10
  15. data/app/assets/stylesheets/pageflow/base.scss +0 -7
  16. data/app/assets/stylesheets/pageflow/editor/base.scss +2 -0
  17. data/app/assets/stylesheets/pageflow/editor/composables.scss +5 -1
  18. data/app/assets/stylesheets/pageflow/editor/emulation_mode_button.scss +44 -55
  19. data/app/assets/stylesheets/pageflow/editor/help.scss +2 -2
  20. data/app/assets/stylesheets/pageflow/ui/tooltip.scss +17 -3
  21. data/app/helpers/pageflow/admin/entries_helper.rb +16 -0
  22. data/app/helpers/pageflow/structured_data_helper.rb +0 -2
  23. data/app/models/pageflow/account.rb +21 -1
  24. data/app/models/pageflow/entry.rb +9 -2
  25. data/app/models/pageflow/entry_duplicate.rb +1 -0
  26. data/app/models/pageflow/entry_template.rb +16 -2
  27. data/app/policies/pageflow/account_policy.rb +10 -0
  28. data/app/policies/pageflow/entry_template_policy.rb +5 -1
  29. data/app/views/admin/accounts/_entry_template_details.html.arb +7 -5
  30. data/app/views/admin/accounts/_form.html.erb +3 -49
  31. data/app/views/admin/entries/_attributes_table.html.arb +5 -0
  32. data/app/views/admin/entries/_not_allowed_to_see_entry_types.json.jbuilder +2 -0
  33. data/app/views/admin/entries/entry_types.json.jbuilder +4 -0
  34. data/app/views/admin/entry_templates/_form.html.erb +58 -0
  35. data/app/views/admin/users/_not_allowed_to_see_user_quota.html.erb +3 -0
  36. data/app/views/components/pageflow/admin/entry_templates_tab.rb +48 -0
  37. data/app/views/pageflow/admin/users/_quota_exhausted.html.erb +1 -1
  38. data/config/initializers/admin_resource_tabs.rb +5 -0
  39. data/config/initializers/help_entries.rb +1 -5
  40. data/config/locales/de.yml +88 -155
  41. data/config/locales/en.yml +79 -143
  42. data/db/migrate/20200515112500_add_constraints_to_entry_templates.rb +21 -0
  43. data/db/migrate/20200807135200_rename_pageflow_entry_template_entry_type_to_entry_type_name.rb +7 -0
  44. data/entry_types/paged/app/assets/javascripts/pageflow_paged/components.js +7 -0
  45. data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/editor.js +1479 -1391
  46. data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/frontend.js +9218 -0
  47. data/{app/assets/javascripts/pageflow → entry_types/paged/app/assets/javascripts/pageflow_paged}/dist/react-client.js +1 -1
  48. data/{app/assets/javascripts/pageflow → entry_types/paged/app/assets/javascripts/pageflow_paged}/dist/react-server.js +3 -3
  49. data/entry_types/paged/app/assets/javascripts/pageflow_paged/frontend.js +6 -0
  50. data/entry_types/paged/app/assets/javascripts/pageflow_paged/server_rendering.js +9 -0
  51. data/entry_types/paged/app/assets/javascripts/pageflow_paged/vendor.js +8 -0
  52. data/entry_types/paged/app/controllers/pageflow_paged/application_controller.rb +2 -2
  53. data/{app/helpers/pageflow → entry_types/paged/app/helpers/pageflow_paged}/page_background_asset_helper.rb +4 -3
  54. data/{app/helpers/pageflow → entry_types/paged/app/helpers/pageflow_paged}/react_server_side_rendering_helper.rb +23 -2
  55. data/entry_types/paged/app/views/layouts/pageflow_paged/application.html.erb +2 -2
  56. data/entry_types/paged/app/views/pageflow_paged/editor/entries/_head.html.erb +2 -2
  57. data/entry_types/paged/app/views/pageflow_paged/entries/_entry.html.erb +1 -1
  58. data/{app/views/pageflow → entry_types/paged/app/views/pageflow_paged}/page_background_asset/_element.html.erb +0 -0
  59. data/{app/views/pageflow → entry_types/paged/app/views/pageflow_paged}/react/_widget.html.erb +0 -0
  60. data/{app/views/pageflow → entry_types/paged/app/views/pageflow_paged}/react/page.html.erb +0 -0
  61. data/entry_types/paged/config/initializers/features.rb +1 -1
  62. data/entry_types/paged/config/initializers/help_entries.rb +17 -0
  63. data/entry_types/paged/config/locales/new/help.de.yml +162 -0
  64. data/entry_types/paged/config/locales/new/help.en.yml +153 -0
  65. data/entry_types/paged/lib/pageflow_paged/engine.rb +13 -0
  66. data/entry_types/paged/lib/pageflow_paged/plugin.rb +5 -1
  67. data/entry_types/paged/lib/pageflow_paged/react.rb +12 -0
  68. data/{lib/pageflow → entry_types/paged/lib/pageflow_paged}/react/page_type.rb +2 -2
  69. data/{lib/pageflow → entry_types/paged/lib/pageflow_paged}/react/widget_type.rb +2 -2
  70. data/entry_types/paged/vendor/assets/javascripts/development/pageflow_paged/vendor/react-server.js +20613 -0
  71. data/entry_types/paged/vendor/assets/javascripts/development/pageflow_paged/vendor/react.js +21495 -0
  72. data/entry_types/paged/vendor/assets/javascripts/production/pageflow_paged/vendor/react-server.js +24 -0
  73. data/entry_types/paged/vendor/assets/javascripts/production/pageflow_paged/vendor/react.js +24 -0
  74. data/entry_types/scrolled/app/assets/javascripts/pageflow_scrolled/legacy.js +0 -0
  75. data/entry_types/scrolled/app/controllers/pageflow_scrolled/editor/chapters_controller.rb +2 -2
  76. data/entry_types/scrolled/app/controllers/pageflow_scrolled/editor/content_elements_controller.rb +14 -4
  77. data/entry_types/scrolled/app/controllers/pageflow_scrolled/editor/sections_controller.rb +2 -2
  78. data/entry_types/scrolled/app/controllers/pageflow_scrolled/entries_controller.rb +8 -0
  79. data/entry_types/scrolled/app/helpers/pageflow_scrolled/editor/seed_html_helper.rb +6 -0
  80. data/entry_types/scrolled/app/helpers/pageflow_scrolled/entry_json_seed_helper.rb +2 -0
  81. data/entry_types/scrolled/app/helpers/pageflow_scrolled/react_server_side_rendering_helper.rb +33 -0
  82. data/entry_types/scrolled/app/helpers/pageflow_scrolled/themes_helper.rb +8 -0
  83. data/entry_types/scrolled/app/models/pageflow_scrolled/content_element.rb +38 -0
  84. data/entry_types/scrolled/app/views/pageflow_scrolled/editor/content_elements/batch.json.jbuilder +2 -0
  85. data/entry_types/scrolled/app/views/pageflow_scrolled/editor/entries/_head.html.erb +1 -7
  86. data/entry_types/scrolled/app/views/pageflow_scrolled/entries/show.html.erb +19 -3
  87. data/entry_types/scrolled/app/views/pageflow_scrolled/entry_json_seed/_entry.json.jbuilder +3 -0
  88. data/entry_types/scrolled/app/views/pageflow_scrolled/entry_json_seed/_theme.json.jbuilder +7 -0
  89. data/entry_types/scrolled/config/initializers/help_entries.rb +16 -0
  90. data/entry_types/scrolled/config/locales/new/de.yml +345 -13
  91. data/entry_types/scrolled/config/locales/new/en.yml +257 -14
  92. data/entry_types/scrolled/config/routes.rb +1 -0
  93. data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/install_generator.rb +28 -0
  94. data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/logoDesktop.svg +56 -0
  95. data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/logoMobile.svg +22 -0
  96. data/entry_types/scrolled/lib/pageflow_scrolled/engine.rb +4 -0
  97. data/entry_types/scrolled/lib/pageflow_scrolled/plugin.rb +3 -1
  98. data/entry_types/scrolled/lib/pageflow_scrolled/seeds.rb +90 -30
  99. data/entry_types/scrolled/lib/tasks/pageflow_scrolled_tasks.rake +64 -27
  100. data/entry_types/scrolled/package/contentElements-editor.js +242 -183
  101. data/entry_types/scrolled/package/contentElements-frontend.css +1 -0
  102. data/entry_types/scrolled/package/contentElements-frontend.js +624 -279
  103. data/entry_types/scrolled/package/editor.js +2561 -363
  104. data/entry_types/scrolled/package/frontend-server.js +228 -0
  105. data/entry_types/scrolled/package/frontend/EditableText-4264c349.js +1993 -0
  106. data/entry_types/scrolled/package/frontend/Wavesurfer-c3c45324.js +378 -0
  107. data/entry_types/scrolled/package/frontend/components-cfe6a479.js +2115 -0
  108. data/entry_types/scrolled/package/frontend/getPrototypeOf-63c7c8e8.js +86 -0
  109. data/entry_types/scrolled/package/frontend/index.css +9 -0
  110. data/entry_types/scrolled/package/frontend/index.js +4425 -0
  111. data/entry_types/scrolled/package/package.json +17 -6
  112. data/entry_types/scrolled/spec/fixtures/audio.m4a +0 -0
  113. data/entry_types/scrolled/spec/fixtures/video.mp4 +0 -0
  114. data/lib/generators/pageflow/initializer/templates/pageflow.rb +20 -9
  115. data/lib/pageflow/ability_mixin.rb +14 -2
  116. data/lib/pageflow/configuration.rb +6 -5
  117. data/lib/pageflow/engine.rb +1 -0
  118. data/lib/pageflow/entry_type_configuration.rb +1 -0
  119. data/lib/pageflow/global_config_api.rb +5 -4
  120. data/lib/pageflow/react.rb +4 -2
  121. data/lib/pageflow/version.rb +1 -1
  122. data/{packages/pageflow → package}/config/jest/index.js +2 -1
  123. data/{packages/pageflow → package}/config/jest/transformers/jst.js +0 -0
  124. data/{packages/pageflow → package}/config/jest/transformers/upwardBabel.js +0 -0
  125. data/package/config/webpack.js +22 -0
  126. data/{packages/pageflow → package}/editor.js +480 -1129
  127. data/package/frontend.js +2525 -0
  128. data/{packages/pageflow → package}/package.json +3 -0
  129. data/{packages/pageflow → package}/testHelpers.js +114 -13
  130. data/{packages/pageflow → package}/ui.js +47 -14
  131. data/spec/factories/accounts.rb +3 -1
  132. data/spec/factories/entry_templates.rb +1 -0
  133. data/spec/factories/published_entries.rb +6 -1
  134. metadata +62 -26
  135. data/app/assets/javascripts/pageflow/dist/frontend.js +0 -5800
  136. data/config/initializers/entry_types.rb +0 -4
  137. data/entry_types/scrolled/package/frontend.js +0 -2879
  138. data/packages/pageflow/config/jest/transformers/cssModules.js +0 -1
  139. data/packages/pageflow/config/webpack.js +0 -14
@@ -13,6 +13,7 @@
13
13
  "eslint-plugin-import": "^2.18.2",
14
14
  "eslint-plugin-jest": "^23.0.4",
15
15
  "jest": "^24.9.0",
16
+ "jest-css-modules-processor": "^0.0.9",
16
17
  "jest-jquery-matchers": "^2.1.0",
17
18
  "jest-sinon": "^1.0.0",
18
19
  "sinon": "^7.5.0"
@@ -22,6 +23,8 @@
22
23
  "lint": "eslint ."
23
24
  },
24
25
  "dependencies": {
26
+ "backbone-events-standalone": "^0.2.7",
27
+ "classlist.js": "^1.1.20150312",
25
28
  "core-js": "^3.4.1",
26
29
  "i18n-js": "^3.5.1"
27
30
  }
@@ -249,15 +249,6 @@ var ColorInput = Base.extend({
249
249
  }
250
250
  });
251
251
 
252
- var SelectInput = Base.extend({
253
- selector: 'select',
254
- values: function values() {
255
- return this.$el.find('option').map(function () {
256
- return $(this).attr('value');
257
- }).get();
258
- }
259
- });
260
-
261
252
  function _defineProperty(obj, key, value) {
262
253
  if (key in obj) {
263
254
  Object.defineProperty(obj, key, {
@@ -273,9 +264,81 @@ function _defineProperty(obj, key, value) {
273
264
  return obj;
274
265
  }
275
266
 
276
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
267
+ function ownKeys(object, enumerableOnly) {
268
+ var keys = Object.keys(object);
269
+
270
+ if (Object.getOwnPropertySymbols) {
271
+ var symbols = Object.getOwnPropertySymbols(object);
272
+ if (enumerableOnly) symbols = symbols.filter(function (sym) {
273
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
274
+ });
275
+ keys.push.apply(keys, symbols);
276
+ }
277
+
278
+ return keys;
279
+ }
280
+
281
+ function _objectSpread2(target) {
282
+ for (var i = 1; i < arguments.length; i++) {
283
+ var source = arguments[i] != null ? arguments[i] : {};
284
+
285
+ if (i % 2) {
286
+ ownKeys(Object(source), true).forEach(function (key) {
287
+ _defineProperty(target, key, source[key]);
288
+ });
289
+ } else if (Object.getOwnPropertyDescriptors) {
290
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
291
+ } else {
292
+ ownKeys(Object(source)).forEach(function (key) {
293
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
294
+ });
295
+ }
296
+ }
297
+
298
+ return target;
299
+ }
300
+
301
+ var Base$1 = Base.extend({
302
+ selector: '.input'
303
+ });
304
+
305
+ Base$1.findByPropertyName = function (propertyName, options) {
306
+ return this.findBy(function (el) {
307
+ return el.data('inputPropertyName') === propertyName;
308
+ }, _objectSpread2({
309
+ predicateName: "input property name '".concat(propertyName, "'")
310
+ }, options));
311
+ };
312
+
313
+ var RadioButtonGroupInput = Base$1.extend({
314
+ values: function values() {
315
+ return this.$el.find('input').map(function () {
316
+ return $(this).attr('value');
317
+ }).get();
318
+ },
319
+ enabledValues: function enabledValues() {
320
+ return this.$el.find('input:not([disabled])').map(function () {
321
+ return $(this).attr('value');
322
+ }).get();
323
+ }
324
+ });
325
+
326
+ var SelectInput = Base$1.extend({
327
+ value: function value() {
328
+ return this.$el.find('select').val();
329
+ },
330
+ values: function values() {
331
+ return this.$el.find('option').map(function () {
332
+ return $(this).attr('value');
333
+ }).get();
334
+ },
335
+ enabledValues: function enabledValues() {
336
+ return this.$el.find('option:not([disabled])').map(function () {
337
+ return $(this).attr('value');
338
+ }).get();
339
+ }
340
+ });
277
341
 
278
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
279
342
  /**
280
343
  * Build editor Backbone models for tests.
281
344
  */
@@ -314,7 +377,7 @@ var factories = {
314
377
 
315
378
  ensureFileTypes(options);
316
379
  ensureFilesCollections(options);
317
- var entry = new model(_objectSpread({
380
+ var entry = new model(_objectSpread2({
318
381
  id: 1
319
382
  }, attributes), _.extend({
320
383
  storylines: new Backbone.Collection(),
@@ -551,6 +614,44 @@ function ensureFilesCollections(options) {
551
614
  }
552
615
  }
553
616
 
617
+ var state = window.pageflow || {};
618
+
619
+ /**
620
+ * Setup global state for testing Backbone editro components.
621
+ *
622
+ * For some editor components like (some views or models) it's easier
623
+ * to depend on the global mutable state (available via the `$state`
624
+ * module alias) instead of injecting dependencies. This helper can be
625
+ * used to test these components in isolation.
626
+ *
627
+ * @param {Object} mapping -
628
+ * Properties to set on the global state. Functions as values will
629
+ * be evaluated and the return value will be assigned instead.
630
+ */
631
+
632
+ var setupGlobals = function setupGlobals(mapping) {
633
+ var globalsBackup;
634
+ beforeEach(function () {
635
+ if (globalsBackup) {
636
+ throw new Error('There can only be one setupGlobals call per test.');
637
+ }
638
+
639
+ globalsBackup = {};
640
+
641
+ _.each(mapping, function (value, key) {
642
+ globalsBackup[key] = state[key];
643
+ state[key] = typeof value === 'function' ? value.call(this) : value;
644
+ });
645
+ });
646
+ afterEach(function () {
647
+ _.each(mapping, function (_, key) {
648
+ state[key] = globalsBackup[key];
649
+ });
650
+
651
+ globalsBackup = null;
652
+ });
653
+ };
654
+
554
655
  /**
555
656
  * Define translations to use in tests.
556
657
  *
@@ -628,4 +729,4 @@ function keysWithDotsToNestedObjects(translations) {
628
729
  }, {});
629
730
  }
630
731
 
631
- export { ColorInput, ConfigurationEditor, ConfigurationEditorTab, DropDownButton, FileMetaDataTable, FileStageItem, FileThumbnail, ReferenceInput, SelectInput, StaticThumbnail, Table, Tabs, ThemeItem, factories, useFakeTranslations };
732
+ export { ColorInput, ConfigurationEditor, ConfigurationEditorTab, DropDownButton, FileMetaDataTable, FileStageItem, FileThumbnail, RadioButtonGroupInput, ReferenceInput, SelectInput, StaticThumbnail, Table, Tabs, ThemeItem, factories, setupGlobals, useFakeTranslations };
@@ -155,10 +155,7 @@ function _arrayWithHoles(arr) {
155
155
  }
156
156
 
157
157
  function _iterableToArrayLimit(arr, i) {
158
- if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) {
159
- return;
160
- }
161
-
158
+ if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
162
159
  var _arr = [];
163
160
  var _n = true;
164
161
  var _d = false;
@@ -184,12 +181,31 @@ function _iterableToArrayLimit(arr, i) {
184
181
  return _arr;
185
182
  }
186
183
 
184
+ function _arrayLikeToArray(arr, len) {
185
+ if (len == null || len > arr.length) len = arr.length;
186
+
187
+ for (var i = 0, arr2 = new Array(len); i < len; i++) {
188
+ arr2[i] = arr[i];
189
+ }
190
+
191
+ return arr2;
192
+ }
193
+
194
+ function _unsupportedIterableToArray(o, minLen) {
195
+ if (!o) return;
196
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
197
+ var n = Object.prototype.toString.call(o).slice(8, -1);
198
+ if (n === "Object" && o.constructor) n = o.constructor.name;
199
+ if (n === "Map" || n === "Set") return Array.from(n);
200
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
201
+ }
202
+
187
203
  function _nonIterableRest() {
188
- throw new TypeError("Invalid attempt to destructure non-iterable instance");
204
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
189
205
  }
190
206
 
191
207
  function _slicedToArray(arr, i) {
192
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
208
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
193
209
  }
194
210
 
195
211
  /**
@@ -271,7 +287,7 @@ function ui(styles) {
271
287
  * <button class=${styles.addButton}></button>
272
288
  * `,
273
289
  *
274
- * events: cssModulesUtils.ui(styles, {
290
+ * events: cssModulesUtils.events(styles, {
275
291
  * 'click addButton': () => console.log('clicked add button');
276
292
  * })
277
293
  * });
@@ -1006,10 +1022,14 @@ var TooltipView = Marionette.ItemView.extend({
1006
1022
  this.ui.label.text(text);
1007
1023
  this.$el.toggleClass('align_bottom_right', options.align === 'bottom right');
1008
1024
  this.$el.toggleClass('align_bottom_left', options.align === 'bottom left');
1025
+ this.$el.toggleClass('align_top_center', options.align === 'top center');
1009
1026
 
1010
1027
  if (options.align === 'bottom right' || options.align === 'bottom left') {
1011
1028
  offsetTop = 10;
1012
1029
  offsetLeft = 0;
1030
+ } else if (options.align === 'top center') {
1031
+ offsetTop = -10;
1032
+ offsetLeft = 0;
1013
1033
  } else {
1014
1034
  offsetTop = -17;
1015
1035
  offsetLeft = 10;
@@ -1689,6 +1709,10 @@ return __p
1689
1709
  * value of the `placeholderModel` occurs whenever the attribute is
1690
1710
  * blank.
1691
1711
  *
1712
+ * @param {function} [options.optionDisabled]
1713
+ * Receives value and has to return boolean indicating whether
1714
+ * option is disabled.
1715
+ *
1692
1716
  * @class
1693
1717
  */
1694
1718
 
@@ -1791,6 +1815,10 @@ var SelectInputView = Marionette.ItemView.extend({
1791
1815
  option.value = value;
1792
1816
  option.text = this.options.texts[index];
1793
1817
 
1818
+ if (this.options.optionDisabled && this.options.optionDisabled(value)) {
1819
+ option.setAttribute('disabled', true);
1820
+ }
1821
+
1794
1822
  if (group) {
1795
1823
  option.setAttribute('data-group', group);
1796
1824
  this.findOrCreateOptGroup(group).append(option);
@@ -1815,10 +1843,10 @@ var SelectInputView = Marionette.ItemView.extend({
1815
1843
  if (!this.isClosed) {
1816
1844
  var value = this.model.get(this.options.propertyName);
1817
1845
 
1818
- if (this.model.has(this.options.propertyName) && this.ui.select.find('option[value="' + value + '"]').length) {
1846
+ if (this.model.has(this.options.propertyName) && this.ui.select.find('option[value="' + value + '"]:not([disabled])').length) {
1819
1847
  this.ui.select.val(value);
1820
1848
  } else {
1821
- this.ui.select.val(this.ui.select.find('option:first').val());
1849
+ this.ui.select.val(this.ui.select.find('option:not([disabled]):first').val());
1822
1850
  }
1823
1851
  }
1824
1852
  }
@@ -1947,7 +1975,7 @@ __p += '<label>\n <span class="name"></span>\n <span class="inline_help"></spa
1947
1975
  ((__t = ( I18n.t('pageflow.ui.templates.inputs.text_area_input.open_in_new_tab') )) == null ? '' : __t) +
1948
1976
  '\n </label>\n <span class="inline_help">\n ' +
1949
1977
  ((__t = ( I18n.t('pageflow.ui.templates.inputs.text_area_input.open_in_new_tab_help') )) == null ? '' : __t) +
1950
- '\n </span>\n </div>\n </div>\n <div class="fragment_link_panel">\n <!-- LinkInputView is inserted here -->\n </div>\n\n <!-- wysihtml5 does not handle hidden fields correctly -->\n <div class="internal">\n <input type="text" data-wysihtml5-dialog-field="href" class="current_url" value="http://">\n <input type="text" data-wysihtml5-dialog-field="target" class="current_target" value="_blank">\n </div>\n\n <a class="button" data-wysihtml5-dialog-action="save">\n ' +
1978
+ '\n </span>\n </div>\n </div>\n <div class="fragment_link_panel">\n <!-- LinkInputView is inserted here -->\n </div>\n\n <!-- wysihtml5 does not handle hidden fields correctly -->\n <div class="internal">\n <input type="text" data-wysihtml5-dialog-field="href" class="current_url" value="">\n <input type="text" data-wysihtml5-dialog-field="target" class="current_target" value="_blank">\n </div>\n\n <a class="button" data-wysihtml5-dialog-action="save">\n ' +
1951
1979
  ((__t = ( I18n.t('pageflow.ui.templates.inputs.text_area_input.save') )) == null ? '' : __t) +
1952
1980
  '\n </a>\n <a class="button" data-wysihtml5-dialog-action="cancel">\n ' +
1953
1981
  ((__t = ( I18n.t('pageflow.ui.templates.inputs.text_area_input.cancel') )) == null ? '' : __t) +
@@ -2094,7 +2122,7 @@ var TextAreaInputView = Marionette.ItemView.extend({
2094
2122
  var currentUrl = this.ui.urlInput.val();
2095
2123
 
2096
2124
  if (currentUrl.startsWith('#')) {
2097
- this.ui.displayUrlInput.val('http://');
2125
+ this.ui.displayUrlInput.val('');
2098
2126
  this.ui.openInNewTabCheckBox.prop('checked', true);
2099
2127
  } else {
2100
2128
  this.ui.displayUrlInput.val(currentUrl);
@@ -2796,8 +2824,8 @@ var tooltipContainer = {
2796
2824
  events: {
2797
2825
  'mouseover [data-tooltip]': function mouseoverDataTooltip(event) {
2798
2826
  if (!this.tooltip.visible) {
2799
- var target = $(event.target);
2800
- var key = target.data('tooltip');
2827
+ var target = $(event.currentTarget);
2828
+ var key = target.attr('data-tooltip');
2801
2829
  var position;
2802
2830
 
2803
2831
  if (target.data('tooltipAlign') === 'bottom left') {
@@ -2810,6 +2838,11 @@ var tooltipContainer = {
2810
2838
  left: target.position().left + target.outerWidth(),
2811
2839
  top: target.position().top + target.outerHeight()
2812
2840
  };
2841
+ } else if (target.data('tooltipAlign') === 'top center') {
2842
+ position = {
2843
+ left: target.position().left + target.outerWidth() / 2,
2844
+ top: target.position().top + 2
2845
+ };
2813
2846
  } else {
2814
2847
  position = {
2815
2848
  left: target.position().left + target.outerWidth(),
@@ -2822,7 +2855,7 @@ var tooltipContainer = {
2822
2855
  });
2823
2856
  }
2824
2857
  },
2825
- 'mouseout [data-tooltip]': function mouseoutDataTooltip() {
2858
+ 'mouseleave [data-tooltip]': function mouseleaveDataTooltip() {
2826
2859
  this.tooltip.hide();
2827
2860
  }
2828
2861
  },
@@ -20,6 +20,7 @@ FactoryBot.define do
20
20
  with_manager { nil }
21
21
 
22
22
  with_feature { nil }
23
+ without_feature { nil }
23
24
  end
24
25
 
25
26
  after(:create) do |account, evaluator|
@@ -47,7 +48,8 @@ FactoryBot.define do
47
48
 
48
49
  after(:build) do |entry, evaluator|
49
50
  entry.features_configuration =
50
- entry.features_configuration.merge(evaluator.with_feature => true)
51
+ entry.features_configuration.merge(evaluator.with_feature => true,
52
+ evaluator.without_feature => false)
51
53
  end
52
54
  end
53
55
  end
@@ -2,6 +2,7 @@ module Pageflow
2
2
  FactoryBot.define do
3
3
  factory :entry_template, class: Pageflow::EntryTemplate do
4
4
  account
5
+ entry_type_name { 'paged' }
5
6
  theme_name { 'default' }
6
7
  end
7
8
  end
@@ -4,13 +4,18 @@ module Pageflow
4
4
  transient do
5
5
  type_name { 'paged' }
6
6
  revision_attributes { {} }
7
+
8
+ with_feature { nil }
9
+ without_feature { nil }
7
10
  end
8
11
 
9
12
  initialize_with do
10
13
  PublishedEntry.new(create(:entry,
11
14
  :published,
12
15
  type_name: type_name,
13
- published_revision_attributes: revision_attributes))
16
+ published_revision_attributes: revision_attributes,
17
+ with_feature: with_feature,
18
+ without_feature: without_feature))
14
19
  end
15
20
 
16
21
  to_create { |published_entry| published_entry.entry.save! }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pageflow
3
3
  version: !ruby/object:Gem::Version
4
- version: 15.2.2
4
+ version: 15.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Codevise Solutions Ltd
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-15 00:00:00.000000000 Z
11
+ date: 2020-08-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -330,14 +330,14 @@ dependencies:
330
330
  requirements:
331
331
  - - "~>"
332
332
  - !ruby/object:Gem::Version
333
- version: '1.8'
333
+ version: '2.6'
334
334
  type: :runtime
335
335
  prerelease: false
336
336
  version_requirements: !ruby/object:Gem::Requirement
337
337
  requirements:
338
338
  - - "~>"
339
339
  - !ruby/object:Gem::Version
340
- version: '1.8'
340
+ version: '2.6'
341
341
  - !ruby/object:Gem::Dependency
342
342
  name: ejs
343
343
  requirement: !ruby/object:Gem::Requirement
@@ -931,6 +931,7 @@ files:
931
931
  - Rakefile
932
932
  - admins/pageflow/accounts.rb
933
933
  - admins/pageflow/entry.rb
934
+ - admins/pageflow/entry_templates.rb
934
935
  - admins/pageflow/folder.rb
935
936
  - admins/pageflow/membership.rb
936
937
  - admins/pageflow/revisions.rb
@@ -1057,9 +1058,6 @@ files:
1057
1058
  - app/assets/javascripts/pageflow/asset_urls.js.erb
1058
1059
  - app/assets/javascripts/pageflow/base.js
1059
1060
  - app/assets/javascripts/pageflow/components.js
1060
- - app/assets/javascripts/pageflow/dist/frontend.js
1061
- - app/assets/javascripts/pageflow/dist/react-client.js
1062
- - app/assets/javascripts/pageflow/dist/react-server.js
1063
1061
  - app/assets/javascripts/pageflow/dist/ui.js
1064
1062
  - app/assets/javascripts/pageflow/editor/base.js
1065
1063
  - app/assets/javascripts/pageflow/editor/vendor.js
@@ -1361,12 +1359,10 @@ files:
1361
1359
  - app/helpers/pageflow/meta_tags_helper.rb
1362
1360
  - app/helpers/pageflow/navigation_bar_helper.rb
1363
1361
  - app/helpers/pageflow/overview_helper.rb
1364
- - app/helpers/pageflow/page_background_asset_helper.rb
1365
1362
  - app/helpers/pageflow/page_types_helper.rb
1366
1363
  - app/helpers/pageflow/pages_helper.rb
1367
1364
  - app/helpers/pageflow/public_i18n_helper.rb
1368
1365
  - app/helpers/pageflow/quota_helper.rb
1369
- - app/helpers/pageflow/react_server_side_rendering_helper.rb
1370
1366
  - app/helpers/pageflow/render_json_helper.rb
1371
1367
  - app/helpers/pageflow/revision_file_helper.rb
1372
1368
  - app/helpers/pageflow/social_share_helper.rb
@@ -1476,11 +1472,15 @@ files:
1476
1472
  - app/views/admin/accounts/_theming_details.html.arb
1477
1473
  - app/views/admin/entries/_attributes_table.html.arb
1478
1474
  - app/views/admin/entries/_links.html.arb
1475
+ - app/views/admin/entries/_not_allowed_to_see_entry_types.json.jbuilder
1476
+ - app/views/admin/entries/entry_types.json.jbuilder
1477
+ - app/views/admin/entry_templates/_form.html.erb
1479
1478
  - app/views/admin/features/_form.html.erb
1480
1479
  - app/views/admin/memberships/_form.html.erb
1481
1480
  - app/views/admin/memberships/_role_hint.html.arb
1482
1481
  - app/views/admin/revisions/_form.html.erb
1483
1482
  - app/views/admin/users/_form.html.erb
1483
+ - app/views/admin/users/_not_allowed_to_see_user_quota.html.erb
1484
1484
  - app/views/admin/users/delete_me.html.erb
1485
1485
  - app/views/admin/users/invitation.html.erb
1486
1486
  - app/views/admin/users/me.html.erb
@@ -1491,6 +1491,7 @@ files:
1491
1491
  - app/views/components/pageflow/admin/embedded_index_table.rb
1492
1492
  - app/views/components/pageflow/admin/entries_tab.rb
1493
1493
  - app/views/components/pageflow/admin/entry_publication_state_indicator.rb
1494
+ - app/views/components/pageflow/admin/entry_templates_tab.rb
1494
1495
  - app/views/components/pageflow/admin/entry_user_badge_list.rb
1495
1496
  - app/views/components/pageflow/admin/extensible_attributes_table.rb
1496
1497
  - app/views/components/pageflow/admin/features_tab.rb
@@ -1579,12 +1580,9 @@ files:
1579
1580
  - app/views/pageflow/help_entries/_section.html.erb
1580
1581
  - app/views/pageflow/image_files/_image_file.json.jbuilder
1581
1582
  - app/views/pageflow/meta_tags/_entry.html.erb
1582
- - app/views/pageflow/page_background_asset/_element.html.erb
1583
1583
  - app/views/pageflow/page_types/_page_type.json.jbuilder
1584
1584
  - app/views/pageflow/pages/_info_box.html.erb
1585
1585
  - app/views/pageflow/public_i18n/_javascript_tag.html.erb
1586
- - app/views/pageflow/react/_widget.html.erb
1587
- - app/views/pageflow/react/page.html.erb
1588
1586
  - app/views/pageflow/revisions/create.json.jbuilder
1589
1587
  - app/views/pageflow/social_share/_entry_meta_tags.html.erb
1590
1588
  - app/views/pageflow/social_share/_image_tags.html.erb
@@ -1602,7 +1600,6 @@ files:
1602
1600
  - config/initializers/active_admin_patches.rb
1603
1601
  - config/initializers/admin_attributes_table_rows.rb
1604
1602
  - config/initializers/admin_resource_tabs.rb
1605
- - config/initializers/entry_types.rb
1606
1603
  - config/initializers/features.rb
1607
1604
  - config/initializers/help_entries.rb
1608
1605
  - config/initializers/paperclip.rb
@@ -1636,13 +1633,24 @@ files:
1636
1633
  - db/migrate/20200117133200_change_revision_appearance_option_default_and_null.rb
1637
1634
  - db/migrate/20200122115400_create_pageflow_entry_templates.rb
1638
1635
  - db/migrate/20200206134400_convert_legacy_scrolled_content_element_types.rb
1636
+ - db/migrate/20200515112500_add_constraints_to_entry_templates.rb
1637
+ - db/migrate/20200807135200_rename_pageflow_entry_template_entry_type_to_entry_type_name.rb
1638
+ - entry_types/paged/app/assets/javascripts/pageflow_paged/components.js
1639
1639
  - entry_types/paged/app/assets/javascripts/pageflow_paged/dist/editor.js
1640
+ - entry_types/paged/app/assets/javascripts/pageflow_paged/dist/frontend.js
1641
+ - entry_types/paged/app/assets/javascripts/pageflow_paged/dist/react-client.js
1642
+ - entry_types/paged/app/assets/javascripts/pageflow_paged/dist/react-server.js
1640
1643
  - entry_types/paged/app/assets/javascripts/pageflow_paged/editor.js
1644
+ - entry_types/paged/app/assets/javascripts/pageflow_paged/frontend.js
1645
+ - entry_types/paged/app/assets/javascripts/pageflow_paged/server_rendering.js
1646
+ - entry_types/paged/app/assets/javascripts/pageflow_paged/vendor.js
1641
1647
  - entry_types/paged/app/assets/stylesheets/pageflow_paged/editor.scss
1642
1648
  - entry_types/paged/app/controllers/concerns/pageflow_paged/without_controller_namespace_partial_path_prefix.rb
1643
1649
  - entry_types/paged/app/controllers/pageflow_paged/application_controller.rb
1644
1650
  - entry_types/paged/app/controllers/pageflow_paged/editor/entries_controller.rb
1645
1651
  - entry_types/paged/app/controllers/pageflow_paged/entries_controller.rb
1652
+ - entry_types/paged/app/helpers/pageflow_paged/page_background_asset_helper.rb
1653
+ - entry_types/paged/app/helpers/pageflow_paged/react_server_side_rendering_helper.rb
1646
1654
  - entry_types/paged/app/views/layouts/pageflow_paged/_ie_include_tags.html.erb
1647
1655
  - entry_types/paged/app/views/layouts/pageflow_paged/_loading_spinner_inline_script.html.erb
1648
1656
  - entry_types/paged/app/views/layouts/pageflow_paged/application.html.erb
@@ -1664,14 +1672,28 @@ files:
1664
1672
  - entry_types/paged/app/views/pageflow_paged/entries/overview/_entry.html.erb
1665
1673
  - entry_types/paged/app/views/pageflow_paged/entries/overview/_page.html.erb
1666
1674
  - entry_types/paged/app/views/pageflow_paged/entries/show.html.erb
1675
+ - entry_types/paged/app/views/pageflow_paged/page_background_asset/_element.html.erb
1667
1676
  - entry_types/paged/app/views/pageflow_paged/pages/_page.html.erb
1677
+ - entry_types/paged/app/views/pageflow_paged/react/_widget.html.erb
1678
+ - entry_types/paged/app/views/pageflow_paged/react/page.html.erb
1668
1679
  - entry_types/paged/config/initializers/features.rb
1680
+ - entry_types/paged/config/initializers/help_entries.rb
1669
1681
  - entry_types/paged/config/initializers/page_types.rb
1682
+ - entry_types/paged/config/locales/new/help.de.yml
1683
+ - entry_types/paged/config/locales/new/help.en.yml
1670
1684
  - entry_types/paged/config/routes.rb
1671
1685
  - entry_types/paged/lib/pageflow_paged.rb
1672
1686
  - entry_types/paged/lib/pageflow_paged/configuration.rb
1673
1687
  - entry_types/paged/lib/pageflow_paged/engine.rb
1674
1688
  - entry_types/paged/lib/pageflow_paged/plugin.rb
1689
+ - entry_types/paged/lib/pageflow_paged/react.rb
1690
+ - entry_types/paged/lib/pageflow_paged/react/page_type.rb
1691
+ - entry_types/paged/lib/pageflow_paged/react/widget_type.rb
1692
+ - entry_types/paged/vendor/assets/javascripts/development/pageflow_paged/vendor/react-server.js
1693
+ - entry_types/paged/vendor/assets/javascripts/development/pageflow_paged/vendor/react.js
1694
+ - entry_types/paged/vendor/assets/javascripts/production/pageflow_paged/vendor/react-server.js
1695
+ - entry_types/paged/vendor/assets/javascripts/production/pageflow_paged/vendor/react.js
1696
+ - entry_types/scrolled/app/assets/javascripts/pageflow_scrolled/legacy.js
1675
1697
  - entry_types/scrolled/app/assets/stylesheets/pageflow_scrolled/editor.scss
1676
1698
  - entry_types/scrolled/app/controllers/pageflow_scrolled/editor/chapters_controller.rb
1677
1699
  - entry_types/scrolled/app/controllers/pageflow_scrolled/editor/content_elements_controller.rb
@@ -1681,22 +1703,29 @@ files:
1681
1703
  - entry_types/scrolled/app/helpers/pageflow_scrolled/editor/seed_html_helper.rb
1682
1704
  - entry_types/scrolled/app/helpers/pageflow_scrolled/entry_json_seed_helper.rb
1683
1705
  - entry_types/scrolled/app/helpers/pageflow_scrolled/i18n_helper.rb
1706
+ - entry_types/scrolled/app/helpers/pageflow_scrolled/react_server_side_rendering_helper.rb
1707
+ - entry_types/scrolled/app/helpers/pageflow_scrolled/themes_helper.rb
1684
1708
  - entry_types/scrolled/app/models/pageflow_scrolled/chapter.rb
1685
1709
  - entry_types/scrolled/app/models/pageflow_scrolled/content_element.rb
1686
1710
  - entry_types/scrolled/app/models/pageflow_scrolled/section.rb
1687
1711
  - entry_types/scrolled/app/models/pageflow_scrolled/storyline.rb
1688
1712
  - entry_types/scrolled/app/views/pageflow_scrolled/chapters/_chapter.json.jbuilder
1689
1713
  - entry_types/scrolled/app/views/pageflow_scrolled/content_elements/_content_element.json.jbuilder
1714
+ - entry_types/scrolled/app/views/pageflow_scrolled/editor/content_elements/batch.json.jbuilder
1690
1715
  - entry_types/scrolled/app/views/pageflow_scrolled/editor/entries/_body.html.erb
1691
1716
  - entry_types/scrolled/app/views/pageflow_scrolled/editor/entries/_head.html.erb
1692
1717
  - entry_types/scrolled/app/views/pageflow_scrolled/editor/entries/_seed.json.jbuilder
1693
1718
  - entry_types/scrolled/app/views/pageflow_scrolled/entries/show.html.erb
1694
1719
  - entry_types/scrolled/app/views/pageflow_scrolled/entry_json_seed/_entry.json.jbuilder
1720
+ - entry_types/scrolled/app/views/pageflow_scrolled/entry_json_seed/_theme.json.jbuilder
1695
1721
  - entry_types/scrolled/app/views/pageflow_scrolled/sections/_section.json.jbuilder
1722
+ - entry_types/scrolled/config/initializers/help_entries.rb
1696
1723
  - entry_types/scrolled/config/locales/new/de.yml
1697
1724
  - entry_types/scrolled/config/locales/new/en.yml
1698
1725
  - entry_types/scrolled/config/routes.rb
1699
1726
  - entry_types/scrolled/lib/generators/pageflow_scrolled/install/install_generator.rb
1727
+ - entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/logoDesktop.svg
1728
+ - entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/logoMobile.svg
1700
1729
  - entry_types/scrolled/lib/pageflow_scrolled.rb
1701
1730
  - entry_types/scrolled/lib/pageflow_scrolled/configuration.rb
1702
1731
  - entry_types/scrolled/lib/pageflow_scrolled/engine.rb
@@ -1704,15 +1733,24 @@ files:
1704
1733
  - entry_types/scrolled/lib/pageflow_scrolled/seeds.rb
1705
1734
  - entry_types/scrolled/lib/tasks/pageflow_scrolled_tasks.rake
1706
1735
  - entry_types/scrolled/package/contentElements-editor.js
1736
+ - entry_types/scrolled/package/contentElements-frontend.css
1707
1737
  - entry_types/scrolled/package/contentElements-frontend.js
1708
1738
  - entry_types/scrolled/package/editor.js
1709
- - entry_types/scrolled/package/frontend.js
1739
+ - entry_types/scrolled/package/frontend-server.js
1740
+ - entry_types/scrolled/package/frontend/EditableText-4264c349.js
1741
+ - entry_types/scrolled/package/frontend/Wavesurfer-c3c45324.js
1742
+ - entry_types/scrolled/package/frontend/components-cfe6a479.js
1743
+ - entry_types/scrolled/package/frontend/getPrototypeOf-63c7c8e8.js
1744
+ - entry_types/scrolled/package/frontend/index.css
1745
+ - entry_types/scrolled/package/frontend/index.js
1710
1746
  - entry_types/scrolled/package/package.json
1711
1747
  - entry_types/scrolled/spec/factories/chapters.rb
1712
1748
  - entry_types/scrolled/spec/factories/content_elements.rb
1713
1749
  - entry_types/scrolled/spec/factories/sections.rb
1714
1750
  - entry_types/scrolled/spec/factories/storylines.rb
1751
+ - entry_types/scrolled/spec/fixtures/audio.m4a
1715
1752
  - entry_types/scrolled/spec/fixtures/image.jpg
1753
+ - entry_types/scrolled/spec/fixtures/video.mp4
1716
1754
  - lib/generators/pageflow/active_admin_initializer/active_admin_initializer_generator.rb
1717
1755
  - lib/generators/pageflow/assets/assets_generator.rb
1718
1756
  - lib/generators/pageflow/assets/templates/application.js
@@ -1807,8 +1845,6 @@ files:
1807
1845
  - lib/pageflow/quota.rb
1808
1846
  - lib/pageflow/quotas.rb
1809
1847
  - lib/pageflow/react.rb
1810
- - lib/pageflow/react/page_type.rb
1811
- - lib/pageflow/react/widget_type.rb
1812
1848
  - lib/pageflow/revision_component.rb
1813
1849
  - lib/pageflow/revision_components.rb
1814
1850
  - lib/pageflow/seeds.rb
@@ -1826,15 +1862,15 @@ files:
1826
1862
  - lib/pageflow/zencoder_video_output_definition.rb
1827
1863
  - lib/tasks/entry_export_import.rake
1828
1864
  - lib/tasks/pageflow_tasks.rake
1829
- - packages/pageflow/config/jest/index.js
1830
- - packages/pageflow/config/jest/transformers/cssModules.js
1831
- - packages/pageflow/config/jest/transformers/jst.js
1832
- - packages/pageflow/config/jest/transformers/upwardBabel.js
1833
- - packages/pageflow/config/webpack.js
1834
- - packages/pageflow/editor.js
1835
- - packages/pageflow/package.json
1836
- - packages/pageflow/testHelpers.js
1837
- - packages/pageflow/ui.js
1865
+ - package/config/jest/index.js
1866
+ - package/config/jest/transformers/jst.js
1867
+ - package/config/jest/transformers/upwardBabel.js
1868
+ - package/config/webpack.js
1869
+ - package/editor.js
1870
+ - package/frontend.js
1871
+ - package/package.json
1872
+ - package/testHelpers.js
1873
+ - package/ui.js
1838
1874
  - spec/factories/accounts.rb
1839
1875
  - spec/factories/audio_files.rb
1840
1876
  - spec/factories/authentication_tokens.rb
@@ -1907,7 +1943,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1907
1943
  version: '0'
1908
1944
  requirements: []
1909
1945
  rubyforge_project:
1910
- rubygems_version: 2.7.5
1946
+ rubygems_version: 2.7.9
1911
1947
  signing_key:
1912
1948
  specification_version: 4
1913
1949
  summary: Multimedia story telling for the web.