pageflow 13.0.0.beta5 → 13.0.0.beta6

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 (65) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +17 -0
  3. data/README.md +4 -0
  4. data/admins/pageflow/accounts.rb +1 -0
  5. data/app/assets/javascripts/pageflow/base.js +1 -0
  6. data/app/assets/javascripts/pageflow/cookie_notice.js +7 -0
  7. data/app/assets/javascripts/pageflow/dist/react.js +505 -74
  8. data/app/assets/javascripts/pageflow/editor/models/configuration.js +5 -5
  9. data/app/assets/javascripts/pageflow/editor/templates/background_positioning_sliders.jst.ejs +8 -0
  10. data/app/assets/javascripts/pageflow/editor/views/background_positioning_sliders_view.js +37 -23
  11. data/app/assets/javascripts/pageflow/editor/views/background_positioning_view.js +2 -2
  12. data/app/assets/javascripts/pageflow/editor/views/configuration_editors/video.js +1 -1
  13. data/app/assets/javascripts/pageflow/editor/views/edit_widget_view.js +9 -0
  14. data/app/assets/javascripts/pageflow/editor/views/info_box_view.js +8 -0
  15. data/app/assets/javascripts/pageflow/editor/views/widget_types/cookie_notice_bar.js +15 -0
  16. data/app/assets/javascripts/pageflow/seed_entry_data.js +3 -3
  17. data/app/assets/javascripts/pageflow/slideshow/adjacent_preparer.js +11 -4
  18. data/app/assets/javascripts/pageflow/ui/views/configuration_editor_view.js +2 -2
  19. data/app/assets/javascripts/pageflow/visited.js +2 -0
  20. data/app/assets/stylesheets/pageflow/admin.scss +5 -22
  21. data/app/assets/stylesheets/pageflow/admin/active_admin_patches.scss +21 -0
  22. data/app/assets/stylesheets/pageflow/editor/background_positioning.scss +34 -10
  23. data/app/assets/stylesheets/pageflow/page_types/video.scss +1 -4
  24. data/app/assets/stylesheets/pageflow/page_types/video/mobile_poster.scss +15 -0
  25. data/app/assets/stylesheets/pageflow/themes/default/base.scss +1 -0
  26. data/app/assets/stylesheets/pageflow/themes/default/cookie_notice_bar.scss +57 -0
  27. data/app/assets/stylesheets/pageflow/themes/default/page.scss +1 -0
  28. data/app/assets/stylesheets/pageflow/themes/default/page/hyphenate.scss +24 -0
  29. data/app/assets/stylesheets/pageflow/themes/default/slideshow.scss +1 -0
  30. data/app/controllers/pageflow/admin/initial_passwords_controller.rb +8 -0
  31. data/app/helpers/pageflow/common_entry_seed_helper.rb +1 -0
  32. data/app/helpers/pageflow/entries_helper.rb +20 -2
  33. data/app/helpers/pageflow/entry_json_seed_helper.rb +1 -1
  34. data/app/helpers/pageflow/public_i18n_helper.rb +6 -1
  35. data/app/models/pageflow/published_entry.rb +14 -1
  36. data/app/views/admin/accounts/_form.html.erb +1 -0
  37. data/app/views/pageflow/admin/initial_passwords/edit.html.erb +16 -0
  38. data/app/views/pageflow/entry_json_seed/_entry.json.jbuilder +1 -1
  39. data/app/views/pageflow/user_mailer/invitation.html.erb +2 -2
  40. data/app/views/pageflow/user_mailer/invitation.text.erb +1 -1
  41. data/config/locales/de.yml +11 -1
  42. data/config/locales/en.yml +10 -0
  43. data/config/routes.rb +6 -0
  44. data/db/migrate/20180528144334_add_privacy_link_url_to_themings.rb +5 -0
  45. data/lib/pageflow/built_in_widget_type.rb +4 -0
  46. data/lib/pageflow/built_in_widget_types_plugin.rb +1 -0
  47. data/lib/pageflow/version.rb +1 -1
  48. data/spec/factories/accounts.rb +7 -7
  49. data/spec/factories/audio_files.rb +11 -11
  50. data/spec/factories/chapters.rb +2 -2
  51. data/spec/factories/entries.rb +7 -7
  52. data/spec/factories/file_usages.rb +2 -2
  53. data/spec/factories/folders.rb +1 -1
  54. data/spec/factories/hosted_files.rb +8 -8
  55. data/spec/factories/image_files.rb +10 -10
  56. data/spec/factories/invited_user.rb +2 -2
  57. data/spec/factories/memberships.rb +3 -3
  58. data/spec/factories/pages.rb +4 -4
  59. data/spec/factories/revisions.rb +8 -8
  60. data/spec/factories/text_track_files.rb +9 -9
  61. data/spec/factories/themings.rb +1 -1
  62. data/spec/factories/users.rb +7 -7
  63. data/spec/factories/video_files.rb +12 -12
  64. data/spec/factories/widgets.rb +2 -2
  65. metadata +16 -6
