decidim-accountability 0.23.5 → 0.24.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/decidim/accountability/accountability/_categories.scss +5 -4
- data/app/cells/decidim/accountability/content_blocks/highlighted_results/elements.erb +5 -0
- data/app/cells/decidim/accountability/content_blocks/highlighted_results/heading.erb +1 -0
- data/app/cells/decidim/accountability/content_blocks/highlighted_results_cell.rb +18 -0
- data/app/cells/decidim/accountability/result_cell.rb +21 -0
- data/app/cells/decidim/accountability/result_m/data.erb +23 -0
- data/app/cells/decidim/accountability/result_m/footer.erb +22 -0
- data/app/cells/decidim/accountability/result_m/tags.erb +1 -0
- data/app/cells/decidim/accountability/result_m_cell.rb +37 -0
- data/app/controllers/concerns/decidim/accountability/admin/filterable.rb +59 -0
- data/app/controllers/decidim/accountability/admin/attachment_collections_controller.rb +32 -0
- data/app/controllers/decidim/accountability/admin/attachments_controller.rb +32 -0
- data/app/controllers/decidim/accountability/admin/results_controller.rb +7 -2
- data/app/helpers/decidim/accountability/admin/filterable_helper.rb +10 -0
- data/app/helpers/decidim/accountability/breadcrumb_helper.rb +3 -1
- data/app/models/decidim/accountability/result.rb +15 -2
- data/app/models/decidim/accountability/status.rb +5 -0
- data/app/views/decidim/accountability/admin/results/index.html.erb +52 -2
- data/app/views/decidim/accountability/results/_show_leaf.html.erb +2 -0
- data/app/views/decidim/accountability/results/_show_parent.html.erb +2 -0
- data/config/locales/ar.yml +0 -4
- data/config/locales/bg.yml +0 -4
- data/config/locales/ca.yml +24 -4
- data/config/locales/cs.yml +24 -4
- data/config/locales/da.yml +0 -4
- data/config/locales/de.yml +24 -4
- data/config/locales/el.yml +0 -4
- data/config/locales/en.yml +24 -4
- data/config/locales/es-MX.yml +24 -4
- data/config/locales/es-PY.yml +24 -4
- data/config/locales/es.yml +24 -4
- data/config/locales/eu.yml +0 -4
- data/config/locales/fi-plain.yml +24 -4
- data/config/locales/fi.yml +24 -4
- data/config/locales/fr-CA.yml +24 -4
- data/config/locales/fr.yml +24 -4
- data/config/locales/gl.yml +24 -4
- data/config/locales/hu.yml +0 -4
- data/config/locales/id-ID.yml +0 -4
- data/config/locales/is-IS.yml +24 -4
- data/config/locales/it.yml +24 -4
- data/config/locales/ja.yml +24 -4
- data/config/locales/lv.yml +0 -4
- data/config/locales/nl.yml +24 -4
- data/config/locales/no.yml +21 -4
- data/config/locales/pl.yml +24 -4
- data/config/locales/pt-BR.yml +0 -4
- data/config/locales/pt.yml +0 -4
- data/config/locales/ro-RO.yml +24 -4
- data/config/locales/ru.yml +0 -4
- data/config/locales/si-LK.yml +3 -0
- data/config/locales/sk.yml +7 -4
- data/config/locales/sl.yml +0 -4
- data/config/locales/sr-CS.yml +0 -4
- data/config/locales/sv.yml +27 -7
- data/config/locales/tr-TR.yml +22 -4
- data/config/locales/uk.yml +0 -4
- data/config/locales/zh-CN.yml +0 -4
- data/lib/decidim/accountability.rb +1 -0
- data/lib/decidim/accountability/admin_engine.rb +2 -0
- data/lib/decidim/accountability/api.rb +10 -0
- data/lib/decidim/accountability/component.rb +20 -8
- data/lib/decidim/accountability/engine.rb +0 -17
- data/lib/decidim/accountability/version.rb +1 -1
- data/lib/decidim/api/accountability_type.rb +26 -0
- data/lib/decidim/api/result_type.rb +32 -0
- data/lib/decidim/api/status_type.rb +19 -0
- data/lib/decidim/api/timeline_entry_type.rb +17 -0
- metadata +39 -28
- data/app/types/decidim/accountability/accountability_type.rb +0 -32
- data/app/types/decidim/accountability/result_type.rb +0 -35
- data/app/types/decidim/accountability/status_type.rb +0 -20
- data/app/types/decidim/accountability/timeline_entry_type.rb +0 -18
- data/app/views/decidim/participatory_processes/participatory_process_groups/_highlighted_results.html.erb +0 -12
- data/app/views/decidim/participatory_processes/participatory_process_groups/_result.html.erb +0 -32
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f071fe2b74dcde96b40da71e7519060a3e9e5f3e979fd7d410cafad5a9402092
|
4
|
+
data.tar.gz: 8557c6b145952a958ef14bcb220081ae1ae97a96f9292cdb65e3ea3cbe4c76ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 16a515587a5f80ea0ef3d733cf1890d31b69ca7d526cc357ed1dad97d4377124d446fdebb22e3f3429908a814d900c8052bb19a61612ffbe279e1f7aa86b0e37
|
7
|
+
data.tar.gz: d52ca7c7b744cc51cf3304fa44a804abb657a3bff26f6fe504e4f49832bfac01e469f417d45bcd7ea45108a02ddbac8b6f5a8eaa9e62d54fb5e45e705ba03862
|
@@ -1,6 +1,7 @@
|
|
1
1
|
.accountability{
|
2
2
|
.categories{
|
3
3
|
a:hover{
|
4
|
+
background-color: var(--secondary);
|
4
5
|
text-decoration: underline;
|
5
6
|
}
|
6
7
|
|
@@ -68,7 +69,7 @@
|
|
68
69
|
|
69
70
|
.card__link{
|
70
71
|
.category--line{
|
71
|
-
background:
|
72
|
+
background-color: var(--secondary);
|
72
73
|
border-radius: 4px;
|
73
74
|
min-height: 9rem;
|
74
75
|
padding: 1rem;
|
@@ -77,7 +78,7 @@
|
|
77
78
|
|
78
79
|
strong{
|
79
80
|
font-weight: 600;
|
80
|
-
color:
|
81
|
+
color: var(--secondary);
|
81
82
|
}
|
82
83
|
|
83
84
|
.progress-figure{
|
@@ -86,7 +87,7 @@
|
|
86
87
|
}
|
87
88
|
|
88
89
|
.category--count{
|
89
|
-
color: lighten($
|
90
|
+
color: lighten($secondary, 50);
|
90
91
|
position: absolute;
|
91
92
|
right: 1rem;
|
92
93
|
bottom: 1rem;
|
@@ -96,7 +97,7 @@
|
|
96
97
|
|
97
98
|
&:hover{
|
98
99
|
.category--count{
|
99
|
-
color: lighten($
|
100
|
+
color: lighten($secondary, 50);
|
100
101
|
}
|
101
102
|
|
102
103
|
strong{
|
@@ -0,0 +1 @@
|
|
1
|
+
<h2 class="section-heading"><%= t("decidim.accountability.content_blocks.highlighted_results.results") %></h2>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Accountability
|
5
|
+
module ContentBlocks
|
6
|
+
class HighlightedResultsCell < Decidim::ContentBlocks::HighlightedElementsCell
|
7
|
+
include Cell::ViewModel::Partial
|
8
|
+
include Decidim::IconHelper
|
9
|
+
include Decidim::Accountability::ApplicationHelper
|
10
|
+
include ActiveSupport::NumberHelper
|
11
|
+
|
12
|
+
def base_relation
|
13
|
+
@base_relation ||= Decidim::Accountability::Result.where(component: published_components)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "cell/partial"
|
4
|
+
|
5
|
+
module Decidim
|
6
|
+
module Accountability
|
7
|
+
# This cell renders the result card for an instance of a Result
|
8
|
+
# the default size is the Medium Card (:m)
|
9
|
+
class ResultCell < Decidim::ViewModel
|
10
|
+
def show
|
11
|
+
cell card_size, model, options
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def card_size
|
17
|
+
"decidim/accountability/result_m"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<% if has_dates? %>
|
2
|
+
<div class="card__icondata">
|
3
|
+
<ul class="card-data">
|
4
|
+
<li class="card-data__item">
|
5
|
+
<%= icon "datetime", class: "icon--big", role: "img", aria_label: t("decidim.accountability.content_blocks.highlighted_results.dates") %>
|
6
|
+
</li>
|
7
|
+
<li class="card-data__item">
|
8
|
+
<div class="card-data__item--centerblock">
|
9
|
+
<strong><%= t("activemodel.attributes.result.start_date") %></strong>
|
10
|
+
<br>
|
11
|
+
<%= start_date ? l(start_date, format: :decidim_short) : t("decidim.accountability.content_blocks.highlighted_results.unspecified") %>
|
12
|
+
</div>
|
13
|
+
</li>
|
14
|
+
<li class="card-data__item">
|
15
|
+
<div class="card-data__item--centerblock">
|
16
|
+
<strong><%= t("activemodel.attributes.result.end_date") %></strong>
|
17
|
+
<br>
|
18
|
+
<%= end_date ? l(end_date, format: :decidim_short) : t("decidim.accountability.content_blocks.highlighted_results.unspecified") %>
|
19
|
+
</div>
|
20
|
+
</li>
|
21
|
+
</ul>
|
22
|
+
</div>
|
23
|
+
<% end %>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<div class="card__footer">
|
2
|
+
<div class="card__support">
|
3
|
+
<% if progress.present? %>
|
4
|
+
<div id="<%= "accountability-result-#{model.id}-progress" %>" class="progress__bar">
|
5
|
+
<div class="progress__bar__title">
|
6
|
+
<span class="progress__bar__number"><%= progress_text %></span>
|
7
|
+
<span class="progress__bar__text"><%= t("decidim.accountability.result_m.executed") %></span>
|
8
|
+
</div>
|
9
|
+
<div class="progress progress__bar__bar" role="progressbar" tabindex="0" aria-valuenow="<%= progress %>" aria-valuemin="0" aria-valuetext="<%= progress %> percent" aria-valuemax="100">
|
10
|
+
<div class="progress-meter progress__bar__bar--complete" style="width: <%= progress %>%"></div>
|
11
|
+
<div class="progress__bar__bar--incomplete" style="width:calc(100% - <%= progress %>%);"></div>
|
12
|
+
</div>
|
13
|
+
</div>
|
14
|
+
<% end %>
|
15
|
+
|
16
|
+
<%= link_to(
|
17
|
+
t("decidim.accountability.result_m.view"),
|
18
|
+
resource_path,
|
19
|
+
class: "card__button button button--sc secondary light small"
|
20
|
+
) %>
|
21
|
+
</div>
|
22
|
+
</div>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= cell "decidim/tags", model, context: { extra_classes: ["tags--result"] } %>
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "cell/partial"
|
4
|
+
|
5
|
+
module Decidim
|
6
|
+
module Accountability
|
7
|
+
# This cell renders the Medium (:m) result card
|
8
|
+
# for an instance of a Result
|
9
|
+
class ResultMCell < Decidim::CardMCell
|
10
|
+
include Decidim::SanitizeHelper
|
11
|
+
include Decidim::TranslationsHelper
|
12
|
+
include ActiveSupport::NumberHelper
|
13
|
+
|
14
|
+
delegate :start_date, :end_date, :progress, to: :model
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def resource_path
|
19
|
+
resource_locator(model).path
|
20
|
+
end
|
21
|
+
|
22
|
+
def progress_text
|
23
|
+
return if progress.blank?
|
24
|
+
|
25
|
+
number_to_percentage(progress, precision: 1, strip_insignificant_zeros: true, locale: I18n.locale, format: "%n%")
|
26
|
+
end
|
27
|
+
|
28
|
+
def statuses
|
29
|
+
[]
|
30
|
+
end
|
31
|
+
|
32
|
+
def has_dates?
|
33
|
+
start_date.present? && end_date.present?
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "active_support/concern"
|
4
|
+
|
5
|
+
module Decidim
|
6
|
+
module Accountability
|
7
|
+
module Admin
|
8
|
+
module Filterable
|
9
|
+
extend ActiveSupport::Concern
|
10
|
+
|
11
|
+
included do
|
12
|
+
include Decidim::Admin::Filterable
|
13
|
+
|
14
|
+
helper Decidim::Accountability::Admin::FilterableHelper
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def base_query
|
19
|
+
collection
|
20
|
+
end
|
21
|
+
|
22
|
+
def search_field_predicate
|
23
|
+
:id_string_or_title_cont
|
24
|
+
end
|
25
|
+
|
26
|
+
def filters
|
27
|
+
[
|
28
|
+
:scope_id_eq,
|
29
|
+
:category_id_eq,
|
30
|
+
:status_id_eq
|
31
|
+
]
|
32
|
+
end
|
33
|
+
|
34
|
+
def filters_with_values
|
35
|
+
{
|
36
|
+
scope_id_eq: scope_ids_hash(scopes.top_level),
|
37
|
+
category_id_eq: category_ids_hash(categories.first_class),
|
38
|
+
status_id_eq: status_ids_hash(statuses)
|
39
|
+
}
|
40
|
+
end
|
41
|
+
|
42
|
+
# Can't user `super` here, because it does not belong to a superclass
|
43
|
+
# but to a concern.
|
44
|
+
def dynamically_translated_filters
|
45
|
+
[:scope_id_eq, :category_id_eq, :status_id_eq]
|
46
|
+
end
|
47
|
+
|
48
|
+
def status_ids_hash(statuses)
|
49
|
+
statuses.each_with_object({}) { |status, hash| hash[status.id] = status.id }
|
50
|
+
end
|
51
|
+
|
52
|
+
def translated_status_id_eq(id)
|
53
|
+
translated_attribute(statuses.find_by(id: id).name)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Accountability
|
5
|
+
module Admin
|
6
|
+
# Controller that allows managing all the attachment collections for an
|
7
|
+
# accountability result.
|
8
|
+
#
|
9
|
+
class AttachmentCollectionsController < Admin::ApplicationController
|
10
|
+
include Decidim::Admin::Concerns::HasAttachmentCollections
|
11
|
+
|
12
|
+
def after_destroy_path
|
13
|
+
result_attachment_collections_path(result, result.component, current_participatory_space)
|
14
|
+
end
|
15
|
+
|
16
|
+
def collection_for
|
17
|
+
result
|
18
|
+
end
|
19
|
+
|
20
|
+
def result
|
21
|
+
@result ||= results.find(params[:result_id])
|
22
|
+
end
|
23
|
+
|
24
|
+
private
|
25
|
+
|
26
|
+
def results
|
27
|
+
@results ||= Result.where(component: current_component)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Accountability
|
5
|
+
module Admin
|
6
|
+
# Controller that allows managing all the attachments for an
|
7
|
+
# accountability result.
|
8
|
+
#
|
9
|
+
class AttachmentsController < Admin::ApplicationController
|
10
|
+
include Decidim::Admin::Concerns::HasAttachments
|
11
|
+
|
12
|
+
def after_destroy_path
|
13
|
+
results_path
|
14
|
+
end
|
15
|
+
|
16
|
+
def attached_to
|
17
|
+
result
|
18
|
+
end
|
19
|
+
|
20
|
+
def result
|
21
|
+
@result ||= results.find(params[:result_id])
|
22
|
+
end
|
23
|
+
|
24
|
+
private
|
25
|
+
|
26
|
+
def results
|
27
|
+
@results ||= Result.where(component: current_component)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -8,9 +8,15 @@ module Decidim
|
|
8
8
|
include Decidim::ApplicationHelper
|
9
9
|
include Decidim::SanitizeHelper
|
10
10
|
include Decidim::Proposals::Admin::Picker
|
11
|
+
include Decidim::Accountability::Admin::Filterable
|
11
12
|
|
12
13
|
helper_method :results, :parent_result, :parent_results, :statuses, :present
|
13
14
|
|
15
|
+
def collection
|
16
|
+
parent_id = params[:parent_id].presence
|
17
|
+
@collection ||= Result.where(component: current_component, parent_id: parent_id).page(params[:page]).per(15)
|
18
|
+
end
|
19
|
+
|
14
20
|
def new
|
15
21
|
enforce_permission_to :create, :result
|
16
22
|
|
@@ -75,8 +81,7 @@ module Decidim
|
|
75
81
|
private
|
76
82
|
|
77
83
|
def results
|
78
|
-
|
79
|
-
@results ||= Result.where(component: current_component, parent_id: parent_id).page(params[:page]).per(15)
|
84
|
+
@results ||= filtered_collection
|
80
85
|
end
|
81
86
|
|
82
87
|
def result
|
@@ -18,7 +18,9 @@ module Decidim
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def category
|
21
|
-
|
21
|
+
return if (category_id = params.dig(:filter, :category_id)).blank?
|
22
|
+
|
23
|
+
@category ||= current_participatory_space.categories.find(category_id.is_a?(Array) ? category_id.first : category_id)
|
22
24
|
end
|
23
25
|
end
|
24
26
|
end
|
@@ -6,6 +6,8 @@ module Decidim
|
|
6
6
|
# title, description and any other useful information to render a custom result.
|
7
7
|
class Result < Accountability::ApplicationRecord
|
8
8
|
include Decidim::Resourceable
|
9
|
+
include Decidim::HasAttachments
|
10
|
+
include Decidim::HasAttachmentCollections
|
9
11
|
include Decidim::HasComponent
|
10
12
|
include Decidim::ScopableResource
|
11
13
|
include Decidim::HasCategory
|
@@ -23,13 +25,15 @@ module Decidim
|
|
23
25
|
translatable_fields :title, :description
|
24
26
|
|
25
27
|
has_many :children, foreign_key: "parent_id", class_name: "Decidim::Accountability::Result", inverse_of: :parent, dependent: :destroy
|
26
|
-
belongs_to :parent,
|
28
|
+
belongs_to :parent, class_name: "Decidim::Accountability::Result", inverse_of: :children, optional: true, counter_cache: :children_count
|
27
29
|
|
28
30
|
belongs_to :status, foreign_key: "decidim_accountability_status_id", class_name: "Decidim::Accountability::Status", inverse_of: :results, optional: true
|
29
31
|
|
30
32
|
has_many :timeline_entries, -> { order(:entry_date) }, foreign_key: "decidim_accountability_result_id",
|
31
33
|
class_name: "Decidim::Accountability::TimelineEntry", inverse_of: :result, dependent: :destroy
|
32
34
|
|
35
|
+
scope :order_by_most_recent, -> { order(created_at: :desc) }
|
36
|
+
|
33
37
|
after_save :update_parent_progress, if: -> { parent_id.present? }
|
34
38
|
|
35
39
|
searchable_fields(
|
@@ -87,6 +91,15 @@ module Decidim
|
|
87
91
|
can_participate_in_space?(user)
|
88
92
|
end
|
89
93
|
|
94
|
+
ransacker :id_string do
|
95
|
+
Arel.sql(%{cast("decidim_accountability_results"."id" as text)})
|
96
|
+
end
|
97
|
+
|
98
|
+
# Allow ransacker to search for a key in a hstore column (`title`.`en`)
|
99
|
+
ransacker :title do |parent|
|
100
|
+
Arel::Nodes::InfixOperation.new("->>", parent.table[:title], Arel::Nodes.build_quoted(I18n.locale.to_s))
|
101
|
+
end
|
102
|
+
|
90
103
|
private
|
91
104
|
|
92
105
|
# Private: When a row uses weight 1 and there's more than one, weight shouldn't be considered
|
@@ -94,7 +107,7 @@ module Decidim
|
|
94
107
|
def children_use_weighted_progress?
|
95
108
|
return false if children.pluck(:weight).all?(&:nil?)
|
96
109
|
|
97
|
-
children.length == 1 || children.pluck(:weight).none? { |weight| weight == 1.0 }
|
110
|
+
children.length == 1 || children.pluck(:weight).none? { |weight| weight&.to_d == 1.0.to_d }
|
98
111
|
end
|
99
112
|
end
|
100
113
|
end
|
@@ -16,6 +16,11 @@ module Decidim
|
|
16
16
|
|
17
17
|
validates :key, presence: true, uniqueness: { scope: :decidim_component_id }
|
18
18
|
validates :name, presence: true
|
19
|
+
|
20
|
+
# Allow ransacker to search for a key in a hstore column (`name`.`en`)
|
21
|
+
ransacker :name do |parent|
|
22
|
+
Arel::Nodes::InfixOperation.new("->>", parent.table[:name], Arel::Nodes.build_quoted(I18n.locale.to_s))
|
23
|
+
end
|
19
24
|
end
|
20
25
|
end
|
21
26
|
end
|
@@ -12,23 +12,65 @@
|
|
12
12
|
</h2>
|
13
13
|
</div>
|
14
14
|
|
15
|
+
<%= admin_filter_selector(:results) %>
|
15
16
|
<div class="card-section">
|
16
17
|
<div class="table-scroll">
|
17
18
|
<table class="table-list">
|
18
19
|
<thead>
|
19
20
|
<tr>
|
20
|
-
<th
|
21
|
-
|
21
|
+
<th>
|
22
|
+
<%= sort_link(query, :id, t("models.result.fields.id", scope: "decidim.accountability"), default_order: :desc ) %>
|
23
|
+
</th>
|
24
|
+
<th>
|
25
|
+
<%= sort_link(query, :title, t("models.result.fields.title", scope: "decidim.accountability")) %>
|
26
|
+
</th>
|
27
|
+
<th>
|
28
|
+
<%= sort_link(query, :category_name, t("models.result.fields.category", scope: "decidim.accountability") ) %>
|
29
|
+
</th>
|
30
|
+
<% if resource_with_scopes_enabled? %>
|
31
|
+
<th>
|
32
|
+
<%= sort_link(query, :scope_name, t("models.result.fields.scope", scope: "decidim.accountability") ) %>
|
33
|
+
</th>
|
34
|
+
<% end %>
|
35
|
+
<th>
|
36
|
+
<%= sort_link(query, :status_name, t("models.result.fields.status", scope: "decidim.accountability") ) %>
|
37
|
+
</th>
|
38
|
+
<th>
|
39
|
+
<%= sort_link(query, :progress, t("models.result.fields.progress", scope: "decidim.accountability") ) %>
|
40
|
+
</th>
|
41
|
+
<th>
|
42
|
+
<%= sort_link(query, :created_at, t("models.result.fields.created_at", scope: "decidim.accountability") ) %>
|
43
|
+
</th>
|
22
44
|
<th class="actions"><%= t("actions.title", scope: "decidim.accountability") %></th>
|
23
45
|
</tr>
|
24
46
|
</thead>
|
25
47
|
<tbody>
|
26
48
|
<% results.each do |result| %>
|
27
49
|
<tr data-id="<%= result.id %>">
|
50
|
+
<td>
|
51
|
+
<%= result.id %><br>
|
52
|
+
</td>
|
28
53
|
<td>
|
29
54
|
<%= link_to translated_attribute(result.title), results_path(parent_id: result.id) %><br>
|
30
55
|
</td>
|
56
|
+
<td>
|
57
|
+
<% if result.category %>
|
58
|
+
<%= translated_attribute result.category.name %>
|
59
|
+
<% end %>
|
60
|
+
</td>
|
31
61
|
<%= td_resource_scope_for(result.scope) %>
|
62
|
+
<td>
|
63
|
+
<% if result.status %>
|
64
|
+
<%= translated_attribute result.status.name %>
|
65
|
+
<% end %>
|
66
|
+
</td>
|
67
|
+
<td>
|
68
|
+
<%= result.progress&.to_i %>
|
69
|
+
</td>
|
70
|
+
<td>
|
71
|
+
<%= l result.created_at, format: :decidim_short %>
|
72
|
+
</td>
|
73
|
+
|
32
74
|
<td class="table-list__actions">
|
33
75
|
<%= icon_link_to "eye", resource_locator(result).path, t("actions.preview", scope: "decidim.accountability"), class: "action-icon--preview", target: :blank %>
|
34
76
|
|
@@ -44,6 +86,14 @@
|
|
44
86
|
<%= icon_link_to "pencil", edit_result_path(result), t("actions.edit", scope: "decidim.accountability"), class: "action-icon--edit" %>
|
45
87
|
<% end %>
|
46
88
|
|
89
|
+
<% if allowed_to? :update, :result, result: result %>
|
90
|
+
<%= icon_link_to "folder", result_attachment_collections_path(result), t("actions.attachment_collections", scope: "decidim.accountability"), class: "action-icon--attachment_collections" %>
|
91
|
+
<% end %>
|
92
|
+
|
93
|
+
<% if allowed_to? :update, :result, result: result %>
|
94
|
+
<%= icon_link_to "paperclip", result_attachments_path(result), t("actions.attachments", scope: "decidim.accountability"), class: "action-icon--attachments" %>
|
95
|
+
<% end %>
|
96
|
+
|
47
97
|
<% if allowed_to? :destroy, :result, result: result %>
|
48
98
|
<%= icon_link_to "circle-x", result_path(result), t("actions.destroy", scope: "decidim.accountability"), class: "action-icon--remove", method: :delete, data: { confirm: t("actions.confirm_destroy", scope: "decidim.accountability", name: t("models.result.name", scope: "decidim.accountability.admin")) } %>
|
49
99
|
<% end %>
|