pageflow 16.1.0 → 17.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (113) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -221
  3. data/README.md +6 -5
  4. data/app/assets/images/pageflow/admin/icons/published_with_noindex.svg +4 -0
  5. data/app/assets/javascripts/pageflow/dist/ui.js +1 -0
  6. data/app/assets/stylesheets/pageflow/admin/active_admin_patches.scss +1 -1
  7. data/app/assets/stylesheets/pageflow/admin/entries.scss +4 -0
  8. data/app/assets/stylesheets/pageflow/admin/publication_state_indicator.scss +4 -0
  9. data/app/assets/stylesheets/pageflow/editor/base.scss +0 -1
  10. data/app/assets/stylesheets/pageflow/editor/drop_down_button.scss +55 -6
  11. data/app/assets/stylesheets/pageflow/editor/file_meta_data.scss +12 -1
  12. data/app/assets/stylesheets/pageflow/ui/forms.scss +3 -3
  13. data/app/assets/stylesheets/pageflow/{editor/wysihtml5.scss → ui/input/text_area_input.scss} +13 -1
  14. data/app/assets/stylesheets/pageflow/ui.scss +1 -0
  15. data/app/controllers/pageflow/editor/entry_publications_controller.rb +5 -1
  16. data/app/controllers/pageflow/editor/file_import_controller.rb +1 -1
  17. data/app/controllers/pageflow/entries_controller.rb +2 -2
  18. data/app/helpers/pageflow/entries_helper.rb +2 -0
  19. data/app/helpers/pageflow/meta_tags_helper.rb +2 -1
  20. data/app/helpers/pageflow/page_types_helper.rb +4 -4
  21. data/app/helpers/pageflow/revision_file_helper.rb +3 -3
  22. data/app/helpers/pageflow/social_share_helper.rb +2 -2
  23. data/app/models/concerns/pageflow/entry_publication_states.rb +9 -0
  24. data/app/models/concerns/pageflow/feature_target.rb +1 -1
  25. data/app/models/concerns/pageflow/output_source.rb +1 -1
  26. data/app/models/concerns/pageflow/serialized_configuration.rb +1 -1
  27. data/app/models/concerns/pageflow/uploadable_file.rb +5 -0
  28. data/app/models/pageflow/account.rb +2 -2
  29. data/app/models/pageflow/entry.rb +7 -5
  30. data/app/models/pageflow/entry_at_revision.rb +2 -0
  31. data/app/models/pageflow/entry_template.rb +4 -1
  32. data/app/models/pageflow/image_file.rb +20 -5
  33. data/app/models/pageflow/image_file_url_templates.rb +7 -1
  34. data/app/models/pageflow/revision.rb +7 -5
  35. data/app/models/pageflow/site.rb +2 -2
  36. data/app/models/pageflow/sitemaps.rb +1 -0
  37. data/app/models/pageflow/theme_customization.rb +2 -2
  38. data/app/models/pageflow/used_file.rb +8 -0
  39. data/app/views/components/pageflow/admin/extensible_attributes_table.rb +1 -7
  40. data/app/views/components/pageflow/admin/revisions_tab.rb +8 -0
  41. data/app/views/pageflow/editor/config/_seeds.json.jbuilder +1 -0
  42. data/app/views/pageflow/editor/entries/_entry.json.jbuilder +1 -0
  43. data/app/views/pageflow/editor/entry_publications/check.json.jbuilder +1 -0
  44. data/app/views/pageflow/image_files/_image_file.json.jbuilder +1 -0
  45. data/app/views/pageflow/meta_tags/_entry.html.erb +1 -0
  46. data/config/initializers/features.rb +2 -0
  47. data/config/initializers/paperclip.rb +4 -0
  48. data/config/locales/de.yml +50 -0
  49. data/config/locales/en.yml +49 -0
  50. data/db/migrate/20231024062501_add_output_presences_to_image_files.rb +5 -0
  51. data/db/migrate/20231128124523_add_noindex_to_revisions.rb +5 -0
  52. data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/editor.js +266 -151
  53. data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/frontend.js +8 -2
  54. data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/react-client.js +1 -1
  55. data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/react-server.js +1 -1
  56. data/entry_types/paged/app/controllers/pageflow_paged/entries_controller.rb +1 -1
  57. data/entry_types/paged/lib/pageflow_paged/engine.rb +7 -11
  58. data/entry_types/scrolled/app/controllers/pageflow_scrolled/entries_controller.rb +9 -3
  59. data/entry_types/scrolled/app/helpers/pageflow_scrolled/editor/seed_html_helper.rb +6 -6
  60. data/entry_types/scrolled/app/helpers/pageflow_scrolled/packs_helper.rb +21 -37
  61. data/entry_types/scrolled/app/helpers/pageflow_scrolled/themes_helper.rb +1 -3
  62. data/entry_types/scrolled/app/views/pageflow_scrolled/editor/entries/_head.html.erb +1 -6
  63. data/entry_types/scrolled/app/views/pageflow_scrolled/entries/show.html.erb +17 -18
  64. data/entry_types/scrolled/app/views/pageflow_scrolled/entry_json_seed/_entry.json.jbuilder +4 -0
  65. data/entry_types/scrolled/config/locales/de.yml +47 -11
  66. data/entry_types/scrolled/config/locales/en.yml +42 -10
  67. data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/install_generator.rb +22 -89
  68. data/entry_types/scrolled/lib/pageflow_scrolled/additional_packs.rb +2 -1
  69. data/entry_types/scrolled/lib/pageflow_scrolled/engine.rb +8 -12
  70. data/entry_types/scrolled/lib/pageflow_scrolled/plugin.rb +6 -0
  71. data/entry_types/scrolled/lib/pageflow_scrolled/web_app_manifest.rb +1 -1
  72. data/entry_types/scrolled/lib/tasks/pageflow_scrolled/dummy.rake +1 -1
  73. data/entry_types/scrolled/package/config/webpack.js +26 -0
  74. data/entry_types/scrolled/package/contentElements-editor.js +36 -23
  75. data/entry_types/scrolled/package/contentElements-frontend.css +1 -1
  76. data/entry_types/scrolled/package/contentElements-frontend.js +250 -94
  77. data/entry_types/scrolled/package/editor.js +331 -147
  78. data/entry_types/scrolled/package/frontend/{EditableInlineText.module-fa9e3aff.js → EditableInlineText.module-6ee0e024.js} +463 -275
  79. data/entry_types/scrolled/package/frontend/{PhonePlatformContext-10a1d600.js → PhonePlatformContext-b28d991a.js} +1 -1
  80. data/entry_types/scrolled/package/frontend/{ToggleFullscreenCornerButton-727cce0d.js → ToggleFullscreenCornerButton-8242f213.js} +1 -1
  81. data/entry_types/scrolled/package/frontend/{Viewer-169e14ca.js → Viewer-32cd1ac1.js} +4 -4
  82. data/entry_types/scrolled/package/frontend/{Viewer-ee1aa590.js → Viewer-6e4d14ed.js} +4 -4
  83. data/entry_types/scrolled/package/frontend/{arrowRight-92a34ccc.js → arrowRight-e42e6011.js} +2 -2
  84. data/entry_types/scrolled/package/frontend/{components-4a09bfa3.js → components-24363f97.js} +7 -6
  85. data/entry_types/scrolled/package/frontend/{i18n-ddd92820.js → i18n-71c39823.js} +84 -46
  86. data/entry_types/scrolled/package/frontend/{index-02378634.js → index-fc4b13e6.js} +3 -3
  87. data/entry_types/scrolled/package/frontend/index.css +1 -1
  88. data/entry_types/scrolled/package/frontend/index.js +90 -66
  89. data/entry_types/scrolled/package/frontend/{useContentElementEditorState-63045393.js → useContentElementEditorState-245f1986.js} +1 -1
  90. data/entry_types/scrolled/package/package.json +4 -3
  91. data/entry_types/scrolled/package/testHelpers.js +4 -2
  92. data/entry_types/scrolled/package/widgets/defaultNavigation.css +2 -2
  93. data/entry_types/scrolled/package/widgets/defaultNavigation.js +39 -4
  94. data/entry_types/scrolled/package/widgets/iconInlineFileRights.css +1 -0
  95. data/entry_types/scrolled/package/widgets/iconInlineFileRights.js +49 -0
  96. data/entry_types/scrolled/package/widgets/textInlineFileRights.css +1 -0
  97. data/entry_types/scrolled/package/widgets/textInlineFileRights.js +37 -0
  98. data/lib/generators/pageflow/resque/templates/resque.rake +1 -1
  99. data/lib/generators/pageflow/resque/templates/resque.rb +1 -1
  100. data/lib/generators/pageflow/routes/routes_generator.rb +4 -3
  101. data/lib/pageflow/configuration.rb +8 -1
  102. data/lib/pageflow/engine.rb +15 -58
  103. data/lib/pageflow/page_type.rb +1 -1
  104. data/lib/pageflow/paperclip_processors/webp.rb +63 -0
  105. data/lib/pageflow/rails_version.rb +2 -2
  106. data/lib/pageflow/user_mixin.rb +1 -1
  107. data/lib/pageflow/version.rb +1 -1
  108. data/package/config/jest/index.js +3 -1
  109. data/package/editor.js +272 -154
  110. data/package/frontend.js +8 -2
  111. data/package/ui.js +1 -0
  112. data/spec/factories/entries.rb +17 -0
  113. metadata +78 -56
