lato_blog 2.1 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/lato_blog/application.js +3 -3
  3. data/app/assets/javascripts/lato_blog/{initializers/Fields.js → modules/BlogFields.js} +5 -5
  4. data/app/assets/javascripts/lato_blog/{initializers/Posts.js → modules/BlogPosts.js} +19 -11
  5. data/app/assets/stylesheets/lato_blog/fields/_fields.scss +1 -0
  6. data/app/assets/stylesheets/lato_blog/fields/_relay.scss +1 -1
  7. data/app/assets/stylesheets/lato_blog/fields/_youtube.scss +3 -0
  8. data/app/assets/stylesheets/lato_blog/pages/_posts.scss +6 -7
  9. data/app/controllers/lato_blog/back/posts_controller.rb +22 -0
  10. data/app/helpers/lato_blog/fields_helper.rb +14 -0
  11. data/app/models/lato_blog/post/serializer_helpers.rb +1 -0
  12. data/app/models/lato_blog/post_field/serializer_helpers.rb +36 -0
  13. data/app/views/lato_blog/back/post_fields/create_relay_field.js.erb +5 -4
  14. data/app/views/lato_blog/back/post_fields/destroy_relay_field.js.erb +5 -4
  15. data/app/views/lato_blog/back/post_fields/fields/_gallery.html.erb +18 -0
  16. data/app/views/lato_blog/back/post_fields/fields/_youtube.html.erb +18 -0
  17. data/app/views/lato_blog/back/posts/edit.html.erb +3 -1
  18. data/app/views/lato_blog/back/posts/index.html.erb +1 -1
  19. data/app/views/lato_blog/back/posts/shared/edit/_edit_categories.html.erb +1 -1
  20. data/app/views/lato_blog/back/posts/shared/edit/_edit_pubblication_datetime.html.erb +1 -1
  21. data/app/views/lato_blog/back/posts/shared/edit/_edit_seo_description.html.erb +24 -0
  22. data/app/views/lato_blog/back/posts/shared/edit/{_edit_status_switch.html.erb → _edit_status.html.erb} +2 -2
  23. data/app/views/lato_blog/back/posts/shared/index/{_index_status_switch.html.erb → _index_switch_status.html.erb} +0 -2
  24. data/config/configs.yml +6 -0
  25. data/config/languages/default.yml +3 -3
  26. data/config/languages/it.yml +3 -3
  27. data/config/routes/back.rb +1 -0
  28. data/db/migrate/20170804131140_add_seo_description_to_lato_blog_posts.rb +5 -0
  29. data/lib/lato_blog/interface.rb +3 -0
  30. data/lib/lato_blog/interfaces/fields.rb +25 -0
  31. data/lib/lato_blog/interfaces/queries.rb +10 -0
  32. data/lib/lato_blog/version.rb +1 -1
  33. metadata +13 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d458228c2534ab38377611c32c79dc316e6a2af5
4
- data.tar.gz: 0f16e5fdecc84317b3479ddf6e3e8ec1a00292fb
3
+ metadata.gz: 5a60707402fba5e85043a6cf3be5bbab59d225a8
4
+ data.tar.gz: a2e8fe0d368e2f37e5ae6865e2da1b68842dad13
5
5
  SHA512:
6
- metadata.gz: 15c718bacb4756e2e76a42fb5fc4e21781474d952945728dbc996400d85bb9a28da580a4d3e4ed3eb51b565248566f3abc51d623d3eccce5727051e04f29e14d
7
- data.tar.gz: 356c7f952826ee180415c8a688924d7ac0244fa6acd7a9316837f4608af594cdc03fb830af6dd0d251d049db4704d2b1c8254a0d200a4571d07dca2c378a84d0
6
+ metadata.gz: 813fe501d514cdc1454b0b0f389c3dd7774f8cd9e30923cca9693d99e2a18d23a38a95b4adb7514562ae6335bd61c09a0b11ad16f574f1bd6b1733d9bc45524c
7
+ data.tar.gz: 91f440dfdc24434b462df9add71f9e4e38accd784f4ffea96b3d1b4f2de5e695632963d735cf33da608ed743675b4510349351e058cae81d6a71659018616d62
@@ -10,10 +10,10 @@
10
10
  // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11
