pageflow 14.0.0.beta1 → 14.0.0.beta2

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 (48) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +17 -0
  3. data/app/assets/javascripts/pageflow/dist/react-client.js +667 -253
  4. data/app/assets/javascripts/pageflow/dist/react-server.js +663 -249
  5. data/app/assets/javascripts/pageflow/editor/collections/files_collection.js +2 -1
  6. data/app/assets/javascripts/pageflow/editor/sync.js +1 -1
  7. data/app/assets/javascripts/pageflow/page_types/mixins/default_page_content.js +8 -0
  8. data/app/assets/javascripts/pageflow/ready.js +2 -2
  9. data/app/assets/javascripts/pageflow/slideshow/dom_order_scroll_navigator.js +6 -4
  10. data/app/assets/javascripts/pageflow/slideshow.js +1 -1
  11. data/app/assets/stylesheets/pageflow/overview.scss +2 -2
  12. data/app/assets/stylesheets/pageflow/themes/default/overview/colors.scss +1 -1
  13. data/app/assets/stylesheets/pageflow/themes/default/overview/typography.scss +2 -1
  14. data/app/controllers/pageflow/editor/files_controller.rb +1 -0
  15. data/app/helpers/pageflow/common_entry_seed_helper.rb +1 -0
  16. data/app/helpers/pageflow/entries_helper.rb +1 -1
  17. data/app/helpers/pageflow/entry_json_seed_helper.rb +2 -1
  18. data/app/helpers/pageflow/meta_tags_helper.rb +6 -1
  19. data/app/helpers/pageflow/page_background_asset_helper.rb +6 -2
  20. data/app/helpers/pageflow/react_server_side_rendering_helper.rb +25 -0
  21. data/app/helpers/pageflow/structured_data_helper.rb +22 -0
  22. data/app/models/pageflow/draft_entry.rb +2 -0
  23. data/app/models/pageflow/published_entry.rb +2 -0
  24. data/app/models/pageflow/revision.rb +6 -1
  25. data/app/views/pageflow/audio_files/_audio_file.json.jbuilder +2 -0
  26. data/app/views/pageflow/chapters/_chapter.html.erb +5 -0
  27. data/app/views/pageflow/entries/_entry.html.erb +3 -2
  28. data/app/views/pageflow/entries/_multimedia_alert.html.erb +1 -1
  29. data/app/views/pageflow/entries/overview/_entry.html.erb +3 -3
  30. data/app/views/pageflow/files/_file.json.jbuilder +1 -0
  31. data/app/views/pageflow/image_files/_image_file.json.jbuilder +2 -0
  32. data/app/views/pageflow/page_background_asset/_element.html.erb +3 -3
  33. data/app/views/pageflow/pages/_page.html.erb +9 -3
  34. data/app/views/pageflow/react/_widget.html.erb +1 -4
  35. data/app/views/pageflow/react/page.html.erb +1 -4
  36. data/app/views/pageflow/structured_data/_entry.json.jbuilder +46 -0
  37. data/app/views/pageflow/video_files/_video_file.json.jbuilder +2 -1
  38. data/config/initializers/features.rb +3 -0
  39. data/config/locales/de.yml +2 -0
  40. data/config/locales/en.yml +2 -0
  41. data/lib/pageflow/built_in_file_type.rb +2 -0
  42. data/lib/pageflow/theme.rb +4 -0
  43. data/lib/pageflow/version.rb +1 -1
  44. data/spec/factories/audio_files.rb +7 -1
  45. data/spec/factories/entries.rb +3 -1
  46. data/spec/factories/image_files.rb +7 -1
  47. data/spec/factories/pages.rb +11 -0
  48. metadata +11 -4
