locomotivecms 4.0.2 → 4.0.3

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: 6a3c0a1f8edd3378737a2c7c32a9269e627e50c1b12626e9b1938dd6a7d7b0a2
4
- data.tar.gz: 76eebf87dfc75d34505c28f705bfd33a45c51503f67bd25722cf16ee5600e52f
3
+ metadata.gz: 672ca536536dc4908f0b030a252694762d02434416aec61a8e6d0e1986b5b832
4
+ data.tar.gz: 1efea0ba4eb61120459bb3f46c2ac7d31b8b8c0ef987331981f93ab19de79d28
5
5
  SHA512:
6
- metadata.gz: 9bea61d9e705090e06914a19436f5106bb8e52bbf5e7aaaf1949acaad340b88b48343f5905cbf0c01b76cd550637724349639868441797fa20740ad8a5207863
7
- data.tar.gz: 7ef8de42f877c3b2b0a6d6aa4c520258ed7c773fc2f2d61634fc39d7246df7e239e4b2c219c12797871771cb677c45cdcde0d2e1061100a21f7f8ce59a4e1911
6
+ metadata.gz: b5a7cae22c14e129b85db97c40d2f767c2f09cac7c23f74d0bbd9d5691ef083bd18f7d307d6ed006b343c14cd58f7f3ffbdc732eda3f714c6bdabf8a4d4f96e0
7
+ data.tar.gz: ebb9837c7b16a9d26527f7019112297507b9105124d409cf31757f8bb075c1060ef97cc3e3855988376c56a2193b0b321db1b6a072da1f10b1f06c8c665256a5
@@ -42,15 +42,21 @@ module Locomotive
42
42
  # @return [ Array ] The list of labels and urls (Hash)
43
43
  #
44
44
  def each_content_entry_group(content_type, &block)
45
- field = content_type.group_by_field
46
- groups = content_type.list_of_groups || []
45
+ field = content_type.group_by_field
46
+ groups = content_type.list_of_groups || []
47
47
 
48
48
  groups.each do |group|
49
+ where = if field.type == 'boolean'
50
+ %({"#{field.name}": #{group[:_id]}})
51
+ else
52
+ %({"#{field.name}_id": "#{group[:_id]}"})
53
+ end
54
+
49
55
  block.call({
50
56
  name: group[:name],
51
57
  url: content_entries_path(current_site, content_type.slug, {
52
58
  group: group[:name],
53
- where: %({"#{field.name}_id": "#{group[:_id]}"}),
59
+ where: where,
54
60
  q: params[:q]
55
61
  })
56
62
  })
@@ -16,6 +16,11 @@ module Locomotive
16
16
  field = self.group_by_field
17
17
 
18
18
  case field.type.to_sym
19
+ when :boolean
20
+ [
21
+ { name: "#{field.label} (#{I18n.t('yes', scope: 'locomotive.shared')})", _id: true },
22
+ { name: "#{field.label} (#{I18n.t('no', scope: 'locomotive.shared')})", _id: false }
23
+ ]
19
24
  when :select
20
25
  self.entries_class._select_options(field.name).map(&:with_indifferent_access)
21
26
  when :belongs_to
@@ -31,7 +36,7 @@ module Locomotive
31
36
  end
32
37
 
33
38
  def groupable?
34
- !!self.group_by_field && %w(select belongs_to).include?(group_by_field.type)
39
+ !!self.group_by_field && %w(select belongs_to boolean).include?(group_by_field.type)
35
40
  end
36
41
 
37
42
  def group_by_field
@@ -38,6 +38,8 @@ en:
38
38
  unsaved_content_warning: "This page is asking you to confirm that you want to leave - data you have entered may not be saved."
39
39
 
40
40
  shared:
41
+ "yes": "Yes"
42
+ "no": "No"
41
43
  header:
42
44
  welcome: Welcome, %{name}
43
45
  sites: My sites
@@ -36,6 +36,8 @@ fr:
36
36
  confirm: Êtes-vous sûr ?
37
37
  unsaved_content_warning: "Vous avez des modifications non sauvegardées dans cette page. Si vous la quittez, ces modifications seront perdues."
38
38
  shared:
39
+ "yes": "Oui"
40
+ "no": "Non"
39
41
  header:
40
42
  welcome: Bienvenue, %{name}
41
43
  sites: Mes sites
@@ -1,3 +1,3 @@
1
1
  module Locomotive
2
- VERSION = '4.0.2'
2
+ VERSION = '4.0.3'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: locomotivecms
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.2
4
+ version: 4.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Didier Lafforgue
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-30 00:00:00.000000000 Z
11
+ date: 2020-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -176,14 +176,14 @@ dependencies:
176
176
  requirements:
177
177
  - - "~>"
178
178
  - !ruby/object:Gem::Version
179
- version: 1.5.2
179
+ version: 1.5.3
180
180
  type: :runtime
181
181
  prerelease: false
182
182
  version_requirements: !ruby/object:Gem::Requirement
183
183
  requirements:
184
184
  - - "~>"
185
185
  - !ruby/object:Gem::Version
186
- version: 1.5.2
186
+ version: 1.5.3
187
187
  - !ruby/object:Gem::Dependency
188
188
  name: slim
189
189
  requirement: !ruby/object:Gem::Requirement