pageflow 15.1.0.beta2 → 15.1.0.beta3
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 +4 -4
- data/CHANGELOG.md +141 -1
- data/README.md +3 -6
- data/admins/pageflow/entry.rb +1 -1
- data/app/assets/javascripts/pageflow/dist/editor.js +1241 -1281
- data/app/assets/javascripts/pageflow/dist/react-client.js +3 -3
- data/app/assets/javascripts/pageflow/dist/react-server.js +2 -2
- data/app/assets/javascripts/pageflow/dist/ui.js +241 -57
- data/app/assets/javascripts/pageflow/editor/base.js +0 -20
- data/app/assets/javascripts/pageflow/editor/vendor.js +16 -0
- data/app/assets/stylesheets/pageflow/admin/embedded_index_table.scss +5 -1
- data/app/controllers/concerns/pageflow/controller_delegation.rb +31 -0
- data/app/controllers/concerns/pageflow/entry_password_protection.rb +4 -4
- data/app/controllers/pageflow/editor/entries_controller.rb +35 -0
- data/app/controllers/pageflow/editor/file_import_controller.rb +1 -1
- data/app/controllers/pageflow/editor/files_controller.rb +1 -1
- data/app/controllers/pageflow/entries_controller.rb +29 -71
- data/app/controllers/pageflow/revisions_controller.rb +16 -5
- data/app/helpers/pageflow/common_entry_seed_helper.rb +9 -24
- data/app/helpers/pageflow/config_helper.rb +25 -3
- data/app/helpers/pageflow/editor/config_helper.rb +12 -0
- data/app/helpers/pageflow/editor/entries_helper.rb +10 -0
- data/app/helpers/pageflow/editor/files_helper.rb +24 -0
- data/app/helpers/pageflow/entries_helper.rb +5 -4
- data/app/helpers/pageflow/entry_json_seed_helper.rb +1 -0
- data/app/helpers/pageflow/files_helper.rb +14 -13
- data/app/helpers/pageflow/page_types_helper.rb +4 -1
- data/app/helpers/pageflow/render_json_helper.rb +30 -5
- data/app/models/concerns/pageflow/auto_generated_perma_id.rb +16 -0
- data/app/models/concerns/pageflow/feature_target.rb +3 -3
- data/app/models/pageflow/draft_entry.rb +3 -0
- data/app/models/pageflow/home_button.rb +3 -1
- data/app/models/pageflow/page.rb +1 -6
- data/app/models/pageflow/published_entry.rb +1 -0
- data/app/models/pageflow/revision.rb +3 -0
- data/app/models/pageflow/storyline.rb +0 -2
- data/app/views/admin/entries/_links.html.arb +1 -1
- data/app/views/admin/features/_form.html.erb +1 -1
- data/app/views/components/pageflow/admin/add_membership_button.rb +13 -1
- data/app/views/layouts/pageflow/application.html.erb +3 -19
- data/app/views/layouts/pageflow/editor.html.erb +18 -0
- data/app/views/pageflow/admin/accounts/_cannot_add_account.html.erb +0 -0
- data/app/views/pageflow/admin/entries/_cannot_add_user.html.erb +5 -0
- data/app/views/pageflow/admin/users/_cannot_add.html.erb +8 -0
- data/app/views/pageflow/admin/users/_cannot_add_account.html.erb +0 -0
- data/app/views/pageflow/admin/users/_cannot_add_entry.html +0 -0
- data/app/views/pageflow/{config/_editor_seeds.json.jbuilder → editor/config/_seeds.json.jbuilder} +3 -2
- data/app/views/pageflow/editor/entries/seed.json.erb +5 -4
- data/app/views/pageflow/{entries/edit.html.erb → editor/entries/show.html.erb} +5 -9
- data/app/views/pageflow/{entries → editor/entries}/show.json.jbuilder +0 -0
- data/app/views/pageflow/entries/{show.css.erb → stylesheet.css.erb} +0 -0
- data/app/views/pageflow/entry_json_seed/_entry.json.jbuilder +2 -8
- data/config/initializers/entry_types.rb +4 -0
- data/config/initializers/features.rb +0 -10
- data/config/initializers/help_entries.rb +0 -8
- data/config/locales/de.yml +4 -0
- data/config/locales/en.yml +4 -0
- data/config/routes.rb +10 -5
- data/db/migrate/20191202145757_create_pageflow_scrolled_sections.rb +21 -0
- data/db/migrate/20191202150657_create_pageflow_scrolled_chapters.rb +11 -0
- data/db/migrate/20191202154723_create_pageflow_scrolled_content_elements.rb +21 -0
- data/db/migrate/20191219143450_add_position_to_content_elements.rb +5 -0
- data/db/migrate/20191220100946_create_pageflow_scrolled_storylines.rb +24 -0
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/editor.js +9805 -114
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/editor.js +7 -0
- data/entry_types/paged/app/assets/stylesheets/pageflow_paged/editor.scss +1 -0
- data/entry_types/paged/app/controllers/concerns/pageflow_paged/without_controller_namespace_partial_path_prefix.rb +21 -0
- data/entry_types/paged/app/controllers/pageflow_paged/application_controller.rb +25 -0
- data/entry_types/paged/app/controllers/pageflow_paged/editor/entries_controller.rb +17 -0
- data/entry_types/paged/app/controllers/pageflow_paged/entries_controller.rb +25 -0
- data/{app/views/layouts/pageflow → entry_types/paged/app/views/layouts/pageflow_paged}/_ie_include_tags.html.erb +0 -0
- data/{app/views/layouts/pageflow → entry_types/paged/app/views/layouts/pageflow_paged}/_loading_spinner_inline_script.html.erb +0 -0
- data/entry_types/paged/app/views/layouts/pageflow_paged/application.html.erb +33 -0
- data/entry_types/paged/app/views/pageflow_paged/chapters/_chapter.html.erb +7 -0
- data/entry_types/paged/app/views/pageflow_paged/editor/entries/_body.html.erb +4 -0
- data/entry_types/paged/app/views/pageflow_paged/editor/entries/_head.html.erb +12 -0
- data/entry_types/paged/app/views/pageflow_paged/editor/entries/_indicators_seed.html.erb +3 -0
- data/entry_types/paged/app/views/pageflow_paged/editor/entries/_seed.json.jbuilder +0 -0
- data/entry_types/paged/app/views/pageflow_paged/editor/entries/partials.html.erb +3 -0
- data/{app/views/pageflow → entry_types/paged/app/views/pageflow_paged}/entries/_entry.html.erb +7 -5
- data/{app/views/pageflow → entry_types/paged/app/views/pageflow_paged}/entries/_header.html.erb +0 -0
- data/{app/views/pageflow → entry_types/paged/app/views/pageflow_paged}/entries/_ie8_hint.html.erb +0 -0
- data/{app/views/pageflow → entry_types/paged/app/views/pageflow_paged}/entries/_indicators.html.erb +0 -0
- data/{app/views/pageflow → entry_types/paged/app/views/pageflow_paged}/entries/_multimedia_alert.html.erb +0 -0
- data/{app/views/pageflow → entry_types/paged/app/views/pageflow_paged}/entries/_non_js_hint.html.erb +0 -0
- data/entry_types/paged/app/views/pageflow_paged/entries/_overview.html.erb +1 -0
- data/{app/views/pageflow → entry_types/paged/app/views/pageflow_paged}/entries/_skip_links.html.erb +0 -0
- data/{app/views/pageflow → entry_types/paged/app/views/pageflow_paged}/entries/overview/_chapter.html.erb +3 -1
- data/{app/views/pageflow → entry_types/paged/app/views/pageflow_paged}/entries/overview/_entry.html.erb +1 -1
- data/{app/views/pageflow → entry_types/paged/app/views/pageflow_paged}/entries/overview/_page.html.erb +0 -0
- data/{app/views/pageflow → entry_types/paged/app/views/pageflow_paged}/entries/show.html.erb +3 -3
- data/{app/views/pageflow → entry_types/paged/app/views/pageflow_paged}/pages/_page.html.erb +1 -1
- data/entry_types/paged/config/initializers/features.rb +16 -0
- data/entry_types/paged/config/initializers/page_types.rb +16 -0
- data/entry_types/paged/config/routes.rb +3 -0
- data/entry_types/paged/lib/pageflow_paged.rb +19 -0
- data/entry_types/paged/lib/pageflow_paged/configuration.rb +16 -0
- data/entry_types/paged/lib/pageflow_paged/engine.rb +7 -0
- data/entry_types/paged/lib/pageflow_paged/plugin.rb +8 -0
- data/entry_types/scrolled/app/assets/stylesheets/pageflow_scrolled/editor.scss +1 -0
- data/entry_types/scrolled/app/controllers/pageflow_scrolled/editor/chapters_controller.rb +56 -0
- data/entry_types/scrolled/app/controllers/pageflow_scrolled/editor/content_elements_controller.rb +61 -0
- data/entry_types/scrolled/app/controllers/pageflow_scrolled/editor/entries_controller.rb +8 -0
- data/entry_types/scrolled/app/controllers/pageflow_scrolled/editor/sections_controller.rb +59 -0
- data/entry_types/scrolled/app/controllers/pageflow_scrolled/entries_controller.rb +10 -0
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/editor/seed_html_helper.rb +21 -0
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/entry_json_seed_helper.rb +33 -0
- data/entry_types/scrolled/app/models/pageflow_scrolled/chapter.rb +40 -0
- data/entry_types/scrolled/app/models/pageflow_scrolled/content_element.rb +17 -0
- data/entry_types/scrolled/app/models/pageflow_scrolled/section.rb +26 -0
- data/entry_types/scrolled/app/models/pageflow_scrolled/storyline.rb +39 -0
- data/entry_types/scrolled/app/views/pageflow_scrolled/chapters/_chapter.json.jbuilder +8 -0
- data/entry_types/scrolled/app/views/pageflow_scrolled/content_elements/_content_element.json.jbuilder +9 -0
- data/entry_types/scrolled/app/views/pageflow_scrolled/editor/entries/_body.html.erb +1 -0
- data/entry_types/scrolled/app/views/pageflow_scrolled/editor/entries/_head.html.erb +12 -0
- data/entry_types/scrolled/app/views/pageflow_scrolled/editor/entries/_seed.json.jbuilder +1 -0
- data/entry_types/scrolled/app/views/pageflow_scrolled/entries/show.html.erb +22 -0
- data/entry_types/scrolled/app/views/pageflow_scrolled/entry_json_seed/_entry.json.jbuilder +35 -0
- data/entry_types/scrolled/app/views/pageflow_scrolled/sections/_section.json.jbuilder +8 -0
- data/entry_types/scrolled/config/routes.rb +23 -0
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/install_generator.rb +34 -0
- data/entry_types/scrolled/lib/pageflow_scrolled.rb +19 -0
- data/entry_types/scrolled/lib/pageflow_scrolled/configuration.rb +6 -0
- data/entry_types/scrolled/lib/pageflow_scrolled/plugin.rb +16 -0
- data/entry_types/scrolled/lib/pageflow_scrolled/seeds.rb +133 -0
- data/entry_types/scrolled/spec/factories/chapters.rb +12 -0
- data/entry_types/scrolled/spec/factories/content_elements.rb +36 -0
- data/entry_types/scrolled/spec/factories/sections.rb +26 -0
- data/entry_types/scrolled/spec/factories/storylines.rb +12 -0
- data/entry_types/scrolled/spec/fixtures/image.jpg +0 -0
- data/lib/generators/pageflow/active_admin_initializer/active_admin_initializer_generator.rb +1 -1
- data/lib/generators/pageflow/assets/assets_generator.rb +2 -2
- data/lib/pageflow/built_in_page_types_plugin.rb +5 -3
- data/lib/pageflow/built_in_widget_types_plugin.rb +38 -12
- data/lib/pageflow/configuration.rb +76 -15
- data/lib/pageflow/editor_controller.rb +44 -0
- data/lib/pageflow/engine.rb +2 -3
- data/lib/pageflow/entries_controller_env_helper.rb +44 -0
- data/lib/pageflow/entry_type.rb +19 -2
- data/lib/pageflow/entry_type_configuration.rb +44 -0
- data/lib/pageflow/entry_types.rb +22 -0
- data/lib/pageflow/feature.rb +11 -5
- data/lib/pageflow/file_importers.rb +2 -2
- data/lib/pageflow/file_type.rb +3 -2
- data/lib/pageflow/file_types.rb +23 -3
- data/lib/pageflow/global_config_api.rb +11 -4
- data/lib/pageflow/page_types.rb +30 -0
- data/lib/pageflow/partial_editor_fragment_renderer.rb +37 -0
- data/lib/pageflow/revision_component.rb +2 -5
- data/lib/pageflow/revision_components.rb +18 -0
- data/lib/pageflow/version.rb +1 -1
- data/lib/pageflow/widget_type.rb +3 -0
- data/lib/pageflow/widget_types.rb +1 -1
- data/spec/factories/draft_entries.rb +11 -0
- data/spec/factories/published_entries.rb +17 -0
- data/vendor/assets/javascripts/dash.all.min.js +0 -1
- metadata +146 -29
- data/app/views/pageflow/chapters/_chapter.html.erb +0 -5
- data/app/views/pageflow/editor/entries/_indicators_seed.html.erb +0 -3
- data/app/views/pageflow/entries/_overview.html.erb +0 -1
- data/app/views/pageflow/entries/partials.html.erb +0 -3
- data/config/initializers/page_type_helpers.rb +0 -8
@@ -0,0 +1,24 @@
|
|
1
|
+
module Pageflow
|
2
|
+
module Editor
|
3
|
+
# @api private
|
4
|
+
module FilesHelper
|
5
|
+
include Pageflow::FilesHelper
|
6
|
+
include AudioFilesHelper
|
7
|
+
include VideoFilesHelper
|
8
|
+
include RenderJsonHelper
|
9
|
+
|
10
|
+
def editor_files_json_seed(entry)
|
11
|
+
inner = Pageflow.config.file_types.map { |file_type|
|
12
|
+
json = render_json_partial(partial: 'pageflow/editor/files/file',
|
13
|
+
collection: entry.find_files(file_type.model),
|
14
|
+
locals: {file_type: file_type},
|
15
|
+
as: :file)
|
16
|
+
|
17
|
+
%("#{file_type.collection_name}": #{json})
|
18
|
+
}.join(',')
|
19
|
+
|
20
|
+
"{#{inner}}".html_safe
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -66,10 +66,11 @@ module Pageflow
|
|
66
66
|
end
|
67
67
|
|
68
68
|
def entry_stylesheet_link_tag(entry)
|
69
|
-
url = polymorphic_path(entry.stylesheet_model,
|
70
|
-
|
71
|
-
|
72
|
-
|
69
|
+
url = pageflow.polymorphic_path(entry.stylesheet_model,
|
70
|
+
action: :stylesheet,
|
71
|
+
v: entry.stylesheet_cache_key,
|
72
|
+
p: Pageflow::VERSION,
|
73
|
+
format: 'css')
|
73
74
|
|
74
75
|
# We cannot use stylesheet_link_tag here since that always uses
|
75
76
|
# the asset host. Entry stylesheet requests are subject to
|
@@ -1,8 +1,7 @@
|
|
1
1
|
module Pageflow
|
2
|
+
# Format and generate seed data for files
|
2
3
|
module FilesHelper
|
3
4
|
include RenderJsonHelper
|
4
|
-
include VideoFilesHelper
|
5
|
-
include AudioFilesHelper
|
6
5
|
|
7
6
|
def file_format(file)
|
8
7
|
file.format.presence || '-'
|
@@ -29,17 +28,19 @@ module Pageflow
|
|
29
28
|
end
|
30
29
|
end
|
31
30
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
31
|
+
# Render seed data for all files of the revision.
|
32
|
+
#
|
33
|
+
# @param [JBuilder] json
|
34
|
+
# @param [PublishedEntry] entry
|
35
|
+
# @since 15.1
|
36
|
+
def files_json_seed(json, entry)
|
37
|
+
Pageflow.config.file_types.each do |file_type|
|
38
|
+
json.set!(file_type.collection_name) do
|
39
|
+
json.array!(entry.find_files(file_type.model)) do |file|
|
40
|
+
json.partial!('pageflow/files/file', file: file, file_type: file_type)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
43
44
|
end
|
44
45
|
end
|
45
46
|
end
|
@@ -21,7 +21,10 @@ module Pageflow
|
|
21
21
|
locals: {
|
22
22
|
configuration: {},
|
23
23
|
page: Page.new,
|
24
|
-
entry: entry
|
24
|
+
entry: entry,
|
25
|
+
|
26
|
+
# Required by RevisionFileHelper#find_file_in_entry
|
27
|
+
:@entry => entry
|
25
28
|
},
|
26
29
|
layout: false).to_str,
|
27
30
|
type: 'text/html', data: {template: "#{page_type.name}_page"})
|
@@ -1,4 +1,5 @@
|
|
1
1
|
module Pageflow
|
2
|
+
# Helpers for rendering JSON seed data.
|
2
3
|
module RenderJsonHelper
|
3
4
|
# Renders `image_files/_image_file.json.jbuilder` when given a
|
4
5
|
# collection of `ImageFile` records.
|
@@ -13,11 +14,25 @@ module Pageflow
|
|
13
14
|
end
|
14
15
|
end
|
15
16
|
|
17
|
+
# Render the given partial with format JSON, independent from
|
18
|
+
# currently rendered format. Can be used together with
|
19
|
+
# {sanitize_json} to render JSON to be included in an HTML script
|
20
|
+
# tag. Takes same parameters as JBuilder's partial! method.
|
16
21
|
def render_json_partial(*args)
|
17
22
|
render_with_format(:json) do
|
18
|
-
|
23
|
+
render_json { |json|
|
19
24
|
json.partial!(*args)
|
20
|
-
|
25
|
+
}.html_safe
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
# Yields to given block with JBuilder object and returns rendered
|
30
|
+
# JSON as string.
|
31
|
+
#
|
32
|
+
# @since 15.1
|
33
|
+
def render_json(&block)
|
34
|
+
render_with_format(:json) do
|
35
|
+
JbuilderTemplate.encode(self, &block)
|
21
36
|
end
|
22
37
|
end
|
23
38
|
|
@@ -25,23 +40,33 @@ module Pageflow
|
|
25
40
|
"\u2028" => '\u2028',
|
26
41
|
"\u2029" => '\u2029',
|
27
42
|
'</' => '<\/'
|
28
|
-
}
|
43
|
+
}.freeze
|
29
44
|
|
30
45
|
ESCAPED_CHARS_REGEX = %r{</|[\u2028\u2029]}u
|
31
46
|
|
47
|
+
# Make JSON string safe for embedding in HTML script tag. Escape
|
48
|
+
# whitespace characters that are allowed in JSON but not allowed
|
49
|
+
# in HTML. Make sure closing script tag in JSON text is not
|
50
|
+
# interpreted as closing tag of the surrounding script tag.
|
32
51
|
def sanitize_json(json)
|
33
52
|
json.gsub(ESCAPED_CHARS_REGEX, ESCAPED_CHARS)
|
34
53
|
end
|
35
54
|
|
55
|
+
# Render the given partial with format HTML, independent from
|
56
|
+
# currently rendered format. Can be used to render HTML to be
|
57
|
+
# included in a JSON response. Takes same parameters as Rails
|
58
|
+
# normal render method.
|
36
59
|
def render_html_partial(*args)
|
37
60
|
render_with_format(:html) do
|
38
61
|
render(*args)
|
39
62
|
end
|
40
63
|
end
|
41
64
|
|
42
|
-
|
65
|
+
private
|
66
|
+
|
67
|
+
def render_with_format(format)
|
43
68
|
old_formats = formats
|
44
|
-
self.formats = [format] #
|
69
|
+
self.formats = [format] # HACK: so partials resolve with json not html format
|
45
70
|
yield
|
46
71
|
ensure
|
47
72
|
self.formats = old_formats
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Pageflow
|
2
|
+
# Add a +perma_id+ attribute of type integer.
|
3
|
+
# The perma_id is automatically generated on create
|
4
|
+
# and remains unchanged throughout the models lifecycle.
|
5
|
+
module AutoGeneratedPermaId
|
6
|
+
extend ActiveSupport::Concern
|
7
|
+
|
8
|
+
included do
|
9
|
+
before_save :ensure_perma_id
|
10
|
+
end
|
11
|
+
|
12
|
+
def ensure_perma_id
|
13
|
+
self.perma_id ||= (self.class.maximum(:perma_id) || 0) + 1
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -13,10 +13,10 @@ module Pageflow
|
|
13
13
|
serialize :features_configuration, JSON
|
14
14
|
end
|
15
15
|
|
16
|
-
def enabled_feature_names
|
17
|
-
|
16
|
+
def enabled_feature_names(config = Pageflow.config_for(self))
|
17
|
+
config.features.select { |feature|
|
18
18
|
feature_state(feature.name) == true
|
19
|
-
|
19
|
+
}.map(&:name)
|
20
20
|
end
|
21
21
|
|
22
22
|
def feature_state(name)
|
@@ -14,6 +14,7 @@ module Pageflow
|
|
14
14
|
:password_digest,
|
15
15
|
:to_model, :to_key, :persisted?, :to_json,
|
16
16
|
:first_published_at,
|
17
|
+
:type_name,
|
17
18
|
:to => :entry)
|
18
19
|
|
19
20
|
delegate(:title, :summary, :credits, :manual_start,
|
@@ -36,6 +37,8 @@ module Pageflow
|
|
36
37
|
@draft = draft || entry.draft
|
37
38
|
end
|
38
39
|
|
40
|
+
alias revision draft
|
41
|
+
|
39
42
|
# So we can always get to the original Entry title.
|
40
43
|
def entry_title
|
41
44
|
entry.title
|
@@ -30,7 +30,9 @@ module Pageflow
|
|
30
30
|
def theming_home_button_url
|
31
31
|
if theming.home_url.present?
|
32
32
|
options = Pageflow.config.theming_url_options(theming) || {}
|
33
|
-
options.merge(controller: 'entries',
|
33
|
+
Pageflow::Engine.routes.url_for(options.merge(controller: 'pageflow/entries',
|
34
|
+
action: 'index',
|
35
|
+
only_path: !options[:host]))
|
34
36
|
end
|
35
37
|
end
|
36
38
|
end
|
data/app/models/pageflow/page.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
module Pageflow
|
2
2
|
class Page < ApplicationRecord
|
3
3
|
include SerializedConfiguration
|
4
|
+
include AutoGeneratedPermaId
|
4
5
|
|
5
6
|
belongs_to :chapter, touch: true
|
6
7
|
|
@@ -10,8 +11,6 @@ module Pageflow
|
|
10
11
|
|
11
12
|
scope :displayed_in_navigation, -> { where(:display_in_navigation => true) }
|
12
13
|
|
13
|
-
before_save :ensure_perma_id
|
14
|
-
|
15
14
|
def title
|
16
15
|
configuration['title'].presence || configuration['additional_title']
|
17
16
|
end
|
@@ -28,9 +27,5 @@ module Pageflow
|
|
28
27
|
def copy_to(chapter)
|
29
28
|
chapter.pages << dup
|
30
29
|
end
|
31
|
-
|
32
|
-
def ensure_perma_id
|
33
|
-
self.perma_id ||= (Page.maximum(:perma_id) || 0) + 1
|
34
|
-
end
|
35
30
|
end
|
36
31
|
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<%= hidden_field_tag('tab', params[:tab]) %>
|
3
3
|
|
4
4
|
<%= f.inputs do %>
|
5
|
-
<% Pageflow.
|
5
|
+
<% Pageflow.config_for(resource).features.each do |feature| %>
|
6
6
|
<li>
|
7
7
|
<%= label_tag(feature_state_input_name(resource, feature.name),
|
8
8
|
t(feature.name_translation_key)) %>
|
@@ -16,6 +16,7 @@ module Pageflow
|
|
16
16
|
path = new_admin_entry_membership_path(
|
17
17
|
parent, entity_type: to_class_name(entity_type)
|
18
18
|
)
|
19
|
+
quota = Pageflow.config.quotas.get(:users, parent.account)
|
19
20
|
else
|
20
21
|
path = new_admin_account_membership_path(
|
21
22
|
parent, entity_type: to_class_name(entity_type)
|
@@ -28,7 +29,13 @@ module Pageflow
|
|
28
29
|
rel = 'add_member'
|
29
30
|
end
|
30
31
|
|
31
|
-
if
|
32
|
+
if parent.is_a?(Entry) && parent.account.users.length < 2
|
33
|
+
render 'pageflow/admin/entries/cannot_add_user',
|
34
|
+
user: user,
|
35
|
+
parent: parent,
|
36
|
+
entity_type: entity_type,
|
37
|
+
quota: quota
|
38
|
+
elsif membership_possible_for(user, parent, entity_type)
|
32
39
|
para do
|
33
40
|
link_to(button_label, path, class: 'button', data: {rel: rel})
|
34
41
|
end
|
@@ -38,6 +45,11 @@ module Pageflow
|
|
38
45
|
class: 'button disabled',
|
39
46
|
data: {rel: rel}),
|
40
47
|
'data-tooltip' => data_tooltip)
|
48
|
+
render 'pageflow/admin/users/cannot_add',
|
49
|
+
user: user,
|
50
|
+
parent: parent,
|
51
|
+
entity_type: entity_type,
|
52
|
+
quota: quota
|
41
53
|
end
|
42
54
|
end
|
43
55
|
|
@@ -1,33 +1,17 @@
|
|
1
1
|
<!DOCTYPE html>
|
2
|
-
<%= content_tag(:html, lang: I18n.locale
|
2
|
+
<%= content_tag(:html, lang: I18n.locale) do %>
|
3
3
|
<head>
|
4
4
|
<title><%= @page_title.presence || 'Pageflow' %></title>
|
5
5
|
|
6
|
-
<script>
|
7
|
-
window.PAGEFLOW_EDITOR = <%= @editor_scope ? 'true' : 'false' %>;
|
8
|
-
</script>
|
9
|
-
|
10
|
-
<%= javascript_include_tag 'pageflow/vendor', 'data-turbolinks-track' => true %>
|
11
|
-
<%= javascript_include_tag 'pageflow/application', 'data-turbolinks-track' => true %>
|
12
|
-
|
13
6
|
<%= csrf_meta_tags %>
|
7
|
+
|
14
8
|
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1, minimum-scale=1, maximum-scale=1" />
|
15
9
|
<meta name="apple-mobile-web-app-capable" content="yes" />
|
16
10
|
|
17
11
|
<%= yield :head %>
|
18
|
-
|
19
|
-
<%= stylesheet_link_tag 'pageflow/print_view', media: 'print', 'data-turbolinks-track' => true %>
|
20
|
-
<%= render 'layouts/pageflow/loading_spinner_inline_script' %>
|
21
|
-
|
22
|
-
<%= render 'layouts/pageflow/ie_include_tags' %>
|
23
12
|
</head>
|
24
13
|
|
25
|
-
<body
|
26
|
-
<script>
|
27
|
-
jQuery('body').removeClass('load_all_images');
|
28
|
-
jQuery("body").removeClass('non_js').addClass('js');
|
29
|
-
</script>
|
14
|
+
<body>
|
30
15
|
<%= yield %>
|
31
|
-
<%= render 'layouts/pageflow/theme_probes' %>
|
32
16
|
</body>
|
33
17
|
<% end %>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<%= content_tag(:html, lang: I18n.locale) do %>
|
3
|
+
<head>
|
4
|
+
<title><%= @page_title.presence || 'Pageflow' %></title>
|
5
|
+
|
6
|
+
<%= csrf_meta_tags %>
|
7
|
+
|
8
|
+
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1, minimum-scale=1, maximum-scale=1" />
|
9
|
+
<meta name="apple-mobile-web-app-capable" content="yes" />
|
10
|
+
|
11
|
+
<%= yield :head %>
|
12
|
+
</head>
|
13
|
+
|
14
|
+
<body class="js">
|
15
|
+
<%= yield %>
|
16
|
+
<%= render 'layouts/pageflow/theme_probes' %>
|
17
|
+
</body>
|
18
|
+
<% end %>
|
File without changes
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<% if parent.is_a?(Pageflow::Entry) %>
|
2
|
+
<%= render 'pageflow/admin/entries/cannot_add_user', user: user, parent: parent, entity_type: entity_type, quota: quota %>
|
3
|
+
<% elsif parent.is_a?(User) %>
|
4
|
+
<%= render "pageflow/admin/users/cannot_add_#{entity_type}", user: user, parent: parent, entity_type: entity_type %>
|
5
|
+
<% elsif parent.is_a?(Pageflow::Account) %>
|
6
|
+
<%= t("pageflow.admin.account.cannot_add") %>
|
7
|
+
<%= render "pageflow/admin/accounts/cannot_add_#{entity_type}", user: user, parent: parent, entity_type: entity_type %>
|
8
|
+
<%end%>
|
File without changes
|
File without changes
|
data/app/views/pageflow/{config/_editor_seeds.json.jbuilder → editor/config/_seeds.json.jbuilder}
RENAMED
@@ -5,7 +5,7 @@ json.call(Pageflow.config,
|
|
5
5
|
:available_public_locales,
|
6
6
|
:available_text_track_kinds,
|
7
7
|
:available_share_providers)
|
8
|
-
json.file_types Pageflow.
|
8
|
+
json.file_types Pageflow.config_for(entry).file_types do |file_type|
|
9
9
|
json.collection_name file_type.collection_name
|
10
10
|
json.top_level_type file_type.top_level_type
|
11
11
|
json.type_name file_type.type_name
|
@@ -15,7 +15,8 @@ json.file_types Pageflow.config.file_types do |file_type|
|
|
15
15
|
json.collection_name nested_file_type.collection_name
|
16
16
|
end
|
17
17
|
end
|
18
|
-
|
18
|
+
|
19
|
+
json.file_importers Pageflow.config_for(entry).file_importers do |file_importer|
|
19
20
|
json.importer_name file_importer.name
|
20
21
|
json.logo_source file_importer.logo_source
|
21
22
|
json.authentication_provider file_importer.authentication_provider
|