@@ -27,7 +27,8 @@ pageflow.FilesCollection = Backbone.Collection.extend({
27
27
  findOrCreateBy: function(attributes) {
28
28
  return this.findWhere(attributes) ||
29
29
  this.create(attributes, {
30
- fileType: this.fileType
30
+ fileType: this.fileType,
31
+ queryParams: { no_upload: true }
31
32
  });
32
33
  },
33
34
 
@@ -3,7 +3,7 @@
3
3
 
4
4
  Backbone.sync = function(method, model, options) {
5
5
  if (model.paramRoot && !options.attrs) {
6
- options.attrs = {};
6
+ options.attrs = options.queryParams || {};
7
7
  options.attrs[model.paramRoot] = model.toJSON(options);
8
8
  }
9
9
 
@@ -0,0 +1,8 @@
1
+ pageflow.defaultPageContent = {
2
+ updateDefaultPageContent: function(pageElement, configuration) {
3
+ pageElement.find('.page_header-tagline').text(configuration.get('tagline') || '');
4
+ pageElement.find('.page_header-title').text(configuration.get('title') || '');
5
+ pageElement.find('.page_header-subtitle').text(configuration.get('subtitle') || '');
6
+ pageElement.find('.page_text p').html(configuration.get('text') || '');
7
+ }
8
+ };
@@ -8,13 +8,13 @@ pageflow.ready = new $.Deferred(function(readyDeferred) {
8
8
  var slideshow = $('[data-role=slideshow]');
9
9
  var body = $('body');
10
10
 
11
+ pageflow.Visited.setup();
12
+
11
13
  pagePreloaded.then(function() {
12
14
  readyDeferred.resolve();
13
15
  pageflow.events.trigger('ready');
14
16
  });
15
17
 
16
- pageflow.Visited.setup();
17
-
18
18
  slideshow.each(function() {
19
19
  pageflow.events.trigger('seed:loaded');
20
20
 
@@ -32,7 +32,8 @@ pageflow.DomOrderScrollNavigator = function(slideshow, entryData) {
32
32
  };
33
33
 
34
34
  this.getNextPage = function(currentPage, pages) {
35
- var nextPage = currentPage.next('.page');
35
+ var currentPageIndex = pages.index(currentPage);
36
+ var nextPage = currentPageIndex < pages.length - 1 ? $(pages.get(currentPageIndex + 1)) : $();
36
37
 
37
38
  if (sameStoryline(currentPage, nextPage)) {
38
39
  return nextPage;
@@ -48,7 +49,8 @@ pageflow.DomOrderScrollNavigator = function(slideshow, entryData) {
48
49
  };
49
50
 
50
51
  this.getPreviousPage = function(currentPage, pages) {
51
- var previousPage = currentPage.prev('.page');
52
+ var currentPageIndex = pages.index(currentPage);
53
+ var previousPage = currentPageIndex > 0 ? $(pages.get(currentPageIndex - 1)) : $();
52
54
 
53
55
  if (sameStoryline(currentPage, previousPage)) {
54
56
  return previousPage;
@@ -57,8 +59,8 @@ pageflow.DomOrderScrollNavigator = function(slideshow, entryData) {
57
59
  return getParentPage(currentPage, pages);
58
60
  };
59
61
 
60
- this.getTransitionDirection = function(previousPage, currentPage, options) {
61
- return (currentPage.index() > previousPage.index() ? 'forwards' : 'backwards');
62
+ this.getTransitionDirection = function(previousPage, currentPage, pages, options) {
63
+ return (pages.index(currentPage) > pages.index(previousPage) ? 'forwards' : 'backwards');
62
64
  };
63
65
 
64
66
  this.getDefaultTransition = function(previousPage, currentPage, pages) {
@@ -113,7 +113,7 @@ pageflow.Slideshow = function($el, configurations) {
113
113
  this.scrollNavigator.getDefaultTransition(previousPage, currentPage, pages);
114
114
 
115
115
  var direction =
116
- this.scrollNavigator.getTransitionDirection(previousPage, currentPage, options);
116
+ this.scrollNavigator.getTransitionDirection(previousPage, currentPage, pages, options);
117
117
 
118
118
  var outDuration = previousPage.page('deactivate', {
119
119
  direction: direction,
@@ -64,7 +64,7 @@
64
64
  @include transition(0.5s ease);
65
65
  @include transform(translate(200%,0));
66
66
 
67
- h2 {
67
+ .overview_headline {
68
68
  @include margin-start(10px);
69
69
  margin-bottom: 0;
70
70
  margin-top: 0;
@@ -231,4 +231,4 @@
231
231
  }
232
232
  }
233
233
  }
234
- }
234
+ }
@@ -54,7 +54,7 @@ $overview-pictogram-visibility: $standard-page-pictogram-visibility !default;
54
54
  color: $overview-text-color;
55
55
  }
56
56
 
57
- h2 {
57
+ .overview_headline {
58
58
  color: $overview-header-text-color;
59
59
  }
60
60
 
@@ -19,11 +19,12 @@ $overview-close-button-typography: () !default;
19
19
 
20
20
  @include standard-typography($overview-typography, ());
21
21
 
22
- h2 {
22
+ .overview_headline {
23
23
  @include typography(
24
24
  $overview-header-typography,
25
25
  (
26
26
  font-size: 3em,
27
+ font-weight: bold
27
28
  )
28
29
  );
29
30
  }
@@ -20,6 +20,7 @@ module Pageflow
20
20
  verify_edit_lock!(entry)
21
21
 
22
22
  @file = entry.create_file!(file_type.model, create_params)
23
+ @file.publish! if params[:no_upload]
23
24
 
24
25
  respond_with(:editor, @file)
25
26
  rescue ActiveRecord::RecordInvalid => e
@@ -10,6 +10,7 @@ module Pageflow
10
10
  {
11
11
  locale: entry.locale,
12
12
  theming: entry.theming.as_json(only: [:privacy_link_url]),
13
+ enabled_feature_names: entry.enabled_feature_names,
13
14
  page_types: PageTypesSeed.new(config).as_json,
14
15
  file_url_templates: FileUrlTemplatesSeed.new(config).as_json,
15
16
  file_model_types: config.file_types
@@ -53,7 +53,7 @@ module Pageflow
53
53
  end
54
54
 
55
55
  if links.any?
56
- content_tag(:h2, I18n.t('pageflow.helpers.entries.global_links'), :class => 'hidden') + safe_join(links, ''.html_safe)
56
+ content_tag(:span, I18n.t('pageflow.helpers.entries.global_links'), class: 'hidden') + safe_join(links, ''.html_safe)
57
57
  else
58
58
  ''
59
59
  end
@@ -14,7 +14,8 @@ module Pageflow
14
14
  def entry_attributes_seed(entry)
15
15
  {
16
16
  title: entry.title,
17
- slug: entry.slug
17
+ slug: entry.slug,
18
+ published_at: entry.published_at.try(:iso8601, 0)
18
19
  }
19
20
  end
20
21
 
@@ -1,7 +1,12 @@
1
1
  module Pageflow
2
+ # @api private
2
3
  module MetaTagsHelper
3
4
  def meta_tags_for_entry(entry)
4
- render partial: 'pageflow/meta_tags/entry', locals: {
5
+ render partial: 'pageflow/meta_tags/entry', locals: meta_tags_data_for_entry(entry)
6
+ end
7
+
8
+ def meta_tags_data_for_entry(entry)
9
+ {
5
10
  keywords: entry.keywords.presence || Pageflow.config.default_keywords_meta_tag,
6
11
  author: entry.author.presence || Pageflow.config.default_author_meta_tag,
7
12
  publisher: entry.publisher.presence || Pageflow.config.default_publisher_meta_tag
@@ -1,8 +1,12 @@
1
1
  module Pageflow
2
2
  module PageBackgroundAssetHelper
3
- def page_background_asset(configuration)
3
+ include EntryJsonSeedHelper
4
+ include ReactServerSideRenderingHelper
5
+
6
+ def page_background_asset(page, entry = @entry)
4
7
  render('pageflow/page_background_asset/element',
5
- configuration: configuration)
8
+ entry: entry,
9
+ page: page)
6
10
  end
7
11
  end
8
12
  end
@@ -0,0 +1,25 @@
1
+ module Pageflow
2
+ # @api private
3
+ module ReactServerSideRenderingHelper
4
+ def render_page_react_component(entry, page, component_name)
5
+ return '' if page.perma_id.blank?
6
+ extra_props_string = %("pageId": #{page.perma_id}, "pageType": "#{page.template}")
7
+ render_react_component_with_seed(entry, component_name, extra_props_string)
8
+ end
9
+
10
+ def render_widget_react_component(entry, widget_type_name, component_name)
11
+ render_react_component_with_seed(entry,
12
+ component_name,
13
+ %("widgetTypeName": "#{widget_type_name}"))
14
+ end
15
+
16
+ private
17
+
18
+ def render_react_component_with_seed(entry, component_name, extra_props_string)
19
+ seed = (@_pageflow_react_entry_seed ||= entry_json_seed(entry))
20
+ props_string = %({ "resolverSeed": #{seed}, #{extra_props_string} })
21
+
22
+ ::React::ServerRendering.render(component_name, props_string, true)
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,22 @@
1
+ module Pageflow
2
+ # @api private
3
+ module StructuredDataHelper
4
+ include RenderJsonHelper
5
+ include SocialShareHelper
6
+ include MetaTagsHelper
7
+
8
+ def structured_data_for_entry(entry)
9
+ return '' unless Pageflow.config_for(entry).features.enabled?('structured_data')
10
+
11
+ content_tag(:script, type: 'application/ld+json') do
12
+ render_json_partial('pageflow/structured_data/entry',
13
+ entry: entry,
14
+ meta_data: meta_tags_data_for_entry(entry))
15
+ end
16
+ end
17
+
18
+ def structured_data_normalize_protocol(url)
19
+ url.gsub(%r{^//}, 'https://')
20
+ end
21
+ end
22
+ end
@@ -10,6 +10,7 @@ module Pageflow
10
10
  :published_until, :published?,
11
11
  :password_digest,
12
12
  :to_model, :to_key, :persisted?, :to_json,
13
+ :first_published_at,
13
14
  :to => :entry)
14
15
 
15
16
  delegate(:title, :summary, :credits, :manual_start,
@@ -23,6 +24,7 @@ module Pageflow
23
24
  :locale,
24
25
  :author, :publisher, :keywords,
25
26
  :theme,
27
+ :published_at,
26
28
  :to => :draft)
27
29
 
28
30
  def initialize(entry, draft = nil)
@@ -11,6 +11,7 @@ module Pageflow
11
11
  :enabled_feature_names,
12
12
  :to_model, :to_key, :persisted?,
13
13
  :authenticate,
14
+ :first_published_at,
14
15
  :to => :entry)
15
16
 
16
17
  delegate(:widgets,
@@ -25,6 +26,7 @@ module Pageflow
25
26
  :author, :publisher, :keywords,
26
27
  :theme,
27
28
  :password_protected?,
29
+ :published_at,
28
30
  :to => :revision)
29
31
 
30
32
  def initialize(entry, revision = nil)
@@ -6,6 +6,11 @@ module Pageflow
6
6
  'pageflow_pages.position ASC'
7
7
  ].join(',')
8
8
 
9
+ CHAPTER_ORDER = [
10
+ 'pageflow_storylines.position ASC',
11
+ 'pageflow_chapters.position ASC'
12
+ ].join(',')
13
+
9
14
  include ThemeReferencer
10
15
 
11
16
  belongs_to :entry, touch: :edited_at
@@ -15,7 +20,7 @@ module Pageflow
15
20
  has_many :widgets, as: :subject, dependent: :destroy
16
21
 
17
22
  has_many :storylines, -> { order('pageflow_storylines.position ASC') }, dependent: :destroy
18
- has_many :chapters, -> { order('position ASC') }, through: :storylines
23
+ has_many :chapters, -> { order(CHAPTER_ORDER) }, through: :storylines
19
24
  has_many :pages, -> { reorder(PAGE_ORDER) }, through: :storylines
20
25
 
21
26
  has_many :file_usages, dependent: :destroy
@@ -0,0 +1,2 @@
1
+ json.call(audio_file, :duration_in_ms)
2
+ json.created_at audio_file.created_at.try(:iso8601, 0)
@@ -0,0 +1,5 @@
1
+ <section class="chapter">
2
+ <h2><%= chapter.title %></h2>
3
+
4
+ <%= render chapter.pages, entry: entry %>
5
+ </section>
@@ -2,16 +2,17 @@
2
2
  id: 'outer_wrapper',
3
3
  data: {theme: entry.theme.name},
4
4
  class: entry_css_class(entry)) do %>
5
+ <%= structured_data_for_entry(entry) %>
5
6
 
6
7
  <%= render 'pageflow/entries/skip_links' %>
7
8
 
8
9
  <h1 class="hidden"><%= entry.title %></h1>
9
10
 
10
- <img src="<%= image_path("pageflow/themes/#{entry.theme.directory_name}/logo_print.png") %>" class="print_image" alt="<%= t('pageflow.public.logo') %>">
11
+ <img src="<%= image_path(entry.theme.print_logo_path) %>" class="print_image" alt="<%= t('pageflow.public.logo') %>">
11
12
  <span class="print_only page_url"><%= request.original_url %></span>
12
13
 
13
14
  <%= content_tag :div, :id => 'content', :class => 'entry', :data => {:role => 'slideshow'} do %>
14
- <%= render entry.pages, entry: entry %>
15
+ <%= render entry.chapters, entry: entry %>
15
16
  <%= render 'pageflow/entries/indicators', :theme => entry.theme %>
16
17
  <% end %>
17
18
 
@@ -1,7 +1,7 @@
1
1
  <div class="multimedia_alert">
2
2
  <div class="multimedia_alert_box">
3
3
  <div class="alert_block">
4
- <h1 class="alert_headline"><%= t('pageflow.public.notice') %></h1>
4
+ <div class="alert_headline"><%= t('pageflow.public.notice') %></div>
5
5
  <div class="alert_icon speaker"></div>
6
6
  <p>
7
7
  <%= t('pageflow.public.sound_hint') %>
@@ -1,9 +1,9 @@
1
- <section class="overview">
1
+ <div class="overview">
2
2
  <div class="content">
3
3
  <a class="close button">
4
4
  <span class="label"><%= t('pageflow.public.close') %></span>
5
5
  </a>
6
- <h2><%= t('pageflow.public.overview') %></h2>
6
+ <div class="overview_headline"><%= t('pageflow.public.overview') %></div>
7
7
 
8
8
  <a class="overview_scroll_indicator left button"
9
9
  tabindex="1"
@@ -25,4 +25,4 @@
25
25
  <span class="hint"><%= t('pageflow.public.scroll_right') %></span>
26
26
  </a>
27
27
  </div>
28
- </section>
28
+ </div>
@@ -1,6 +1,7 @@
1
1
  json.call(file,
2
2
  :id,
3
3
  :basename,
4
+ :rights,
4
5
  :configuration,
5
6
  :parent_file_id,
6
7
  :parent_file_model_type)
@@ -0,0 +1,2 @@
1
+ json.call(image_file, :width, :height)
2
+ json.created_at image_file.created_at.try(:iso8601, 0)
@@ -1,3 +1,3 @@
1
- <div class="page_background_asset" style="height: 100%;">
2
- <%= background_image_div(configuration, 'background_image') %>
3
- </div>
1
+ <%= content_tag(:div, class: 'page_background_asset', style: 'height: 100%;') do -%>
2
+ <% concat render_page_react_component(entry, page, 'pageflow.react.ServerSidePageBackgroundAsset') %>
3
+ <% end %>
@@ -1,6 +1,12 @@
1
1
  <%= cache page do %>
2
- <%= content_tag :section, :id => page.perma_id, :class => page_css_class(page), :data => {:template => page.template, :id => page.id, :chapter_id => page.chapter_id} do %>
3
- <%= render_page_template(page, entry: entry) %>
4
- <a class="to_top" href="#content"><%= t('pageflow.public.goto_top') %></a>
2
+ <%= content_tag(:section,
3
+ id: page.perma_id,
4
+ class: page_css_class(page),
5
+ data: {
6
+ template: page.template,
7
+ id: page.id, chapter_id: page.chapter_id
8
+ }) do -%>
9
+ <% concat(render_page_template(page, entry: entry)) -%>
5
10
  <% end %>
11
+ <a class="to_top" href="#content"><%= t('pageflow.public.goto_top') %></a>
6
12
  <% end %>
@@ -1,8 +1,5 @@
1
1
  <%= content_tag(:div, '', data: {widget: name}) do -%>
2
2
  <% if server_rendering -%>
3
- <% concat React::ServerRendering.render(
4
- 'pageflow.react.ServerSideWidget',
5
- %Q'{ "resolverSeed": #{@_pageflow_react_entry_seed ||= entry_json_seed(entry)}, "widgetTypeName": "#{name}" }',
6
- true) %>
3
+ <% concat render_widget_react_component(entry, name, 'pageflow.react.ServerSideWidget') %>
7
4
  <% end %>
8
5
  <% end %>
@@ -1,6 +1,3 @@
1
1
  <% if page.template.present? %>
2
- <% concat React::ServerRendering.render(
3
- 'pageflow.react.ServerSidePage',
4
- %Q'{ "resolverSeed": #{@_pageflow_react_entry_seed ||= entry_json_seed(entry)}, "pageId": #{page.perma_id}, "pageType": "#{page.template}" }',
5
- true) %>
2
+ <% concat render_page_react_component(entry, page, 'pageflow.react.ServerSidePage') %>
6
3
  <% end %>
@@ -0,0 +1,46 @@
1
+ json.key_format!(camelize: :lower)
2
+
3
+ json.set! '@context', 'http://schema.org'
4
+ json.set! '@type', 'Article'
5
+
6
+ json.headline pretty_entry_title(entry)
7
+ json.description social_share_entry_description(entry)
8
+
9
+ json.keywords(meta_data[:keywords]) if meta_data[:keywords].present?
10
+
11
+ if meta_data[:author].present?
12
+ json.author do
13
+ json.set! '@type', 'Organization'
14
+ json.name meta_data[:author]
15
+ end
16
+ end
17
+
18
+ if meta_data[:publisher].present?
19
+ json.publisher do
20
+ json.set! '@type', 'Organization'
21
+ json.name meta_data[:publisher]
22
+ json.logo do
23
+ json.set! '@type', 'ImageObject'
24
+ json.url structured_data_normalize_protocol(asset_url(entry.theme.print_logo_path))
25
+ end
26
+ end
27
+ end
28
+
29
+ json.date_published entry.first_published_at.try(:iso8601, 0)
30
+ json.date_modified entry.published_at.try(:iso8601, 0)
31
+
32
+ json.main_entity_of_page do
33
+ json.set! '@type', 'WebPage'
34
+ json.set! '@id', structured_data_normalize_protocol(social_share_entry_url(entry))
35
+ end
36
+
37
+ thumbnail_file = entry.thumbnail_file
38
+
39
+ if thumbnail_file.present?
40
+ json.image do
41
+ json.set! '@type', 'ImageObject'
42
+ json.url structured_data_normalize_protocol(thumbnail_file.thumbnail_url(:thumbnail_large))
43
+ json.width 560
44
+ json.height 315
45
+ end
46
+ end
@@ -1,2 +1,3 @@
1
- json.call(video_file, :width, :height)
1
+ json.call(video_file, :width, :height, :duration_in_ms)
2
+ json.created_at video_file.created_at.try(:iso8601, 0)
2
3
  json.variants video_file.present_outputs + [:poster_medium, :poster_large, :poster_ultra, :print]
@@ -8,4 +8,7 @@ Pageflow.configure do |config|
8
8
  config.features.register('selectable_themes')
9
9
  config.features.register('editor_emulation_mode')
10
10
  config.features.register('waveform_player_controls')
11
+ config.features.register('structured_data')
12
+
13
+ config.features.enable_by_default('structured_data')
11
14
  end
@@ -1765,6 +1765,8 @@ de:
1765
1765
  feature_name: Erzählstränge
1766
1766
  main: Hauptstrang
1767
1767
  untitled: Unbenannter Erzählstrang
1768
+ structured_data:
1769
+ feature_name: Eingebettete strukturierte Daten
1768
1770
  title_loading_spinner:
1769
1771
  feature_name: "'Titel und Bild'-Lade-Ansicht"
1770
1772
  widget_type_name: Titel und Bild
@@ -1737,6 +1737,8 @@ en:
1737
1737
  feature_name: Storylines
1738
1738
  main: Main storyline
1739
1739
  untitled: Unnamed storyline
1740
+ structured_data:
1741
+ feature_name: Embedded structured data
1740
1742
  title_loading_spinner:
1741
1743
  feature_name: "'Title and image' loading view"
1742
1744
  widget_type_name: Title and Image
@@ -5,6 +5,7 @@ module Pageflow
5
5
  # available as built-ins.
6
6
  def self.image
7
7
  FileType.new(model: 'Pageflow::ImageFile',
8
+ partial: 'pageflow/image_files/image_file',
8
9
  editor_partial: 'pageflow/editor/image_files/image_file',
9
10
  collection_name: 'image_files',
10
11
  url_templates: ImageFileUrlTemplates.new,
@@ -27,6 +28,7 @@ module Pageflow
27
28
 
28
29
  def self.audio
29
30
  FileType.new(model: 'Pageflow::AudioFile',
31
+ partial: 'pageflow/audio_files/audio_file',
30
32
  editor_partial: 'pageflow/editor/audio_files/audio_file',
31
33
  collection_name: 'audio_files',
32
34
  url_templates: AudioFileUrlTemplates.new,
@@ -20,6 +20,10 @@ module Pageflow
20
20
  "pageflow/themes/#{name}/preview_thumbnail.png"
21
21
  end
22
22
 
23
+ def print_logo_path
24
+ "pageflow/themes/#{name}/logo_print.png"
25
+ end
26
+
23
27
  def has_home_button?
24
28
  !@options[:no_home_button]
25
29
  end
@@ -1,3 +1,3 @@
1
1
  module Pageflow
2
- VERSION = '14.0.0.beta1'.freeze
2
+ VERSION = '14.0.0.beta2'.freeze
3
3
  end
@@ -9,6 +9,7 @@ module Pageflow
9
9
 
10
10
  transient do
11
11
  used_in { nil }
12
+ with_configuration { nil }
12
13
  end
13
14
 
14
15
  before(:create) do |file, evaluator|
@@ -16,7 +17,12 @@ module Pageflow
16
17
  end
17
18
 
18
19
  after(:create) do |file, evaluator|
19
- create(:file_usage, :file => file, :revision => evaluator.used_in) if evaluator.used_in
20
+ if evaluator.used_in
21
+ create(:file_usage,
22
+ file: file,
23
+ revision: evaluator.used_in,
24
+ configuration: evaluator.with_configuration)
25
+ end
20
26
  end
21
27
 
22
28
  trait :uploading do
@@ -20,6 +20,7 @@ module Pageflow
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 |entry, evaluator|
@@ -43,7 +44,8 @@ module Pageflow
43
44
 
44
45
  after(:build) do |entry, evaluator|
45
46
  entry.features_configuration =
46
- entry.features_configuration.merge(evaluator.with_feature => true)
47
+ entry.features_configuration.merge(evaluator.with_feature => true,
48
+ evaluator.without_feature => false)
47
49
  end
48
50
 
49
51
  trait :published do
@@ -9,6 +9,7 @@ module Pageflow
9
9
 
10
10
  transient do
11
11
  used_in { nil }
12
+ with_configuration { nil }
12
13
  end
13
14
 
14
15
  before(:create) do |file, evaluator|
@@ -16,7 +17,12 @@ module Pageflow
16
17
  end
17
18
 
18
19
  after(:create) do |file, evaluator|
19
- create(:file_usage, :file => file, :revision => evaluator.used_in) if evaluator.used_in
20
+ if evaluator.used_in
21
+ create(:file_usage,
22
+ file: file,
23
+ revision: evaluator.used_in,
24
+ configuration: evaluator.with_configuration)
25
+ end
20
26
  end
21
27
 
22
28
  trait :uploading do
@@ -4,6 +4,17 @@ module Pageflow
4
4
  chapter
5
5
  template { 'background_image' }
6
6
  configuration { {} }
7
+
8
+ transient do
9
+ revision { nil }
10
+ end
11
+
12
+ before(:create) do |page, evaluator|
13
+ if evaluator.revision
14
+ storyline = create(:storyline, revision: evaluator.revision)
15
+ page.chapter = create(:chapter, storyline: storyline)
16
+ end
17
+ end
7
18
  end
8
19
 
9
20
  factory :valid_page, :class => Page do