data/package/editor.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import Backbone from 'backbone';
2
2
  import _ from 'underscore';
3
- import { Object as Object$1, ConfigurationEditorTabView, TextInputView, UrlDisplayView, TabsView, ConfigurationEditorView, CollectionView, tooltipContainer, SelectInputView, inputView, TextAreaInputView, CheckBoxGroupInputView, i18nUtils, TableView, TextTableCellView, PresenceTableCellView, SortableCollectionView, attributeBinding, DeleteRowTableCellView, CheckBoxInputView, SliderInputView, IconTableCellView } from 'pageflow/ui';
3
+ import { Object as Object$1, TabsView, ConfigurationEditorView, CollectionView, tooltipContainer, SelectInputView, inputView, TextInputView, TextAreaInputView, CheckBoxGroupInputView, i18nUtils, ConfigurationEditorTabView, SeparatorView, UrlDisplayView, TableView, TextTableCellView, PresenceTableCellView, SortableCollectionView, attributeBinding, DeleteRowTableCellView, CheckBoxInputView, SliderInputView, IconTableCellView } from 'pageflow/ui';
4
4
  export * from 'pageflow/ui';
5
5
  import Cocktail from 'cocktail';
6
6
  import I18n$1 from 'i18n-js';
@@ -315,58 +315,6 @@ _.each(['each', 'map', 'reduce', 'first', 'find', 'contains', 'filter'], functio
315
315
  };
316
316
  });
317
317
 
318
- var state = window.pageflow || {};
319
-
320
- function template(data) {
321
- var __p = '';
322
- __p += '';
323
- return __p
324
- }
325
-
326
- var EditFileView = Marionette.ItemView.extend({
327
- template: template,
328
- className: 'edit_file',
329
- onRender: function onRender() {
330
- var fileType = this.model.fileType();
331
- var entry = this.options.entry || state.entry;
332
- var tab = new ConfigurationEditorTabView({
333
- model: this.model.configuration,
334
- attributeTranslationKeyPrefixes: ['pageflow.editor.files.attributes.' + fileType.collectionName, 'pageflow.editor.files.common_attributes', 'pageflow.editor.nested_files.' + fileType.collectionName, 'pageflow.editor.nested_files.common_attributes']
335
- });
336
-
337
- if (this.options.displayFileName) {
338
- tab.input('file_name', TextInputView, {
339
- model: this.model,
340
- disabled: true
341
- });
342
- }
343
-
344
- tab.input('rights', TextInputView, {
345
- model: this.model,
346
- placeholder: entry.get('default_file_rights')
347
- });
348
-
349
- _(this.fileTypeInputs()).each(function (options) {
350
- tab.input(options.name, options.inputView, options.inputViewOptions);
351
- });
352
-
353
- tab.input('original_url', UrlDisplayView, {
354
- model: this.model
355
- });
356
- this.appendSubview(tab);
357
- },
358
- fileTypeInputs: function fileTypeInputs() {
359
- var fileType = this.model.fileType();
360
- return _.chain(fileType.configurationEditorInputs).map(function (inputs) {
361
- if (_.isFunction(inputs)) {
362
- return inputs(this.model);
363
- } else {
364
- return inputs;
365
- }
366
- }, this).flatten().value();
367
- }
368
- });
369
-
370
318
  var app = new Marionette.Application();
371
319
 
372
320
  var dialogView = {
@@ -383,7 +331,7 @@ var dialogView = {
383
331
  }
384
332
  };
385
333
 