@@ -0,0 +1,15 @@
1
+ .videoPage .background_image {
2
+ display: none;
3
+ }
4
+
5
+ .has_phone_platform {
6
+ // Show mobile poster only on phone platform
7
+ .videoPage .background_image {
8
+ display: block;
9
+ }
10
+
11
+ // But not while playing inline (e.g. on Android)
12
+ &.has_no_native_video_player .videoPage.should_play .background_image {
13
+ display: none;
14
+ }
15
+ }
@@ -16,6 +16,7 @@
16
16
 
17
17
  @import "./built_in_page_types";
18
18
  @import "./anchors";
19
+ @import "./cookie_notice_bar";
19
20
  @import "./loading_spinner";
20
21
  @import "./logo";
21
22
  @import "./page";
@@ -0,0 +1,57 @@
1
+ /// Color of the cookie notice bar
2
+ $cookie-notice-bar-background-color: rgba(20, 20, 20, 0.9);
3
+
4
+ /// Color of the text inside cookie notice bar
5
+ $cookie-notice-bar-text-color: #fff;
6
+
7
+ $cookie-notice-bar-link-text-color: $main-color;
8
+
9
+ $cookie-notice-bar-typography: ();
10
+
11
+ $cookie-notice-bar-dismiss-button-background-color: $main-color-dark;
12
+
13
+ $cookie-notice-bar-dismiss-button-text-color: #fff;
14
+
15
+ .cookie_notice_bar {
16
+ position: absolute;
17
+ bottom: 0;
18
+ left: 0;
19
+ right: 0;
20
+ background-color: $cookie-notice-bar-background-color;
21
+ color: $cookie-notice-bar-text-color;
22
+ padding: 10px 20px;
23
+ z-index: 2;
24
+
25
+ @include standard-typography(
26
+ $cookie-notice-bar-typography
27
+ );
28
+
29
+ &-content {
30
+ @extend %pageflow_widget_margin_right_max !optional;
31
+ }
32
+
33
+ &-text {
34
+ margin-top: 10px;
35
+ margin-bottom: 10px;
36
+ display: inline-block;
37
+
38
+ a {
39
+ color: $cookie-notice-bar-link-text-color;
40
+ }
41
+ }
42
+
43
+ &-dismiss {
44
+ background-color: $cookie-notice-bar-dismiss-button-background-color;
45
+ color: $cookie-notice-bar-dismiss-button-text-color;
46
+ border-radius: 3px;
47
+ float: right;
48
+ margin-top: 5px;
49
+ padding: 5px 10px;
50
+ }
51
+ }
52
+
53
+ @include pageflow-widget-margin("cookie_notice_bar_visible", "bottom") {
54
+ @include desktop {
55
+ margin-bottom: 60px;
56
+ }
57
+ }
@@ -84,6 +84,7 @@ $page-content-text-font-size: 1.2em !default;
84
84
  $page-content-text-line-height: 1.5em !default;
