decidim-sortitions 0.28.2 → 0.29.0.rc2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fe7075f02df2c278d2e0138dbac38a859359048f9cbb708faf9f40733edeb284
4
- data.tar.gz: d5f238fe3d11adb3748ef758caa0b6890db4e63a7ae794f5f2fe4a5b19e1836e
3
+ metadata.gz: '09d9067968ff0e41444864d0ec53dac4ef48ee0684102c7ab342980fe035c965'
4
+ data.tar.gz: 26708470be5725d7496b8bafc6fbbad168cb335f914ec532e9200bd38db391f7
5
5
  SHA512:
6
- metadata.gz: a98b04f77bc12d9fdab7b318fc3c974b061498d9049f7cde25de040ed80c6fb00351f4f4686d06e6d2fc400370e906cbbae5f5847e76119a01b5e33d5ce25fd8
7
- data.tar.gz: d589c9c2592e5a0161ef9a643e4c2ca205d5a21eb2a04f7927c0a4ce3780f6bf10a7b56eca03abd4838f30f51d9a627e501764d07b0edebb6e8faef8e517f496
6
+ metadata.gz: 6bc2f623a0a19ac749c968949764fdffad1be79651f9cbe060210677d2dce04387f26f4e3eef12194a35855c6c1d365e80493df67c4ebb36e5d604bb57b05ad5
7
+ data.tar.gz: 71368d5d75369b87e2d8caf1187555549b5d587885340bcd75803ddf620dfc96b5357b6ffe3fda66bef892ae97e2dbebd9dcfec26e7b071cc1e69882328ded2c
@@ -7,7 +7,7 @@ module Decidim
7
7
  include Decidim::TranslationsHelper
8
8
  include Decidim::PaginateHelper
9
9
 
10
- # Converst a list of components into a list of selectable options
10
+ # Converts a list of components into a list of selectable options
11
11
  def components_options(components)
12
12
  components.map do |f|
13
13
  [translated_attribute(f.name), f.id]
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Decidim
4
4
  module Sortitions
5
- # Model that encapsulates the parameters of a sortion
5
+ # Model that encapsulates the parameters of a sortition
6
6
  class Sortition < ApplicationRecord
7
7
  include Decidim::Resourceable
8
8
  include Decidim::HasCategory
@@ -18,30 +18,23 @@ module Decidim
18
18
  @request_timestamp = sortition.request_timestamp
19
19
  end
20
20
 
21
- # Given a particpiatory process retrieves its proposals
21
+ # Given a participatory process retrieves its proposals
22
22
  #
23
23
  # Returns an ActiveRecord::Relation.
24
24
  def query
25
- if category.nil?
26
- return Decidim::Proposals::Proposal
27
- .except_withdrawn
28
- .published
29
- .except_rejected
30
- .not_hidden
31
- .where("decidim_proposals_proposals.created_at < ?", request_timestamp)
32
- .where(component: sortition.decidim_proposals_component)
33
- .order(id: :asc)
34
- end
25
+ proposals = Decidim::Proposals::Proposal
26
+ .not_withdrawn
27
+ .published
28
+ .not_hidden
29
+ .where("decidim_proposals_proposals.created_at < ?", request_timestamp)
30
+ .where(component: sortition.decidim_proposals_component)
31
+ proposals = proposals.where.not(id: proposals.only_status(:rejected))
32
+
33
+ return proposals.order(id: :asc) if category.nil?
35
34
 
36
35
  # categorization -> category
37
- Decidim::Proposals::Proposal
36
+ proposals
38
37
  .joins(:categorization)
39
- .except_withdrawn
40
- .published
41
- .except_rejected
42
- .not_hidden
43
- .where(component: sortition.decidim_proposals_component)
44
- .where("decidim_proposals_proposals.created_at < ?", request_timestamp)
45
38
  .where(decidim_categorizations: { decidim_category_id: category.id })
46
39
  .order(id: :asc)
47
40
  end
@@ -16,7 +16,7 @@
16
16
  <th><%= t("models.sortition.fields.reference", scope: "decidim.sortitions.admin") %></th>
17
17
  <th><%= t("models.sortition.fields.title", scope: "decidim.sortitions.admin") %></th>
18
18
  <th><%= t("models.sortition.fields.created_at", scope: "decidim.sortitions.admin") %></th>
19
- <th class="actions"></th>
19
+ <th></th>
20
20
  </tr>
21
21
  </thead>
22
22
  <tbody>
