lato_blog 2.2.1 → 2.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/app/controllers/lato_blog/back/posts_controller.rb +7 -0
- data/app/controllers/lato_blog/doc/fields_controller.rb +2 -0
- data/app/helpers/lato_blog/fields_helper.rb +8 -0
- data/app/models/lato_blog/post_field/serializer_helpers.rb +7 -0
- data/app/views/lato_blog/back/post_fields/fields/_textarea.html.erb +17 -0
- data/app/views/lato_blog/doc/doc/index.html.erb +1 -0
- data/app/views/lato_blog/doc/fields/textarea.html.erb +0 -0
- data/config/routes/doc.rb +1 -0
- data/lib/lato_blog/interfaces/fields.rb +12 -0
- data/lib/lato_blog/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c74a82339636ff4b7bd53964c331b5c4bc4fe0ea96f16bf87b075c070e4642e
|
4
|
+
data.tar.gz: cd7bf3c56dd65ae60d795fa7958a9521935fbd5c78315302c683d55d27445d58
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bcd4b8d59e6c0aae9c1a95fdfe69d5f3e8ac6cb8de8285e15180b1bcde9f710be796cafe4a8c6a6e39d25444b385015fc41c0f2a12923fba9a69d34c3efe4327
|
7
|
+
data.tar.gz: 5caf86ac03aaa93578f0408d4f63f1b785bd31d4c336abb80cf31eb99f126e72a1046fb7a6917ef3bb01b55dbca9da1bc77f22e0bbcf3107bdbe430a866dc020
|
data/README.md
CHANGED
@@ -250,6 +250,8 @@ module LatoBlog
|
|
250
250
|
case field.typology
|
251
251
|
when 'text'
|
252
252
|
update_field_text(field, value)
|
253
|
+
when 'textarea'
|
254
|
+
update_field_textarea(field, value)
|
253
255
|
when 'datetime'
|
254
256
|
update_field_datetime(field, value)
|
255
257
|
when 'editor'
|
@@ -277,6 +279,11 @@ module LatoBlog
|
|
277
279
|
field.update(value: value)
|
278
280
|
end
|
279
281
|
|
282
|
+
# Textarea.
|
283
|
+
def update_field_textarea(field, value)
|
284
|
+
field.update(value: value)
|
285
|
+
end
|
286
|
+
|
280
287
|
# Datetime.
|
281
288
|
def update_field_datetime(field, value)
|
282
289
|
field.update(value: value)
|
@@ -16,6 +16,8 @@ module LatoBlog
|
|
16
16
|
case post_field.typology
|
17
17
|
when 'text'
|
18
18
|
render_post_field_text(post_field, key)
|
19
|
+
when 'textarea'
|
20
|
+
render_post_field_textarea(post_field, key)
|
19
21
|
when 'datetime'
|
20
22
|
render_post_field_datetime(post_field, key)
|
21
23
|
when 'editor'
|
@@ -43,6 +45,12 @@ module LatoBlog
|
|
43
45
|
render 'lato_blog/back/post_fields/fields/text', post_field: post_field, key: key
|
44
46
|
end
|
45
47
|
|
48
|
+
# Textarea.
|
49
|
+
def render_post_field_textarea(post_field, key)
|
50
|
+
render 'lato_blog/back/post_fields/fields/textarea', post_field: post_field, key: key
|
51
|
+
end
|
52
|
+
|
53
|
+
|
46
54
|
# Datetime.
|
47
55
|
def render_post_field_datetime(post_field, key)
|
48
56
|
render 'lato_blog/back/post_fields/fields/datetime', post_field: post_field, key: key
|
@@ -24,6 +24,8 @@ module LatoBlog
|
|
24
24
|
case typology
|
25
25
|
when 'text'
|
26
26
|
serialize_field_value_text
|
27
|
+
when 'textarea'
|
28
|
+
serialize_field_value_textarea
|
27
29
|
when 'datetime'
|
28
30
|
serialize_field_value_datetime
|
29
31
|
when 'editor'
|
@@ -51,6 +53,11 @@ module LatoBlog
|
|
51
53
|
value
|
52
54
|
end
|
53
55
|
|
56
|
+
# Textarea.
|
57
|
+
def serialize_field_value_textarea
|
58
|
+
value
|
59
|
+
end
|
60
|
+
|
54
61
|
# Datetime.
|
55
62
|
def serialize_field_value_datetime
|
56
63
|
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<%
|
2
|
+
row = cell(:elements, :row).new
|
3
|
+
%>
|
4
|
+
|
5
|
+
<div
|
6
|
+
class="fields__container fields-textarea <%= post_field.meta_datas[:class].blank? ? field_general_get_default_class : post_field.meta_datas[:class] %>"
|
7
|
+
data-field-id="<%= post_field.id %>"
|
8
|
+
>
|
9
|
+
<%=raw row.open %>
|
10
|
+
<%=raw cell(:inputs, :textarea).new(
|
11
|
+
name: key,
|
12
|
+
value: post_field.value,
|
13
|
+
label: post_field.meta_datas[:label]
|
14
|
+
) %>
|
15
|
+
<%=raw row.close %>
|
16
|
+
|
17
|
+
</div>
|
@@ -68,6 +68,7 @@ post_fields:
|
|
68
68
|
<%=raw cell(:elements, :button).new(label: 'Text', url: lato_blog.doc_fields_text_path) %>
|
69
69
|
<%=raw cell(:elements, :button).new(label: 'Image', url: lato_blog.doc_fields_image_path) %>
|
70
70
|
<%=raw cell(:elements, :button).new(label: 'Datetime', url: lato_blog.doc_fields_datetime_path) %>
|
71
|
+
<%=raw cell(:elements, :button).new(label: 'Textarea', url: lato_blog.doc_fields_textarea_path) %>
|
71
72
|
<%=raw cell(:elements, :button).new(label: 'Editor', url: lato_blog.doc_fields_editor_path) %>
|
72
73
|
<%=raw cell(:elements, :button).new(label: 'Geolocalization', url: lato_blog.doc_fields_geolocalization_path) %>
|
73
74
|
|
File without changes
|
data/config/routes/doc.rb
CHANGED
@@ -11,6 +11,7 @@ namespace :doc do
|
|
11
11
|
get 'fields_text', to: 'fields#text', as: 'fields_text'
|
12
12
|
get 'fields_datetime', to: 'fields#datetime', as: 'fields_datetime'
|
13
13
|
get 'fields_editor', to: 'fields#editor', as: 'fields_editor'
|
14
|
+
get 'fields_textarea', to: 'fields#textarea', as: 'fields_textarea'
|
14
15
|
get 'fields_geolocalization', to: 'fields#geolocalization', as: 'fields_geolocalization'
|
15
16
|
get 'fields_image', to: 'fields#image', as: 'fields_image'
|
16
17
|
get 'fields_composed', to: 'fields#composed', as: 'fields_composed'
|
@@ -82,6 +82,8 @@ module LatoBlog
|
|
82
82
|
case db_post_field.typology
|
83
83
|
when 'text'
|
84
84
|
update_db_post_field_text(db_post_field, content, post_field_parent)
|
85
|
+
when 'textarea'
|
86
|
+
update_db_post_field_textarea(db_post_field, content, post_field_parent)
|
85
87
|
when 'datetime'
|
86
88
|
update_db_post_field_datetime(db_post_field, content, post_field_parent)
|
87
89
|
when 'editor'
|
@@ -116,6 +118,16 @@ module LatoBlog
|
|
116
118
|
)
|
117
119
|
end
|
118
120
|
|
121
|
+
# Textarea.
|
122
|
+
def update_db_post_field_textarea(db_post_field, content, post_field_parent = nil)
|
123
|
+
db_post_field.update(
|
124
|
+
meta_datas: {
|
125
|
+
label: content[:label] && !content[:label].blank? ? content[:label] : db_post_field.key,
|
126
|
+
class: content[:class] && !content[:class].blank? ? content[:class] : nil
|
127
|
+
}
|
128
|
+
)
|
129
|
+
end
|
130
|
+
|
119
131
|
# Datetime.
|
120
132
|
def update_db_post_field_datetime(db_post_field, content, post_field_parent = nil)
|
121
133
|
db_post_field.update(
|
data/lib/lato_blog/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lato_blog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ideonetwork
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-11-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -153,6 +153,7 @@ files:
|
|
153
153
|
- app/views/lato_blog/back/post_fields/fields/_image.html.erb
|
154
154
|
- app/views/lato_blog/back/post_fields/fields/_relay.html.erb
|
155
155
|
- app/views/lato_blog/back/post_fields/fields/_text.html.erb
|
156
|
+
- app/views/lato_blog/back/post_fields/fields/_textarea.html.erb
|
156
157
|
- app/views/lato_blog/back/post_fields/fields/_youtube.html.erb
|
157
158
|
- app/views/lato_blog/back/post_fields/index.html.erb
|
158
159
|
- app/views/lato_blog/back/posts/edit.html.erb
|
@@ -186,6 +187,7 @@ files:
|
|
186
187
|
- app/views/lato_blog/doc/fields/image.html.erb
|
187
188
|
- app/views/lato_blog/doc/fields/relay.html.erb
|
188
189
|
- app/views/lato_blog/doc/fields/text.html.erb
|
190
|
+
- app/views/lato_blog/doc/fields/textarea.html.erb
|
189
191
|
- app/views/lato_blog/doc/general/api.html.erb
|
190
192
|
- app/views/lato_blog/doc/general/installation.html.erb
|
191
193
|
- app/views/lato_blog/doc/general/personalization.html.erb
|