scrivito_sdk 0.40.0 → 0.41.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/scrivito/objs_controller.rb +5 -1
- data/app/helpers/scrivito_helper.rb +22 -11
- data/app/models/scrivito/content_widget.rb +11 -0
- data/app/views/scrivito/content_widget/show.html.erb +7 -0
- data/config/ca-bundle.crt +1 -1
- data/config/cms_routes.rb +3 -1
- data/config/routes.rb +0 -1
- data/lib/assets/javascripts/scrivito_sdk.js +1 -1
- data/lib/assets/javascripts/scrivito_ui.js +415 -137
- data/lib/assets/stylesheets/scrivito_sdk.css +13 -0
- data/lib/assets/stylesheets/scrivito_ui.css +121 -0
- data/lib/generators/scrivito/install/install_generator.rb +6 -1
- data/lib/generators/scrivito/install/templates/app/views/download/embed.html.erb +1 -0
- data/lib/generators/scrivito/install/templates/app/views/image/embed.html.erb +1 -0
- data/lib/generators/scrivito/install/templates/scrivito/migrate/install_scrivito_migration.rb +4 -0
- data/lib/scrivito/basic_obj.rb +9 -1
- data/lib/scrivito/basic_widget.rb +5 -1
- data/lib/scrivito/cache/chainable.rb +52 -0
- data/lib/scrivito/cache/file_store.rb +26 -0
- data/lib/scrivito/cache/ram_store.rb +32 -0
- data/lib/scrivito/cache.rb +1 -40
- data/lib/scrivito/cache_garbage_collector.rb +1 -1
- data/lib/scrivito/cms_backend.rb +5 -5
- data/lib/scrivito/{cms_cache_storage.rb → cms_data_cache.rb} +22 -10
- data/lib/scrivito/cms_rest_api/widget_extractor.rb +1 -1
- data/lib/scrivito/configuration.rb +41 -6
- data/lib/scrivito/content_state.rb +6 -6
- data/lib/scrivito/controller_actions.rb +8 -2
- data/lib/scrivito/obj_params_parser.rb +4 -2
- data/lib/scrivito/workspace_data_from_service.rb +2 -2
- metadata +12 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 89a64283aa9e79b8a6c8ced8a53b72a081935820
|
4
|
+
data.tar.gz: 2ed35eb7b75e516209295ea0178c424e2e9cdd1e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e1f36dfc18acfdf77dd15ab6ea51dee7b9958fdf04517207e2735532b3dc4c5352cd58926bf612a25ba760c7e4f543cb36ee89d4aec25362fc9b4e04060511c6
|
7
|
+
data.tar.gz: 66b0024d79000f5966cd3c6aa0bb337f0ee0ca4018d4e751aa0ff93719e6f131748f4ebacbfffdf41740224ac127becd1ba592db19333a24395083ca7f2eca4f
|
@@ -189,7 +189,7 @@ module Scrivito
|
|
189
189
|
end
|
190
190
|
|
191
191
|
def valid_widget_classes
|
192
|
-
(widget_classes_from_widget || widget_classes_from_obj ||
|
192
|
+
(widget_classes_from_widget || widget_classes_from_obj || widget_descendants).map(&:to_s)
|
193
193
|
end
|
194
194
|
|
195
195
|
def widget_classes_from_widget
|
@@ -202,6 +202,10 @@ module Scrivito
|
|
202
202
|
current_obj.valid_widget_classes_for(params[:field_name])
|
203
203
|
end
|
204
204
|
|
205
|
+
def widget_descendants
|
206
|
+
Widget.descendants.reject(&:hide_from_widget_class_selection?)
|
207
|
+
end
|
208
|
+
|
205
209
|
def assert_dialog_layout
|
206
210
|
view_context.lookup_context.find('layouts/scrivito_dialog')
|
207
211
|
rescue ActionView::MissingTemplate
|
@@ -8,32 +8,42 @@ module ScrivitoHelper
|
|
8
8
|
include Scrivito::RoutingHelper
|
9
9
|
|
10
10
|
#
|
11
|
-
#
|
12
|
-
#
|
13
|
-
#
|
11
|
+
# Renders a field within the given HTML tag.
|
12
|
+
#
|
13
|
+
# This method also renders additional attributes, which are needed for in-place editing.
|
14
|
+
# These attributes are only rendered when appropriate, i.e. not for a regular visitor.
|
15
|
+
#
|
16
|
+
# The helper is similar to (and internally uses)
|
14
17
|
# http://api.rubyonrails.org/classes/ActionView/Helpers/TagHelper.html#method-i-content_tag.
|
18
|
+
# You can add additional HTML attributes by passing them in +html_options+.
|
15
19
|
#
|
16
20
|
# @api public
|
17
21
|
#
|
18
|
-
#
|
19
|
-
#
|
22
|
+
# @note If the param +field_name+ is of type +widget+, then +tag_name+ must be a block tag,
|
23
|
+
# like +div+ or +h1+. An inline tag like +p+ or +span+ could result in broken HTML output, since
|
24
|
+
# the widgets are rendered within block tags.
|
20
25
|
#
|
21
|
-
# @param tag_name [String, Symbol] Name of the
|
26
|
+
# @param tag_name [String, Symbol] Name of the HTML tag (e.g. +:h1+ or +:div+).
|
27
|
+
# If the param +field_name+ is of type +widget+, then +tag_name+ must be a block tag,
|
28
|
+
# like +div+ or +h1+. An inline tag like +p+ or +span+ could result in broken HTML output, since
|
29
|
+
# the widgets are rendered within block tags.
|
22
30
|
# @param obj_or_widget [Scrivito::BasicObj, Scrivito::BasicWidget] A {Scrivito::BasicObj}
|
23
31
|
# or {Scrivito::BasicWidget} from which the +field_name+ is read.
|
24
32
|
# @param field_name [String, Symbol] Which field of the Obj should be rendered.
|
25
33
|
# @param html_options [Hash] HTML options to be passed to +content_tag+.
|
26
34
|
# @param block [Proc] Optional block to render inner HTML. If none given the value of attribute
|
27
35
|
# will be rendered instead. +block+ is not allowed for fields of type +widget+.
|
36
|
+
#
|
28
37
|
# @raise ArgumentError if the field behind +field_name+ is of type +widget+ and a +block+ is given.
|
29
|
-
# @return [String] The rendered html tag
|
30
38
|
#
|
31
|
-
# @
|
39
|
+
# @return [String] The rendered HTML tag.
|
40
|
+
#
|
41
|
+
# @example Renders an <h2> tag containing the text of the +headline+ attribute of +@obj+ and assigns the tag a css class called +very_important+
|
32
42
|
# <%= scrivito_tag :h2, @obj, :headline, class: "very_important" %>
|
33
43
|
#
|
34
|
-
# @example Renders an <h2> tag containing
|
35
|
-
# <%= scrivito_tag :h2,
|
36
|
-
# <%=
|
44
|
+
# @example Renders an <h2> tag containing a truncated +headline+ of the +widget+
|
45
|
+
# <%= scrivito_tag :h2, widget, :headline do %>
|
46
|
+
# <%= truncate widget.headline %>
|
37
47
|
# <% end %>
|
38
48
|
#
|
39
49
|
# @example Render a download link for a PDF document
|
@@ -44,6 +54,7 @@ module ScrivitoHelper
|
|
44
54
|
# Drop PDF here to upload
|
45
55
|
# <% end %>
|
46
56
|
# <% end %>
|
57
|
+
#
|
47
58
|
def scrivito_tag(tag_name, obj_or_widget, field_name, html_options = {}, &block)
|
48
59
|
Scrivito::CmsFieldTag.new(
|
49
60
|
self, tag_name, obj_or_widget, field_name.to_s
|
data/config/ca-bundle.crt
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
##
|
2
2
|
## Bundle of CA Root Certificates
|
3
3
|
##
|
4
|
-
## Certificate data from Mozilla as of:
|
4
|
+
## Certificate data from Mozilla as of: Thu Feb 5 15:33:13 2015
|
5
5
|
##
|
6
6
|
## This is a bundle of X.509 certificates of public Certificate Authorities
|
7
7
|
## (CA). These were automatically extracted from Mozilla's root certificates
|
data/config/cms_routes.rb
CHANGED
@@ -4,7 +4,9 @@ Rails.application.routes.draw do
|
|
4
4
|
get '__scrivito/render_widget/:id/show_widget/:widget_id' => 'scrivito/cms_dispatch#show_widget'
|
5
5
|
get '__scrivito/render_widget/:id/widget_details/:widget_id' => 'scrivito/cms_dispatch#widget_details'
|
6
6
|
|
7
|
-
get '
|
7
|
+
get '__scrivito/page_details/:id' => 'scrivito/cms_dispatch#page_details'
|
8
|
+
|
9
|
+
get '/__scrivito/resource_details/:resource_id' => 'scrivito/cms_dispatch#resource_details'
|
8
10
|
|
9
11
|
match ':id(/*slug)',
|
10
12
|
to: 'scrivito/cms_dispatch#index',
|
data/config/routes.rb
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
if (scrivito_ui.is_inited()) {
|
12
12
|
if (!dom_config) {
|
13
13
|
// UI is already running, but editing is not allowed: reload UI to make it disappear.
|
14
|
-
window.parent.location.
|
14
|
+
window.parent.location = window.location;
|
15
15
|
}
|
16
16
|
} else {
|
17
17
|
if (!dom_config) {
|