@@ -25,9 +25,9 @@
25
25
  <td><%= sortition.reference %></td>
26
26
  <td>
27
27
  <% if allowed_to? :update, :sortition, sortition: sortition %>
28
- <%= link_to decidim_html_escape(translated_attribute(sortition.title)), edit_sortition_path(sortition) %>
28
+ <%= link_to decidim_escape_translated(sortition.title), edit_sortition_path(sortition) %>
29
29
  <% else %>
30
- <%= decidim_html_escape(translated_attribute(sortition.title)) %>
30
+ <%= decidim_escape_translated(sortition.title) %>
31
31
  <% end %>
32
32
  </td>
33
33
  <td><%= l sortition.created_at, format: :short %></td>
@@ -2,7 +2,7 @@
2
2
  <div class="card" id="sortition">
3
3
  <div class="item_show__header">
4
4
  <h1 class="item_show__header-title">
5
- <%= decidim_html_escape(translated_attribute(sortition.title)) %>
5
+ <%= decidim_escape_translated(sortition.title) %>
6
6
  </h1>
7
7
  </div>
8
8
  <div class="table-scroll">
@@ -1,4 +1,4 @@
1
- <div class="card card--action card--list">
1
+ <div class="card card--action">
2
2
  <% resources.each do |sortition| %>
3
3
  <div class="card--list__item">
4
4
  <div class="card--list__text">
@@ -7,7 +7,7 @@
7
7
  <% end %>
8
8
  <div>
9
9
  <%= link_to resource_locator(sortition).path, class: "card__link" do %>
10
- <h5 class="card--list__heading"><%= decidim_html_escape(translated_attribute(sortition.title)) %></h5>
10
+ <h5 class="card--list__heading"><%= decidim_escape_translated(sortition.title) %></h5>
11
11
  <% end %>
12
12
  <div class="author">
13
13
  <span class="author__avatar">
@@ -19,8 +19,8 @@
19
19
  </div>
20
20
  </div>
21
21
  </div>
22
- <div class="card--list__data">
23
- <span class="card--list__data__number">
22
+ <div>
23
+ <span>
24
24
  <%= sortition.selected_proposals.size %>
25
25
  </span> <%= t(".selected_proposals", count: proposal.selected_proposals.size) %>
26
26
  </div>
@@ -1,11 +1,11 @@
1
- <div class="author-data__main">
2
- <div class="author author--inline">
3
- <span class="author__avatar author__avatar--small">
1
+ <div>
2
+ <div class="author">
3
+ <span class="author__avatar">
4
4
  <%= image_tag present(sortition.author).avatar_url %>
5
5
  </span>
6
6
  <span class="author__name">
7
7
  <% if sortition.author&.deleted? %>
8
- <span class="label label--small label--basic">
8
+ <span class="label">
9
9
  <%= t(".deleted") %>
10
10
  </span>
11
11
  <% else %>
@@ -1,11 +1,11 @@
1
- <div class="author-data__main">
2
- <div class="author author--inline">
3
- <span class="author__avatar author__avatar--small">
1
+ <div>
2
+ <div class="author">
3
+ <span class="author__avatar">
4
4
  <%= image_tag present(sortition.cancelled_by_user).avatar_url %>
5
5
  </span>
6
6
  <span class="author__name">
7
7
  <% if sortition.cancelled_by_user&.deleted? %>
8
- <span class="label label--small label--basic">
8
+ <span class="label">
9
9
  <%= t(".deleted") %>
10
10
  </span>
11
11
  <% else %>
@@ -1,4 +1,4 @@
1
- <ul class="tags tags--sortition">
1
+ <ul>
2
2
  <li>
3
3
  <%= link_to t("filters.active", scope: "decidim.sortitions.sortitions"),
4
4
  sortitions_path(filter: { with_any_state: "active" }) unless sortition.cancelled? %>
@@ -1,6 +1,6 @@
1
1
  <% add_decidim_meta_tags({
2
2
  description: decidim_sanitize_editor(translated_attribute(sortition.additional_info)),
3
- title: decidim_html_escape(translated_attribute(sortition.title)),
3
+ title: decidim_escape_translated(sortition.title),
4
4
  url: sortition_url(sortition.to_param)
5
5
  }) %>
6
6
 
