pageflow 0.9.2 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of pageflow might be problematic. Click here for more details.
- checksums.yaml +5 -13
- data/CHANGELOG.md +193 -11
- data/README.md +9 -1
- data/Rakefile +5 -0
- data/admins/pageflow/accounts.rb +2 -1
- data/admins/pageflow/entry.rb +21 -1
- data/admins/pageflow/revisions.rb +1 -1
- data/app/assets/fonts/pageflow/entypo-license.txt +358 -0
- data/app/assets/fonts/pageflow/fontawesome-license.txt +1 -0
- data/app/assets/fonts/pageflow/sourcesanspro-bold-webfont.eot +0 -0
- data/app/assets/fonts/pageflow/sourcesanspro-bold-webfont.svg +1236 -194
- data/app/assets/fonts/pageflow/sourcesanspro-bold-webfont.ttf +0 -0
- data/app/assets/fonts/pageflow/sourcesanspro-bold-webfont.woff +0 -0
- data/app/assets/fonts/pageflow/sourcesanspro-license.txt +93 -0
- data/app/assets/fonts/pageflow/sourcesanspro-light-webfont.eot +0 -0
- data/app/assets/fonts/pageflow/sourcesanspro-light-webfont.svg +1153 -839
- data/app/assets/fonts/pageflow/sourcesanspro-light-webfont.ttf +0 -0
- data/app/assets/fonts/pageflow/sourcesanspro-light-webfont.woff +0 -0
- data/app/assets/fonts/pageflow/sourcesanspro-regular-webfont.eot +0 -0
- data/app/assets/fonts/pageflow/sourcesanspro-regular-webfont.svg +1252 -199
- data/app/assets/fonts/pageflow/sourcesanspro-regular-webfont.ttf +0 -0
- data/app/assets/fonts/pageflow/sourcesanspro-regular-webfont.woff +0 -0
- data/app/assets/javascripts/pageflow/base.js +2 -0
- data/app/assets/javascripts/pageflow/browser/agent.js +25 -0
- data/app/assets/javascripts/pageflow/browser/css_animations.js +18 -0
- data/app/assets/javascripts/pageflow/browser/mobile_platform.js +1 -4
- data/app/assets/javascripts/pageflow/browser/video.js +8 -1
- data/app/assets/javascripts/pageflow/chapter_filter.js +6 -16
- data/app/assets/javascripts/pageflow/editor/api.js +6 -2
- data/app/assets/javascripts/pageflow/editor/api/page_type.js +12 -0
- data/app/assets/javascripts/pageflow/editor/base.js +4 -0
- data/app/assets/javascripts/pageflow/editor/collections/chapter_pages_collection.js +4 -1
- data/app/assets/javascripts/pageflow/editor/collections/chapters_collection.js +1 -5
- data/app/assets/javascripts/pageflow/editor/collections/mixins/add_and_return_model.js +11 -0
- data/app/assets/javascripts/pageflow/editor/collections/mixins/ordered_collection.js +6 -4
- data/app/assets/javascripts/pageflow/editor/collections/ordered_page_links_collection.js +9 -0
- data/app/assets/javascripts/pageflow/editor/collections/page_links_collection.js +78 -0
- data/app/assets/javascripts/pageflow/editor/collections/pages_collection.js +9 -3
- data/app/assets/javascripts/pageflow/editor/collections/storyline_chapters_collection.js +35 -0
- data/app/assets/javascripts/pageflow/editor/collections/storylines_collection.js +33 -0
- data/app/assets/javascripts/pageflow/editor/controllers/sidebar_controller.js +19 -2
- data/app/assets/javascripts/pageflow/editor/initializers/edit_lock.js +1 -1
- data/app/assets/javascripts/pageflow/editor/initializers/setup_collections.js +11 -0
- data/app/assets/javascripts/pageflow/editor/initializers/setup_common_seed.js +3 -0
- data/app/assets/javascripts/pageflow/editor/initializers/stylesheet_reloading.js +11 -0
- data/app/assets/javascripts/pageflow/editor/models/chapter.js +14 -7
- data/app/assets/javascripts/pageflow/editor/models/chapter_scaffold.js +13 -0
- data/app/assets/javascripts/pageflow/editor/models/edit_lock_container.js +4 -4
- data/app/assets/javascripts/pageflow/editor/models/entry.js +33 -4
- data/app/assets/javascripts/pageflow/editor/models/mixins/persited_promise.js +18 -0
- data/app/assets/javascripts/pageflow/editor/models/page.js +4 -0
- data/app/assets/javascripts/pageflow/editor/models/page_link.js +37 -0
- data/app/assets/javascripts/pageflow/editor/models/page_link_file_selection_handler.js +14 -0
- data/app/assets/javascripts/pageflow/editor/models/preview_entry_data.js +15 -0
- data/app/assets/javascripts/pageflow/editor/models/scaffold.js +26 -0
- data/app/assets/javascripts/pageflow/editor/models/storyline.js +99 -0
- data/app/assets/javascripts/pageflow/editor/models/storyline_configuration.js +15 -0
- data/app/assets/javascripts/pageflow/editor/models/storyline_ordering.js +117 -0
- data/app/assets/javascripts/pageflow/editor/models/storyline_scaffold.js +23 -0
- data/app/assets/javascripts/pageflow/editor/models/storyline_transitive_child_pages.js +33 -0
- data/app/assets/javascripts/pageflow/editor/routers/sidebar_router.js +3 -0
- data/app/assets/javascripts/pageflow/editor/templates/edit_entry.jst.ejs +1 -6
- data/app/assets/javascripts/pageflow/editor/templates/edit_page_link.jst.ejs +3 -0
- data/app/assets/javascripts/pageflow/editor/templates/edit_storyline.jst.ejs +12 -0
- data/app/assets/javascripts/pageflow/editor/templates/page_link_item.jst.ejs +1 -0
- data/app/assets/javascripts/pageflow/editor/templates/page_selection.jst.ejs +2 -2
- data/app/assets/javascripts/pageflow/editor/templates/storyline_outline.jst.ejs +4 -0
- data/app/assets/javascripts/pageflow/editor/templates/storyline_picker.jst.ejs +7 -0
- data/app/assets/javascripts/pageflow/editor/utils/reload_stylesheet.js +9 -0
- data/app/assets/javascripts/pageflow/editor/views/configuration_editors/groups/options.js +2 -2
- data/app/assets/javascripts/pageflow/editor/views/configuration_editors/groups/page_link.js +10 -0
- data/app/assets/javascripts/pageflow/editor/views/edit_chapter_view.js +0 -4
- data/app/assets/javascripts/pageflow/editor/views/edit_entry_view.js +9 -15
- data/app/assets/javascripts/pageflow/editor/views/edit_meta_data_view.js +14 -6
- data/app/assets/javascripts/pageflow/editor/views/edit_page_link_view.js +47 -0
- data/app/assets/javascripts/pageflow/editor/views/edit_storyline_view.js +97 -0
- data/app/assets/javascripts/pageflow/editor/views/editor_view.js +6 -3
- data/app/assets/javascripts/pageflow/editor/views/entry_preview_view.js +13 -7
- data/app/assets/javascripts/pageflow/editor/views/file_item_view.js +1 -1
- data/app/assets/javascripts/pageflow/editor/views/inputs/page_link_input_view.js +3 -1
- data/app/assets/javascripts/pageflow/editor/views/locked_view.js +3 -3
- data/app/assets/javascripts/pageflow/editor/views/mixins/loadable.js +1 -1
- data/app/assets/javascripts/pageflow/editor/views/page_item_view.js +2 -0
- data/app/assets/javascripts/pageflow/editor/views/page_link_configuration_editor_view.js +7 -0
- data/app/assets/javascripts/pageflow/editor/views/page_link_item_view.js +8 -1
- data/app/assets/javascripts/pageflow/editor/views/page_preview_view.js +1 -1
- data/app/assets/javascripts/pageflow/editor/views/page_selection_view.js +13 -12
- data/app/assets/javascripts/pageflow/editor/views/storyline_outline_view.js +33 -0
- data/app/assets/javascripts/pageflow/editor/views/storyline_picker_view.js +114 -0
- data/app/assets/javascripts/pageflow/entry_data.js +38 -4
- data/app/assets/javascripts/pageflow/highlighted_page.js +5 -5
- data/app/assets/javascripts/pageflow/history.js +1 -1
- data/app/assets/javascripts/pageflow/native_scrolling.js +14 -0
- data/app/assets/javascripts/pageflow/page_transitions.js +3 -1
- data/app/assets/javascripts/pageflow/page_type.js +2 -0
- data/app/assets/javascripts/pageflow/ready.js +4 -1
- data/app/assets/javascripts/pageflow/seed_entry_data.js +28 -1
- data/app/assets/javascripts/pageflow/slideshow.js +11 -8
- data/app/assets/javascripts/pageflow/slideshow/dom_order_scroll_navigator.js +93 -8
- data/app/assets/javascripts/pageflow/slideshow/hidden_text_indicator_widget.js +5 -3
- data/app/assets/javascripts/pageflow/slideshow/lazy_page_widget.js +4 -0
- data/app/assets/javascripts/pageflow/slideshow/page_widget.js +15 -6
- data/app/assets/javascripts/pageflow/ui/templates/tooltip.jst.ejs +2 -0
- data/app/assets/javascripts/pageflow/ui/views/inputs/text_area_input_view.js +17 -4
- data/app/assets/javascripts/pageflow/ui/views/mixins/tooltip_container.js +42 -0
- data/app/assets/javascripts/pageflow/ui/views/tooltip_view.js +49 -0
- data/app/assets/javascripts/pageflow/video_player.js +2 -2
- data/app/assets/javascripts/pageflow/video_player/{filter_for_silk.js → filter_sources.js} +2 -2
- data/app/assets/javascripts/pageflow/widgets/navigation.js +17 -14
- data/app/assets/javascripts/pageflow/widgets/navigation_mobile.js +7 -2
- data/app/assets/javascripts/pageflow/widgets/overview.js +9 -6
- data/app/assets/javascripts/pageflow/widgets/page_navigation_list.js +51 -13
- data/app/assets/javascripts/pageflow/widgets/page_navigation_list_animation.js +48 -0
- data/app/assets/javascripts/pageflow/widgets/parent_page_button.js +9 -2
- data/app/assets/stylesheets/pageflow/admin.css.scss +2 -15
- data/app/assets/stylesheets/pageflow/admin/features.scss +5 -0
- data/app/assets/stylesheets/pageflow/admin/forms.scss +18 -0
- data/app/assets/stylesheets/pageflow/animations.css.scss +1 -0
- data/app/assets/stylesheets/pageflow/animations/navigation_bar.scss +89 -0
- data/app/assets/stylesheets/pageflow/delayed_text_fade_in.css.scss +1 -1
- data/app/assets/stylesheets/pageflow/editor/base.css.scss +5 -0
- data/app/assets/stylesheets/pageflow/editor/menu.css.scss +1 -0
- data/app/assets/stylesheets/pageflow/editor/outline.css.scss +5 -0
- data/app/assets/stylesheets/pageflow/editor/page_links.css.scss +9 -1
- data/app/assets/stylesheets/pageflow/editor/page_selection.css.scss +7 -1
- data/app/assets/stylesheets/pageflow/editor/storyline_picker.css.scss +32 -0
- data/app/assets/stylesheets/pageflow/extendables.scss +26 -0
- data/app/assets/stylesheets/pageflow/mixins/pageflow.css.scss +25 -0
- data/app/assets/stylesheets/pageflow/navigation_bar.css.scss +64 -4
- data/app/assets/stylesheets/pageflow/navigation_mobile.css.scss +56 -0
- data/app/assets/stylesheets/pageflow/page_transitions.css.scss +4 -1
- data/app/assets/stylesheets/pageflow/page_transitions/scroll_over_from_left.scss +12 -0
- data/app/assets/stylesheets/pageflow/page_transitions/scroll_over_from_right.scss +12 -0
- data/app/assets/stylesheets/pageflow/page_types/video.css.scss +5 -1
- data/app/assets/stylesheets/pageflow/themes/default/page.css.scss +180 -42
- data/app/assets/stylesheets/pageflow/ui.css.scss +1 -0
- data/app/assets/stylesheets/pageflow/ui/forms.css.scss +11 -2
- data/app/assets/stylesheets/pageflow/ui/input/extended_select_input.css.scss +1 -0
- data/app/assets/stylesheets/pageflow/ui/tabs_view.css.scss +0 -3
- data/app/assets/stylesheets/pageflow/ui/tooltip.scss +57 -0
- data/app/controllers/concerns/pageflow/entry_password_protection.rb +13 -0
- data/app/controllers/pageflow/chapters_controller.rb +24 -9
- data/app/controllers/pageflow/edit_locks_controller.rb +2 -2
- data/app/controllers/pageflow/editor/files_controller.rb +0 -2
- data/app/controllers/pageflow/editor/widgets_controller.rb +1 -1
- data/app/controllers/pageflow/entries_controller.rb +5 -9
- data/app/controllers/pageflow/files_controller.rb +3 -0
- data/app/controllers/pageflow/storylines_controller.rb +69 -0
- data/app/helpers/pageflow/admin/features_helper.rb +17 -6
- data/app/helpers/pageflow/admin/widgets_helper.rb +18 -0
- data/app/helpers/pageflow/audio_files_helper.rb +2 -2
- data/app/helpers/pageflow/common_entry_seed_helper.rb +52 -0
- data/app/helpers/pageflow/entries_helper.rb +7 -1
- data/app/helpers/pageflow/entry_json_seed_helper.rb +27 -10
- data/app/helpers/pageflow/meta_tags_helper.rb +11 -0
- data/app/helpers/pageflow/page_types_helper.rb +9 -5
- data/app/helpers/pageflow/pages_helper.rb +9 -96
- data/app/helpers/pageflow/public_i18n_helper.rb +13 -0
- data/app/helpers/pageflow/social_share_helper.rb +1 -1
- data/app/helpers/pageflow/video_files_helper.rb +133 -0
- data/app/helpers/pageflow/widgets_helper.rb +3 -9
- data/app/models/concerns/pageflow/feature_target.rb +21 -3
- data/app/models/concerns/pageflow/hosted_file.rb +4 -0
- data/app/models/pageflow/account.rb +2 -2
- data/app/models/pageflow/chapter.rb +4 -4
- data/app/models/pageflow/chapter_scaffold.rb +33 -0
- data/app/models/pageflow/cname_theming_request_scope.rb +7 -1
- data/app/models/pageflow/draft_entry.rb +13 -2
- data/app/models/pageflow/edit_lock.rb +2 -2
- data/app/models/pageflow/entry.rb +3 -2
- data/app/models/pageflow/image_file.rb +6 -0
- data/app/models/pageflow/published_entry.rb +13 -2
- data/app/models/pageflow/revision.rb +17 -4
- data/app/models/pageflow/storyline.rb +23 -0
- data/app/models/pageflow/storyline_scaffold.rb +27 -0
- data/app/models/pageflow/theming.rb +4 -0
- data/app/models/pageflow/widget.rb +16 -12
- data/app/views/admin/accounts/_form.html.erb +8 -12
- data/app/views/admin/accounts/_widgets_inline_help.html.erb +5 -0
- data/app/views/layouts/pageflow/application.html.erb +4 -1
- data/app/views/pageflow/admin/widgets/_fields.html.erb +9 -0
- data/app/views/pageflow/config/_editor_seeds.json.jbuilder +1 -1
- data/app/views/pageflow/editor/entries/_entry.json.jbuilder +2 -2
- data/app/views/pageflow/editor/entries/_other_entry.json.jbuilder +1 -0
- data/app/views/pageflow/editor/entries/index.json.jbuilder +1 -1
- data/app/views/pageflow/editor/entries/seed.json.erb +4 -1
- data/app/views/pageflow/editor/files/_file.json.jbuilder +4 -0
- data/app/views/pageflow/editor/themings/_theming.json.jbuilder +1 -0
- data/app/views/pageflow/entries/_entry.html.erb +2 -2
- data/app/views/pageflow/entries/_ie8_hint.html.erb +2 -2
- data/app/views/pageflow/entries/_indicators.html.erb +3 -3
- data/app/views/pageflow/entries/_mobile_navigation.html.erb +6 -5
- data/app/views/pageflow/entries/_multimedia_alert.html.erb +6 -6
- data/app/views/pageflow/entries/_non_js_hint.html.erb +1 -1
- data/app/views/pageflow/entries/_skip_links.html.erb +3 -3
- data/app/views/pageflow/entries/edit.html.erb +4 -2
- data/app/views/pageflow/entries/navigation/_bar_bottom.html.erb +6 -5
- data/app/views/pageflow/entries/navigation/_bar_top.html.erb +13 -13
- data/app/views/pageflow/entries/navigation/_home_button.html.erb +2 -2
- data/app/views/pageflow/entries/navigation/_page.html.erb +1 -1
- data/app/views/pageflow/entries/overview/_chapter.html.erb +1 -1
- data/app/views/pageflow/entries/overview/_entry.html.erb +7 -6
- data/app/views/pageflow/entries/share_menu/_facebook_link.html.erb +1 -1
- data/app/views/pageflow/entries/share_menu/_google_link.html.erb +1 -1
- data/app/views/pageflow/entries/share_menu/_twitter_link.html.erb +1 -1
- data/app/views/pageflow/entries/show.html.erb +4 -1
- data/app/views/pageflow/file_types/_thumbnails.css.erb +2 -0
- data/app/views/pageflow/meta_tags/_entry.html.erb +4 -0
- data/app/views/pageflow/pages/_page.html.erb +2 -2
- data/app/views/pageflow/pages/templates/_audio.html.erb +2 -2
- data/app/views/pageflow/pages/templates/_audio_loop.html.erb +1 -1
- data/app/views/pageflow/pages/templates/_background_video.html.erb +8 -3
- data/app/views/pageflow/pages/templates/_video.html.erb +9 -4
- data/app/views/pageflow/public_i18n/_javascript_tag.html.erb +5 -0
- data/app/views/pageflow/social_share/_entry_meta_tags.html.erb +1 -1
- data/app/views/pageflow/video_files/_script_tag.html.erb +3 -0
- data/app/views/pageflow/video_files/_video_file.html.erb +4 -1
- data/app/views/pageflow/video_files/_video_tag.html.erb +7 -0
- data/config/initializers/admin_resource_tabs.rb +1 -0
- data/config/initializers/features.rb +3 -1
- data/config/initializers/paperclip.rb +5 -0
- data/config/locales/de.yml +205 -601
- data/config/locales/en.yml +198 -405
- data/config/routes.rb +10 -2
- data/db/migrate/20150826125417_create_pageflow_storylines.rb +12 -0
- data/db/migrate/20150826125744_add_storyline_id_to_chapters.rb +6 -0
- data/db/migrate/20150826125745_insert_main_storylines.rb +28 -0
- data/db/migrate/20150830105831_remove_revision_id_from_chapters.rb +5 -0
- data/db/migrate/20150830110006_remove_entry_id_from_chapters.rb +5 -0
- data/db/migrate/20160201130118_add_additional_cnames_to_themings.rb +5 -0
- data/db/migrate/20160216130336_add_meta_fields_to_revision.rb +7 -0
- data/lib/generators/pageflow/initializer/templates/pageflow.rb +7 -0
- data/lib/pageflow/ability_mixin.rb +7 -1
- data/lib/pageflow/configuration.rb +27 -2
- data/lib/pageflow/engine.rb +4 -1
- data/lib/pageflow/features.rb +24 -0
- data/lib/pageflow/global_config_api.rb +1 -0
- data/lib/pageflow/seeds.rb +4 -2
- data/lib/pageflow/theme.rb +4 -0
- data/lib/pageflow/version.rb +1 -1
- data/spec/factories/chapters.rb +6 -3
- data/spec/factories/storylines.rb +13 -0
- metadata +1021 -928
- data/app/assets/fonts/pageflow/FranklinGothic-Demi-webfont.eot +0 -0
- data/app/assets/fonts/pageflow/FranklinGothic-Demi-webfont.svg +0 -768
- data/app/assets/fonts/pageflow/FranklinGothic-Demi-webfont.ttf +0 -0
- data/app/assets/fonts/pageflow/FranklinGothic-Demi-webfont.woff +0 -0
- data/app/assets/fonts/pageflow/FranklinGothic-Hvy-webfont.eot +0 -0
- data/app/assets/fonts/pageflow/FranklinGothic-Hvy-webfont.svg +0 -968
- data/app/assets/fonts/pageflow/FranklinGothic-Hvy-webfont.ttf +0 -0
- data/app/assets/fonts/pageflow/FranklinGothic-Hvy-webfont.woff +0 -0
- data/app/assets/fonts/pageflow/thesansboldplain.eot +0 -0
- data/app/assets/fonts/pageflow/thesansboldplain.svg +0 -228
- data/app/assets/fonts/pageflow/thesansboldplain.ttf +0 -0
- data/app/assets/fonts/pageflow/thesansboldplain.woff +0 -0
- data/app/assets/fonts/pageflow/thesanssemiboldplain.eot +0 -0
- data/app/assets/fonts/pageflow/thesanssemiboldplain.svg +0 -228
- data/app/assets/fonts/pageflow/thesanssemiboldplain.ttf +0 -0
- data/app/assets/fonts/pageflow/thesanssemiboldplain.woff +0 -0
- data/app/assets/javascripts/pageflow/browser/hashchange_support.js +0 -8
- data/app/assets/javascripts/pageflow/widgets/button.js +0 -22
- data/app/views/layouts/pageflow/_meta_tags.html.erb +0 -5
- data/app/views/pageflow/pages/_video_tag.html.erb +0 -13
@@ -0,0 +1,57 @@
|
|
1
|
+
.tooltip {
|
2
|
+
$background-color: rgba(0, 0, 0, 0.7);
|
3
|
+
|
4
|
+
position: absolute;
|
5
|
+
z-index: 10001;
|
6
|
+
top: 40px;
|
7
|
+
left: 400px;
|
8
|
+
max-width: 70%;
|
9
|
+
padding: 10px 15px;
|
10
|
+
color: #fff;
|
11
|
+
font-size: 13px;
|
12
|
+
font-weight: bold;
|
13
|
+
text-decoration: none;
|
14
|
+
pointer-events: none;
|
15
|
+
border-radius: 5px;
|
16
|
+
background-color: $background-color;
|
17
|
+
|
18
|
+
opacity: 0;
|
19
|
+
@include transition(opacity 0.15s ease);
|
20
|
+
|
21
|
+
&.visible {
|
22
|
+
opacity: 1;
|
23
|
+
}
|
24
|
+
|
25
|
+
&:after {
|
26
|
+
content: '';
|
27
|
+
border-top: solid 10px transparent;
|
28
|
+
border-right: solid 10px $background-color;
|
29
|
+
border-bottom: solid 10px transparent;
|
30
|
+
border-left: solid 10px transparent;
|
31
|
+
position: absolute;
|
32
|
+
top: 7px;
|
33
|
+
left: -20px;
|
34
|
+
}
|
35
|
+
|
36
|
+
&.align_bottom_right,
|
37
|
+
&.align_bottom_left {
|
38
|
+
&:after {
|
39
|
+
border-top: solid 10px transparent;
|
40
|
+
border-right: solid 10px transparent;
|
41
|
+
border-bottom: solid 10px $background-color;
|
42
|
+
border-left: solid 10px transparent;
|
43
|
+
|
44
|
+
top: -20px;
|
45
|
+
left: 7px;
|
46
|
+
}
|
47
|
+
}
|
48
|
+
|
49
|
+
&.align_bottom_right {
|
50
|
+
@include transform(translateX(-100%));
|
51
|
+
|
52
|
+
&:after {
|
53
|
+
right: 7px;
|
54
|
+
left: auto;
|
55
|
+
}
|
56
|
+
}
|
57
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module Pageflow
|
2
|
+
module EntryPasswordProtection
|
3
|
+
private
|
4
|
+
|
5
|
+
def check_entry_password_protection(entry)
|
6
|
+
return unless entry.password_protected?
|
7
|
+
|
8
|
+
authenticate_or_request_with_http_basic('Pageflow') do |_, password|
|
9
|
+
entry.authenticate(password)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -5,16 +5,27 @@ module Pageflow
|
|
5
5
|
before_filter :authenticate_user!
|
6
6
|
|
7
7
|
def create
|
8
|
-
|
9
|
-
chapter =
|
8
|
+
storyline = Storyline.find(params[:storyline_id])
|
9
|
+
chapter = storyline.chapters.build(chapter_params)
|
10
10
|
|
11
11
|
authorize!(:create, chapter)
|
12
|
-
verify_edit_lock!(
|
12
|
+
verify_edit_lock!(storyline.entry)
|
13
13
|
chapter.save
|
14
14
|
|
15
15
|
respond_with(chapter)
|
16
16
|
end
|
17
17
|
|
18
|
+
def scaffold
|
19
|
+
storyline = Storyline.find(params[:storyline_id])
|
20
|
+
chapter_scaffold = ChapterScaffold.build(storyline, chapter_params, depth: 'page')
|
21
|
+
|
22
|
+
authorize!(:create, chapter_scaffold.to_model)
|
23
|
+
verify_edit_lock!(storyline.entry)
|
24
|
+
chapter_scaffold.save!
|
25
|
+
|
26
|
+
respond_with(chapter_scaffold)
|
27
|
+
end
|
28
|
+
|
18
29
|
def update
|
19
30
|
chapter = Chapter.find(params[:id])
|
20
31
|
|
@@ -26,12 +37,13 @@ module Pageflow
|
|
26
37
|
end
|
27
38
|
|
28
39
|
def order
|
29
|
-
|
40
|
+
storyline = Storyline.find(params[:storyline_id])
|
41
|
+
entry = DraftEntry.new(storyline.entry)
|
30
42
|
|
31
|
-
authorize!(:edit_outline, entry
|
32
|
-
verify_edit_lock!(entry)
|
43
|
+
authorize!(:edit_outline, storyline.entry)
|
44
|
+
verify_edit_lock!(storyline.entry)
|
33
45
|
params.require(:ids).each_with_index do |id, index|
|
34
|
-
entry.chapters.update(id, :position
|
46
|
+
entry.chapters.update(id, storyline_id: storyline.id, position: index)
|
35
47
|
end
|
36
48
|
|
37
49
|
head :no_content
|
@@ -42,7 +54,7 @@ module Pageflow
|
|
42
54
|
|
43
55
|
authorize!(:destroy, chapter)
|
44
56
|
verify_edit_lock!(chapter.entry)
|
45
|
-
chapter.entry.snapshot(:
|
57
|
+
chapter.entry.snapshot(creator: current_user)
|
46
58
|
|
47
59
|
chapter.destroy
|
48
60
|
|
@@ -53,7 +65,10 @@ module Pageflow
|
|
53
65
|
|
54
66
|
def chapter_params
|
55
67
|
configuration = params.require(:chapter)[:configuration].try(:permit!)
|
56
|
-
|
68
|
+
|
69
|
+
params.require(:chapter)
|
70
|
+
.permit(:position, :title)
|
71
|
+
.merge(configuration: configuration)
|
57
72
|
end
|
58
73
|
end
|
59
74
|
end
|
@@ -7,7 +7,7 @@ module Pageflow
|
|
7
7
|
def create
|
8
8
|
entry = Entry.find(params[:entry_id])
|
9
9
|
authorize!(:edit, entry)
|
10
|
-
entry.edit_lock.
|
10
|
+
entry.edit_lock.acquire(current_user, edit_lock_params)
|
11
11
|
entry.snapshot(:creator => current_user)
|
12
12
|
respond_with(entry.reload.edit_lock, :location => entry_edit_lock_url(entry))
|
13
13
|
end
|
@@ -15,7 +15,7 @@ module Pageflow
|
|
15
15
|
def update
|
16
16
|
entry = Entry.find(params[:entry_id])
|
17
17
|
authorize!(:edit, entry)
|
18
|
-
entry.edit_lock.
|
18
|
+
entry.edit_lock.acquire(current_user, edit_lock_params)
|
19
19
|
head :no_content
|
20
20
|
end
|
21
21
|
|
@@ -29,7 +29,6 @@ module Pageflow
|
|
29
29
|
file = file_type.model.find(params[:id])
|
30
30
|
|
31
31
|
authorize!(:retry, file)
|
32
|
-
verify_edit_lock!(file.entry)
|
33
32
|
file.retry!
|
34
33
|
|
35
34
|
respond_with(:editor, file, location: editor_file_url(file, collection_name: params[:collection_name]))
|
@@ -39,7 +38,6 @@ module Pageflow
|
|
39
38
|
file = file_type.model.find(params[:id])
|
40
39
|
|
41
40
|
authorize!(:update, file)
|
42
|
-
verify_edit_lock!(file.entry)
|
43
41
|
file.update_attributes!(update_params)
|
44
42
|
|
45
43
|
head(:no_content)
|
@@ -1,6 +1,7 @@
|
|
1
1
|
module Pageflow
|
2
2
|
class EntriesController < Pageflow::ApplicationController
|
3
3
|
include PublicHttpsMode
|
4
|
+
include EntryPasswordProtection
|
4
5
|
|
5
6
|
before_filter :authenticate_user!, :except => [:index, :show, :page]
|
6
7
|
|
@@ -24,8 +25,8 @@ module Pageflow
|
|
24
25
|
@entry = PublishedEntry.find(params[:id], entry_request_scope)
|
25
26
|
I18n.locale = @entry.locale
|
26
27
|
|
27
|
-
if !request.format.css?
|
28
|
-
|
28
|
+
if !request.format.css?
|
29
|
+
check_entry_password_protection(@entry)
|
29
30
|
end
|
30
31
|
|
31
32
|
if params[:page].present?
|
@@ -84,17 +85,12 @@ module Pageflow
|
|
84
85
|
def entry_params
|
85
86
|
params.require(:entry).permit(:title, :summary, :credits, :manual_start, :home_url, :home_button_enabled,
|
86
87
|
:emphasize_chapter_beginning, :emphasize_new_pages,
|
87
|
-
:share_image_id, :share_image_x, :share_image_y, :locale
|
88
|
+
:share_image_id, :share_image_x, :share_image_y, :locale,
|
89
|
+
:author, :publisher, :keywords)
|
88
90
|
end
|
89
91
|
|
90
92
|
def entry_request_scope
|
91
93
|
Pageflow.config.public_entry_request_scope.call(Entry, request)
|
92
94
|
end
|
93
|
-
|
94
|
-
def check_entry_password(entry)
|
95
|
-
authenticate_or_request_with_http_basic('Pageflow') do |_, password|
|
96
|
-
entry.authenticate(password)
|
97
|
-
end
|
98
|
-
end
|
99
95
|
end
|
100
96
|
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
module Pageflow
|
2
2
|
class FilesController < Pageflow::ApplicationController
|
3
3
|
include PublicHttpsMode
|
4
|
+
include EntryPasswordProtection
|
4
5
|
|
5
6
|
before_filter :check_public_https_mode
|
6
7
|
|
@@ -9,6 +10,8 @@ module Pageflow
|
|
9
10
|
format.html do
|
10
11
|
entry = PublishedEntry.find(params[:entry_id], entry_request_scope)
|
11
12
|
@file = entry.files(file_type.model).find(params[:id])
|
13
|
+
|
14
|
+
check_entry_password_protection(entry)
|
12
15
|
end
|
13
16
|
end
|
14
17
|
end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
module Pageflow
|
2
|
+
class StorylinesController < Pageflow::ApplicationController
|
3
|
+
respond_to :json
|
4
|
+
|
5
|
+
before_filter :authenticate_user!
|
6
|
+
|
7
|
+
def create
|
8
|
+
entry = DraftEntry.find(params[:entry_id])
|
9
|
+
storyline = entry.storylines.build(storyline_params)
|
10
|
+
|
11
|
+
authorize!(:create, storyline)
|
12
|
+
verify_edit_lock!(entry.to_model)
|
13
|
+
storyline.save
|
14
|
+
|
15
|
+
respond_with(storyline)
|
16
|
+
end
|
17
|
+
|
18
|
+
def scaffold
|
19
|
+
entry = DraftEntry.find(params[:entry_id])
|
20
|
+
storyline_scaffold = StorylineScaffold.build(entry, storyline_params, params.slice(:depth))
|
21
|
+
|
22
|
+
authorize!(:create, storyline_scaffold.to_model)
|
23
|
+
verify_edit_lock!(entry.to_model)
|
24
|
+
storyline_scaffold.save!
|
25
|
+
|
26
|
+
respond_with(storyline_scaffold)
|
27
|
+
end
|
28
|
+
|
29
|
+
def update
|
30
|
+
storyline = Storyline.find(params[:id])
|
31
|
+
|
32
|
+
authorize!(:update, storyline)
|
33
|
+
verify_edit_lock!(storyline.entry)
|
34
|
+
storyline.update_attributes(storyline_params)
|
35
|
+
|
36
|
+
respond_with(storyline)
|
37
|
+
end
|
38
|
+
|
39
|
+
def order
|
40
|
+
entry = DraftEntry.find(params[:entry_id])
|
41
|
+
|
42
|
+
authorize!(:edit_outline, entry.to_model)
|
43
|
+
verify_edit_lock!(entry)
|
44
|
+
params.require(:ids).each_with_index do |id, index|
|
45
|
+
entry.storylines.update(id, position: index)
|
46
|
+
end
|
47
|
+
|
48
|
+
head :no_content
|
49
|
+
end
|
50
|
+
|
51
|
+
def destroy
|
52
|
+
storyline = Storyline.find(params[:id])
|
53
|
+
|
54
|
+
authorize!(:destroy, storyline)
|
55
|
+
verify_edit_lock!(storyline.entry)
|
56
|
+
|
57
|
+
storyline.destroy
|
58
|
+
|
59
|
+
respond_with(storyline)
|
60
|
+
end
|
61
|
+
|
62
|
+
private
|
63
|
+
|
64
|
+
def storyline_params
|
65
|
+
configuration = params.require(:storyline)[:configuration].try(:permit!)
|
66
|
+
params.require(:storyline).permit.merge(configuration: configuration)
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
@@ -2,10 +2,14 @@ module Pageflow
|
|
2
2
|
module Admin
|
3
3
|
module FeaturesHelper
|
4
4
|
def feature_state_select_tag(feature_target, feature_name)
|
5
|
-
|
5
|
+
own_state = feature_target.own_feature_state(feature_name)
|
6
|
+
inherited_state = feature_target.inherited_feature_state(feature_name)
|
7
|
+
|
8
|
+
value = FeatureTarget::STATE_MAPPING[own_state]
|
9
|
+
collection = feature_states_collection(inherited_state)
|
6
10
|
|
7
11
|
select_tag(feature_state_input_name(feature_target, feature_name),
|
8
|
-
options_for_select(
|
12
|
+
options_for_select(collection, value))
|
9
13
|
end
|
10
14
|
|
11
15
|
def feature_state_input_name(feature_target, feature_name)
|
@@ -13,13 +17,20 @@ module Pageflow
|
|
13
17
|
"#{param_key}[feature_states][#{feature_name}]"
|
14
18
|
end
|
15
19
|
|
16
|
-
def feature_states_collection
|
20
|
+
def feature_states_collection(inherited_feature_state)
|
21
|
+
default_item_label = I18n.t('pageflow.admin.features.states.default',
|
22
|
+
inherited: feature_state_display_name(inherited_feature_state))
|
17
23
|
{
|
18
|
-
|
19
|
-
|
20
|
-
|
24
|
+
default_item_label => FeatureTarget::STATE_MAPPING[nil],
|
25
|
+
feature_state_display_name(true) => FeatureTarget::STATE_MAPPING[true],
|
26
|
+
feature_state_display_name(false) => FeatureTarget::STATE_MAPPING[false]
|
21
27
|
}
|
22
28
|
end
|
29
|
+
|
30
|
+
def feature_state_display_name(state)
|
31
|
+
I18n.t(FeatureTarget::STATE_MAPPING[state],
|
32
|
+
scope: 'pageflow.admin.features.states')
|
33
|
+
end
|
23
34
|
end
|
24
35
|
end
|
25
36
|
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Pageflow
|
2
|
+
module Admin
|
3
|
+
module WidgetsHelper
|
4
|
+
def admin_widgets_fields(form, config)
|
5
|
+
render('pageflow/admin/widgets/fields',
|
6
|
+
widgets: form.object.widgets.resolve(config, include_placeholders: true),
|
7
|
+
form: form,
|
8
|
+
config: config)
|
9
|
+
end
|
10
|
+
|
11
|
+
def admin_widget_types_collection_for_role(config, role)
|
12
|
+
config.widget_types.find_all_by_role(role).each_with_object({}) do |widget_type, result|
|
13
|
+
result[I18n.t(widget_type.translation_key)] = widget_type.name
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -23,9 +23,9 @@ module Pageflow
|
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
-
def audio_file_non_js_link(audio_file_id)
|
26
|
+
def audio_file_non_js_link(entry, audio_file_id)
|
27
27
|
if (audio_file = AudioFile.find_by_id(audio_file_id))
|
28
|
-
link_to(t('pageflow.audio.open'), short_audio_file_path(
|
28
|
+
link_to(t('pageflow.audio.open'), short_audio_file_path(entry, audio_file))
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
@@ -0,0 +1,52 @@
|
|
1
|
+
module Pageflow
|
2
|
+
# Seed data that is used for published entires as well as editor
|
3
|
+
# display.
|
4
|
+
#
|
5
|
+
# @api private
|
6
|
+
module CommonEntrySeedHelper
|
7
|
+
def common_entry_seed(entry)
|
8
|
+
{
|
9
|
+
locale: entry.locale,
|
10
|
+
page_types: PageTypesSeed.new(entry, Pageflow.config_for(entry)).as_json
|
11
|
+
}
|
12
|
+
end
|
13
|
+
|
14
|
+
class PageTypesSeed
|
15
|
+
attr_reader :entry, :config
|
16
|
+
|
17
|
+
def initialize(entry, config)
|
18
|
+
@entry = entry
|
19
|
+
@config = config
|
20
|
+
end
|
21
|
+
|
22
|
+
def as_json
|
23
|
+
config.page_types.each_with_object({}) do |page_type, result|
|
24
|
+
result[page_type.name.to_sym] = page_type_seed(page_type)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
private
|
29
|
+
|
30
|
+
def page_type_seed(page_type)
|
31
|
+
{
|
32
|
+
thumbnail_candidates: thumbnail_candidates(page_type)
|
33
|
+
}
|
34
|
+
end
|
35
|
+
|
36
|
+
def thumbnail_candidates(page_type)
|
37
|
+
page_type.thumbnail_candidates.map do |candidate|
|
38
|
+
{
|
39
|
+
attribute: candidate[:attribute],
|
40
|
+
collection_name: candidate[:file_collection],
|
41
|
+
css_class_prefix: thumbnail_candidate_css_class_prefix(candidate)
|
42
|
+
}
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def thumbnail_candidate_css_class_prefix(candidate)
|
47
|
+
file_type = config.file_types.find_by_collection_name!(candidate[:file_collection])
|
48
|
+
file_type.model.model_name.singular
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|