85
85
 
86
86
  @import "./page/anchors";
87
+ @import "./page/hyphenate";
87
88
  @import "./page/paddings";
88
89
  @import "./page/scroller";
89
90
  @import "./page/shadow";
@@ -0,0 +1,24 @@
1
+ /// Let browser break words in header.
2
+ ///
3
+ /// - `"narrow"`: Only allow hyphenating words when header is narrow,
4
+ /// i.e. in portrait phone layout.
5
+ ///
6
+ /// - `"always"`: Always break words
7
+ ///
8
+ /// - `"never"`: Never break words
9
+ $page-hyphenate-header: "narrow" !default;
10
+
11
+ .page {
12
+ h2 {
13
+ @if $page-hyphenate-header == "always" {
14
+
15
+ hyphens: auto;
16
+
17
+ } @else if $page-hyphenate-header == "narrow" {
18
+
19
+ @include phone_portrait {
20
+ hyphens: auto;
21
+ }
22
+ }
23
+ }
24
+ }
@@ -1,3 +1,4 @@
1
1
  .slideshow {
2
2
  @extend %pageflow_widget_margin_top !optional;
3
+ @extend %pageflow_widget_margin_bottom !optional;
3
4
  }
@@ -0,0 +1,8 @@
1
+ module Pageflow
2
+ module Admin
3
+ class InitialPasswordsController < Devise::PasswordsController
4
+ layout 'active_admin_logged_out'
5
+ helper ActiveAdmin::ViewHelpers
6
+ end
7
+ end
8
+ end
@@ -10,6 +10,7 @@ module Pageflow
10
10
  {
11
11
  locale: entry.locale,
12
12
  slug: entry.slug,
13
+ theming: entry.theming.as_json(only: [:privacy_link_url]),
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
@@ -27,11 +27,29 @@ module Pageflow
27
27
 
28
28
  def entry_global_links(entry)
29
29
  links = []
30
+
30
31
  if entry.theming.imprint_link_label.present? && entry.theming.imprint_link_url.present?
31
- links << link_to(raw(entry.theming.imprint_link_label), entry.theming.imprint_link_url, :target => '_blank', :tabindex => 2, :class => 'legal')
32
+ links << link_to(raw(entry.theming.imprint_link_label),
33
+ entry.theming.imprint_link_url,
34
+ target: '_blank',
35
+ tabindex: 2,
36
+ class: 'legal')
32
37
  end
38
+
33
39
  if entry.theming.copyright_link_label.present? && entry.theming.copyright_link_url.present?
34
- links << link_to(raw(entry.theming.copyright_link_label), entry.theming.copyright_link_url, :target => '_blank', :tabindex => 2, :class => 'copy')
40
+ links << link_to(raw(entry.theming.copyright_link_label),
41
+ entry.theming.copyright_link_url,
42
+ target: '_blank',
43
+ tabindex: 2,
44
+ class: 'copy')
45
+ end
46
+
47
+ if entry.theming.privacy_link_url.present?
48
+ links << link_to(I18n.t('pageflow.public.privacy_notice'),
49
+ "#{entry.theming.privacy_link_url}?lang=#{entry.locale}",
50
+ target: '_blank',
51
+ tabindex: 2,
52
+ class: 'privacy')
35
53
  end
36
54
 
37
55
  if links.any?
@@ -11,7 +11,7 @@ module Pageflow
11
11
  entry: entry)).html_safe
12
12
  end
13
13
 
14
- def entry_theming_seed(entry)
14
+ def entry_theme_seed(entry)
15
15
  theme = entry.theme