386
- function template$1(data) {
334
+ function template(data) {
387
335
  var __t, __p = '';
388
336
  __p += '<div class="box">\n <div class="content">\n <h1 class="dialog-header"></h1>\n </div>\n\n <div class="footer">\n <a href="" class="close">\n ' +
389
337
  ((__t = ( I18n.t('pageflow.editor.templates.file_settings_dialog.close') )) == null ? '' : __t) +
@@ -392,7 +340,7 @@ return __p
392
340
  }
393
341
 
394
342
  var FileSettingsDialogView = Marionette.ItemView.extend({
395
- template: template$1,
343
+ template: template,
396
344
  className: 'file_settings_dialog editor dialog',
397
345
  mixins: [dialogView],
398
346
  ui: {
@@ -423,11 +371,11 @@ FileSettingsDialogView.open = function (options) {
423
371
  app.dialogRegion.show(new FileSettingsDialogView(options));
424
372
  };
425
373
 
426
- function template$2(data) {
374
+ function template$1(data) {
427
375
  var __t, __p = '';
428
- __p += '<a class="edit" href="" title="' +
376
+ __p += '<span class="value"></span>\n<a class="edit" href="" title="' +
429
377
  ((__t = ( I18n.t('pageflow.editor.templates.file_meta_data_item_value_view.edit') )) == null ? '' : __t) +
430
- '">\n</a>\n<span class="value"></span>\n';
378
+ '">\n</a>\n\n';
431
379
  return __p
432
380
  }
433
381
 
@@ -450,7 +398,8 @@ return __p
450
398
  */
451
399
 
452
400
  var FileMetaDataItemValueView = Marionette.ItemView.extend({
453
- template: template$2,
401
+ template: template$1,
402
+ className: 'value_wrapper',
454
403
  ui: {
455
404
  value: '.value',
456
405
  editLink: '.edit'
@@ -492,7 +441,13 @@ var TextFileMetaDataItemValueView = FileMetaDataItemValueView.extend({
492
441
  model = this.model;
493
442
  }
494
443
 
495
- return model.get(this.options.name);
444
+ var value = model.get(this.options.name);
445
+
446
+ if (value && this.options.formatValue) {
447
+ return this.options.formatValue(value);
448
+ }
449
+
450
+ return value;
496
451
  }
497
452
  });
498
453
 
@@ -505,6 +460,7 @@ var FileType = Object$1.extend({
505
460
  this.paramKey = options.paramKey;
506
461
  this.i18nKey = options.i18nKey;
507
462
  this.nestedFileTypes = [];
463
+ this.settingsDialogTabs = options.settingsDialogTabs || [];
508
464
  this.confirmUploadTableColumns = options.confirmUploadTableColumns || [];
509
465
  this.configurationEditorInputs = [].concat(options.configurationEditorInputs || []);
510
466
  this.configurationUpdaters = options.configurationUpdaters || [];
@@ -512,17 +468,8 @@ var FileType = Object$1.extend({
512
468
  this.nestedFilesOrder = options.nestedFilesOrder;
513
469
  this.skipUploadConfirmation = options.skipUploadConfirmation || false;
514
470
  this.filters = options.filters || [];
515
- this.metaDataAttributes = [{
516
- name: 'rights',
517
- valueView: TextFileMetaDataItemValueView,
518
- valueViewOptions: {
519
- settingsDialogTabLink: 'general'
520
- }
521
- }].concat(options.metaDataAttributes || []);
522
- this.settingsDialogTabs = [{
523
- name: 'general',
524
- view: EditFileView
525
- }].concat(options.settingsDialogTabs || []);
471
+ this.noExtendedFileRights = options.noExtendedFileRights;
472
+ this.metaDataAttributes = options.metaDataAttributes || [];
526
473
 
527
474
  if (typeof options.matchUpload === 'function') {
528
475
  this.matchUpload = options.matchUpload;
@@ -562,6 +509,8 @@ var FileTypes = Object$1.extend({
562
509
  initialize: function initialize() {
563
510
  this.clientSideConfigs = [];
564
511
  this.clientSideConfigModifications = {};
512
+ this.commonSettingsDialogTabs = [];
513
+ this.commonMetaDataAttributes = [];
565
514
  },
566
515
  register: function register(name, config) {
567
516
  if (this._setup) {
@@ -591,10 +540,9 @@ var FileTypes = Object$1.extend({
591
540
  throw 'Missing client side config for file type "' + serverSideConfig.collectionName + '"';
592
541
  }
593
542
 
594
- _(_this.clientSideConfigModifications[serverSideConfig.collectionName]).each(function (modification) {
595
- this.lintModification(modification, serverSideConfig.collectionName);
596
- this.applyModification(clientSideConfig, modification);
597
- }, _this);
543
+ _this.applyCommonConfig(clientSideConfig);
544
+
545
+ _this.applyModifications(serverSideConfig, clientSideConfig);
598
546
 
599
547
  return _.extend({}, serverSideConfig, clientSideConfig);
600
548
  }).sortBy(function (config) {
@@ -613,6 +561,16 @@ var FileTypes = Object$1.extend({
613
561
  })));
614
562
  });
615
563
  },
564
+ applyCommonConfig: function applyCommonConfig(clientSideConfig) {
565
+ clientSideConfig.settingsDialogTabs = this.commonSettingsDialogTabs.concat(clientSideConfig.settingsDialogTabs || []);
566
+ clientSideConfig.metaDataAttributes = this.commonMetaDataAttributes.concat(clientSideConfig.metaDataAttributes || []);
567
+ },
568
+ applyModifications: function applyModifications(serverSideConfig, clientSideConfig) {
569
+ _(this.clientSideConfigModifications[serverSideConfig.collectionName]).each(function (modification) {
570
+ this.lintModification(modification, serverSideConfig.collectionName);
571
+ this.applyModification(clientSideConfig, modification);
572
+ }, this);
573
+ },
616
574
  lintModification: function lintModification(modification, collectionName) {
617
575
  var unmodifyableProperties = _.difference(_.keys(modification), this.modifyableProperties);
618
576
 
@@ -895,6 +853,8 @@ var WidgetTypes = Object$1.extend({
895
853
  }
896
854
  });
897
855
 
856
+ var state = window.pageflow || {};
857
+
898
858
  /**
899
859
  * Interface for engines providing editor extensions.
900
860
  * @alias editor
@@ -905,6 +865,7 @@ var EditorApi = Object$1.extend(
905
865
  {
906
866
  initialize: function initialize(options) {
907
867
  this.router = options && options.router;
868
+ this.entryType = {};
908
869
  this.sideBarRoutings = [];
909
870
  this.mainMenuItems = [];
910
871
  this.initializers = [];
@@ -974,6 +935,9 @@ var EditorApi = Object$1.extend(
974
935
  * Checks to see if the browser is supported.
975
936
  * @param {function} options.browserNotSupportedView
976
937
  * Backbone view that will be rendered if the browser is not supported.
938
+ * @param {boolean} [options.supportsExtendedFileRights]
939
+ * Offer additional inputs for files to specify source url, license and default
940
+ * display location.
977
941
  */
978
942
  registerEntryType: function registerEntryType(name, options) {
979
943
  this.entryType = _objectSpread2({
@@ -3364,7 +3328,7 @@ var Entry = Backbone.Model.extend({
3364
3328
  },
3365
3329
  parse: function parse(response, options) {
3366
3330
  if (response) {
3367
- this.set(_.pick(response, 'published', 'published_until', 'password_protected'));
3331
+ this.set(_.pick(response, 'published', 'published_until', 'password_protected', 'last_published_with_noindex'));
3368
3332
 
3369
3333
  this._setFiles(response, {
3370
3334
  add: false,
@@ -3894,7 +3858,7 @@ function _slicedToArray(arr, i) {
3894
3858
  return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
3895
3859
  }
3896
3860
 
3897
- function template$3(data) {
3861
+ function template$2(data) {
3898
3862
  var __t, __p = '';
3899
3863
  __p += '<a class="back">' +
3900
3864
  ((__t = ( I18n.t('pageflow.editor.templates.back_button_decorator.outline') )) == null ? '' : __t) +
@@ -3903,7 +3867,7 @@ return __p
3903
3867
  }
3904
3868
 
3905
3869
  var BackButtonDecoratorView = Marionette.Layout.extend({
3906
- template: template$3,
3870
+ template: template$2,
3907
3871
  className: 'back_button_decorator',
3908
3872
  events: {
3909
3873
  'click a.back': 'goBack'
@@ -3922,7 +3886,7 @@ var BackButtonDecoratorView = Marionette.Layout.extend({
3922
3886
  }
3923
3887
  });
3924
3888
 
3925
- function template$4(data) {
3889
+ function template$3(data) {
3926
3890
  var __t, __p = '';
3927
3891
  __p += '<input type="checkbox">\n<label class="file_name"></label>\n<span class="duration"></span>\n\n<div class="actions">\n <a class="remove" title="' +
3928
3892
  ((__t = ( I18n.t('pageflow.editor.templates.confirmable_file_item.remove') )) == null ? '' : __t) +
@@ -3932,7 +3896,7 @@ return __p
3932
3896
 
3933
3897
  var ConfirmableFileItemView = Marionette.ItemView.extend({
3934
3898
  tagName: 'li',
3935
- template: template$4,
3899
+ template: template$3,
3936
3900
  ui: {
3937
3901
  fileName: '.file_name',
3938
3902
  duration: '.duration',
@@ -3965,7 +3929,7 @@ var ConfirmableFileItemView = Marionette.ItemView.extend({
3965
3929
  }
3966
3930
  });
3967
3931
 
3968
- function template$5(data) {
3932
+ function template$4(data) {
3969
3933
  var __t, __p = '';
3970
3934
  __p += '<div class="blank_slate">\n <p>\n ' +
3971
3935
  ((__t = ( I18n.t('pageflow.editor.templates.confirm_encoding.all_released') )) == null ? '' : __t) +
@@ -3984,7 +3948,7 @@ return __p
3984
3948
  }
3985
3949
 
3986
3950
  var ConfirmEncodingView = Marionette.ItemView.extend({
3987
- template: template$5,
3951
+ template: template$4,
3988
3952
  className: 'confirm_encoding',
3989
3953
  ui: {
3990
3954
  blankSlate: '.blank_slate',
@@ -4138,7 +4102,7 @@ var failureIndicatingView = modelLifecycleTrackingView({
4138
4102
  }
4139
4103
  });
4140
4104
 
4141
- function template$6(data) {
4105
+ function template$5(data) {
4142
4106
  var __t, __p = '';
4143
4107
  __p += '<a class="close" href="#">' +
4144
4108
  ((__t = ( I18n.t('pageflow.editor.templates.edit_entry.close') )) == null ? '' : __t) +
@@ -4155,7 +4119,7 @@ return __p
4155
4119
  }
4156
4120
 
4157
4121
  var EditEntryView = Marionette.Layout.extend({
4158
- template: template$6,
4122
+ template: template$5,
4159
4123
  mixins: [failureIndicatingView, tooltipContainer],
4160
4124
  ui: {
4161
4125
  publishButton: 'a.publish',
@@ -4237,7 +4201,7 @@ var EditEntryView = Marionette.Layout.extend({
4237
4201
  }
4238
4202
  });
4239
4203
 
4240
- function template$7(data) {
4204
+ function template$6(data) {
4241
4205
  var __t, __p = '';
4242
4206
  __p += '<div class="widget_type">\n</div>\n<a class="settings" title="' +
4243
4207
  ((__t = ( I18n.t('pageflow.editor.templates.widget_item.settings') )) == null ? '' : __t) +
@@ -4246,7 +4210,7 @@ return __p
4246
4210
  }
4247
4211
 
4248
4212
  var WidgetItemView = Marionette.Layout.extend({
4249
- template: template$7,
4213
+ template: template$6,
4250
4214
  tagName: 'li',
4251
4215
  className: 'widget_item',
4252
4216
  regions: {
@@ -4283,14 +4247,14 @@ var WidgetItemView = Marionette.Layout.extend({
4283
4247
  }
4284
4248
  });
4285
4249
 
4286
- function template$8(data) {
4250
+ function template$7(data) {
4287
4251
  var __p = '';
4288
4252
  __p += '<ol class="widgets">\n</ol>\n';
4289
4253
  return __p
4290
4254
  }
4291
4255
 
4292
4256
  var EditWidgetsView = Marionette.Layout.extend({
4293
- template: template$8,
4257
+ template: template$7,
4294
4258
  ui: {
4295
4259
  widgets: '.widgets'
4296
4260
  },
@@ -4306,14 +4270,14 @@ var EditWidgetsView = Marionette.Layout.extend({
4306
4270
  }
4307
4271
  });
4308
4272
 
4309
- function template$9(data) {
4273
+ function template$8(data) {
4310
4274
  var __p = '';
4311
4275
  __p += '<div class="image"></div>\n<div class="label"></div>\n';
4312
4276
  return __p
4313
4277
  }
4314
4278
 
4315
4279
  var BackgroundPositioningPreviewView = Marionette.ItemView.extend({
4316
- template: template$9,
4280
+ template: template$8,
4317
4281
  className: 'preview',
4318
4282
  modelEvents: {
4319
4283
  change: 'update'
@@ -4344,14 +4308,14 @@ var BackgroundPositioningPreviewView = Marionette.ItemView.extend({
4344
4308
  }
4345
4309
  });
4346
4310
 
4347
- function template$a(data) {
4311
+ function template$9(data) {
4348
4312
  var __p = '';
4349
4313
  __p += '<div class="container">\n <div class="slider horizontal">\n </div>\n <div class="slider vertical">\n </div>\n <div class="percent horizontal">\n <input type="number" min="0" max="100">\n %\n </div>\n <div class="percent vertical">\n <input type="number" min="0" max="100">\n %\n </div>\n</div>\n';
4350
4314
  return __p
4351
4315
  }
4352
4316
 
4353
4317
  var BackgroundPositioningSlidersView = Marionette.ItemView.extend({
4354
- template: template$a,
4318
+ template: template$9,
4355
4319
  className: '',
4356
4320
  ui: {
4357
4321
  container: '.container',
@@ -4432,7 +4396,7 @@ var BackgroundPositioningSlidersView = Marionette.ItemView.extend({
4432
4396
  }
4433
4397
  });
4434
4398
 
4435
- function template$b(data) {
4399
+ function template$a(data) {
4436
4400
  var __t, __p = '';
4437
4401
  __p += '<div class="box">\n <div class="content">\n <h2 class="dialog-header">' +
4438
4402
  ((__t = ( I18n.t('pageflow.editor.templates.background_positioning.title') )) == null ? '' : __t) +
@@ -4449,7 +4413,7 @@ return __p
4449
4413
  }
4450
4414
 
4451
4415
  var BackgroundPositioningView = Marionette.ItemView.extend({
4452
- template: template$b,
4416
+ template: template$a,
4453
4417
  className: 'background_positioning editor dialog',
4454
4418
  mixins: [dialogView],
4455
4419
  ui: {
@@ -4503,14 +4467,14 @@ BackgroundPositioningView.open = function (options) {
4503
4467
  app.dialogRegion.show(new BackgroundPositioningView(options));
4504
4468
  };
4505
4469
 
4506
- function template$c(data) {
4470
+ function template$b(data) {
4507
4471
  var __p = '';
4508
4472
  __p += '<div class="label"></div>\n<a href="#"></a>\n';
4509
4473
  return __p
4510
4474
  }
4511
4475
 
4512
4476
  var DropDownButtonItemView = Marionette.ItemView.extend({
4513
- template: template$c,
4477
+ template: template$b,
4514
4478
  tagName: 'li',
4515
4479
  className: 'drop_down_button_item',
4516
4480
  ui: {
@@ -4524,6 +4488,10 @@ var DropDownButtonItemView = Marionette.ItemView.extend({
4524
4488
  }
4525
4489
 
4526
4490
  event.preventDefault();
4491
+
4492
+ if (this.model.get('kind') === 'checkBox' || this.model.get('kind') === 'radio') {
4493
+ event.stopPropagation();
4494
+ }
4527
4495
  }
4528
4496
  },
4529
4497
  modelEvents: {
@@ -4543,7 +4511,11 @@ var DropDownButtonItemView = Marionette.ItemView.extend({
4543
4511
  this.ui.label.text(this.model.get('label'));
4544
4512
  this.$el.toggleClass('is_selectable', !!this.model.selected);
4545
4513
  this.$el.toggleClass('is_disabled', !!this.model.get('disabled'));
4514
+ this.$el.toggleClass('is_hidden', !!this.model.get('hidden'));
4515
+ this.$el.toggleClass('has_check_box', this.model.get('kind') === 'checkBox');
4516
+ this.$el.toggleClass('has_radio', this.model.get('kind') === 'radio');
4546
4517
  this.$el.toggleClass('is_checked', !!this.model.get('checked'));
4518
+ this.$el.toggleClass('separated', !!this.model.get('separated'));
4547
4519
  this.$el.data('name', this.model.get('name'));
4548
4520
  }
4549
4521
  });
@@ -4560,7 +4532,7 @@ var DropDownButtonItemListView = function DropDownButtonItemListView(options) {
4560
4532
  });
4561
4533
  };
4562
4534
 
4563
- function template$d(data) {
4535
+ function template$c(data) {
4564
4536
  var __p = '';
4565
4537
  __p += '<button></button>\n\n<div class="drop_down_button_menu">\n</div>\n';
4566
4538
  return __p
@@ -4609,7 +4581,7 @@ return __p
4609
4581
  */
4610
4582
 
4611
4583
  var DropDownButtonView = Marionette.ItemView.extend({
4612
- template: template$d,
4584
+ template: template$c,
4613
4585
  className: 'drop_down_button',
4614
4586
  ui: {
4615
4587
  button: '> button',
@@ -4686,7 +4658,7 @@ var DropDownButtonView = Marionette.ItemView.extend({
4686
4658
  }
4687
4659
  });
4688
4660
 
4689
- function template$e(data) {
4661
+ function template$d(data) {
4690
4662
  var __p = '';
4691
4663
  __p += '<div class="pictogram"></div>\n';
4692
4664
  return __p
@@ -4694,7 +4666,7 @@ return __p
4694
4666
 
4695
4667
  var FileThumbnailView = Marionette.ItemView.extend({
4696
4668
  className: 'file_thumbnail',
4697
- template: template$e,
4669
+ template: template$d,
4698
4670
  modelEvents: {
4699
4671
  'change:state': 'update'
4700
4672
  },
@@ -4836,15 +4808,7 @@ var FileInputView = Marionette.ItemView.extend({
4836
4808
 
4837
4809
  if (file) {
4838
4810
  _.each(this.options.dropDownMenuItems, function (item) {
4839
- items.add(new FileInputView.CustomMenuItem({
4840
- name: item.name,
4841
- label: item.label
4842
- }, {
4843
- inputModel: _this.model,
4844
- propertyName: _this.options.propertyName,
4845
- file: file,
4846
- selected: item.selected
4847
- }));
4811
+ items.add(_this._createCustomMenuItem(file, item));
4848
4812
  });
4849
4813
 
4850
4814
  items.add(new FileInputView.EditFileSettingsMenuItem({
@@ -4857,6 +4821,31 @@ var FileInputView = Marionette.ItemView.extend({
4857
4821
 
4858
4822
  return items;
4859
4823
  },
4824
+ _createCustomMenuItem: function _createCustomMenuItem(file, item) {
4825
+ var _this2 = this;
4826
+
4827
+ var options = {
4828
+ inputModel: this.model,
4829
+ propertyName: this.options.propertyName,
4830
+ file: file
4831
+ };
4832
+
4833
+ if (typeof item === 'function') {
4834
+ return new item({}, options);
4835
+ } else {
4836
+ return new FileInputView.CustomMenuItem({
4837
+ name: item.name,
4838
+ label: item.label,
4839
+ checked: item.checked,
4840
+ items: item.items && new Backbone.Collection(item.items.map(function (item) {
4841
+ return _this2._createCustomMenuItem(file, item);
4842
+ }))
4843
+ }, _objectSpread2(_objectSpread2({}, options), {}, {
4844
+ selected: item.selected,
4845
+ items: item.items
4846
+ }));
4847
+ }
4848
+ },
4860
4849
  _listenToNestedTextTrackFiles: function _listenToNestedTextTrackFiles(file) {
4861
4850
  if (this.textTrackFiles) {
4862
4851
  this.stopListening(this.textTrackFiles);
@@ -4931,6 +4920,7 @@ FileInputView.DefaultTextTrackFileMenuItem = Backbone.Model.extend({
4931
4920
  this.update();
4932
4921
  },
4933
4922
  update: function update() {
4923
+ this.set('kind', 'radio');
4934
4924
  this.set('checked', this.options.textTrackFile == this.getDefaultTextTrackFile());
4935
4925
  this.set('name', this.options.textTrackFile ? null : 'no_default_text_track');
4936
4926
  this.set('label', this.options.textTrackFile ? this.options.textTrackFile.displayLabel() : this.options.textTrackFiles.length ? I18n$1.t('pageflow.editor.views.inputs.file_input.auto_default_text_track') : I18n$1.t('pageflow.editor.views.inputs.file_input.no_default_text_track'));
@@ -4947,14 +4937,14 @@ FileInputView.DefaultTextTrackFileMenuItem = Backbone.Model.extend({
4947
4937
  }
4948
4938
  });
4949
4939
 
4950
- function template$f(data) {
4940
+ function template$e(data) {
4951
4941
  var __p = '';
4952
4942
  __p += '<div class="spinner">\n <div class="rect1"></div>\n <div class="rect2"></div>\n <div class="rect3"></div>\n <div class="rect4"></div>\n <div class="rect5"></div>\n</div>\n';
4953
4943
  return __p
4954
4944
  }
4955
4945
 
4956
4946
  var LoadingView = Marionette.ItemView.extend({
4957
- template: template$f,
4947
+ template: template$e,
4958
4948
  className: 'loading',
4959
4949
  tagName: 'li'
4960
4950
  });
@@ -4977,7 +4967,7 @@ var selectableView = {
4977
4967
  }
4978
4968
  };
4979
4969
 
4980
- function template$g(data) {
4970
+ function template$f(data) {
4981
4971
  var __t, __p = '';
4982
4972
  __p += '<span class="theme_name"></span>\n<span class="button_or_checkmark">\n <p class="theme_in_use"></p>\n <a class="use_theme">' +
4983
4973
  ((__t = ( I18n.t('pageflow.editor.templates.theme.use') )) == null ? '' : __t) +
@@ -4987,7 +4977,7 @@ return __p
4987
4977
 
4988
4978
  var ThemeItemView = Marionette.ItemView.extend({
4989
4979
  tagName: 'li',
4990
- template: template$g,
4980
+ template: template$f,
4991
4981
  className: 'theme_item',
4992
4982
  mixins: [selectableView],
4993
4983
  selectionAttribute: 'theme',
@@ -5018,7 +5008,7 @@ var ThemeItemView = Marionette.ItemView.extend({
5018
5008
  }
5019
5009
  });
5020
5010
 
5021
- function template$h(data) {
5011
+ function template$g(data) {
5022
5012
  var __t, __p = '';
5023
5013
  __p += '<div class="box">\n <h1 class="dialog-header">\n ' +
5024
5014
  ((__t = ( I18n.t('pageflow.editor.templates.change_theme_dialog.header') )) == null ? '' : __t) +
@@ -5033,7 +5023,7 @@ return __p
5033
5023
  }
5034
5024
 
5035
5025
  var ChangeThemeDialogView = Marionette.ItemView.extend({
5036
- template: template$h,
5026
+ template: template$g,
5037
5027
  className: 'change_theme dialog editor',
5038
5028
  mixins: [dialogView],
5039
5029
  ui: {
@@ -5101,14 +5091,14 @@ ChangeThemeDialogView.changeTheme = function (options) {
5101
5091
  }).promise();
5102
5092
  };
5103
5093
 
5104
- function template$i(data) {
5094
+ function template$h(data) {
5105
5095
  var __p = '';
5106
5096
  __p += '\n';
5107
5097
  return __p
5108
5098
  }
5109
5099
 
5110
5100
  var StaticThumbnailView = Marionette.ItemView.extend({
5111
- template: template$i,
5101
+ template: template$h,
5112
5102
  className: 'static_thumbnail',
5113
5103
  modelEvents: {
5114
5104
  'change:configuration': 'update'
@@ -5172,7 +5162,7 @@ var ModelThumbnailView = Marionette.View.extend({
5172
5162
  }
5173
5163
  });
5174
5164
 
5175
- function template$j(data) {
5165
+ function template$i(data) {
5176
5166
  var __p = '';
5177
5167
  __p += '<label>\n <span class="name"></span>\n <span class="inline_help"></span>\n</label>\n<div class="title"></div>\n<button class="unset"></button>\n<button class="choose"></button>\n';
5178
5168
  return __p
@@ -5188,7 +5178,7 @@ var ReferenceInputView = Marionette.ItemView.extend(
5188
5178
  /** @lends ReferenceInputView.prototype */
5189
5179
  {
5190
5180
  mixins: [inputView],
5191
- template: template$j,
5181
+ template: template$i,
5192
5182
  className: 'reference_input',
5193
5183
  ui: {
5194
5184
  title: '.title',
@@ -5287,7 +5277,7 @@ var ThemeInputView = ReferenceInputView.extend({
5287
5277
  }
5288
5278
  });
5289
5279
 
5290
- function template$k(data) {
5280
+ function template$j(data) {
5291
5281
  var __t, __p = '';
5292
5282
  __p += '<a class="back">' +
5293
5283
  ((__t = ( I18n.t('pageflow.editor.templates.edit_meta_data.outline') )) == null ? '' : __t) +
@@ -5300,7 +5290,7 @@ return __p
5300
5290
  }
5301
5291
 
5302
5292
  var EditMetaDataView = Marionette.Layout.extend({
5303
- template: template$k,
5293
+ template: template$j,
5304
5294
  className: 'edit_meta_data',
5305
5295
  mixins: [failureIndicatingView],
5306
5296
  regions: {
@@ -5400,7 +5390,7 @@ var EditMetaDataView = Marionette.Layout.extend({
5400
5390
  }
5401
5391
  });
5402
5392
 
5403
- function template$l(data) {
5393
+ function template$k(data) {
5404
5394
  var __t, __p = '';
5405
5395
  __p += '<a class="back">' +
5406
5396
  ((__t = ( I18n.t('pageflow.editor.templates.edit_widget.back') )) == null ? '' : __t) +
@@ -5409,7 +5399,7 @@ return __p
5409
5399
  }
5410
5400
 
5411
5401
  var EditWidgetView = Marionette.ItemView.extend({
5412
- template: template$l,
5402
+ template: template$k,
5413
5403
  className: 'edit_widget',
5414
5404
  events: {
5415
5405
  'click a.back': function clickABack() {
@@ -5441,7 +5431,7 @@ var loadable = modelLifecycleTrackingView({
5441
5431
  }
5442
5432
  });
5443
5433
 
5444
- function template$m(data) {
5434
+ function template$l(data) {
5445
5435
  var __p = '';
5446
5436
  __p += '<span class="file_thumbnail"></span>\n\n<span class="file_name"></span>\n';
5447
5437
  return __p
@@ -5449,7 +5439,7 @@ return __p
5449
5439
 
5450
5440
  var ExplorerFileItemView = Marionette.ItemView.extend({
5451
5441
  tagName: 'li',
5452
- template: template$m,
5442
+ template: template$l,
5453
5443
  mixins: [loadable, selectableView],
5454
5444
  selectionAttribute: 'file',
5455
5445
  ui: {
@@ -5486,14 +5476,14 @@ var ExplorerFileItemView = Marionette.ItemView.extend({
5486
5476
  }
5487
5477
  });
5488
5478
 
5489
- function template$n(data) {
5479
+ function template$m(data) {
5490
5480
  var __p = '';
5491
5481
  __p += '<a href="">\n <span class="title"></span>\n</a>\n';
5492
5482
  return __p
5493
5483
  }
5494
5484
 
5495
5485
  var OtherEntryItemView = Marionette.ItemView.extend({
5496
- template: template$n,
5486
+ template: template$m,
5497
5487
  className: 'other_entry_item',
5498
5488
  tagName: 'li',
5499
5489
  mixins: [selectableView],
@@ -5508,7 +5498,7 @@ var OtherEntryItemView = Marionette.ItemView.extend({
5508
5498
  }
5509
5499
  });
5510
5500
 
5511
- function template$o(data) {
5501
+ function template$n(data) {
5512
5502
  var __t, __p = '';
5513
5503
  __p +=
5514
5504
  ((__t = ( I18n.t('pageflow.editor.templates.other_entries_blank_slate.none_available') )) == null ? '' : __t) +
@@ -5534,7 +5524,7 @@ var OtherEntriesCollectionView = Marionette.View.extend({
5534
5524
  selection: this.options.selection
5535
5525
  },
5536
5526
  blankSlateViewConstructor: Marionette.ItemView.extend({
5537
- template: template$o,
5527
+ template: template$n,
5538
5528
  tagName: 'li',
5539
5529
  className: 'blank_slate'
5540
5530
  }),
@@ -5545,7 +5535,7 @@ var OtherEntriesCollectionView = Marionette.View.extend({
5545
5535
  }
5546
5536
  });
5547
5537
 
5548
- function template$p(data) {
5538
+ function template$o(data) {
5549
5539
  var __t, __p = '';
5550
5540
  __p += '<div class="box">\n <h1 class="dialog-header">\n ' +
5551
5541
  ((__t = ( I18n.t('pageflow.editor.templates.files_explorer.reuse_files') )) == null ? '' : __t) +
@@ -5574,7 +5564,7 @@ return __p
5574
5564
  }
5575
5565
 
5576
5566
  var FilesExplorerView = Marionette.ItemView.extend({
5577
- template: template$p,
5567
+ template: template$o,
5578
5568
  className: 'files_explorer editor dialog',
5579
5569
  mixins: [dialogView],
5580
5570
  ui: {
@@ -5661,7 +5651,7 @@ FilesExplorerView.open = function (options) {
5661
5651
  app.dialogRegion.show(new FilesExplorerView(options));
5662
5652
  };
5663
5653
 
5664
- function template$q(data) {
5654
+ function template$p(data) {
5665
5655
  var __p = '';
5666
5656
  __p += '<th></th>\n<td></td>';
5667
5657
  return __p
@@ -5669,17 +5659,18 @@ return __p
5669
5659
 
5670
5660
  var FileMetaDataItemView = Marionette.ItemView.extend({
5671
5661
  tagName: 'tr',
5672
- template: template$q,
5662
+ template: template$p,
5673
5663
  ui: {
5674
5664
  label: 'th',
5675
5665
  value: 'td'
5676
5666
  },
5677
5667
  onRender: function onRender() {
5678
- this.subview(new this.options.valueView(_.extend({
5679
- el: this.ui.value,
5668
+ this.appendSubview(new this.options.valueView(_.extend({
5680
5669
  model: this.model,
5681
5670
  name: this.options.name
5682
- }, this.options.valueViewOptions || {})));
5671
+ }, this.options.valueViewOptions || {})), {
5672
+ to: this.ui.value
5673
+ });
5683
5674
  this.ui.label.text(this.labelText());
5684
5675
  },
5685
5676
  labelText: function labelText() {
@@ -5691,7 +5682,7 @@ var FileMetaDataItemView = Marionette.ItemView.extend({
5691
5682
  }
5692
5683
  });
5693
5684
 
5694
- function template$r(data) {
5685
+ function template$q(data) {
5695
5686
  var __p = '';
5696
5687
  __p += '<p class="percent"></p>\n<p class="description"></p>\n<p class="error_message"></p>';
5697
5688
  return __p
@@ -5700,7 +5691,7 @@ return __p
5700
5691
  var FileStageItemView = Marionette.ItemView.extend({
5701
5692
  tagName: 'li',
5702
5693
  className: 'file_stage_item',
5703
- template: template$r,
5694
+ template: template$q,
5704
5695
  ui: {
5705
5696
  description: '.description',
5706
5697
  percent: '.percent',
@@ -5741,7 +5732,7 @@ var FileStageItemView = Marionette.ItemView.extend({
5741
5732
  }
5742
5733
  });
5743
5734
 
5744
- function template$s(data) {
5735
+ function template$r(data) {
5745
5736
  var __t, __p = '';
5746
5737
  __p += '<span class="file_thumbnail"></span>\n\n<span class="file_name"></span>\n<a class="select">' +
5747
5738
  ((__t = ( I18n.t('pageflow.editor.templates.file_item.select') )) == null ? '' : __t) +
@@ -5765,7 +5756,7 @@ return __p
5765
5756
 
5766
5757
  var FileItemView = Marionette.ItemView.extend({
5767
5758
  tagName: 'li',
5768
- template: template$s,
5759
+ template: template$r,
5769
5760
  mixins: [loadable],
5770
5761
  ui: {
5771
5762
  fileName: '.file_name',
@@ -5880,7 +5871,7 @@ var FileItemView = Marionette.ItemView.extend({
5880
5871
  }
5881
5872
  });
5882
5873
 
5883
- function template$t(data) {
5874
+ function template$s(data) {
5884
5875
  var __t, __p = '';
5885
5876
  __p += '<div class="filtered_files-banner">\n <span class="filtered_files-banner_prefix">\n ' +
5886
5877
  ((__t = ( I18n.t('pageflow.editor.views.filtered_files_view.banner_prefix') )) == null ? '' : __t) +
@@ -5899,7 +5890,7 @@ return __p
5899
5890
  }
5900
5891
 
5901
5892
  var FilteredFilesView = Marionette.ItemView.extend({
5902
- template: template$t,
5893
+ template: template$s,
5903
5894
  className: 'filtered_files',
5904
5895
  ui: {
5905
5896
  banner: '.filtered_files-banner',
@@ -5963,7 +5954,7 @@ var FilteredFilesView = Marionette.ItemView.extend({
5963
5954
  }
5964
5955
  });
5965
5956
 
5966
- function template$u(data) {
5957
+ function template$t(data) {
5967
5958
  var __t, __p = '';
5968
5959
  __p += '<div class="box choose_importer_box">\n <h1 class="dialog-header">' +
5969
5960
  ((__t = ( I18n.t('pageflow.editor.views.files_view.importer.heading') )) == null ? '' : __t) +
@@ -5973,7 +5964,7 @@ __p += '<div class="box choose_importer_box">\n <h1 class="dialog-header">' +
5973
5964
  return __p
5974
5965
  }
5975
5966
 
5976
- function template$v(data) {
5967
+ function template$u(data) {
5977
5968
  var __t, __p = '';
5978
5969
  __p += '<button class=\'importer\' data-key=\'' +
5979
5970
  ((__t = ( data.fileImporter.key )) == null ? '' : __t) +
@@ -5988,7 +5979,7 @@ return __p
5988
5979
  }
5989
5980
 
5990
5981
  var ImporterSelectView = Marionette.ItemView.extend({
5991
- template: template$v,
5982
+ template: template$u,
5992
5983
  className: 'importer_select',
5993
5984
  tagName: 'li',
5994
5985
  events: {
@@ -6005,7 +5996,7 @@ var ImporterSelectView = Marionette.ItemView.extend({
6005
5996
  });
6006
5997
 
6007
5998
  var ChooseImporterView = Marionette.ItemView.extend({
6008
- template: template$u,
5999
+ template: template$t,
6009
6000
  className: 'choose_importer editor dialog',
6010
6001
  mixins: [dialogView],
6011
6002
  ui: {
@@ -6040,7 +6031,7 @@ ChooseImporterView.open = function (options) {
6040
6031
  app.dialogRegion.show(new ChooseImporterView(options).render());
6041
6032
  };
6042
6033
 
6043
- function template$w(data) {
6034
+ function template$v(data) {
6044
6035
  var __t, __p = '';
6045
6036
  __p += '<div class="box file_importer_box">\n <h1 class="dialog-header">' +
6046
6037
  ((__t = ( I18n.t('pageflow.editor.file_importers.'+data.importerKey+'.dialog_label') )) == null ? '' : __t) +
@@ -6054,7 +6045,7 @@ __p += '<div class="box file_importer_box">\n <h1 class="dialog-header">' +
6054
6045
  return __p
6055
6046
  }
6056
6047
 
6057
- function template$x(data) {
6048
+ function template$w(data) {
6058
6049
  var __t, __p = '';
6059
6050
  __p += '<div class="box">\n <h1 class="dialog-header">' +
6060
6051
  ((__t = ( I18n.t('pageflow.editor.templates.confirm_upload.header') )) == null ? '' : __t) +
@@ -6070,6 +6061,73 @@ __p += '<div class="box">\n <h1 class="dialog-header">' +
6070
6061
  return __p
6071
6062
  }
6072
6063
 
6064
+ function template$x(data) {
6065
+ var __p = '';
6066
+ __p += '';
6067
+ return __p
6068
+ }
6069
+
6070
+ var EditFileView = Marionette.ItemView.extend({
6071
+ template: template$x,
6072
+ className: 'edit_file',
6073
+ onRender: function onRender() {
6074
+ var fileType = this.model.fileType();
6075
+ var entry = this.options.entry || state.entry;
6076
+ var tab = new ConfigurationEditorTabView({
6077
+ model: this.model.configuration,
6078
+ attributeTranslationKeyPrefixes: ['pageflow.editor.files.attributes.' + fileType.collectionName, 'pageflow.editor.files.common_attributes', 'pageflow.editor.nested_files.' + fileType.collectionName, 'pageflow.editor.nested_files.common_attributes']
6079
+ });
6080
+
6081
+ if (this.options.displayFileName) {
6082
+ tab.input('file_name', TextInputView, {
6083
+ model: this.model,
6084
+ disabled: true
6085
+ });
6086
+ }
6087
+
6088
+ tab.input('rights', TextInputView, {
6089
+ model: this.model,
6090
+ placeholder: entry.get('default_file_rights')
6091
+ });
6092
+
6093
+ if (editor.entryType.supportsExtendedFileRights && !fileType.noExtendedFileRights) {
6094
+ tab.input('source_url', TextInputView);
6095
+ tab.input('license', SelectInputView, {
6096
+ includeBlank: true,
6097
+ blankTranslationKey: 'pageflow.editor.files.common_attributes.license.blank',
6098
+ values: state.config.availableFileLicenses,
6099
+ texts: state.config.availableFileLicenses.map(function (name) {
6100
+ return I18n$1.t("pageflow.file_licenses.".concat(name, ".name"));
6101
+ })
6102
+ });
6103
+ tab.input('rights_display', SelectInputView, {
6104
+ values: ['credits', 'inline']
6105
+ });
6106
+ }
6107
+
6108
+ tab.view(SeparatorView);
6109
+
6110
+ _(this.fileTypeInputs()).each(function (options) {
6111
+ tab.input(options.name, options.inputView, options.inputViewOptions);
6112
+ });
6113
+
6114
+ tab.input('original_url', UrlDisplayView, {
6115
+ model: this.model
6116
+ });
6117
+ this.appendSubview(tab);
6118
+ },
6119
+ fileTypeInputs: function fileTypeInputs() {
6120
+ var fileType = this.model.fileType();
6121
+ return _.chain(fileType.configurationEditorInputs).map(function (inputs) {
6122
+ if (_.isFunction(inputs)) {
6123
+ return inputs(this.model);
6124
+ } else {
6125
+ return inputs;
6126
+ }
6127
+ }, this).flatten().value();
6128
+ }
6129
+ });
6130
+
6073
6131
  var UploadableFilesView = Marionette.View.extend({
6074
6132
  className: 'uploadable_files',
6075
6133
  initialize: function initialize() {
@@ -6116,7 +6174,7 @@ var UploadableFilesView = Marionette.View.extend({
6116
6174
  });
6117
6175
 
6118
6176
  var ConfirmFileImportUploadView = Marionette.Layout.extend({
6119
- template: template$x,
6177
+ template: template$w,
6120
6178
  className: 'confirm_upload editor dialog',
6121
6179
  mixins: [dialogView],
6122
6180
  regions: {
@@ -6186,7 +6244,7 @@ ConfirmFileImportUploadView.open = function (options) {
6186
6244
  };
6187
6245
 
6188
6246
  var FilesImporterView = Marionette.ItemView.extend({
6189
- template: template$w,
6247
+ template: template$v,
6190
6248
  className: 'files_importer editor dialog',
6191
6249
  mixins: [dialogView],
6192
6250
  ui: {
@@ -6244,7 +6302,10 @@ var FilesImporterView = Marionette.ItemView.extend({
6244
6302
  content_type: file.type,
6245
6303
  file_size: -1,
6246
6304
  rights: file.rights,
6247
- source_url: file.url
6305
+ source_url: file.url,
6306
+ configuration: {
6307
+ source_url: file.source_url
6308
+ }
6248
6309
  }, {
6249
6310
  fileType: fileType
6250
6311
  });
@@ -6481,7 +6542,11 @@ __p += '<div class="files_pending notice">\n <p>' +
6481
6542
  ((__t = ( I18n.t('pageflow.editor.templates.publish_entry.date') )) == null ? '' : __t) +
6482
6543
  '\n <input type="text" name="publish_until">\n </label>\n\n <label>\n ' +
6483
6544
  ((__t = ( I18n.t('pageflow.editor.templates.publish_entry.time') )) == null ? '' : __t) +
6484
- '\n <input type="text" name="publish_until_time" value="00:00">\n </label>\n </div>\n\n <div class="check_box_input">\n <input id="publish_password_protected" type="checkbox" name="password_protected" value="1">\n <label for="publish_password_protected">\n <span class="name">\n ' +
6545
+ '\n <input type="text" name="publish_until_time" value="00:00">\n </label>\n </div>\n\n <div class="check_box_input">\n <input id="publish_with_noindex" type="checkbox" name="noindex" value="1">\n <label for="publish_with_noindex">\n <span class="name">\n ' +
6546
+ ((__t = ( I18n.t('pageflow.editor.templates.publish_entry.noindex') )) == null ? '' : __t) +
6547
+ '\n </span>\n <span class="inline_help">\n ' +
6548
+ ((__t = ( I18n.t('pageflow.editor.templates.publish_entry.noindex_help') )) == null ? '' : __t) +
6549
+ '\n </span>\n </label>\n </div>\n\n <div class="check_box_input">\n <input id="publish_password_protected" type="checkbox" name="password_protected" value="1">\n <label for="publish_password_protected">\n <span class="name">\n ' +
6485
6550
  ((__t = ( I18n.t('pageflow.editor.templates.publish_entry.password_protected') )) == null ? '' : __t) +
6486
6551
  '\n </span>\n <span class="inline_help">\n ' +
6487
6552
  ((__t = ( I18n.t('pageflow.editor.templates.publish_entry.password_help') )) == null ? '' : __t) +
@@ -6518,6 +6583,7 @@ var PublishEntryView = Marionette.ItemView.extend({
6518
6583
  passwordFields: '.password_fields',
6519
6584
  userNameField: 'input[name=user_name]',
6520
6585
  passwordField: 'input[name=password]',
6586
+ noindexCheckBox: 'input[name=noindex]',
6521
6587
  alreadyPublishedWithPassword: '.already_published_with_password',
6522
6588
  previouslyPublishedWithPassword: '.previously_published_with_password',
6523
6589
  alreadyPublishedWithoutPassword: '.already_published_without_password',
@@ -6580,6 +6646,7 @@ var PublishEntryView = Marionette.ItemView.extend({
6580
6646
  this.ui.passwordField.val(this.randomPassword());
6581
6647
  }
6582
6648
 
6649
+ this.ui.noindexCheckBox.prop('checked', this.model.get('last_published_with_noindex'));
6583
6650
  this.ui.alreadyPublishedWithPassword.toggle(this.model.get('published') && this.model.get('password_protected'));
6584
6651
  this.ui.previouslyPublishedWithPassword.toggle(!this.model.get('published') && this.model.get('password_protected'));
6585
6652
  this.ui.alreadyPublishedWithoutPassword.toggle(this.model.get('published') && !this.model.get('password_protected')); // Helpers
@@ -6620,7 +6687,8 @@ var PublishEntryView = Marionette.ItemView.extend({
6620
6687
  this.options.entryPublication.publish({
6621
6688
  published_until: publishedUntil,
6622
6689
  password_protected: this.ui.passwordProtectedCheckBox.is(':checked'),
6623
- password: this.ui.passwordField.val()
6690
+ password: this.ui.passwordField.val(),
6691
+ noindex: this.ui.noindexCheckBox.is(':checked')
6624
6692
  }).fail(function () {
6625
6693
  alert('Beim Veröffentlichen ist ein Fehler aufgetreten');
6626
6694
  }).always(function () {
@@ -7801,7 +7869,7 @@ var ListView = Marionette.ItemView.extend({
7801
7869
  });
7802
7870
 
7803
7871
  var ConfirmUploadView = Marionette.Layout.extend({
7804
- template: template$x,
7872
+ template: template$w,
7805
7873
  className: 'confirm_upload editor dialog',
7806
7874
  mixins: [dialogView],
7807
7875
  regions: {
@@ -8101,11 +8169,60 @@ app.addInitializer(function () {
8101
8169
  });
8102
8170
  });
8103
8171
 
8172
+ function _arrayWithoutHoles(arr) {
8173
+ if (Array.isArray(arr)) return _arrayLikeToArray(arr);
8174
+ }
8175
+
8176
+ function _iterableToArray(iter) {
8177
+ if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
8178
+ }
8179
+
8180
+ function _nonIterableSpread() {
8181
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
8182
+ }
8183
+
8184
+ function _toConsumableArray(arr) {
8185
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
8186
+ }
8187
+
8104
8188
  var OtherFile = UploadableFile.extend({
8105
8189
  thumbnailPictogram: 'other'
8106
8190
  });
8107
8191
 
8108
8192
  app.addInitializer(function (options) {
8193
+ editor.fileTypes.commonMetaDataAttributes = [{
8194
+ name: 'rights',
8195
+ valueView: TextFileMetaDataItemValueView,
8196
+ valueViewOptions: {
8197
+ settingsDialogTabLink: 'general'
8198
+ }
8199
+ }];
8200
+
8201
+ if (editor.entryType.supportsExtendedFileRights) {
8202
+ editor.fileTypes.commonMetaDataAttributes = [].concat(_toConsumableArray(editor.fileTypes.commonMetaDataAttributes), [{
8203
+ name: 'source_url',
8204
+ valueView: TextFileMetaDataItemValueView,
8205
+ valueViewOptions: {
8206
+ fromConfiguration: true,
8207
+ settingsDialogTabLink: 'general'
8208
+ }
8209
+ }, {
8210
+ name: 'license',
8211
+ valueView: TextFileMetaDataItemValueView,
8212
+ valueViewOptions: {
8213
+ fromConfiguration: true,
8214
+ formatValue: function formatValue(value) {
8215
+ return I18n$1.t("pageflow.file_licenses.".concat(value, ".name"));
8216
+ },
8217
+ settingsDialogTabLink: 'general'
8218
+ }
8219
+ }]);
8220
+ }
8221
+
8222
+ editor.fileTypes.commonSettingsDialogTabs = [{
8223
+ name: 'general',
8224
+ view: EditFileView
8225
+ }];
8109
8226
  var textTracksMetaDataAttribute = {
8110
8227
  name: 'text_tracks',
8111
8228
  valueView: TextTracksFileMetaDataItemValueView,
@@ -8165,6 +8282,7 @@ app.addInitializer(function (options) {
8165
8282
  return upload.name.match(/\.vtt$/) || upload.name.match(/\.srt$/);
8166
8283
  },
8167
8284
  skipUploadConfirmation: true,
8285
+ noExtendedFileRights: true,
8168
8286
  configurationEditorInputs: [{
8169
8287
  name: 'label',
8170
8288
  inputView: TextInputView,