scrivito_sdk 0.18.1 → 0.30.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (144) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/scrivito/blobs_controller.rb +1 -2
  3. data/app/controllers/scrivito/default_cms_controller.rb +9 -75
  4. data/app/controllers/scrivito/objs_controller.rb +107 -119
  5. data/app/controllers/scrivito/tasks_controller.rb +1 -1
  6. data/app/controllers/scrivito/users_controller.rb +1 -1
  7. data/app/controllers/scrivito/webservice_controller.rb +6 -2
  8. data/app/controllers/scrivito/workspaces_controller.rb +57 -17
  9. data/app/helpers/scrivito_helper.rb +285 -0
  10. data/app/views/google_maps_widget/show.html.erb +1 -0
  11. data/app/views/scrivito/_editing_auth_warning.html.erb +43 -0
  12. data/app/views/scrivito/blobs/upload_permission.json.jbuilder +1 -0
  13. data/app/views/scrivito/objs/copy.json.jbuilder +1 -0
  14. data/app/views/scrivito/objs/copy_widget.html.erb +1 -1
  15. data/app/views/scrivito/objs/create.json.jbuilder +1 -0
  16. data/app/views/scrivito/objs/create_widget.html.erb +1 -1
  17. data/app/views/scrivito/objs/details.json.jbuilder +1 -0
  18. data/app/views/scrivito/objs/format_missing_error.json.jbuilder +1 -0
  19. data/app/views/scrivito/objs/modification.json.jbuilder +1 -0
  20. data/app/views/scrivito/objs/page_class_selection.json.jbuilder +1 -0
  21. data/app/views/scrivito/objs/search.json.jbuilder +6 -0
  22. data/app/views/scrivito/objs/search_only_size.json.jbuilder +1 -0
  23. data/app/views/scrivito/objs/update.json.jbuilder +1 -0
  24. data/app/views/scrivito/objs/widget_class_selection.json.jbuilder +1 -0
  25. data/app/views/scrivito/objs/widget_modification.json.jbuilder +1 -0
  26. data/app/views/scrivito/tasks/show.json.jbuilder +3 -0
  27. data/app/views/scrivito/users/suggest.json.jbuilder +1 -0
  28. data/app/views/scrivito/webservice/empty.json +1 -0
  29. data/app/views/scrivito/webservice/error.json.jbuilder +2 -0
  30. data/app/views/scrivito/workspaces/_workspace.json.jbuilder +5 -0
  31. data/app/views/scrivito/workspaces/check.json.jbuilder +1 -0
  32. data/app/views/scrivito/workspaces/create.json.jbuilder +1 -0
  33. data/app/views/scrivito/workspaces/index.json.jbuilder +1 -0
  34. data/app/views/scrivito/workspaces/show.json.jbuilder +1 -0
  35. data/app/views/scrivito/workspaces/task.json.jbuilder +5 -0
  36. data/config/ca-bundle.crt +259 -234
  37. data/config/cms_routes.rb +2 -2
  38. data/config/routes.rb +3 -0
  39. data/lib/assets/javascripts/{scrivito_editing.js → scrivito_sdk.js} +1662 -1180
  40. data/lib/assets/stylesheets/{scrivito_editing.css → scrivito_sdk.css} +242 -6
  41. data/lib/generators/scrivito/install/install_generator.rb +62 -0
  42. data/lib/generators/scrivito/install/templates/app/controllers/cms_controller.rb +3 -0
  43. data/lib/generators/scrivito/install/templates/app/controllers/page_controller.rb +2 -0
  44. data/lib/generators/scrivito/install/templates/app/models/headline_widget.rb +7 -0
  45. data/lib/generators/scrivito/install/templates/app/models/image.rb +5 -0
  46. data/lib/generators/scrivito/install/templates/app/models/image_widget.rb +7 -0
  47. data/lib/generators/scrivito/install/templates/app/models/obj.rb +2 -0
  48. data/lib/generators/scrivito/install/templates/app/models/page.rb +8 -0
  49. data/lib/generators/scrivito/install/templates/app/models/text_widget.rb +7 -0
  50. data/lib/generators/scrivito/install/templates/app/models/widget.rb +2 -0
  51. data/lib/generators/scrivito/install/templates/app/views/headline_widget/show.html.erb +1 -0
  52. data/lib/generators/scrivito/install/templates/app/views/headline_widget/thumbnail.html.erb +3 -0
  53. data/lib/generators/scrivito/install/templates/app/views/image_widget/show.html.erb +1 -0
  54. data/lib/generators/scrivito/install/templates/app/views/image_widget/thumbnail.html.erb +3 -0
  55. data/lib/generators/scrivito/install/templates/app/views/page/details.html.erb +1 -0
  56. data/lib/generators/scrivito/install/templates/app/views/page/index.html.erb +16 -0
  57. data/lib/generators/scrivito/install/templates/app/views/page/thumbnail.html.erb +3 -0
  58. data/lib/generators/scrivito/install/templates/app/views/text_widget/show.html.erb +1 -0
  59. data/lib/generators/scrivito/install/templates/app/views/text_widget/thumbnail.html.erb +3 -0
  60. data/lib/generators/scrivito/install/templates/config/initializers/scrivito.rb +10 -0
  61. data/lib/generators/scrivito/install/templates/scrivito/migrate/install_scrivito.rb +49 -0
  62. data/lib/generators/scrivito/migration/USAGE +9 -0
  63. data/lib/generators/{cms → scrivito}/migration/migration_generator.rb +4 -9
  64. data/lib/generators/{cms → scrivito}/migration/templates/migration.erb +3 -3
  65. data/lib/generators/{cms → scrivito}/widget/templates/details.html.erb +0 -0
  66. data/lib/generators/{cms → scrivito}/widget/templates/migration.erb +0 -0
  67. data/lib/generators/{cms → scrivito}/widget/templates/model.erb +0 -0
  68. data/lib/generators/{cms → scrivito}/widget/templates/show.html.erb +0 -0
  69. data/lib/generators/scrivito/widget/templates/thumbnail.html.erb +3 -0
  70. data/lib/generators/{cms → scrivito}/widget/widget_generator.rb +3 -2
  71. data/lib/obj.rb +17 -3
  72. data/lib/scrivito/attribute_collection.rb +7 -12
  73. data/lib/scrivito/attribute_content.rb +31 -12
  74. data/lib/scrivito/basic_obj.rb +186 -96
  75. data/lib/scrivito/basic_widget.rb +25 -10
  76. data/lib/scrivito/binary.rb +75 -0
  77. data/lib/scrivito/cache_garbage_collector.rb +19 -4
  78. data/lib/scrivito/child_list_tag.rb +108 -0
  79. data/lib/scrivito/client_config.rb +2 -1
  80. data/lib/scrivito/client_error.rb +3 -2
  81. data/lib/scrivito/cms_backend.rb +81 -16
  82. data/lib/scrivito/cms_dispatch_controller.rb +7 -0
  83. data/lib/scrivito/cms_env.rb +0 -2
  84. data/lib/scrivito/cms_field_tag.rb +44 -35
  85. data/lib/scrivito/cms_rest_api.rb +23 -6
  86. data/lib/scrivito/cms_rest_api/attribute_serializer.rb +1 -1
  87. data/lib/scrivito/cms_routing.rb +120 -0
  88. data/lib/scrivito/configuration.rb +69 -58
  89. data/lib/scrivito/connection_manager.rb +30 -1
  90. data/lib/scrivito/content_service.rb +10 -7
  91. data/lib/scrivito/controller_actions.rb +108 -0
  92. data/lib/scrivito/diff.rb +30 -15
  93. data/lib/scrivito/editing_context.rb +4 -0
  94. data/lib/scrivito/editing_context_helper.rb +19 -0
  95. data/lib/scrivito/editing_context_middleware.rb +20 -1
  96. data/lib/scrivito/image_tag_helper.rb +44 -0
  97. data/lib/scrivito/layout_tags.rb +33 -0
  98. data/lib/scrivito/link.rb +4 -2
  99. data/lib/scrivito/membership.rb +0 -8
  100. data/lib/scrivito/migrations.rb +0 -1
  101. data/lib/scrivito/migrations/installer.rb +1 -1
  102. data/lib/scrivito/migrations/migration.rb +0 -2
  103. data/lib/scrivito/migrations/migrator.rb +2 -3
  104. data/lib/scrivito/obj_class.rb +64 -16
  105. data/lib/scrivito/obj_class_data.rb +4 -0
  106. data/lib/scrivito/obj_search_enumerator.rb +1 -1
  107. data/lib/scrivito/routing_helper.rb +42 -0
  108. data/lib/scrivito/{engine.rb → sdk_engine.rb} +15 -29
  109. data/lib/scrivito/tag_renderer.rb +40 -0
  110. data/lib/scrivito/test_request.rb +40 -0
  111. data/lib/scrivito/type_computer.rb +1 -6
  112. data/lib/scrivito/user.rb +33 -15
  113. data/lib/scrivito/user_definition.rb +34 -6
  114. data/lib/scrivito/widget_tag.rb +67 -0
  115. data/lib/scrivito/workspace.rb +12 -24
  116. data/lib/scrivito_sdk.rb +17 -1
  117. data/lib/tasks/cache.rake +4 -5
  118. data/lib/tasks/migration.rake +1 -1
  119. data/lib/widget.rb +21 -3
  120. metadata +119 -70
  121. data/README +0 -6
  122. data/app/controllers/cms_controller.rb +0 -7
  123. data/app/helpers/cms_helper.rb +0 -7
  124. data/app/helpers/cms_routing_helper.rb +0 -7
  125. data/app/helpers/scrivito/cms_asset_helper.rb +0 -110
  126. data/app/helpers/scrivito/cms_tag_helper.rb +0 -232
  127. data/app/helpers/scrivito/default_cms_helper.rb +0 -21
  128. data/app/helpers/scrivito/default_cms_routing_helper.rb +0 -128
  129. data/app/helpers/scrivito/display_helper.rb +0 -64
  130. data/app/helpers/scrivito/editing_helper.rb +0 -32
  131. data/app/helpers/scrivito/layout_helper.rb +0 -21
  132. data/app/models/named_link.rb +0 -2
  133. data/app/views/cms/_index.html.erb +0 -7
  134. data/app/views/cms/index.html.erb +0 -1
  135. data/app/views/scrivito/_editing_javascript.html.erb +0 -7
  136. data/app/views/scrivito/default_cms/show_widget.html.erb +0 -1
  137. data/lib/assets/stylesheets/scrivito.css +0 -199
  138. data/lib/generators/cms/migration/USAGE +0 -9
  139. data/lib/generators/cms/widget/templates/thumbnail.html.erb +0 -2
  140. data/lib/scrivito/blob.rb +0 -48
  141. data/lib/scrivito/cms_accessible.rb +0 -30
  142. data/lib/scrivito/cms_rest_api/blob_uploader.rb +0 -18
  143. data/lib/scrivito/cms_test_request.rb +0 -23
  144. data/lib/scrivito/migrations/migration_dsl.rb +0 -180