11
  // about supported directives.
12
12
  //
13
- //= require_tree ./initializers
13
+ //= require_tree ./modules
14
14
 
15
15
 
16
16
  $(window).load(function () {
17
- BlogFieldsInitializer.init()
18
- BlogPostsInitializer.init()
17
+ BlogFields.init()
18
+ BlogPosts.init()
19
19
  })
@@ -1,6 +1,6 @@
1
- var BlogFieldsInitializer = (function () {
1
+ var BlogFields = (function () {
2
2
 
3
- function initializeRelayNewButton () {
3
+ function _initializeRelayNewButton () {
4
4
  $('.fields-relay__menu-add').click(function (e) {
5
5
  // save current status with form submit
6
6
  _relaySubmitUpdateBeforeAction()
@@ -12,7 +12,7 @@ var BlogFieldsInitializer = (function () {
12
12
  })
13
13
  }
14
14
 
15
- function initializeRelayDestroy () {
15
+ function _initializeRelayDestroy () {
16
16
  $('.fields-relay__sortableblock .js-sortable__main-container').each(function (i, el) {
17
17
  $(el).find('.js-sortable__element').each(function (index, element) {
18
18
  var fieldId = $(element).find('.fields__container').data('field-id')
@@ -45,8 +45,8 @@ var BlogFieldsInitializer = (function () {
45
45
  // Init:
46
46
 
47
47
  function init () {
48
- initializeRelayNewButton()
49
- initializeRelayDestroy()
48
+ _initializeRelayNewButton()
49
+ _initializeRelayDestroy()
50
50
  }
51
51
 
52
52
  return {
@@ -1,9 +1,9 @@
1
- var BlogPostsInitializer = (function () {
1
+ var BlogPosts = (function () {
2
2
 
3
- function initializeAutosave () {
3
+ function _initializeAutosave () {
4
4
  var formInput = $('.posts__form-autosave')
5
5
 
6
- if (formInput) {
6
+ if (formInput.length > 0) {
7
7
  var form = $(formInput).parent()
8
8
  setInterval(function () {
9
9
  if ($(formInput).val('false')) {
@@ -17,34 +17,42 @@ var BlogPostsInitializer = (function () {
17
17
  }
18
18
  }
19
19
 
20
- function initializeCategoriesAutosave () {
20
+ function _initializeCategoriesAutosave () {
21
21
  var form = $('.posts__edit-categories').find('form')
22
22
  $(form).find('input').change(function () {
23
23
  $(form).submit()
24
24
  })
25
25
  }
26
26
 
27
- function initializePublicationDatetimeAutosave () {
27
+ function _initializePublicationDatetimeAutosave () {
28
28
  var form = $('.posts__edit-publication-datetime').find('form')
29
29
  $(form).find('input').change(function () {
30
30
  $(form).submit()
31
31
  })
32
32
  }
33
33
 
34
- function initializeStatusSwitchAutosave () {
35
- var form = $('.posts__edit-status-switch').find('form')
34
+ function _initializeStatusSwitchAutosave () {
35
+ var form = $('.posts__edit-status').find('form')
36
36
  $(form).find('select').change(function () {
37
37
  $(form).submit()
38
38
  })
39
39
  }
40
40
 
41
+ function _initializeSeoDescriptionAutosave () {
42
+ var form = $('.posts__edit-seo-description').find('form')
43
+ $(form).find('textarea').change(function () {
44
+ $(form).submit()
45
+ })
46
+ }
47
+
41
48
  // Init:
42
49
 
43
50
  function init () {
44
- initializeAutosave()
45
- initializeCategoriesAutosave()
46
- initializePublicationDatetimeAutosave()
47
- initializeStatusSwitchAutosave()
51
+ _initializeAutosave()
52
+ _initializeCategoriesAutosave()
53
+ _initializePublicationDatetimeAutosave()
54
+ _initializeStatusSwitchAutosave()
55
+ _initializeSeoDescriptionAutosave()
48
56
  }
49
57
 
50
58
  return {
@@ -4,5 +4,6 @@
4
4
  @import "editor";
5
5
  @import "geolocalization";
6
6
  @import "image";
7
+ @import "youtube";
7
8
  @import "composed";
8
9
  @import "relay";
@@ -6,7 +6,7 @@
6
6
  @include clearfix;
7
7
 
8
8
  // fix images height
9
- .elements-preview__container {
9
+ .fields-image .elements-preview__container {
10
10
  padding-bottom: 40%;
11
11
  }
12
12
  }
@@ -0,0 +1,3 @@
1
+ .fields-youtube {
2
+
3
+ }
@@ -1,10 +1,3 @@
1
- .posts__edit-status-switch, .posts__edit-publication-datetime {
2
-
3
- .elements-button {
4
- margin-top: 0;
5
- }
6
- }
7
-
8
1
  .posts__edit-categories {
9
2
  .inputs-checkbox {
10
3
  margin: 0;
@@ -18,6 +11,12 @@
18
11
  }
19
12
  }
20
13
 
14
+ .posts__edit-seo-description {
15
+ textarea {
16
+ height: 100px !important;
17
+ }
18
+ }
19
+
21
20
  .posts__index {
22
21
  .elements-table__row td:first-child {
23
22
  width: 60%;
@@ -139,6 +139,14 @@ module LatoBlog
139
139
  end
140
140
  end
141
141
 
142
+ # This function updates the seo description of a post.
143
+ def update_seo_description
144
+ @post = LatoBlog::Post.find_by(id: params[:id])
145
+ return unless check_post_presence
146
+
147
+ @post.update(seo_description: params[:seo_description])
148
+ end
149
+
142
150
  # This function destroyes a post.
143
151
  def destroy
144
152
  @post = LatoBlog::Post.find_by(id: params[:id])
@@ -225,6 +233,10 @@ module LatoBlog
225
233
  update_field_geolocalization(field, value)
226
234
  when 'image'
227
235
  update_field_image(field, value)
236
+ when 'gallery'
237
+ update_field_gallery(field, value)
238
+ when 'youtube'
239
+ update_field_youtube(field, value)
228
240
  when 'composed'
229
241
  update_field_composed(field, value)
230
242
  when 'relay'
@@ -265,6 +277,16 @@ module LatoBlog
265
277
  field.update(value: value)
266
278
  end
267
279
 
280
+ # Gallery.
281
+ def update_field_gallery(field, value)
282
+ field.update(value: value)
283
+ end
284
+
285
+ # Youtube.
286
+ def update_field_youtube(field, value)
287
+ field.update(value: value)
288
+ end
289
+
268
290
  # Composed.
269
291
  def update_field_composed(field, value)
270
292
  # find composed children
@@ -24,6 +24,10 @@ module LatoBlog
24
24
  render_post_field_geolocalization(post_field, key)
25
25
  when 'image'
26
26
  render_post_field_image(post_field, key)
27
+ when 'gallery'
28
+ render_post_field_gallery(post_field, key)
29
+ when 'youtube'
30
+ render_post_field_youtube(post_field, key)
27
31
  when 'composed'
28
32
  render_post_field_composed(post_field, key)
29
33
  when 'relay'
@@ -67,6 +71,16 @@ module LatoBlog
67
71
  render 'lato_blog/back/post_fields/fields/image', post_field: post_field, key: key
68
72
  end
69
73
 
74
+ # Gallery.
75
+ def render_post_field_gallery(post_field, key)
76
+ render 'lato_blog/back/post_fields/fields/gallery', post_field: post_field, key: key
77
+ end
78
+
79
+ # Youtube.
80
+ def render_post_field_youtube(post_field, key)
81
+ render 'lato_blog/back/post_fields/fields/youtube', post_field: post_field, key: key
82
+ end
83
+
70
84
  # Composed.
71
85
  def render_post_field_composed(post_field, key)
72
86
  render 'lato_blog/back/post_fields/fields/composed', post_field: post_field, key: key
@@ -11,6 +11,7 @@ module LatoBlog
11
11
  serialized[:subtitle] = subtitle
12
12
  serialized[:excerpt] = excerpt
13
13
  serialized[:content] = content
14
+ serialized[:seo_description] = seo_description
14
15
  serialized[:meta_language] = meta_language
15
16
  serialized[:meta_permalink] = meta_permalink
16
17
  serialized[:meta_status] = meta_status
@@ -32,6 +32,10 @@ module LatoBlog
32
32
  serialize_field_value_geolocalization
33
33
  when 'image'
34
34
  serialize_field_value_image
35
+ when 'gallery'
36
+ serialize_field_value_gallery
37
+ when 'youtube'
38
+ serialize_field_value_youtube
35
39
  when 'composed'
36
40
  serialize_field_value_composed
37
41
  when 'relay'
@@ -105,6 +109,38 @@ module LatoBlog
105
109
  serialized
106
110
  end
107
111
 
112
+ # Gallery.
113
+ def serialize_field_value_gallery
114
+ media_ids = value.split(',')
115
+ medias = LatoMedia::Media.where(id: media_ids)
116
+ return unless medias
117
+
118
+ # add basic info
119
+ serialized = []
120
+
121
+ medias.each do |media|
122
+ serialized_media = {}
123
+ serialized_media[:id] = media.id
124
+ serialized_media[:title] = media.title
125
+ serialized_media[:url] = media.attachment.url
126
+
127
+ # add image info
128
+ serialized_media[:thumb_url] = (media.image? ? media.attachment.url(:thumb) : nil)
129
+ serialized_media[:medium_url] = (media.image? ? media.attachment.url(:medium) : nil)
130
+ serialized_media[:large_url] = (media.image? ? media.attachment.url(:large) : nil)
131
+
132
+ serialized.push(serialized_media)
133
+ end
134
+
135
+ # return serialized media
136
+ serialized
137
+ end
138
+
139
+ # Youtube.
140
+ def serialize_field_value_youtube
141
+ value
142
+ end
143
+
108
144
  # Composed.
109
145
  def serialize_field_value_composed
110
146
  serialized = {}
@@ -6,9 +6,10 @@
6
6
 
7
7
  $('.fields-relay[data-field-id="<%= @post_field.id %>"]').replaceWith('<%=j render_post_field(@post_field) %>')
8
8
 
9
- BlogFieldsInitializer.init()
10
- SortableManager.init()
11
- InputsInitializer.init()
12
- MediaInputsInitializer.init()
9
+ // TODO: Aggiornare solo i field interni al ripetitore
10
+ BlogFields.init()
11
+ CoreDatepicker.init()
12
+ CoreEditor.init()
13
+ CoreMediapicker.init()
13
14
 
14
15
  <% end %>
@@ -6,9 +6,10 @@
6
6
 
7
7
  $('.fields-relay[data-field-id="<%= @post_field.id %>"]').replaceWith('<%=j render_post_field(@post_field) %>')
8
8
 
9
- BlogFieldsInitializer.init()
10
- SortableManager.init()
11
- InputsInitializer.init()
12
- MediaInputsInitializer.init()
9
+ // TODO: Aggiornare solo i field interni al ripetitore
10
+ BlogFields.init()
11
+ CoreDatepicker.init()
12
+ CoreEditor.init()
13
+ CoreMediapicker.init()
13
14
 
14
15
  <% end %>
@@ -0,0 +1,18 @@
1
+ <%
2
+ row = cell(:elements, :row).new
3
+ %>
4
+
5
+ <div
6
+ class="fields__container fields-gallery <%= 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
+
10
+ <%=raw row.open %>
11
+ <%=raw cell('LatoMedia', :inputs, :gallery).new(
12
+ name: key,
13
+ value: post_field.value,
14
+ label: post_field.meta_datas[:label]
15
+ ) %>
16
+ <%=raw row.close %>
17
+
18
+ </div>
@@ -0,0 +1,18 @@
1
+ <%
2
+ row = cell(:elements, :row).new
3
+ %>
4
+
5
+ <div
6
+ class="fields__container fields-youtube <%= 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
+
10
+ <%=raw row.open %>
11
+ <%=raw cell(:inputs, :youtube).new(
12
+ name: key,
13
+ value: post_field.value,
14
+ label: post_field.meta_datas[:label]
15
+ ) %>
16
+ <%=raw row.close %>
17
+
18
+ </div>
@@ -33,12 +33,14 @@
33
33
 
34
34
  <%= render 'lato_blog/back/posts/shared/edit/edit_languages' %>
35
35
 
36
- <%= render 'lato_blog/back/posts/shared/edit/edit_status_switch' %>
36
+ <%= render 'lato_blog/back/posts/shared/edit/edit_status' %>
37
37
 
38
38
  <%= render 'lato_blog/back/posts/shared/edit/edit_pubblication_datetime' %>
39
39
 
40
40
  <%= render 'lato_blog/back/posts/shared/edit/edit_categories' %>
41
41
 
42
+ <%= render 'lato_blog/back/posts/shared/edit/edit_seo_description' %>
43
+
42
44
  <%=raw row.close %>
43
45
 
44
46
  <%=raw container_block_small.close %>
@@ -27,7 +27,7 @@
27
27
 
28
28
  <%= render 'lato_blog/back/posts/shared/index/index_informations', informations: @posts_informations %>
29
29
 
30
- <%= render 'lato_blog/back/posts/shared/index/index_status_switch', status: @posts_status %>
30
+ <%= render 'lato_blog/back/posts/shared/index/index_switch_status', status: @posts_status %>
31
31
 
32
32
  <%=raw row.close %>
33
33
 
@@ -7,7 +7,7 @@
7
7
 
8
8
  <%=raw block.open %>
9
9
 
10
- <%=raw cell(:elements, :title).new(label: LANGUAGES[:lato_blog][:mixed][:change_categories], size: 6) %>
10
+ <%=raw cell(:elements, :title).new(label: LANGUAGES[:lato_blog][:mixed][:categories], size: 6) %>
11
11
 
12
12
  <%=raw form.open %>
13
13
 
@@ -6,7 +6,7 @@
6
6
 
7
7
  <%=raw block.open %>
8
8
 
9
- <%=raw cell(:elements, :title).new(label: LANGUAGES[:lato_blog][:mixed][:change_publication_datetime], size: 6) %>
9
+ <%=raw cell(:elements, :title).new(label: LANGUAGES[:lato_blog][:mixed][:publication_datetime], size: 6) %>
10
10
 
11
11
  <%=raw form.open %>
12
12
 
@@ -0,0 +1,24 @@
1
+ <%
2
+ block = cell(:elements, :block).new(class: 'xs-12 sm-12 md-12 posts__edit-seo-description')
3
+ row = cell(:elements, :row).new
4
+ form = cell(:inputs, :form).new(url: lato_blog.posts_update_seo_description_path, method: :post, remote: true)
5
+ %>
6
+
7
+ <%=raw block.open %>
8
+
9
+ <%=raw cell(:elements, :title).new(label: LANGUAGES[:lato_blog][:mixed][:seo_description], size: 6) %>
10
+
11
+ <%=raw form.open %>
12
+
13
+ <input type="hidden" name="id" value="<%= @post.id %>">
14
+
15
+ <%=raw row.open %>
16
+
17
+ <%=raw cell(:inputs, :textarea).new(name: 'seo_description', value: @post.seo_description,
18
+ class: 'md-12') %>
19
+
20
+ <%=raw row.close %>
21
+
22
+ <%=raw form.close %>
23
+
24
+ <%=raw block.close %>
@@ -1,12 +1,12 @@
1
1
  <%
2
- block = cell(:elements, :block).new(class: 'xs-12 sm-12 md-12 posts__edit-status-switch')
2
+ block = cell(:elements, :block).new(class: 'xs-12 sm-12 md-12 posts__edit-status')
3
3
  row = cell(:elements, :row).new
4
4
  form = cell(:inputs, :form).new(url: lato_blog.posts_update_status_path, method: :post, remote: true)
5
5
  %>
6
6
 
7
7
  <%=raw block.open %>
8
8
 
9
- <%=raw cell(:elements, :title).new(label: LANGUAGES[:lato_blog][:mixed][:switch_status], size: 6) %>
9
+ <%=raw cell(:elements, :title).new(label: LANGUAGES[:lato_blog][:mixed][:status], size: 6) %>
10
10
 
11
11
  <%=raw form.open %>
12
12
 
@@ -4,8 +4,6 @@
4
4
 
5
5
  <%=raw block.open %>
6
6
 
7
- <%=raw cell(:elements, :title).new(label: LANGUAGES[:lato_blog][:mixed][:switch_status], size: 6) %>
8
-
9
7
  <%
10
8
  published_button = cell(:elements, :button).new(label: LANGUAGES[:lato_blog][:mixed][:published_posts],
11
9
  icon: 'thumbs-o-up', url: lato_blog.posts_path(status: 'published'))
data/config/configs.yml CHANGED
@@ -23,6 +23,9 @@ post_fields:
23
23
  image:
24
24
  type: image
25
25
  label: Image
26
+ gallery:
27
+ type: gallery
28
+ label: Gallery
26
29
  editor:
27
30
  type: editor
28
31
  label: Editor
@@ -32,6 +35,9 @@ post_fields:
32
35
  datetime:
33
36
  type: datetime
34
37
  label: Datetime
38
+ youtube:
39
+ type: youtube
40
+ label: Youtube
35
41
  composed:
36
42
  type: composed
37
43
  label: Composed
@@ -51,7 +51,6 @@ mixed:
51
51
  published_posts: Public articles
52
52
  drafted_posts: Drafted articles
53
53
  deleted_posts: Deleted articles
54
- switch_status: Switch status
55
54
  update: Update
56
55
  save: Save
57
56
  create: Create
@@ -70,9 +69,9 @@ mixed:
70
69
  update_date: Date of update
71
70
  superuser_creator: Superuser creator
72
71
  status: Status
73
- change_publication_datetime: Change publication date
72
+ publication_datetime: Publication date
74
73
  child_tree: Child tree
75
- change_categories: Change categories
74
+ categories: Categories
76
75
  number_of_posts: Number of posts
77
76
  key: Key
78
77
  typology: Typology
@@ -80,6 +79,7 @@ mixed:
80
79
  post_fields_warning: 'WARNING: Deleting fields could lead to the complete loss of some item data!'
81
80
  post_id: Post id
82
81
  post_field_id: Post field id
82
+ seo_description: Seo description
83
83
 
84
84
  posts_status:
85
85
  published: Published
@@ -51,7 +51,6 @@ mixed:
51
51
  published_posts: Articoli pubblici
52
52
  drafted_posts: Articoli in bozza
53
53
  deleted_posts: Articoli nel cestino
54
- switch_status: Aggiorna stato
55
54
  update: Aggiorna
56
55
  save: Salva
57
56
  create: Crea
@@ -70,9 +69,9 @@ mixed:
70
69
  update_date: Data di aggioranmento
71
70
  superuser_creator: Creato da
72
71
  status: Stato
73
- change_publication_datetime: Aggiorna data di pubblicazione
72
+ publication_datetime: Data di pubblicazione
74
73
  child_tree: Albero dei figli
75
- change_categories: Aggiorna categorie
74
+ categories: Categorie
76
75
  number_of_posts: Numero di articoli
77
76
  key: Chiave
78
77
  typology: Tipologia
@@ -80,6 +79,7 @@ mixed:
80
79
  post_fields_warning: 'ATTENZIONE: L'eliminazione dei campi può causare la perdita definitiva di alcuni dati degli articoli!'
81
80
  post_id: Id articolo
82
81
  post_field_id: Id campo
82
+ seo_description: Descrizione seo
83
83
 
84
84
  posts_status:
85
85
  published: Pubblico
@@ -6,6 +6,7 @@ resources :posts, module: 'back'
6
6
  post 'posts_extra/update_status', to: 'back/posts#update_status', as: 'posts_update_status'
7
7
  post 'posts_extra/update_publication_datetime', to: 'back/posts#update_publication_datetime', as: 'posts_update_publication_datetime'
8
8
  post 'posts_extra/update_categories', to: 'back/posts#update_categories', as: 'posts_update_categories'
9
+ post 'posts_extra/update_seo_description', to: 'back/posts#update_seo_description', as: 'posts_update_seo_description'
9
10
  get 'posts_extra/destroy_all_deleted', to: 'back/posts#destroy_all_deleted', as: 'posts_destroy_all_deleted'
10
11
 
11
12
  # post fields
@@ -0,0 +1,5 @@
1
+ class AddSeoDescriptionToLatoBlogPosts < ActiveRecord::Migration[5.1]
2
+ def change
3
+ add_column :lato_blog_posts, :seo_description, :text
4
+ end
5
+ end
@@ -13,5 +13,8 @@ module LatoBlog
13
13
  require 'lato_blog/interfaces/fields'
14
14
  include LatoBlog::Interface::Fields
15
15
 
16
+ require 'lato_blog/interfaces/queries'
17
+ include LatoBlog::Interface::Queries
18
+
16
19
  end
17
20
  end
@@ -90,6 +90,10 @@ module LatoBlog
90
90
  update_db_post_field_geolocalization(db_post_field, content, post_field_parent)
91
91
  when 'image'
92
92
  update_db_post_field_image(db_post_field, content, post_field_parent)
93
+ when 'gallery'
94
+ update_db_post_field_gallery(db_post_field, content, post_field_parent)
95
+ when 'youtube'
96
+ update_db_post_field_youtube(db_post_field, content, post_field_parent)
93
97
  when 'composed'
94
98
  update_db_post_field_composed(db_post_field, content, post_field_parent)
95
99
  when 'relay'
@@ -152,6 +156,27 @@ module LatoBlog
152
156
  )
153
157
  end
154
158
 
159
+ # Gallery.
160
+ def update_db_post_field_gallery(db_post_field, content, post_field_parent = nil)
161
+ db_post_field.update(
162
+ meta_datas: {
163
+ label: content[:label] && !content[:label].blank? ? content[:label] : db_post_field.key,
164
+ class: content[:class] && !content[:class].blank? ? content[:class] : nil
165
+ }
166
+ )
167
+ end
168
+
169
+ # Youtube.
170
+ def update_db_post_field_youtube(db_post_field, content, post_field_parent = nil)
171
+ db_post_field.update(
172
+ meta_datas: {
173
+ label: content[:label] && !content[:label].blank? ? content[:label] : db_post_field.key,
174
+ class: content[:class] && !content[:class].blank? ? content[:class] : nil
175
+ }
176
+ )
177
+ end
178
+
179
+
155
180
  # Composed.
156
181
  def update_db_post_field_composed(db_post_field, content, post_field_parent = nil)
157
182
  # update the main field
@@ -0,0 +1,10 @@
1
+ module LatoBlog
2
+
3
+ # This module contains a list of helpers used on controllers to get posts.
4
+ module Interface::Queries
5
+
6
+ # TODO
7
+
8
+ end
9
+
10
+ end
@@ -1,3 +1,3 @@
1
1
  module LatoBlog
2
- VERSION = '2.1'
2
+ VERSION = '2.1.1'
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.1'
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ideonetwork
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-03 00:00:00.000000000 Z
11
+ date: 2017-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -78,8 +78,8 @@ files:
78
78
  - Rakefile
79
79
  - app/assets/config/lato_blog_manifest.js
80
80
  - app/assets/javascripts/lato_blog/application.js
81
- - app/assets/javascripts/lato_blog/initializers/Fields.js
82
- - app/assets/javascripts/lato_blog/initializers/Posts.js
81
+ - app/assets/javascripts/lato_blog/modules/BlogFields.js
82
+ - app/assets/javascripts/lato_blog/modules/BlogPosts.js
83
83
  - app/assets/stylesheets/lato_blog/_helpers.scss
84
84
  - app/assets/stylesheets/lato_blog/application.scss
85
85
  - app/assets/stylesheets/lato_blog/fields/_composed.scss
@@ -91,6 +91,7 @@ files:
91
91
  - app/assets/stylesheets/lato_blog/fields/_image.scss
92
92
  - app/assets/stylesheets/lato_blog/fields/_relay.scss
93
93
  - app/assets/stylesheets/lato_blog/fields/_text.scss
94
+ - app/assets/stylesheets/lato_blog/fields/_youtube.scss
94
95
  - app/assets/stylesheets/lato_blog/pages/_categories.scss
95
96
  - app/assets/stylesheets/lato_blog/pages/_pages.scss
96
97
  - app/assets/stylesheets/lato_blog/pages/_posts.scss
@@ -140,10 +141,12 @@ files:
140
141
  - app/views/lato_blog/back/post_fields/fields/_composed.html.erb
141
142
  - app/views/lato_blog/back/post_fields/fields/_datetime.html.erb
142
143
  - app/views/lato_blog/back/post_fields/fields/_editor.html.erb
144
+ - app/views/lato_blog/back/post_fields/fields/_gallery.html.erb
143
145
  - app/views/lato_blog/back/post_fields/fields/_geolocalization.html.erb
144
146
  - app/views/lato_blog/back/post_fields/fields/_image.html.erb
145
147
  - app/views/lato_blog/back/post_fields/fields/_relay.html.erb
146
148
  - app/views/lato_blog/back/post_fields/fields/_text.html.erb
149
+ - app/views/lato_blog/back/post_fields/fields/_youtube.html.erb
147
150
  - app/views/lato_blog/back/post_fields/index.html.erb
148
151
  - app/views/lato_blog/back/posts/edit.html.erb
149
152
  - app/views/lato_blog/back/posts/index.html.erb
@@ -154,10 +157,11 @@ files:
154
157
  - app/views/lato_blog/back/posts/shared/edit/_edit_informations.html.erb
155
158
  - app/views/lato_blog/back/posts/shared/edit/_edit_languages.html.erb
156
159
  - app/views/lato_blog/back/posts/shared/edit/_edit_pubblication_datetime.html.erb
157
- - app/views/lato_blog/back/posts/shared/edit/_edit_status_switch.html.erb
160
+ - app/views/lato_blog/back/posts/shared/edit/_edit_seo_description.html.erb
161
+ - app/views/lato_blog/back/posts/shared/edit/_edit_status.html.erb
158
162
  - app/views/lato_blog/back/posts/shared/index/_index.html.erb
159
163
  - app/views/lato_blog/back/posts/shared/index/_index_informations.html.erb
160
- - app/views/lato_blog/back/posts/shared/index/_index_status_switch.html.erb
164
+ - app/views/lato_blog/back/posts/shared/index/_index_switch_status.html.erb
161
165
  - app/views/lato_blog/back/posts/shared/new/_new_informations.html.erb
162
166
  - app/views/lato_blog/doc/doc/index.html.erb
163
167
  - app/views/lato_blog/doc/fields/composed.html.erb
@@ -187,6 +191,7 @@ files:
187
191
  - db/migrate/20170516063320_create_lato_blog_category_parents.rb
188
192
  - db/migrate/20170516063330_create_lato_blog_category_posts.rb
189
193
  - db/migrate/20170516063330_create_lato_blog_post_fields.rb
194
+ - db/migrate/20170804131140_add_seo_description_to_lato_blog_posts.rb
190
195
  - lib/lato_blog.rb
191
196
  - lib/lato_blog/engine.rb
192
197
  - lib/lato_blog/interface.rb
@@ -194,9 +199,10 @@ files:
194
199
  - lib/lato_blog/interfaces/fields.rb
195
200
  - lib/lato_blog/interfaces/languages.rb
196
201
  - lib/lato_blog/interfaces/posts.rb
202
+ - lib/lato_blog/interfaces/queries.rb
197
203
  - lib/lato_blog/version.rb
198
204
  - lib/tasks/lato_blog_tasks.rake
199
- homepage: http://naturaldesign.cc/
205
+ homepage: http://ideonetwork.it/
200
206
  licenses:
201
207
  - MIT
202
208
  metadata: {}