16
16
  {
17
17
  change_to_parent_page_at_storyline_boundary: theme.change_to_parent_page_at_storyline_boundary?,
@@ -7,11 +7,16 @@ module Pageflow
7
7
  end
8
8
 
9
9
  def public_i18n_translations(entry)
10
+ merge_ignoring_nil = lambda do |_, fallback, value|
11
+ value.presence || fallback
12
+ end
13
+
10
14
  {
11
15
  pageflow: {
12
16
  public: I18n.t('pageflow.public', locale: I18n.default_locale)
13
17
  .dup
14
- .deep_merge(I18n.t('pageflow.public', locale: entry.locale))
18
+ .deep_merge(I18n.t('pageflow.public', locale: entry.locale),
19
+ &merge_ignoring_nil)
15
20
  }
16
21
  }
17
22
  end
@@ -59,8 +59,21 @@ module Pageflow
59
59
  PublishedEntry.new(scope.published.find(id))
60
60
  end
61
61
 
62
+ def cache_key
63
+ [
64
+ self.class.model_name.cache_key,
65
+ entry.cache_key,
66
+ revision.cache_key,
67
+ theming.cache_key
68
+ ].compact.join('-')
69
+ end
70
+
62
71
  def cache_version
63
- "#{entry.cache_version}-#{revision.cache_version}-#{theming.cache_version}"
72
+ [
73
+ entry.cache_version,
74
+ revision.cache_version,
75
+ theming.cache_version
76
+ ].compact.join('-').presence
64
77
  end
65
78
 
66
79
  def home_button
@@ -34,6 +34,7 @@
34
34
  <%= theming.input :imprint_link_url %>
35
35
  <%= theming.input :copyright_link_label %>
36
36
  <%= theming.input :copyright_link_url %>
37
+ <%= theming.input :privacy_link_url %>
37
38
 
38
39
  <% account_config.admin_form_inputs.find_all_for(:theming).each do |form_input| %>
39
40
  <%= form_input.build(theming) %>
@@ -0,0 +1,16 @@
1
+ <div id="login">
2
+ <h2><%= render_or_call_method_or_proc_on(self, active_admin_application.site_title) %> - <%= title t('pageflow.initial_password.title') %></h2>
3
+
4
+ <%= devise_error_messages! %>
5
+ <%= active_admin_form_for(resource, as: resource_name, url: admin_initial_password_path, html: { method: :put }) do |f|
6
+ f.inputs do
7
+ f.input :password
8
+ f.input :password_confirmation
9
+ f.input :reset_password_token, as: :hidden, input_html: { value: resource.reset_password_token }
10
+ end
11
+ f.actions do
12
+ f.action :submit, label: t('pageflow.initial_password.submit'), button_html: { value: t('pageflow.initial_password.submit') }
13
+ end
14
+ end
15
+ %>
16
+ </div>
@@ -1,6 +1,6 @@
1
1
  json.merge! common_entry_seed(entry)
2
2
 
3
- json.theming entry_theming_seed(entry)
3
+ json.theme entry_theme_seed(entry)
4
4
 
5
5
  json.storylines entry_storylines_seed(entry)
6
6
  json.chapters entry_chapters_seed(entry)
@@ -2,8 +2,8 @@
2
2
 
3
3
  <p><%= t('.instruction') %></p>
4
4
 
5
- <p><%= link_to main_app.edit_user_password_url(@user, reset_password_token: @password_token),
6
- main_app.edit_user_password_url(@user, reset_password_token: @password_token) %></p>
5
+ <p><%= link_to edit_admin_initial_password_url(reset_password_token: @password_token),
6
+ edit_admin_initial_password_url(reset_password_token: @password_token) %></p>
7
7
 
8
8
  <p><%= t('.ending') %></p>
9
9
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  <%= t('.instruction') %>
4
4
 
5
- <%= main_app.edit_user_password_url(@user, reset_password_token: @password_token) %>
5
+ <%= edit_admin_initial_password_url(reset_password_token: @password_token) %>
6
6
 
7
7
  <%= t('.ending') %>
8
8
 
@@ -268,6 +268,7 @@ de:
268
268
  home_url: Redirect URL
269
269
  imprint_link_label: Impressum-Link Text
270
270
  imprint_link_url: Impressum-Link URL
271
+ privacy_link_url: Datenschutz-Link URL
271
272
  theme_name: Theme
272
273
  pageflow/video_file:
273
274
  dimensions: Maße
@@ -983,6 +984,8 @@ de:
983
984
  captions: Ton-Ersatz-Textspur
984
985
  descriptions: Bild-Ersatz-Textspur
985
986
  subtitles: Übersetzungs-Textspur
987
+ cookie_notice_bar:
988
+ widget_type_name: Leiste am unteren Seitenrand
986
989
  default_theme:
987
990
  name: Standard
988
991
  delayed_text_fade_in:
@@ -1017,6 +1020,8 @@ de:
1017
1020
  header: Dies ist ein leerer Pageflow
1018
1021
  intro: Pageflows bestehen aus Kapiteln und Seiten. In der Seitenleiste rechts findest Du die Gliederung.
1019
1022
  outro: Hier siehst Du dann eine Vorschau deines Pageflows.
1023
+ cookie_notice_bar:
1024
+ widget_type_info_box_text: Der Hinweis wird beim ersten Öffnen von Beiträgen, die Cookies verwenden, am unteren Seitenrand angezeigt. Cookies werden gesetzt, falls ein Dienst zur Erhebnung von Nutzungsdaten (z.B. Google Analytics) verwendet wird oder wenn die Funktion 'Neue Seiten hervorheben' aktiv ist.
1020
1025
  entries:
1021
1026
  unsupported_browser_hint:
1022
1027
  message: Die Version Ihres Browsers wird vom Pageflow Editor nicht unterstützt. Bitte benutzen Sie einen aktuellen Browser.
@@ -1652,6 +1657,9 @@ de:
1652
1657
  image_rights: Bildrechte
1653
1658
  highdef_video_encoding:
1654
1659
  feature_name: Full HD und 4K Videos
1660
+ initial_password:
1661
+ submit: Speichern und anmelden
1662
+ title: Passwort festlegen
1655
1663
  invalid_transition: Der gewünschte Statuswechsel ist nicht erlaubt.
1656
1664
  languages:
1657
1665
  ar: Arabisch
@@ -1718,6 +1726,7 @@ de:
1718
1726
  ui:
1719
1727
  configuration_editor:
1720
1728
  tabs:
1729
+ cookie_notice_bar: Cookie Hinweis
1721
1730
  files: Dateien
1722
1731
  general: Allgemein
1723
1732
  links: Verweise
@@ -1763,7 +1772,7 @@ de:
1763
1772
 
1764
1773
  Alle Änderungen sind in der linken Frontend-Ansicht sichtbar, sobald das entsprechende Texteingabefeld im Editierbereich verlassen wurde.
1765
1774
  thumbnail_image_id: Das Thumbnail ersetzt das ansonsten automatisch generierte Vorschaubild in der Navigation und in der Übersicht.
1766
- transition: Wähle hier den Effekt, der beim Erreichen dieser der Seite benutzt werden soll.
1775
+ transition: Wähle hier den Effekt, der beim Erreichen dieser Seite benutzt werden soll.
1767
1776
  templates:
1768
1777
  inputs:
1769
1778
  file_input:
@@ -1825,6 +1834,7 @@ de:
1825
1834
  none: "(Kein)"
1826
1835
  roles:
1827
1836
  analytics: Zählpixel
1837
+ cookie_notice: Cookie Hinweis
1828
1838
  mobile_navigation: Mobile Navigation
1829
1839
  navigation: Navigationsleiste
1830
1840
  player_controls: Player Controls
@@ -268,6 +268,7 @@ en:
268
268
  home_url: Redirect URL
269
269
  imprint_link_label: Legal notice link label
270
270
  imprint_link_url: Legal notice link URL
271
+ privacy_link_url: Privacy link URL
271
272
  theme_name: Theme
272
273
  pageflow/video_file:
273
274
  dimensions: Dimensions
@@ -981,6 +982,8 @@ en:
981
982
  captions: Audio Replacement Text Track
982
983
  descriptions: Image Description Text Track
983
984
  subtitles: Translation Text Track
985
+ cookie_notice_bar:
986
+ widget_type_name: Bar at lower page margin
984
987
  default_theme:
985
988
  name: Default
986
989
  delayed_text_fade_in:
@@ -1017,6 +1020,8 @@ en:
1017
1020
  header: This is an empty Pageflow
1018
1021
  intro: Each Pageflow consist of chapters and pages. The editor panel to your right shows the outline of your story.
1019
1022
  outro: In this area, a live preview will be shown.
1023
+ cookie_notice_bar:
1024
+ widget_type_info_box_text: The notice is displayed when visiting an entry that uses Cookies. Cookies are set, if an analytics integration is active or the 'Emphasize new pages' feature has been enabled.
1020
1025
  entries:
1021
1026
  unsupported_browser_hint:
1022
1027
  message: The Pageflow editor does not support the browser version you are using. We recommend upgrading your browser to the most recent version.
@@ -1624,6 +1629,9 @@ en:
1624
1629
  image_rights: Credits
1625
1630
  highdef_video_encoding:
1626
1631
  feature_name: Full HD and 4K videos
1632
+ initial_password:
1633
+ submit: Save and sign in
1634
+ title: Set your password
1627
1635
  invalid_transition: Invalid transition
1628
1636
  languages:
1629
1637
  ar: Arabic
@@ -1690,6 +1698,7 @@ en:
1690
1698
  ui:
1691
1699
  configuration_editor:
1692
1700
  tabs:
1701
+ cookie_notice_bar: Cookie Notice
1693
1702
  files: Files
1694
1703
  general: General
1695
1704
  links: Links
@@ -1800,6 +1809,7 @@ en:
1800
1809
  none: "(none)"
1801
1810
  roles:
1802
1811
  analytics: Tracking
1812
+ cookie_notice: Cookie Notice
1803
1813
  mobile_navigation: Mobile navigation
1804
1814
  navigation: Navigation bar
1805
1815
  player_controls: Player Controls
data/config/routes.rb CHANGED
@@ -30,6 +30,12 @@ Pageflow::Engine.routes.draw do
30
30
  resource :edit_lock
31
31
  end
32
32
 
33
+ namespace :admin do
34
+ devise_scope :user do
35
+ resource :initial_password, only: [:edit, :update]
36
+ end
37
+ end
38
+
33
39
  namespace :editor do
34
40
  resources :entries, :only => :index, :shallow => true do
35
41
  get :seed, :on => :member
@@ -0,0 +1,5 @@
1
+ class AddPrivacyLinkUrlToThemings < ActiveRecord::Migration[5.2]
2
+ def change
3
+ add_column :pageflow_themings, :privacy_link_url, :string
4
+ end
5
+ end
@@ -31,5 +31,9 @@ module Pageflow
31
31
  def self.slim_player_controls
32
32
  new('slim_player_controls', ['player_controls'], 'pageflow/widgets/placeholder')
33
33
  end
34
+
35
+ def self.cookie_notice_bar
36
+ Pageflow::React.create_widget_type('cookie_notice_bar', 'cookie_notice')
37
+ end
34
38
  end
35
39
  end
@@ -5,6 +5,7 @@ module Pageflow
5
5
  config.widget_types.register(Pageflow::BuiltInWidgetType.mobile_navigation, default: true)
6
6
  config.widget_types.register(Pageflow::BuiltInWidgetType.slim_player_controls)
7
7
  config.widget_types.register(Pageflow::BuiltInWidgetType.classic_player_controls, default: true)
8
+ config.widget_types.register(Pageflow::BuiltInWidgetType.cookie_notice_bar)
8
9
  end
9
10
  end
10
11
  end
@@ -1,3 +1,3 @@
1
1
  module Pageflow
2
- VERSION = '13.0.0.beta5'.freeze
2
+ VERSION = '13.0.0.beta6'.freeze
3
3
  end