@@ -1,64 +0,0 @@
1
- module Scrivito
2
-
3
- # This module contains a helper that can be used to render attributes of the CMS models.
4
- # @api public
5
- module DisplayHelper
6
-
7
- # For a consistent look of your site and easy maintenance, only the display helpers
8
- # should be used to render an attribute <em>value</em> of a CMS model.
9
- #
10
- # <%= display_value @obj.title %>
11
- # Renders the value, taking its type into account.
12
- # * An HtmlString will be exported by converting its links
13
- # * A Time will be exported in an international form: Year-Month-Day Hour:Minutes
14
- # * A non-HTML String will be quoted
15
- # * other values will be rendered unchanged
16
- #
17
- # @api public
18
- def display_value(value)
19
- case value
20
- when HtmlString then convert_links(value).html_safe
21
- when String then h(value)
22
- when Time then h(l(value))
23
- else value
24
- end
25
- end
26
-
27
- # Renders a field from the CMS.
28
- #
29
- # <%= display_field @obj, :title %>
30
- #
31
- # @api public
32
- def display_field(obj, attr, options = {})
33
- display_value obj[attr]
34
- end
35
-
36
- # Legacy method - deprecated
37
- #
38
- # Use display_value and display_field instead
39
- def display(*args)
40
- if args.last.kind_of? Hash
41
- options = args.pop
42
- else
43
- options = {}
44
- end
45
- return display_value(args.first) if args.size == 1
46
- display_field(args[0], args[1], options)
47
- end
48
-
49
- private
50
-
51
- def convert_links(html, cms_path_options = {})
52
- if html
53
- html.gsub(%r{<?\bobjid:([a-f0-9]{16})\b>?}) do
54
- if obj = Obj.find_by_id($1)
55
- cms_path(obj, cms_path_options)
56
- else
57
- "#__target_object_not_reachable"
58
- end
59
- end
60
- end
61
- end
62
-
63
- end
64
- end
@@ -1,32 +0,0 @@
1
- module Scrivito
2
-
3
- module EditingHelper
4
-
5
- def generator_meta_tag
6
- content = 'Scrivito by Infopark AG (scrivito.com)'
7
- content << "; Version #{GemInfo.version}" if inplace_editing_allowed?
8
- tag :meta, name: 'generator', content: content
9
- end
10
-
11
- def include_editing_stylesheet
12
- (inplace_editing_allowed? ? stylesheet_link_tag(:scrivito_editing) : '').html_safe
13
- end
14
-
15
- def widget_reset_stylesheet
16
- stylesheet = '*[data-scrivito-field-type="widget"],' \
17
- ' *[data-scrivito-private-widget-id] { position: relative; }'
18
- content_tag(:style, stylesheet, {type: 'text/css'}, false)
19
- end
20
-
21
- def include_editing_javascript
22
- (inplace_editing_allowed? ? render('scrivito/editing_javascript') : '').html_safe
23
- end
24
-
25
- def scrivito_client_config
26
- client_config = ClientConfig.new(@obj, cms_editing_context, lookup_context,
27
- resource: @scrivito_resource, return_to: params[:return_to])
28
- client_config.to_json.html_safe
29
- end
30
- end
31
-
32
- end
@@ -1,21 +0,0 @@
1
- module Scrivito
2
-
3
- # This module contains helpers that render tags for the html head
4
- # and the end of the html body.
5
- # @api public
6
- module LayoutHelper
7
-
8
- # Renders all tags needed in the HTML head.
9
- # @api public
10
- def scrivito_header_tags
11
- generator_meta_tag + include_editing_stylesheet + widget_reset_stylesheet
12
- end
13
-
14
- # Renders all tags needed at the end of the BODY tag.
15
- # @api public
16
- def scrivito_after_content_tags
17
- include_editing_javascript
18
- end
19
- end
20
-
21
- end
@@ -1,2 +0,0 @@
1
- # ::NamedLink is just a shortcut
2
- ::NamedLink = Scrivito::NamedLink
@@ -1,7 +0,0 @@
1
- <h1 class="cms_title"><%= display_field @obj, :title %></h1>
2
- <ul class="cms_toclist">
3
- <% @obj.toclist.each do |item| %>
4
- <li><%= link_to display_field(item, :title), cms_path(item) %></li>
5
- <% end %>
6
- </ul>
7
- <%= display_field @obj, :body %>
@@ -1 +0,0 @@
1
- <%= render :partial => 'index' %>
@@ -1,7 +0,0 @@
1
- <%= javascript_include_tag :scrivito_editing %>
2
- <%= javascript_tag do %>
3
- $(function() {
4
- scrivito.init(<%= scrivito_client_config %>);
5
- scrivito.gui.start();
6
- });
7
- <% end %>
@@ -1 +0,0 @@
1
- <%= render_widget(widget) %>
@@ -1,199 +0,0 @@
1
- /* scrivito marker + field highlighting */
2
-
3
-
4
- [data-scrivito-field-type="widget"] { min-height: 25px;}
5
-
6
- .scrivito_empty_widget_field {
7
- -webkit-box-shadow: 0 0 5px rgba(0,0,0,.3) inset;
8
- background: rgba(0,0,0,.05);
9
- box-shadow: 0 0 5px rgba(0,0,0,.3) inset;
10
- min-height: 50px;
11
- visibility: visible!important;
12
- }
13
-
14
- .scrivito_widget_drop_placeholder,
15
- .scrivito_empty_widget_field.scrivito_widget_drop_allowed {
16
- -webkit-box-shadow: 0 0 5px rgba(152,187,225,.9) inset;
17
- background: rgba(152,187,225,.3);
18
- box-shadow: 0 0 5px rgba(152,187,225,.9) inset;
19
- max-height: 150px;
20
- min-height: 100px;
21
- visibility: visible!important;
22
- }
23
-
24
- body.scrivito_editing_active .scrivito_empty_widget_field.scrivito_widget_drop_allowed {
25
- max-height: 200px;
26
- min-height: 100px;
27
- }
28
-
29
- [data-scrivito-private-widget-id] .scrivito_empty_widget_field { min-height: 100px; }
30
-
31
- .ui-sortable-helper { opacity:0.5;}
32
-
33
- /* widgets */
34
- [data-scrivito-display-mode="editing"] *[data-scrivito-widget-obj-class] {
35
- -webkit-box-shadow:0 0 0 2px transparent;
36
- box-shadow:0 0 0 2px transparent;
37
- -webkit-transition: box-shadow linear .3s;
38
- transition: box-shadow linear .3s;
39
- }
40
- body.scrivito_widget_dragging_active[data-scrivito-display-mode="editing"] *[data-scrivito-widget-obj-class],
41
- body.scrivito_widget_dragging_active[data-scrivito-display-mode="editing"] *[data-scrivito-widget-obj-class] *[data-scrivito-field-type="widget"],
42
- [data-scrivito-display-mode="editing"] *[data-scrivito-widget-obj-class]:hover,
43
- [data-scrivito-display-mode="editing"] *[data-scrivito-widget-obj-class]:hover *[data-scrivito-field-type="widget"] {
44
- -webkit-box-shadow:0 0 0 2px #439439;
45
- box-shadow:0 0 0 2px #439439;
46
- }
47
-
48
- body.scrivito_widget_dragging_active[data-scrivito-display-mode="editing"] *[data-scrivito-widget-obj-class] *[data-scrivito-field-type="widget"]:not(.scrivito_empty_widget_field) {
49
- min-height: 100px;
50
- }
51
-
52
- /* margin for nested widgets */
53
- [data-scrivito-display-mode="editing"] *[data-scrivito-widget-obj-class] *[data-scrivito-field-type="widget"],
54
- [data-scrivito-display-mode="added"] *[data-scrivito-widget-obj-class] *[data-scrivito-field-type="widget"],
55
- [data-scrivito-display-mode="diff"] [data-scrivito-widget-obj-class] *[data-scrivito-field-type="widget"],
56
- [data-scrivito-display-mode="deleted"] *[data-scrivito-widget-obj-class] *[data-scrivito-field-type="widget"] { margin-top: 35px;}
57
-
58
- /* highlight cms fields */
59
- [data-scrivito-display-mode="editing"] *[data-scrivito-field-type="string"],
60
- [data-scrivito-display-mode="editing"] *[data-scrivito-field-type="text"],
61
- [data-scrivito-display-mode="editing"] *[data-scrivito-field-type="html"],
62
- [data-scrivito-display-mode="editing"] *[data-scrivito-field-type="reference"],
63
- [data-scrivito-display-mode="editing"] *[data-scrivito-field-type="referencelist"],
64
- [data-scrivito-display-mode="editing"] *[data-scrivito-field-type="linklist"],
65
- [data-scrivito-display-mode="editing"] *[data-scrivito-field-type="enum"],
66
- [data-scrivito-display-mode="editing"] *[data-scrivito-field-type="multienum"],
67
- [data-scrivito-display-mode="editing"] *[data-scrivito-field-type="date"] {
68
- outline: 2px dotted transparent;
69
- -webkit-transition: outline-color linear .3s;
70
- transition: outline-color linear .3s;
71
- }
72
-
73
- /* highlight cms fields on hover */
74
- [data-scrivito-display-mode="editing"] *[data-scrivito-field-type="string"]:hover,
75
- [data-scrivito-display-mode="editing"] *[data-scrivito-field-type="text"]:hover,
76
- [data-scrivito-display-mode="editing"] *[data-scrivito-field-type="html"]:hover,
77
- [data-scrivito-display-mode="editing"] *[data-scrivito-field-type="reference"]:hover,
78
- [data-scrivito-display-mode="editing"] *[data-scrivito-field-type="referencelist"]:hover,
79
- [data-scrivito-display-mode="editing"] *[data-scrivito-field-type="linklist"]:hover,
80
- [data-scrivito-display-mode="editing"] *[data-scrivito-field-type="enum"]:hover,
81
- [data-scrivito-display-mode="editing"] *[data-scrivito-field-type="multienum"]:hover,
82
- [data-scrivito-display-mode="editing"] *[data-scrivito-field-type="date"]:hover {
83
- outline: 2px dotted #439439;
84
- }
85
-
86
- /* highlight unmodified but moved widgets */
87
- [data-scrivito-private-widget-container-modification="deleted"] {
88
- -webkit-box-shadow:0 0 0 2px #808080;
89
- box-shadow:0 0 0 2px #808080;
90
- }
91
-
92
- [data-scrivito-private-widget-container-modification="deleted"] * {
93
- opacity:.7;
94
- }
95
-
96
- [data-scrivito-private-widget-container-modification="deleted"] .scrivito_editing_marker,
97
- [data-scrivito-private-widget-container-modification="deleted"] .scrivito_editing_marker .scrivito_icon,
98
- [data-scrivito-private-widget-modification="edited"][data-scrivito-private-widget-container-modification="deleted"] * {
99
- opacity:1;
100
- }
101
-
102
- /* highlight modified "edited" cms widget */
103
- [data-scrivito-private-widget-modification="edited"],
104
- [data-scrivito-private-child-list-modification="edited"],
105
- [data-scrivito-private-widget-container-modification="new"] {
106
- -webkit-box-shadow:0 0 0 2px #4f749d;
107
- box-shadow:0 0 0 2px #4f749d;
108
- }
109
- /* highlight modified "added" cms widget */
110
- [data-scrivito-private-widget-modification="new"], [data-scrivito-private-obj-modification="new"] {
111
- -webkit-box-shadow:0 0 0 2px #4c8c07;
112
- box-shadow:0 0 0 2px #4c8c07;
113
- }
114
- /* highlight modified "deleted" cms widget */
115
- [data-scrivito-private-widget-modification="deleted"], [data-scrivito-private-obj-modification="deleted"] {
116
- -webkit-box-shadow:0 0 0 2px #ff1f01;
117
- box-shadow:0 0 0 2px #ff1f01;
118
- }
119
-
120
-
121
- /* highlight modified "edited" cms fields */
122
- [data-scrivito-field-type="widget"] *[data-scrivito-field-modification="edited"],
123
- [data-scrivito-field-type="widget"] *[data-scrivito-field-modification="new"] ,
124
- [data-scrivito-field-type="widget"] *[data-scrivito-field-modification="deleted"] {
125
- outline: 2px dotted transparent;
126
- -webkit-transition: outline-color linear .3s;
127
- transition: outline-color linear .3s;
128
- }
129
-
130
- *[data-scrivito-field-modification="edited"],
131
- [data-scrivito-field-type="widget"]:hover *[data-scrivito-field-modification="edited"],
132
- .scrivito_details_dialog *[data-scrivito-field-modification="edited"] {
133
- outline: 2px dotted #4f749d;
134
- outline: 2px dotted rgba(79, 116, 157, 1);
135
- }
136
- /* highlight modified "added" cms fields */
137
- [data-scrivito-field-type="widget"]:hover *[data-scrivito-field-modification="new"],
138
- .scrivito_details_dialog *[data-scrivito-field-modification="new"]{
139
- outline: 2px dotted #4c8c07;
140
- outline: 2px dotted rgba(76, 140, 7, 1);
141
- }
142
- /* highlight modified "deleted" cms fields */
143
- [data-scrivito-field-type="widget"]:hover *[data-scrivito-field-modification="deleted"],
144
- .scrivito_details_dialog *[data-scrivito-field-modification="deleted"]{
145
- outline: 2px dotted #ff1f01;
146
- outline: 2px dotted rgba(255, 31, 1, 1);
147
- }
148
-
149
- /* highlight ins and del tags in cms fields with textual diff */
150
- [data-scrivito-field-type="string"] ins,
151
- [data-scrivito-field-type="html"] ins,
152
- [data-scrivito-field-type="text"] ins {
153
- background-color: rgba(76, 140, 7, 0.3);
154
- text-decoration: none;
155
- }
156
- [data-scrivito-field-type="string"] del,
157
- [data-scrivito-field-type="html"] del,
158
- [data-scrivito-field-type="text"] del {
159
- background-color: rgba(255, 31, 1, 0.3);
160
- text-decoration: line-through;
161
- }
162
-
163
- /* scrivito_editing_marker edit colors */
164
- .scrivito_editing_marker {background: #439439; background:rgba(67, 148, 57, .5);}
165
- .scrivito_editing_marker:hover,
166
- .scrivito_editing_marker:active { background: #439439; background: rgba(67, 148, 57, 1); }
167
-
168
- [data-scrivito-display-mode="editing"] [data-scrivito-private-child-list-path]:hover > .scrivito_editing_marker,
169
- [data-scrivito-display-mode="editing"] [data-scrivito-widget-obj-class]:hover > .scrivito_editing_marker {
170
- background: #439439; background: rgba(67, 148, 57, 1);
171
- }
172
-
173
- /* scrivito_editing_marker edited/new/deleted colors */
174
- [data-scrivito-private-widget-modification="edited"] .scrivito_editing_marker,
175
- [data-scrivito-private-widget-modification="edited"] .scrivito_editing_marker .scrivito_editing_marker_title,
176
- [data-scrivito-field-modification="edited"] .scrivito_editing_marker,
177
- [data-scrivito-private-widget-modification="edited"][data-scrivito-private-widget-container-modification="new"] .scrivito_editing_marker,
178
- [data-scrivito-private-widget-modification="edited"][data-scrivito-private-widget-container-modification="deleted"] .scrivito_editing_marker {
179
- background: #4f749d;
180
- }
181
-
182
- [data-scrivito-private-widget-modification="new"] .scrivito_editing_marker,
183
- [data-scrivito-private-widget-modification="new"] .scrivito_editing_marker .scrivito_editing_marker_title,
184
- [data-scrivito-field-modification="new"] .scrivito_editing_marker,
185
- [data-scrivito-private-widget-modification="new"][data-scrivito-private-widget-container-modification="new"] .scrivito_editing_marker {
186
- background: #4c8c07;
187
- }
188
- [data-scrivito-private-widget-modification="deleted"] .scrivito_editing_marker,
189
- [data-scrivito-private-widget-modification="deleted"] .scrivito_editing_marker .scrivito_editing_marker_title,
190
- [data-scrivito-field-modification="deleted"] .scrivito_editing_marker,
191
- [data-scrivito-private-widget-modification="deleted"][data-scrivito-private-widget-container-modification="deleted"] .scrivito_editing_marker {
192
- background: #ff1f01;
193
- }
194
-
195
- /* scrivito_editing_marker colors for unmodified but moved widgets */
196
- :not([data-scrivito-private-widget-modification])[data-scrivito-private-widget-container-modification="deleted"] .scrivito_editing_marker,
197
- :not([data-scrivito-private-widget-modification])[data-scrivito-private-widget-container-modification="deleted"] .scrivito_editing_marker .scrivito_editing_marker_title {
198
- background: #808080;
199
- }
@@ -1,9 +0,0 @@
1
- Description:
2
- Creates a new CMS migration.
3
-
4
- Example:
5
- rails generate cms:migration CreateExample
6
- rails generate cms:migration create_example
7
-
8
- This will create:
9
- cms/migrate/[timestamp]_create_example.rb
@@ -1,2 +0,0 @@
1
- This is the thumbnail view of the <%= class_name %>.
2
- Edit "app/views/<%= file_name %>/thumbnail.html.erb" to change its appearance.
@@ -1,48 +0,0 @@
1
- module Scrivito
2
-
3
- # TODO Caching:
4
- # unlimited urls: ewig
5
- # limited urls: zeitlimit - x (x fuer mindestverwendbarkeitszeit)
6
- class Blob
7
-
8
- class << self
9
-
10
- def configure(config)
11
- end
12
-
13
- def find(id)
14
- new(id)
15
- end
16
-
17
- end
18
-
19
- attr_reader :id
20
-
21
- def initialize(id)
22
- @id = id
23
- end
24
-
25
- def url
26
- raw_data["url"]
27
- end
28
-
29
- def content_type
30
- meta_data[:content_type]
31
- end
32
-
33
- def length
34
- meta_data[:content_length].to_i
35
- end
36
-
37
- private
38
-
39
- def raw_data
40
- @raw_data ||= CmsBackend.instance.find_blob_data_by_id(id)
41
- end
42
-
43
- def meta_data
44
- @meta_data ||= RestClient.head(raw_data["meta_url"]).headers
45
- end
46
- end
47
-
48
- end
@@ -1,30 +0,0 @@
1
- module Scrivito
2
-
3
- # @api public
4
- module CmsAccessible
5
-
6
- protected
7
-
8
- # Filter method to load a CMS object.
9
- #
10
- # To require the loading for all actions, use this in your controllers:
11
- # before_filter :load_object
12
- def load_object
13
- CmsEnv.new(request.env).load
14
- loaded_obj = request.env[CmsEnv::OBJ_ENV_KEY]
15
- raise loaded_obj if loaded_obj.is_a?(StandardError)
16
- @obj = loaded_obj
17
- end
18
-
19
- # Deliver a binary @obj by redirecting to its `body_data_url`.
20
- # Will respond with 404 if the @obj has no blob.
21
- # @api public
22
- def deliver_file
23
- if @obj.body_data_url
24
- redirect_to enforce_protocol_from_request(@obj.body_data_url)
25
- else
26
- render text: "Empty Blob", status: 404
27
- end
28
- end
29
- end
30
- end
@@ -1,18 +0,0 @@
1
- module Scrivito
2
- class CmsRestApi
3
- module BlobUploader
4
- class << self
5
- def upload_file(file)
6
- upload_permission = CmsRestApi.get('blobs/upload_permission')
7
-
8
- fields = upload_permission['fields'].merge({file: file})
9
-
10
- # Net/HTTP does not support multipart forms
11
- RestClient.post(upload_permission['url'], fields)
12
-
13
- upload_permission['blob']
14
- end
15
- end
16
- end
17
- end
18
- end