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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 43d3ed99415f85ffd9afa16903b7ac82b97df955ee008283aa5df096ed34b97d
4
- data.tar.gz: 7eb82efe92b26342c04e5c0c9c997a8c8a9ad0103bed7d36e46bd0d6dc047c1b
3
+ metadata.gz: 5c74a82339636ff4b7bd53964c331b5c4bc4fe0ea96f16bf87b075c070e4642e
4
+ data.tar.gz: cd7bf3c56dd65ae60d795fa7958a9521935fbd5c78315302c683d55d27445d58
5
5
  SHA512:
6
- metadata.gz: c6bb9987c2857d569ceb7d76775ad1b2eee1a7e221dc07d915b22e6c1cb2250d2e6ee7bc8c8091794796a16f411bbea463f1316fbf920ef7a907463eb6193572
7
- data.tar.gz: 7161801e6f6195cbe0b200c7aa450587595eb7a7481408ce71ca19854ecad8a7cf7136f3b979805bcdf23c18ea9489dc26442db44641d02eb0cfde631dba9631
6
+ metadata.gz: bcd4b8d59e6c0aae9c1a95fdfe69d5f3e8ac6cb8de8285e15180b1bcde9f710be796cafe4a8c6a6e39d25444b385015fc41c0f2a12923fba9a69d34c3efe4327
7
+ data.tar.gz: 5caf86ac03aaa93578f0408d4f63f1b785bd31d4c336abb80cf31eb99f126e72a1046fb7a6917ef3bb01b55dbca9da1bc77f22e0bbcf3107bdbe430a866dc020
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Lato Blog
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/lato_blog.svg)](https://badge.fury.io/rb/lato_blog)
4
+
3
5
  Lato is a Rails engine used to develop modular admin panels. This is the module used to manage a blog.
4
6
 
5
7
  ## Installation
@@ -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)
@@ -15,5 +15,7 @@ module LatoBlog
15
15
 
16
16
  def relay; end
17
17
 
18
+ def textarea; end
19
+
18
20
  end
19
21
  end
@@ -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
 
@@ -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(
@@ -1,3 +1,3 @@
1
1
  module LatoBlog
2
- VERSION = '2.2.1'
2
+ VERSION = '2.2.2'
3
3
  end
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.1
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-03-08 00:00:00.000000000 Z
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