@@ -21,7 +21,7 @@ edit_link(
21
21
 
22
22
  <section class="layout-main__section layout-main__heading">
23
23
  <h1 class="h1 decorator mb-4">
24
- <%= decidim_html_escape(translated_attribute(sortition.title)) %>
24
+ <%= decidim_escape_translated(sortition.title) %>
25
25
  </h1>
26
26
  <div class="layout-author">
27
27
  <%= cell "decidim/author", present(sortition.author), context_actions: [:date], from: sortition, layout: :compact %>
@@ -17,11 +17,11 @@ Gem::Specification.new do |s|
17
17
  "homepage_uri" => "https://decidim.org",
18
18
  "source_code_uri" => "https://github.com/decidim/decidim"
19
19
  }
20
- s.required_ruby_version = "~> 3.1.0"
20
+ s.required_ruby_version = "~> 3.2.0"
21
21
 
22
22
  s.name = "decidim-sortitions"
23
23
  s.summary = "Decidim sortitions module"
24
- s.description = "This module makes possible to select amont a set of proposal by sortition"
24
+ s.description = "This module makes possible to select amount a set of proposal by sortition"
25
25
 
26
26
  s.files = Dir.chdir(__dir__) do
27
27
  `git ls-files -z`.split("\x0").select do |f|
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Decidim
4
4
  module Sortitions
5
- # This is the engine that runs on the administration interface of `decidim_sorititions`.
5
+ # This is the engine that runs on the administration interface of `decidim_sortitions`.
6
6
  # It mostly handles rendering the created projects associated to a participatory
7
7
  # process.
8
8
  class AdminEngine < ::Rails::Engine
@@ -3,7 +3,7 @@
3
3
  module Decidim
4
4
  module Sortitions
5
5
  def self.version
6
- "0.28.2"
6
+ "0.29.0.rc2"
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decidim-sortitions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.28.2
4
+ version: 0.29.0.rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Salvador Perez Garcia
@@ -16,71 +16,71 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.28.2
19
+ version: 0.29.0.rc2
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 0.28.2
26
+ version: 0.29.0.rc2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: decidim-comments
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 0.28.2
33
+ version: 0.29.0.rc2
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 0.28.2
40
+ version: 0.29.0.rc2
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: decidim-core
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 0.28.2
47
+ version: 0.29.0.rc2
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: 0.28.2
54
+ version: 0.29.0.rc2
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: decidim-proposals
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: 0.28.2
61
+ version: 0.29.0.rc2
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - '='
67
67
  - !ruby/object:Gem::Version
68
- version: 0.28.2
68
+ version: 0.29.0.rc2
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: decidim-dev
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - '='
74
74
  - !ruby/object:Gem::Version
75
- version: 0.28.2
75
+ version: 0.29.0.rc2
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - '='
81
81
  - !ruby/object:Gem::Version
82
- version: 0.28.2
83
- description: This module makes possible to select amont a set of proposal by sortition
82
+ version: 0.29.0.rc2
83
+ description: This module makes possible to select amount a set of proposal by sortition
84
84
  email:
85
85
  - jsperezg@gmail.com
86
86
  executables: []
@@ -127,7 +127,6 @@ files:
127
127
  - app/views/decidim/sortitions/sortitions/_count.html.erb
128
128
  - app/views/decidim/sortitions/sortitions/_linked_sortitions.html.erb
129
129
  - app/views/decidim/sortitions/sortitions/_proposal.html.erb
130
- - app/views/decidim/sortitions/sortitions/_proposal_badge.html.erb
131
130
  - app/views/decidim/sortitions/sortitions/_results_count.html.erb
132
131
  - app/views/decidim/sortitions/sortitions/_sortition.html.erb
133
132
  - app/views/decidim/sortitions/sortitions/_sortition_author.html.erb
@@ -264,14 +263,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
264
263
  requirements:
265
264
  - - "~>"
266
265
  - !ruby/object:Gem::Version
267
- version: 3.1.0
266
+ version: 3.2.0
268
267
  required_rubygems_version: !ruby/object:Gem::Requirement
269
268
  requirements:
270
- - - ">="
269
+ - - ">"
271
270
  - !ruby/object:Gem::Version
272
- version: '0'
271
+ version: 1.3.1
273
272
  requirements: []
274
- rubygems_version: 3.3.7
273
+ rubygems_version: 3.4.10
275
274
  signing_key:
276
275
  specification_version: 4
277
276
  summary: Decidim sortitions module
@@ -1,3 +0,0 @@
1
- <% if proposal.answered? %>
2
- <span class="<%= proposal_state_badge_css_class(proposal.state) %> label proposal-status"><%= humanize_proposal_state proposal.state %></span>
3
- <% end %>