ruby_cms 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/app/controllers/ruby_cms/admin/visual_editor_controller.rb +16 -2
- data/lib/ruby_cms/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 83d1d3f4aadd9f1f8ad953f3babc9fbb104c2238ba411d0d24bf97bba3574684
|
|
4
|
+
data.tar.gz: 8bef2b9e212a3da28f8af8f387c648c57a5e76a1a50a29b757e49a54b2fe0e62
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 957a2871489bcdc0680f029b43dc7696ec3109bfff994227771c9ff29cf069f529e9d9c99fed37ca1e31eb13acc049dfe2d9c72fb2617f2ac9d755e2928accf0
|
|
7
|
+
data.tar.gz: 800a6f5e760a8d5a5a99e86d5e9d6f9ad2015664c79c2068178f10d5b6c1b59d7d88a5d40230c33577d9d44d950e9a86cfd9f124ebbd166d13a2e06eada03754
|
data/CHANGELOG.md
CHANGED
|
@@ -135,12 +135,22 @@ module RubyCms
|
|
|
135
135
|
|
|
136
136
|
def assign_content_block_content(block)
|
|
137
137
|
if rich_text_content?
|
|
138
|
-
block
|
|
138
|
+
assign_rich_text_content(block)
|
|
139
139
|
elsif params[:content].present?
|
|
140
140
|
block.content = params[:content]
|
|
141
141
|
end
|
|
142
142
|
end
|
|
143
143
|
|
|
144
|
+
def assign_rich_text_content(block)
|
|
145
|
+
rich_content = params[:rich_content].to_s
|
|
146
|
+
|
|
147
|
+
if block.respond_to?(:rich_content=)
|
|
148
|
+
block.rich_content = rich_content
|
|
149
|
+
else
|
|
150
|
+
block.content = ActionController::Base.helpers.strip_tags(rich_content)
|
|
151
|
+
end
|
|
152
|
+
end
|
|
153
|
+
|
|
144
154
|
def rich_text_content?
|
|
145
155
|
params[:content_type] == "rich_text" && params[:rich_content].present?
|
|
146
156
|
end
|
|
@@ -158,7 +168,11 @@ module RubyCms
|
|
|
158
168
|
end
|
|
159
169
|
|
|
160
170
|
def content_block_content_text(block)
|
|
161
|
-
block.content_type == "rich_text"
|
|
171
|
+
return block.content unless block.content_type == "rich_text"
|
|
172
|
+
return block.content unless block.respond_to?(:rich_content)
|
|
173
|
+
return block.content unless block.rich_content.respond_to?(:to_plain_text)
|
|
174
|
+
|
|
175
|
+
block.rich_content.to_plain_text
|
|
162
176
|
end
|
|
163
177
|
|
|
164
178
|
# Return body HTML only (no layout/comments) so preview and Trix get clean HTML.
|
data/lib/ruby_cms/version.rb
CHANGED