decidim-accountability 0.28.2 → 0.29.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/cells/decidim/accountability/highlighted_results_for_component_cell.rb +0 -3
- data/app/cells/decidim/accountability/project_cell.rb +1 -6
- data/app/cells/decidim/accountability/result_l_cell.rb +1 -2
- data/app/cells/decidim/accountability/result_metadata_cell.rb +0 -6
- data/app/cells/decidim/accountability/results_cell.rb +0 -2
- data/app/cells/decidim/accountability/status_cell.rb +11 -8
- data/app/commands/decidim/accountability/admin/create_imported_result.rb +18 -85
- data/app/commands/decidim/accountability/admin/create_result.rb +12 -86
- data/app/commands/decidim/accountability/admin/create_status.rb +3 -31
- data/app/commands/decidim/accountability/admin/create_timeline_entry.rb +3 -30
- data/app/commands/decidim/accountability/admin/has_result_command.rb +54 -0
- data/app/commands/decidim/accountability/admin/update_imported_result.rb +16 -70
- data/app/commands/decidim/accountability/admin/update_result.rb +10 -72
- data/app/commands/decidim/accountability/admin/update_status.rb +3 -39
- data/app/commands/decidim/accountability/admin/update_timeline_entry.rb +3 -38
- data/app/controllers/decidim/accountability/admin/results_controller.rb +1 -1
- data/app/controllers/decidim/accountability/admin/statuses_controller.rb +7 -8
- data/app/controllers/decidim/accountability/admin/timeline_entries_controller.rb +8 -8
- data/app/controllers/decidim/accountability/results_controller.rb +1 -21
- data/app/helpers/decidim/accountability/application_helper.rb +0 -34
- data/app/helpers/decidim/accountability/breadcrumb_helper.rb +0 -4
- data/app/models/decidim/accountability/result.rb +1 -1
- data/app/models/decidim/accountability/status.rb +1 -1
- data/app/packs/src/decidim/accountability/index.js +1 -1
- data/app/services/decidim/accountability/results_csv_importer.rb +1 -1
- data/app/views/decidim/accountability/admin/results/index.html.erb +1 -1
- data/app/views/decidim/accountability/admin/statuses/index.html.erb +2 -2
- data/app/views/decidim/accountability/admin/timeline_entries/index.html.erb +1 -1
- data/app/views/decidim/accountability/results/_home_categories.html.erb +2 -2
- data/app/views/decidim/accountability/results/_nav_breadcrumb.html.erb +8 -8
- data/app/views/decidim/accountability/results/_project.html.erb +1 -1
- data/app/views/decidim/participatory_spaces/_result.html.erb +3 -3
- data/config/locales/ar.yml +0 -12
- data/config/locales/bg.yml +0 -12
- data/config/locales/ca.yml +0 -12
- data/config/locales/cs.yml +0 -12
- data/config/locales/da.yml +0 -11
- data/config/locales/de.yml +0 -12
- data/config/locales/el.yml +0 -12
- data/config/locales/en.yml +0 -12
- data/config/locales/es-MX.yml +0 -12
- data/config/locales/es-PY.yml +0 -12
- data/config/locales/es.yml +0 -12
- data/config/locales/eu.yml +0 -12
- data/config/locales/fi-plain.yml +0 -12
- data/config/locales/fi.yml +0 -12
- data/config/locales/fr-CA.yml +0 -12
- data/config/locales/fr.yml +0 -12
- data/config/locales/ga-IE.yml +0 -8
- data/config/locales/gl.yml +0 -12
- data/config/locales/he-IL.yml +0 -12
- data/config/locales/hu.yml +0 -12
- data/config/locales/id-ID.yml +0 -11
- data/config/locales/is-IS.yml +0 -12
- data/config/locales/it.yml +0 -12
- data/config/locales/ja.yml +0 -12
- data/config/locales/ko.yml +0 -12
- data/config/locales/lb.yml +0 -12
- data/config/locales/lt.yml +0 -12
- data/config/locales/lv.yml +0 -11
- data/config/locales/nl.yml +0 -12
- data/config/locales/no.yml +0 -12
- data/config/locales/pl.yml +0 -12
- data/config/locales/pt-BR.yml +0 -12
- data/config/locales/pt.yml +0 -12
- data/config/locales/ro-RO.yml +0 -12
- data/config/locales/ru.yml +0 -11
- data/config/locales/si-LK.yml +0 -5
- data/config/locales/sk.yml +0 -11
- data/config/locales/sl.yml +0 -4
- data/config/locales/sq-AL.yml +0 -12
- data/config/locales/sr-CS.yml +0 -11
- data/config/locales/sv.yml +0 -12
- data/config/locales/th-TH.yml +0 -1
- data/config/locales/tr-TR.yml +0 -12
- data/config/locales/uk.yml +0 -11
- data/config/locales/zh-CN.yml +0 -11
- data/config/locales/zh-TW.yml +0 -12
- data/decidim-accountability.gemspec +1 -1
- data/lib/decidim/accountability/component.rb +0 -4
- data/lib/decidim/accountability/seeds.rb +76 -67
- data/lib/decidim/accountability/test/factories.rb +0 -4
- data/lib/decidim/accountability/version.rb +1 -1
- data/lib/decidim/api/result_type.rb +1 -1
- metadata +24 -26
- data/app/commands/decidim/accountability/admin/destroy_result.rb +0 -43
- data/app/services/decidim/accountability/result_stats_calculator.rb +0 -49
- data/app/views/decidim/accountability/results/_stats_box.html.erb +0 -79
@@ -5,83 +5,21 @@ module Decidim
|
|
5
5
|
module Admin
|
6
6
|
# This command is executed when the user changes a Result from the admin
|
7
7
|
# panel.
|
8
|
-
class UpdateResult < Decidim::
|
9
|
-
|
10
|
-
#
|
11
|
-
# form - The form from which to get the data.
|
12
|
-
# result - The current instance of the result to be updated.
|
13
|
-
def initialize(form, result)
|
14
|
-
@form = form
|
15
|
-
@result = result
|
16
|
-
end
|
17
|
-
|
18
|
-
# Updates the result if valid.
|
19
|
-
#
|
20
|
-
# Broadcasts :ok if successful, :invalid otherwise.
|
21
|
-
def call
|
22
|
-
return broadcast(:invalid) if form.invalid?
|
8
|
+
class UpdateResult < Decidim::Commands::UpdateResource
|
9
|
+
include Decidim::Accountability::Admin::HasResultCommand
|
23
10
|
|
24
|
-
|
25
|
-
|
26
|
-
link_proposals
|
27
|
-
link_meetings
|
28
|
-
link_projects
|
29
|
-
send_notifications if should_notify_followers?
|
30
|
-
end
|
31
|
-
|
32
|
-
broadcast(:ok)
|
33
|
-
end
|
11
|
+
fetch_form_attributes :scope, :category, :parent_id, :title, :description, :start_date, :end_date,
|
12
|
+
:progress, :decidim_accountability_status_id, :external_id, :weight
|
34
13
|
|
35
14
|
private
|
36
15
|
|
37
|
-
|
38
|
-
|
39
|
-
def update_result
|
40
|
-
Decidim.traceability.update!(
|
41
|
-
result,
|
42
|
-
form.current_user,
|
43
|
-
scope: @form.scope,
|
44
|
-
category: @form.category,
|
45
|
-
parent_id: @form.parent_id,
|
46
|
-
title: @form.title,
|
47
|
-
description: @form.description,
|
48
|
-
start_date: @form.start_date,
|
49
|
-
end_date: @form.end_date,
|
50
|
-
progress: @form.progress,
|
51
|
-
decidim_accountability_status_id: @form.decidim_accountability_status_id,
|
52
|
-
external_id: @form.external_id.presence,
|
53
|
-
weight: @form.weight
|
54
|
-
)
|
55
|
-
end
|
56
|
-
|
57
|
-
def proposals
|
58
|
-
@proposals ||= result.sibling_scope(:proposals).where(id: form.proposal_ids)
|
59
|
-
end
|
60
|
-
|
61
|
-
def projects
|
62
|
-
@projects ||= result.sibling_scope(:projects).where(id: form.project_ids)
|
63
|
-
end
|
64
|
-
|
65
|
-
def meeting_ids
|
66
|
-
@meeting_ids ||= proposals.flat_map do |proposal|
|
67
|
-
proposal.linked_resources(:meetings, "proposals_from_meeting").pluck(:id)
|
68
|
-
end.uniq
|
69
|
-
end
|
70
|
-
|
71
|
-
def meetings
|
72
|
-
@meetings ||= result.sibling_scope(:meetings).where(id: meeting_ids)
|
73
|
-
end
|
74
|
-
|
75
|
-
def link_proposals
|
76
|
-
result.link_resources(proposals, "included_proposals")
|
77
|
-
end
|
78
|
-
|
79
|
-
def link_projects
|
80
|
-
result.link_resources(projects, "included_projects")
|
81
|
-
end
|
16
|
+
alias result resource
|
82
17
|
|
83
|
-
def
|
84
|
-
|
18
|
+
def run_after_hooks
|
19
|
+
link_proposals
|
20
|
+
link_meetings
|
21
|
+
link_projects
|
22
|
+
send_notifications if should_notify_followers?
|
85
23
|
end
|
86
24
|
|
87
25
|
def send_notifications
|
@@ -3,46 +3,10 @@
|
|
3
3
|
module Decidim
|
4
4
|
module Accountability
|
5
5
|
module Admin
|
6
|
-
# This command is executed when the user changes a
|
6
|
+
# This command is executed when the user changes a Status from the admin
|
7
7
|
# panel.
|
8
|
-
class UpdateStatus < Decidim::
|
9
|
-
|
10
|
-
#
|
11
|
-
# form - The form from which to get the data.
|
12
|
-
# status - The current instance of the status to be updated.
|
13
|
-
def initialize(form, status, user)
|
14
|
-
@form = form
|
15
|
-
@status = status
|
16
|
-
@user = user
|
17
|
-
end
|
18
|
-
|
19
|
-
# Updates the status if valid.
|
20
|
-
#
|
21
|
-
# Broadcasts :ok if successful, :invalid otherwise.
|
22
|
-
def call
|
23
|
-
return broadcast(:invalid) if form.invalid?
|
24
|
-
|
25
|
-
transaction do
|
26
|
-
update_status
|
27
|
-
end
|
28
|
-
|
29
|
-
broadcast(:ok)
|
30
|
-
end
|
31
|
-
|
32
|
-
private
|
33
|
-
|
34
|
-
attr_reader :status, :form
|
35
|
-
|
36
|
-
def update_status
|
37
|
-
Decidim.traceability.update!(
|
38
|
-
status,
|
39
|
-
@user,
|
40
|
-
key: @form.key,
|
41
|
-
name: @form.name,
|
42
|
-
description: @form.description,
|
43
|
-
progress: @form.progress
|
44
|
-
)
|
45
|
-
end
|
8
|
+
class UpdateStatus < Decidim::Commands::UpdateResource
|
9
|
+
fetch_form_attributes :key, :name, :description, :progress
|
46
10
|
end
|
47
11
|
end
|
48
12
|
end
|
@@ -3,45 +3,10 @@
|
|
3
3
|
module Decidim
|
4
4
|
module Accountability
|
5
5
|
module Admin
|
6
|
-
# This command is executed when the user changes a
|
6
|
+
# This command is executed when the user changes a TimelineEntry from the admin
|
7
7
|
# panel.
|
8
|
-
class UpdateTimelineEntry < Decidim::
|
9
|
-
|
10
|
-
#
|
11
|
-
# form - The form from which to get the data.
|
12
|
-
# timeline_entry - The current instance of the timeline_entry to be updated.
|
13
|
-
def initialize(form, timeline_entry, user)
|
14
|
-
@form = form
|
15
|
-
@timeline_entry = timeline_entry
|
16
|
-
@user = user
|
17
|
-
end
|
18
|
-
|
19
|
-
# Updates the timeline_entry if valid.
|
20
|
-
#
|
21
|
-
# Broadcasts :ok if successful, :invalid otherwise.
|
22
|
-
def call
|
23
|
-
return broadcast(:invalid) if form.invalid?
|
24
|
-
|
25
|
-
transaction do
|
26
|
-
update_timeline_entry
|
27
|
-
end
|
28
|
-
|
29
|
-
broadcast(:ok)
|
30
|
-
end
|
31
|
-
|
32
|
-
private
|
33
|
-
|
34
|
-
attr_reader :timeline_entry, :form
|
35
|
-
|
36
|
-
def update_timeline_entry
|
37
|
-
Decidim.traceability.update!(
|
38
|
-
timeline_entry,
|
39
|
-
@user,
|
40
|
-
entry_date: form.entry_date,
|
41
|
-
title: form.title,
|
42
|
-
description: form.description
|
43
|
-
)
|
44
|
-
end
|
8
|
+
class UpdateTimelineEntry < Decidim::Commands::UpdateResource
|
9
|
+
fetch_form_attributes :entry_date, :title, :description
|
45
10
|
end
|
46
11
|
end
|
47
12
|
end
|
@@ -68,7 +68,7 @@ module Decidim
|
|
68
68
|
def destroy
|
69
69
|
enforce_permission_to(:destroy, :result, result:)
|
70
70
|
|
71
|
-
|
71
|
+
Decidim::Commands::DestroyResource.call(result, current_user) do
|
72
72
|
on(:ok) do
|
73
73
|
flash[:notice] = I18n.t("results.destroy.success", scope: "decidim.accountability.admin")
|
74
74
|
|
@@ -18,7 +18,7 @@ module Decidim
|
|
18
18
|
|
19
19
|
@form = form(StatusForm).from_params(params)
|
20
20
|
|
21
|
-
CreateStatus.call(@form
|
21
|
+
CreateStatus.call(@form) do
|
22
22
|
on(:ok) do
|
23
23
|
flash[:notice] = I18n.t("statuses.create.success", scope: "decidim.accountability.admin")
|
24
24
|
redirect_to statuses_path
|
@@ -42,7 +42,7 @@ module Decidim
|
|
42
42
|
|
43
43
|
@form = form(StatusForm).from_params(params)
|
44
44
|
|
45
|
-
UpdateStatus.call(@form, status
|
45
|
+
UpdateStatus.call(@form, status) do
|
46
46
|
on(:ok) do
|
47
47
|
flash[:notice] = I18n.t("statuses.update.success", scope: "decidim.accountability.admin")
|
48
48
|
redirect_to statuses_path
|
@@ -58,13 +58,12 @@ module Decidim
|
|
58
58
|
def destroy
|
59
59
|
enforce_permission_to(:destroy, :status, status:)
|
60
60
|
|
61
|
-
Decidim.
|
62
|
-
|
61
|
+
Decidim::Commands::DestroyResource.call(status, current_user) do
|
62
|
+
on(:ok) do
|
63
|
+
flash[:notice] = I18n.t("statuses.destroy.success", scope: "decidim.accountability.admin")
|
64
|
+
redirect_to statuses_path
|
65
|
+
end
|
63
66
|
end
|
64
|
-
|
65
|
-
flash[:notice] = I18n.t("statuses.destroy.success", scope: "decidim.accountability.admin")
|
66
|
-
|
67
|
-
redirect_to statuses_path
|
68
67
|
end
|
69
68
|
|
70
69
|
private
|
@@ -19,7 +19,7 @@ module Decidim
|
|
19
19
|
@form = form(TimelineEntryForm).from_params(params)
|
20
20
|
@form.decidim_accountability_result_id = params[:result_id]
|
21
21
|
|
22
|
-
CreateTimelineEntry.call(@form
|
22
|
+
CreateTimelineEntry.call(@form) do
|
23
23
|
on(:ok) do
|
24
24
|
flash[:notice] = I18n.t("timeline_entries.create.success", scope: "decidim.accountability.admin")
|
25
25
|
redirect_to result_timeline_entries_path(params[:result_id])
|
@@ -43,7 +43,7 @@ module Decidim
|
|
43
43
|
|
44
44
|
@form = form(TimelineEntryForm).from_params(params)
|
45
45
|
|
46
|
-
UpdateTimelineEntry.call(@form, timeline_entry
|
46
|
+
UpdateTimelineEntry.call(@form, timeline_entry) do
|
47
47
|
on(:ok) do
|
48
48
|
flash[:notice] = I18n.t("timeline_entries.update.success", scope: "decidim.accountability.admin")
|
49
49
|
redirect_to result_timeline_entries_path(params[:result_id])
|
@@ -59,13 +59,13 @@ module Decidim
|
|
59
59
|
def destroy
|
60
60
|
enforce_permission_to(:destroy, :timeline_entry, timeline_entry:)
|
61
61
|
|
62
|
-
Decidim.
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
flash[:notice] = I18n.t("timeline_entries.destroy.success", scope: "decidim.accountability.admin")
|
62
|
+
Decidim::Commands::DestroyResource.call(timeline_entry, current_user) do
|
63
|
+
on(:ok) do
|
64
|
+
flash[:notice] = I18n.t("timeline_entries.destroy.success", scope: "decidim.accountability.admin")
|
67
65
|
|
68
|
-
|
66
|
+
redirect_to result_timeline_entries_path(params[:result_id])
|
67
|
+
end
|
68
|
+
end
|
69
69
|
end
|
70
70
|
|
71
71
|
private
|
@@ -5,12 +5,10 @@ module Decidim
|
|
5
5
|
# Exposes the result resource so users can view them
|
6
6
|
class ResultsController < Decidim::Accountability::ApplicationController
|
7
7
|
include FilterResource
|
8
|
-
include Decidim::TranslatableAttributes
|
9
|
-
|
10
8
|
helper Decidim::TraceabilityHelper
|
11
9
|
helper Decidim::Accountability::BreadcrumbHelper
|
12
10
|
|
13
|
-
helper_method :results, :result, :first_class_categories, :count_calculator
|
11
|
+
helper_method :results, :result, :first_class_categories, :count_calculator
|
14
12
|
|
15
13
|
before_action :set_controller_breadcrumb
|
16
14
|
|
@@ -33,24 +31,6 @@ module Decidim
|
|
33
31
|
@result ||= search_collection.includes(:timeline_entries).find_by(id: params[:id])
|
34
32
|
end
|
35
33
|
|
36
|
-
def next_result
|
37
|
-
return if search_collection.size < 2
|
38
|
-
|
39
|
-
search_collection.order(:start_date, :id).where(Decidim::Accountability::Result.arel_table[:id].gt(result.id)).first
|
40
|
-
end
|
41
|
-
|
42
|
-
def prev_result
|
43
|
-
return if search_collection.size < 2
|
44
|
-
|
45
|
-
search_collection.order(:start_date, :id).where(Decidim::Accountability::Result.arel_table[:id].lt(result.id)).last
|
46
|
-
end
|
47
|
-
|
48
|
-
def nav_paths
|
49
|
-
return {} if result.blank?
|
50
|
-
|
51
|
-
{ prev_path: prev_result, next_path: next_result }.compact_blank.transform_values { |result| result_path(result) }
|
52
|
-
end
|
53
|
-
|
54
34
|
def search_collection
|
55
35
|
Result.where(component: current_component)
|
56
36
|
end
|
@@ -14,44 +14,10 @@ module Decidim
|
|
14
14
|
number_to_percentage(number, precision: 1, strip_insignificant_zeros: true, locale: I18n.locale)
|
15
15
|
end
|
16
16
|
|
17
|
-
def display_count(count)
|
18
|
-
heading_parent_level_results(count)
|
19
|
-
end
|
20
|
-
|
21
|
-
def active_class_if_current(scope)
|
22
|
-
"class=active" if scope.to_s == current_scope.to_s
|
23
|
-
end
|
24
|
-
|
25
17
|
def component_name
|
26
18
|
(defined?(current_component) && translated_attribute(current_component&.name).presence) || t("decidim.components.accountability.name")
|
27
19
|
end
|
28
20
|
|
29
|
-
def categories_label
|
30
|
-
translated_attribute(component_settings.categories_label).presence || t("results.home.categories_label", scope: "decidim.accountability")
|
31
|
-
end
|
32
|
-
|
33
|
-
def subcategories_label
|
34
|
-
translated_attribute(component_settings.subcategories_label).presence || t("results.home.subcategories_label", scope: "decidim.accountability")
|
35
|
-
end
|
36
|
-
|
37
|
-
def heading_parent_level_results(count)
|
38
|
-
text = translated_attribute(component_settings.heading_parent_level_results).presence
|
39
|
-
if text
|
40
|
-
pluralize(count, text)
|
41
|
-
else
|
42
|
-
t("results.count.results_count", scope: "decidim.accountability", count:)
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
def heading_leaf_level_results(count)
|
47
|
-
text = translated_attribute(component_settings.heading_leaf_level_results).presence
|
48
|
-
if text
|
49
|
-
pluralize(count, text)
|
50
|
-
else
|
51
|
-
t("results.count.results_count", scope: "decidim.accountability", count:)
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
21
|
def filter_items_for(participatory_space:, category:)
|
56
22
|
[
|
57
23
|
{
|
@@ -5,10 +5,6 @@ module Decidim
|
|
5
5
|
# Helpers needed to render the navigation breadcrumbs in results.
|
6
6
|
#
|
7
7
|
module BreadcrumbHelper
|
8
|
-
def stats_calculator
|
9
|
-
@stats_calculator ||= ResultStatsCalculator.new(result)
|
10
|
-
end
|
11
|
-
|
12
8
|
def current_scope
|
13
9
|
params[:filter][:with_scope] if params[:filter]
|
14
10
|
end
|
@@ -56,7 +56,7 @@ module Decidim
|
|
56
56
|
end
|
57
57
|
|
58
58
|
# Public: There are two ways to update parent's progress:
|
59
|
-
# - using weights, in which case each progress is multiplied by the
|
59
|
+
# - using weights, in which case each progress is multiplied by the weight and them summed
|
60
60
|
# - not using weights, and using the average of progress of each children
|
61
61
|
def update_progress!
|
62
62
|
self.progress = if children_use_weighted_progress?
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module Decidim
|
4
4
|
module Accountability
|
5
5
|
# The data store for a Status in the Decidim::Accountability component. It stores a
|
6
|
-
# key, a localized name, a localized description and
|
6
|
+
# key, a localized name, a localized description and associated progress number.
|
7
7
|
class Status < Accountability::ApplicationRecord
|
8
8
|
include Decidim::HasComponent
|
9
9
|
include Decidim::TranslatableResource
|
@@ -2,7 +2,7 @@ import "diff"
|
|
2
2
|
import "src/decidim/accountability/version_diff"
|
3
3
|
|
4
4
|
$(() => {
|
5
|
-
// Show category list on click when we are on a small
|
5
|
+
// Show category list on click when we are on a small screen
|
6
6
|
if ($(window).width() < 768) {
|
7
7
|
$(".category--section").click((event) => {
|
8
8
|
$(event.currentTarget).next(".category--elements").toggleClass("active");
|
@@ -131,7 +131,7 @@ module Decidim
|
|
131
131
|
Decidim::Accountability::Result.includes(:parent).references(:parent)
|
132
132
|
.where(parents_decidim_accountability_results: { id: nil })
|
133
133
|
.where.not(parent_id: nil).each do |result|
|
134
|
-
|
134
|
+
Decidim::Commands::DestroyResource.call(result, @extra_context[:current_user])
|
135
135
|
end
|
136
136
|
end
|
137
137
|
end
|
@@ -50,7 +50,7 @@
|
|
50
50
|
<th>
|
51
51
|
<%= sort_link(query, :created_at, t("models.result.fields.created_at", scope: "decidim.accountability") ) %>
|
52
52
|
</th>
|
53
|
-
<th
|
53
|
+
<th><%= t("actions.title", scope: "decidim.accountability") %></th>
|
54
54
|
</tr>
|
55
55
|
</thead>
|
56
56
|
<tbody>
|
@@ -14,7 +14,7 @@
|
|
14
14
|
<th><%= t("models.status.fields.name", scope: "decidim.accountability") %></th>
|
15
15
|
<th><%= t("models.status.fields.description", scope: "decidim.accountability") %></th>
|
16
16
|
<th><%= t("models.status.fields.progress", scope: "decidim.accountability") %></th>
|
17
|
-
<th
|
17
|
+
<th><%= t("actions.title", scope: "decidim.accountability") %></th>
|
18
18
|
</tr>
|
19
19
|
</thead>
|
20
20
|
<tbody>
|
@@ -22,7 +22,7 @@
|
|
22
22
|
<tr data-id="<%= status.id %>">
|
23
23
|
<td><%= status.key %><br></td>
|
24
24
|
<td><%= translated_attribute(status.name) %></td>
|
25
|
-
<td><%= truncate translated_attribute(status.description),
|
25
|
+
<td><%= truncate translated_attribute(status.description), length: 50 %></td>
|
26
26
|
<td><%= status.progress %></td>
|
27
27
|
<td class="table-list__actions">
|
28
28
|
<% if allowed_to? :update, :status, status: status %>
|
@@ -16,7 +16,7 @@
|
|
16
16
|
<tr>
|
17
17
|
<th><%= t("models.timeline_entry.fields.entry_date", scope: "decidim.accountability") %></th>
|
18
18
|
<th><%= t("models.timeline_entry.fields.title", scope: "decidim.accountability") %></th>
|
19
|
-
<th
|
19
|
+
<th><%= t("actions.title", scope: "decidim.accountability") %></th>
|
20
20
|
</tr>
|
21
21
|
</thead>
|
22
22
|
<tbody>
|
@@ -9,12 +9,12 @@
|
|
9
9
|
) %>
|
10
10
|
|
11
11
|
<div>
|
12
|
-
<span class="accountability__grid-title"><%= categories_label %></span>
|
12
|
+
<span class="accountability__grid-title"><%= t("results.home.categories_label", scope: "decidim.accountability") %></span>
|
13
13
|
<%= subelements.call %>
|
14
14
|
</div>
|
15
15
|
|
16
16
|
<div>
|
17
|
-
<span class="accountability__grid-title"><%= subcategories_label %></span>
|
17
|
+
<span class="accountability__grid-title"><%= t("results.home.subcategories_label", scope: "decidim.accountability") %></span>
|
18
18
|
<% if subelements.has_results? %>
|
19
19
|
<div class="accountability__subgrid">
|
20
20
|
<% category.subcategories.each do |subcategory| %>
|
@@ -1,35 +1,35 @@
|
|
1
|
-
<div
|
1
|
+
<div>
|
2
2
|
<%= link_to t(".global"), root_path %>
|
3
3
|
<% if component_settings.display_progress_enabled? %>
|
4
|
-
<span
|
4
|
+
<span><%= display_percentage progress_calculator(current_scope, nil) %></span>
|
5
5
|
<% end %>
|
6
6
|
|
7
7
|
<% if category.present? && category.parent.present? %>
|
8
|
-
<span
|
8
|
+
<span>></span>
|
9
9
|
<div>
|
10
10
|
<%= link_to translated_attribute(category.parent.name), results_path(filter: { with_category: category.parent_id, with_scope: current_scope }) %>
|
11
11
|
<% if component_settings.display_progress_enabled? %>
|
12
|
-
<span
|
12
|
+
<span><%= display_percentage progress_calculator(current_scope, category.parent_id) %></span>
|
13
13
|
<% end %>
|
14
14
|
</div>
|
15
15
|
<% end %>
|
16
16
|
|
17
17
|
<% if category.present? %>
|
18
|
-
<span
|
18
|
+
<span>></span>
|
19
19
|
<div>
|
20
20
|
<%= link_to translated_attribute(category.name), results_path(filter: { with_category: category.id, with_scope: current_scope }) %>
|
21
21
|
<% if component_settings.display_progress_enabled? %>
|
22
|
-
<span
|
22
|
+
<span><%= display_percentage progress_calculator(current_scope, category.id) %></span>
|
23
23
|
<% end %>
|
24
24
|
</div>
|
25
25
|
<% end %>
|
26
26
|
|
27
27
|
<% if result && result.parent.present? %>
|
28
|
-
<span
|
28
|
+
<span>></span>
|
29
29
|
<div>
|
30
30
|
<%= link_to translated_attribute(result.parent.title), result_path(result.parent, filter: { with_category: current_scope }) %>
|
31
31
|
<% if component_settings.display_progress_enabled? %>
|
32
|
-
<span
|
32
|
+
<span><%= display_percentage result.parent.progress %></span>
|
33
33
|
<% end %>
|
34
34
|
</div>
|
35
35
|
<% end %>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<%= render layout: "layouts/decidim/shared/layout_item"
|
1
|
+
<%= render layout: "layouts/decidim/shared/layout_item" do %>
|
2
2
|
<%= cell("decidim/accountability/project", result) %>
|
3
3
|
|
4
4
|
<section class="layout-main__section layout-main__buttons" data-buttons>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<%= translated_attribute(result.title) %>
|
7
7
|
</h4>
|
8
8
|
|
9
|
-
<div
|
9
|
+
<div>
|
10
10
|
<% if result.start_date %>
|
11
11
|
<strong><%= t("models.result.fields.start_date", scope: "decidim.accountability") %></strong>
|
12
12
|
<span><%= l result.start_date, format: :short %></span>
|
@@ -25,8 +25,8 @@
|
|
25
25
|
<% end %>
|
26
26
|
|
27
27
|
<% if result.progress.present? %>
|
28
|
-
<div
|
29
|
-
<span
|
28
|
+
<div>
|
29
|
+
<span><%= display_percentage result.progress %></span>
|
30
30
|
</div>
|
31
31
|
<% end %>
|
32
32
|
</div>
|
data/config/locales/ar.yml
CHANGED
@@ -181,15 +181,7 @@ ar:
|
|
181
181
|
search: البحث عن الإجراءات
|
182
182
|
show:
|
183
183
|
stats:
|
184
|
-
attendees: الحضور
|
185
184
|
back_to_resource: العودة إلى النتيجة
|
186
|
-
comments: التعليقات
|
187
|
-
contributions: مساهمات
|
188
|
-
last_edited_by: التعديل الأخير تم بواسطة
|
189
|
-
last_updated_at: آخر تحديث في
|
190
|
-
meetings: اجتماعات
|
191
|
-
proposals: اقتراحات
|
192
|
-
votes: الدعم
|
193
185
|
timeline:
|
194
186
|
title: تطور المشروع
|
195
187
|
admin:
|
@@ -208,16 +200,12 @@ ar:
|
|
208
200
|
name: المسائلة
|
209
201
|
settings:
|
210
202
|
global:
|
211
|
-
categories_label: اسم "الفئات"
|
212
203
|
comments_enabled: تم تمكين التعليقات
|
213
204
|
comments_max_length: الحد الأقصى لطول التعليقات (اترك ال0 للقيمة الافتراضية)
|
214
205
|
display_progress_enabled: عرض التقدم
|
215
|
-
heading_leaf_level_results: اسم "المشاريع"
|
216
|
-
heading_parent_level_results: اسم "النتائج"
|
217
206
|
intro: مقدمة
|
218
207
|
scope_id: النطاق
|
219
208
|
scopes_enabled: النطاقات مفعلة
|
220
|
-
subcategories_label: اسم "الفئات الفرعية"
|
221
209
|
step:
|
222
210
|
comments_blocked: تم حظر التعليقات
|
223
211
|
events:
|
data/config/locales/bg.yml
CHANGED
@@ -235,15 +235,7 @@ bg:
|
|
235
235
|
search: Търсене на действия
|
236
236
|
show:
|
237
237
|
stats:
|
238
|
-
attendees: Присъстващи
|
239
238
|
back_to_resource: Върни се към резултата
|
240
|
-
comments: Коментари
|
241
|
-
contributions: Предложения
|
242
|
-
last_edited_by: Последна промяна на
|
243
|
-
last_updated_at: Последно обновен на
|
244
|
-
meetings: Срещи
|
245
|
-
proposals: Предложения
|
246
|
-
votes: Поддръжки
|
247
239
|
timeline:
|
248
240
|
title: Развитие на проекта
|
249
241
|
admin:
|
@@ -262,16 +254,12 @@ bg:
|
|
262
254
|
name: Отговорност
|
263
255
|
settings:
|
264
256
|
global:
|
265
|
-
categories_label: Име за "категории"
|
266
257
|
comments_enabled: Коментарите са разрешени
|
267
258
|
comments_max_length: Максимална дължина на коментарите (Оставете 0 за стойност по подразбиране)
|
268
259
|
display_progress_enabled: Показвай развитието
|
269
|
-
heading_leaf_level_results: Име за "Проекти"
|
270
|
-
heading_parent_level_results: Име за "Резултати"
|
271
260
|
intro: Въведение
|
272
261
|
scope_id: Сфера
|
273
262
|
scopes_enabled: Сферите са разрешени
|
274
|
-
subcategories_label: Име за "подкатегории"
|
275
263
|
step:
|
276
264
|
comments_blocked: Коментарите са блокирани
|
277
265
|
events:
|
data/config/locales/ca.yml
CHANGED
@@ -236,15 +236,7 @@ ca:
|
|
236
236
|
search: Cercar actuacions
|
237
237
|
show:
|
238
238
|
stats:
|
239
|
-
attendees: Assistents
|
240
239
|
back_to_resource: Tornar al resultat
|
241
|
-
comments: Comentaris
|
242
|
-
contributions: Aportacions
|
243
|
-
last_edited_by: Editat per última vegada per
|
244
|
-
last_updated_at: Darrera actualització el
|
245
|
-
meetings: Trobades
|
246
|
-
proposals: Propostes
|
247
|
-
votes: Suports
|
248
240
|
timeline:
|
249
241
|
title: Evolució del projecte
|
250
242
|
admin:
|
@@ -263,16 +255,12 @@ ca:
|
|
263
255
|
name: Seguiment
|
264
256
|
settings:
|
265
257
|
global:
|
266
|
-
categories_label: Nom per a "Categories"
|
267
258
|
comments_enabled: Comentaris habilitats
|
268
259
|
comments_max_length: Longitud màxima dels comentaris (deixa 0 si vols mantenir la configuració per defecte)
|
269
260
|
display_progress_enabled: Mostrar el progrés
|
270
|
-
heading_leaf_level_results: Nom per a "Projectes"
|
271
|
-
heading_parent_level_results: Nom per a "Resultats"
|
272
261
|
intro: Introducció
|
273
262
|
scope_id: Àmbit
|
274
263
|
scopes_enabled: Àmbits habilitats
|
275
|
-
subcategories_label: Nom per a "Subcategories"
|
276
264
|
step:
|
277
265
|
comments_blocked: Comentaris bloquejats
|
278
266
|
events:
|