decidim-budgets 0.31.6 → 0.32.0.rc1

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.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -13
  3. data/app/cells/decidim/budgets/budget_list_item_cell.rb +6 -12
  4. data/app/commands/decidim/budgets/admin/create_project.rb +7 -6
  5. data/app/commands/decidim/budgets/admin/update_project.rb +7 -6
  6. data/app/commands/decidim/budgets/checkout.rb +7 -1
  7. data/app/controllers/concerns/decidim/budgets/admin/filterable.rb +0 -4
  8. data/app/controllers/decidim/budgets/admin/budgets_controller.rb +3 -2
  9. data/app/controllers/decidim/budgets/admin/projects_controller.rb +3 -2
  10. data/app/controllers/decidim/budgets/admin/proposals_imports_controller.rb +1 -1
  11. data/app/controllers/decidim/budgets/line_items_controller.rb +4 -4
  12. data/app/controllers/decidim/budgets/projects_controller.rb +27 -27
  13. data/app/forms/decidim/budgets/admin/project_form.rb +2 -4
  14. data/app/forms/decidim/budgets/admin/project_import_proposals_form.rb +0 -13
  15. data/app/helpers/decidim/budgets/projects_helper.rb +9 -2
  16. data/app/models/decidim/budgets/project.rb +8 -8
  17. data/app/permissions/decidim/budgets/permissions.rb +7 -2
  18. data/app/views/decidim/budgets/admin/projects/_actions.html.erb +1 -1
  19. data/app/views/decidim/budgets/admin/projects/_form.html.erb +1 -1
  20. data/app/views/decidim/budgets/admin/projects/_project-tr.html.erb +0 -3
  21. data/app/views/decidim/budgets/admin/projects/_projects-thead.html.erb +0 -1
  22. data/app/views/decidim/budgets/admin/projects/edit.html.erb +3 -2
  23. data/app/views/decidim/budgets/admin/projects/new.html.erb +3 -2
  24. data/app/views/decidim/budgets/projects/_budget_summary.html.erb +1 -1
  25. data/app/views/decidim/budgets/projects/show.html.erb +2 -18
  26. data/config/locales/ar.yml +0 -3
  27. data/config/locales/bg.yml +1 -11
  28. data/config/locales/bs-BA.yml +0 -1
  29. data/config/locales/ca-IT.yml +4 -12
  30. data/config/locales/ca.yml +4 -12
  31. data/config/locales/cs.yml +4 -11
  32. data/config/locales/de.yml +2 -11
  33. data/config/locales/el.yml +1 -11
  34. data/config/locales/en.yml +4 -11
  35. data/config/locales/es-MX.yml +4 -12
  36. data/config/locales/es-PY.yml +4 -12
  37. data/config/locales/es.yml +4 -12
  38. data/config/locales/eu.yml +25 -33
  39. data/config/locales/fi-plain.yml +3 -11
  40. data/config/locales/fi.yml +3 -11
  41. data/config/locales/fr-CA.yml +2 -12
  42. data/config/locales/fr.yml +2 -12
  43. data/config/locales/ga-IE.yml +0 -1
  44. data/config/locales/gl.yml +1 -8
  45. data/config/locales/hu.yml +1 -11
  46. data/config/locales/id-ID.yml +0 -3
  47. data/config/locales/is-IS.yml +1 -3
  48. data/config/locales/it.yml +1 -10
  49. data/config/locales/ja.yml +4 -12
  50. data/config/locales/kaa.yml +0 -1
  51. data/config/locales/ko.yml +0 -3
  52. data/config/locales/lb.yml +1 -10
  53. data/config/locales/lt.yml +1 -11
  54. data/config/locales/lv.yml +0 -3
  55. data/config/locales/nl.yml +1 -11
  56. data/config/locales/no.yml +1 -11
  57. data/config/locales/pl.yml +1 -11
  58. data/config/locales/pt-BR.yml +4 -11
  59. data/config/locales/pt.yml +1 -10
  60. data/config/locales/ro-RO.yml +1 -11
  61. data/config/locales/ru.yml +0 -3
  62. data/config/locales/sk.yml +0 -361
  63. data/config/locales/sq-AL.yml +0 -5
  64. data/config/locales/sr-CS.yml +0 -1
  65. data/config/locales/sv.yml +4 -13
  66. data/config/locales/tr-TR.yml +1 -10
  67. data/config/locales/uk.yml +0 -3
  68. data/config/locales/zh-CN.yml +1 -10
  69. data/config/locales/zh-TW.yml +1 -11
  70. data/decidim-budgets.gemspec +8 -11
  71. data/lib/decidim/api/budget_type.rb +0 -2
  72. data/lib/decidim/api/budgets_type.rb +2 -2
  73. data/lib/decidim/api/project_type.rb +2 -4
  74. data/lib/decidim/budgets/component.rb +1 -5
  75. data/lib/decidim/budgets/project_serializer.rb +2 -2
  76. data/lib/decidim/budgets/version.rb +1 -1
  77. data/lib/decidim/budgets.rb +0 -2
  78. metadata +14 -18
  79. data/app/jobs/decidim/budgets/send_order_summary_job.rb +0 -15
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a664ae470b6c502a3e309f5d28eca3adb0007e4fe396cedc00383fa5c4531a27
4
- data.tar.gz: 9f442c1648418b9155eaa32ddad0c590f183469623d8cb49fd7ce8d9d2bc769d
3
+ metadata.gz: 8d1e9a57f1570f7e7c744aa5491727f328cddc0eb68cab35598f7f67042e1820
4
+ data.tar.gz: e66a4b84c85494fcd0f56c9f7231dafca776d6e43cdd1c61fcc5e51d258f05b1
5
5
  SHA512:
6
- metadata.gz: '068140a973104d5cb9bb5eb7d1f979ce3f43aaef1745fd7c02852c8be2292353bce54c600425987fd1b5cec0e635295da50f408a95582c1cf4d95add5760dbcd'
7
- data.tar.gz: 51bb291d46c7007f110c5e04a9673577aeadb25efb20b9e54d273f8dfda3f96581fa7c2b43ff4b897084cc1deac42c031e3f6a307fb1c25eaf26672fe9d7b2c2
6
+ metadata.gz: 70d15990935083ada78aad11f412d08c9beb4207b848a726eb362bc965a3e0adb0c61e4e85db1742615293691a838c6c7e62db252f20a6b28f5ea548b3b51e1a
7
+ data.tar.gz: 7fa445aa14f232f290e66ff43d57f52302d81b640dc33248dad3868e5de52e2d73d2ca130d2186becacf4e82d5540d67cf61d8a152d0a5e2242d2bf73108a371
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # Decidim::Budgets
1
+ # decidim-budgets
2
2
 
3
- The Budgets module adds budgets with projects related to them to any participatory process. It adds a CRUD engine to the admin and public views scoped inside the participatory space. Projects will link to related proposals and have a budget. The users should be able to distribute a budget between these projects.
3
+ The Budgets module adds budgets with projects related to them to any participatory space. It adds a CRUD engine to the admin and public views scoped inside the participatory space. Projects will link to related proposals and have a budget. The users should be able to distribute a budget between these projects.
4
4
 
5
5
  ## Usage
6
6
 
@@ -16,17 +16,7 @@ This plugin provides:
16
16
 
17
17
  ## Installation
18
18
 
19
- Add this line to your application's Gemfile:
20
-
21
- ```ruby
22
- gem "decidim-budgets"
23
- ```
24
-
25
- And then execute:
26
-
27
- ```bash
28
- bundle
29
- ```
19
+ This is on the default Decidim installation so you should not change anything to use this component.
30
20
 
31
21
  ## Budget Workflows
32
22
 
@@ -47,18 +47,12 @@ module Decidim
47
47
  # If not (i.e. voting is disabled or finished), then link to the resource itself
48
48
  def link_to_resource_or_vote(css_class)
49
49
  if voting_open?
50
- if current_user
51
- action_authorized_link_to :vote,
52
- budget_projects_path(budget, start_voting: true),
53
- resource: budget,
54
- class: css_class,
55
- data: { "redirect-url": budget_projects_path(budget) } do
56
- yield
57
- end
58
- else
59
- link_to budget_projects_path(budget, start_voting: true), class: css_class do
60
- yield
61
- end
50
+ action_authorized_link_to "vote",
51
+ budget_projects_path(budget, start_voting: true),
52
+ resource: budget,
53
+ data: { "redirect-url": budget_projects_path(budget) },
54
+ class: css_class do
55
+ yield
62
56
  end
63
57
  else
64
58
  link_to resource_path, class: css_class do
@@ -6,24 +6,25 @@ module Decidim
6
6
  # This command is executed when the user creates a Project from the admin
7
7
  # panel.
8
8
  class CreateProject < Decidim::Commands::CreateResource
9
- include ::Decidim::MultipleAttachmentsMethods
9
+ include ::Decidim::GalleryMethods
10
+
10
11
  fetch_form_attributes :budget, :taxonomizations, :title, :description, :budget_amount, :address, :latitude, :longitude
11
12
 
12
13
  private
13
14
 
14
- attr_reader :attachments
15
+ attr_reader :gallery
15
16
 
16
17
  def run_after_hooks
17
18
  @attached_to = resource
18
19
  link_proposals
19
- create_attachments if process_attachments?
20
+ create_gallery if process_gallery?
20
21
  end
21
22
 
22
23
  def run_before_hooks
23
- return unless process_attachments?
24
+ return unless process_gallery?
24
25
 
25
- build_attachments
26
- raise Decidim::Commands::HookError if attachments_invalid?
26
+ build_gallery
27
+ raise Decidim::Commands::HookError if gallery_invalid?
27
28
  end
28
29
 
29
30
  def extra_params
@@ -6,7 +6,8 @@ module Decidim
6
6
  # This command is executed when the user changes a Project from the admin
7
7
  # panel.
8
8
  class UpdateProject < Decidim::Commands::UpdateResource
9
- include ::Decidim::MultipleAttachmentsMethods
9
+ include ::Decidim::GalleryMethods
10
+
10
11
  fetch_form_attributes :taxonomizations, :title, :description, :budget_amount, :address, :latitude, :longitude
11
12
 
12
13
  def initialize(form, project)
@@ -18,15 +19,15 @@ module Decidim
18
19
 
19
20
  def run_after_hooks
20
21
  link_proposals
21
- create_attachments if process_attachments?
22
- attachment_cleanup!(include_all_attachments: true)
22
+ create_gallery if process_gallery?
23
+ photo_cleanup!
23
24
  end
24
25
 
25
26
  def run_before_hooks
26
- return unless process_attachments?
27
+ return unless process_gallery?
27
28
 
28
- build_attachments
29
- raise Decidim::Commands::HookError if attachments_invalid?
29
+ build_gallery
30
+ raise Decidim::Commands::HookError if gallery_invalid?
30
31
  end
31
32
 
32
33
  def attributes
@@ -31,7 +31,7 @@ module Decidim
31
31
  return unless order && order.valid?
32
32
 
33
33
  @order.with_lock do
34
- SendOrderSummaryJob.perform_later(@order)
34
+ send_order_summary_job(@order)
35
35
 
36
36
  Decidim.traceability.update!(
37
37
  @order,
@@ -43,6 +43,12 @@ module Decidim
43
43
  false
44
44
  end
45
45
  end
46
+
47
+ def send_order_summary_job(order)
48
+ return if order&.user&.email.blank?
49
+
50
+ OrderSummaryMailer.order_summary(order).deliver_later
51
+ end
46
52
  end
47
53
  end
48
54
  end
@@ -23,10 +23,6 @@ module Decidim
23
23
  collection.includes(:taxonomies).joins(:taxonomies)
24
24
  end
25
25
 
26
- def search_field_predicate
27
- :id_string_or_title_cont
28
- end
29
-
30
26
  def filters
31
27
  [
32
28
  :taxonomies_part_of_contains,
@@ -6,6 +6,7 @@ module Decidim
6
6
  # This controller allows the create or update a budget.
7
7
  class BudgetsController < Admin::ApplicationController
8
8
  include Decidim::Admin::HasTrashableResources
9
+
9
10
  helper_method :budgets, :budget, :finished_orders, :pending_orders,
10
11
  :users_with_pending_orders, :users_with_finished_orders
11
12
 
@@ -26,7 +27,7 @@ module Decidim
26
27
 
27
28
  on(:invalid) do
28
29
  flash.now[:alert] = I18n.t("budgets.create.invalid", scope: "decidim.budgets.admin")
29
- render action: "new", status: :unprocessable_entity
30
+ render action: "new", status: :unprocessable_content
30
31
  end
31
32
  end
32
33
  end
@@ -48,7 +49,7 @@ module Decidim
48
49
 
49
50
  on(:invalid) do
50
51
  flash.now[:alert] = I18n.t("budgets.update.invalid", scope: "decidim.budgets.admin")
51
- render action: "edit", status: :unprocessable_entity
52
+ render action: "edit", status: :unprocessable_content
52
53
  end
53
54
  end
54
55
  end
@@ -9,6 +9,7 @@ module Decidim
9
9
  include Decidim::Admin::HasTrashableResources
10
10
  include Decidim::Admin::ComponentTaxonomiesHelper
11
11
  include Decidim::Budgets::Admin::Filterable
12
+
12
13
  helper Decidim::Budgets::Admin::ProjectBulkActionsHelper
13
14
  helper Decidim::Budgets::ProjectsHelper
14
15
 
@@ -39,7 +40,7 @@ module Decidim
39
40
 
40
41
  on(:invalid) do
41
42
  flash.now[:alert] = I18n.t("projects.create.invalid", scope: "decidim.budgets.admin")
42
- render action: "new", status: :unprocessable_entity
43
+ render action: "new", status: :unprocessable_content
43
44
  end
44
45
  end
45
46
  end
@@ -62,7 +63,7 @@ module Decidim
62
63
 
63
64
  on(:invalid) do
64
65
  flash.now[:alert] = I18n.t("projects.update.invalid", scope: "decidim.budgets.admin")
65
- render action: "edit", status: :unprocessable_entity
66
+ render action: "edit", status: :unprocessable_content
66
67
  end
67
68
  end
68
69
  end
@@ -24,7 +24,7 @@ module Decidim
24
24
 
25
25
  on(:invalid) do
26
26
  flash[:alert] = I18n.t("proposals_imports.create.invalid", scope: "decidim.budgets.admin")
27
- render action: "new", status: :unprocessable_entity
27
+ render action: "new", status: :unprocessable_content
28
28
  end
29
29
  end
30
30
  end
@@ -22,12 +22,12 @@ module Decidim
22
22
  AddLineItem.call(persisted_current_order, project, current_user) do
23
23
  on(:ok) do |order|
24
24
  self.current_order = order
25
- format.html { redirect_back(fallback_location: budget_path(budget)) }
25
+ format.html { redirect_back_or_to(budget_path(budget)) }
26
26
  format.js { render "update_budget" }
27
27
  end
28
28
 
29
29
  on(:invalid) do
30
- format.js { render "update_budget", status: :unprocessable_entity }
30
+ format.js { render "update_budget", status: :unprocessable_content }
31
31
  end
32
32
  end
33
33
  end
@@ -38,12 +38,12 @@ module Decidim
38
38
  respond_to do |format|
39
39
  RemoveLineItem.call(current_order, project) do
40
40
  on(:ok) do |_order|
41
- format.html { redirect_back(fallback_location: budget_path(budget)) }
41
+ format.html { redirect_back_or_to(budget_path(budget)) }
42
42
  format.js { render "update_budget" }
43
43
  end
44
44
 
45
45
  on(:invalid) do
46
- format.js { render "update_budget", status: :unprocessable_entity }
46
+ format.js { render "update_budget", status: :unprocessable_content }
47
47
  end
48
48
  end
49
49
  end
@@ -6,10 +6,11 @@ module Decidim
6
6
  class ProjectsController < Decidim::Budgets::ApplicationController
7
7
  include FilterResource
8
8
  include NeedsCurrentOrder
9
+ include Decidim::AttachmentsHelper
9
10
  include Decidim::Budgets::Orderable
10
11
  include Decidim::IconHelper
11
12
 
12
- helper_method :projects, :project, :budget, :all_geocoded_projects, :tabs, :panels, :resource_added?
13
+ helper_method :projects, :project, :budget, :all_geocoded_projects, :resource_added?, :tab_panel_items
13
14
 
14
15
  before_action :set_focus_mode_if_voting_open
15
16
 
@@ -64,16 +65,8 @@ module Decidim
64
65
  voting_finished? && budget.projects.selected.any?
65
66
  end
66
67
 
67
- def tabs
68
- @tabs ||= items.map { |item| item.slice(:id, :text, :icon) }
69
- end
70
-
71
- def panels
72
- @panels ||= items.map { |item| item.slice(:id, :method, :args) }
73
- end
74
-
75
- def items
76
- @items ||= [
68
+ def tab_panel_items
69
+ @tab_panel_items ||= [
77
70
  {
78
71
  enabled: ProjectHistoryCell.new(@project).render?,
79
72
  id: "included_history",
@@ -82,24 +75,31 @@ module Decidim
82
75
  method: :cell,
83
76
  args: ["decidim/budgets/project_history", @project]
84
77
  },
85
- {
86
- enabled: @project.photos.present?,
87
- id: "images",
88
- text: t("decidim.application.photos.photos"),
89
- icon: resource_type_icon_key("images"),
90
- method: :cell,
91
- args: ["decidim/images_panel", @project]
92
- },
93
- {
94
- enabled: @project.documents.present?,
95
- id: "documents",
96
- text: t("decidim.application.documents.documents"),
97
- icon: resource_type_icon_key("documents"),
98
- method: :cell,
99
- args: ["decidim/documents_panel", @project]
100
- }
78
+ *attachments_tab_panel_items(@project)
101
79
  ].select { |item| item[:enabled] }
102
80
  end
81
+
82
+ def add_breadcrumb_item
83
+ return {} if project.blank?
84
+
85
+ {
86
+ label: translated_attribute(project.title),
87
+ url: Decidim::EngineRouter.main_proxy(current_component).budget_project_url(budget, project),
88
+ active: false,
89
+ resource: project
90
+ }
91
+ end
92
+
93
+ def add_parent_breadcrumb_item
94
+ return {} if budget.blank?
95
+
96
+ {
97
+ label: translated_attribute(budget.title),
98
+ url: Decidim::EngineRouter.main_proxy(current_component).budget_projects_url(budget),
99
+ active: false,
100
+ resource: budget
101
+ }
102
+ end
103
103
  end
104
104
  end
105
105
  end
@@ -22,7 +22,7 @@ module Decidim
22
22
  attribute :attachment, AttachmentForm
23
23
  attribute :selected, Boolean
24
24
 
25
- attachments_attribute :attachments
25
+ attachments_attribute :photos
26
26
 
27
27
  validates :title, translatable_presence: true
28
28
  validates :description, translatable_presence: true
@@ -36,8 +36,6 @@ module Decidim
36
36
  def map_model(model)
37
37
  self.proposal_ids = model.linked_resources(:proposals, "included_proposals").pluck(:id)
38
38
  self.selected = model.selected?
39
- self.attachments = model.attachments.ids
40
- self.add_attachments = model.attachments.map { |att| { id: att.id, title: att.title } }
41
39
  end
42
40
 
43
41
  def participatory_space_manifest
@@ -76,7 +74,7 @@ module Decidim
76
74
  # an error, the attachment is lost, so we need a way to inform the user of
77
75
  # this problem.
78
76
  def notify_missing_attachment_if_errored
79
- errors.add(:add_attachments, :needs_to_be_reattached) if errors.any? && add_attachments.present?
77
+ errors.add(:add_photos, :needs_to_be_reattached) if errors.any? && add_photos.present?
80
78
  end
81
79
  end
82
80
  end
@@ -14,7 +14,6 @@ module Decidim
14
14
 
15
15
  validates :origin_component_id, :origin_component, :current_component, presence: true
16
16
  validates :default_budget, presence: true, numericality: { greater_than: 0 }
17
- validate :valid_states
18
17
 
19
18
  def states
20
19
  super.compact_blank
@@ -37,18 +36,6 @@ module Decidim
37
36
  def budget
38
37
  @budget ||= context[:budget]
39
38
  end
40
-
41
- private
42
-
43
- def valid_states
44
- return unless origin_component
45
- return if states.empty?
46
-
47
- valid_tokens = Decidim::Proposals::ProposalState.where(component: origin_component).pluck(:token) + ["not_answered"]
48
- return if states.all? { |state| valid_tokens.include?(state) }
49
-
50
- errors.add(:states, :invalid)
51
- end
52
39
  end
53
40
  end
54
41
  end
@@ -117,9 +117,16 @@ module Decidim
117
117
  def filter_sections
118
118
  @filter_sections ||= begin
119
119
  items = []
120
- items.append(method: :with_any_status, collection: filter_status_values, label: t("decidim.budgets.projects.filters.status"), id: "status") if voting_finished?
120
+ if voting_finished?
121
+ items.append(method: :with_any_status,
122
+ name: "[with_any_status]",
123
+ collection: filter_status_values,
124
+ label: t("decidim.budgets.projects.filters.status"),
125
+ id: "status")
126
+ end
121
127
  current_component.available_taxonomy_filters.each do |taxonomy_filter|
122
- items.append(method: "with_any_taxonomies[#{taxonomy_filter.root_taxonomy_id}]",
128
+ items.append(method: :with_any_taxonomies,
129
+ name: "[with_any_taxonomies][#{taxonomy_filter.root_taxonomy_id}]",
123
130
  collection: filter_taxonomy_values_for(taxonomy_filter),
124
131
  label: decidim_sanitize_translated(taxonomy_filter.name),
125
132
  id: "taxonomy-#{taxonomy_filter.root_taxonomy_id}")
@@ -134,14 +134,14 @@ module Decidim
134
134
  end
135
135
 
136
136
  ransacker :confirmed_orders_count do
137
- query = <<-SQL.squish
138
- (
139
- SELECT COUNT(decidim_budgets_line_items.decidim_order_id)
140
- FROM decidim_budgets_line_items
141
- LEFT JOIN decidim_budgets_orders ON decidim_budgets_orders.id = decidim_budgets_line_items.decidim_order_id
142
- WHERE decidim_budgets_orders.checked_out_at IS NOT NULL
143
- AND decidim_budgets_projects.id = decidim_budgets_line_items.decidim_project_id
144
- )
137
+ query = <<~SQL.squish
138
+ (
139
+ SELECT COUNT(decidim_budgets_line_items.decidim_order_id)
140
+ FROM decidim_budgets_line_items
141
+ LEFT JOIN decidim_budgets_orders ON decidim_budgets_orders.id = decidim_budgets_line_items.decidim_order_id
142
+ WHERE decidim_budgets_orders.checked_out_at IS NOT NULL
143
+ AND decidim_budgets_projects.id = decidim_budgets_line_items.decidim_project_id
144
+ )
145
145
  SQL
146
146
  Arel.sql(query)
147
147
  end
@@ -4,6 +4,7 @@ module Decidim
4
4
  module Budgets
5
5
  class Permissions < Decidim::DefaultPermissions
6
6
  def permissions
7
+ return permission_action if permission_action.scope == :public && public_action_allowed?
7
8
  return permission_action unless user
8
9
 
9
10
  # Delegate the admin permission checks to the admin permissions class
@@ -15,8 +16,6 @@ module Decidim
15
16
  can_vote?(false) if can_vote_project?(project || order&.projects&.first)
16
17
  when [:report, :project]
17
18
  permission_action.allow!
18
- when [:read, :project]
19
- toggle_allow(project.visible?)
20
19
  when [:create, :order]
21
20
  can_vote?(true)
22
21
  when [:export_pdf, :order]
@@ -44,6 +43,12 @@ module Decidim
44
43
  @workflow ||= context.fetch(:workflow, nil)
45
44
  end
46
45
 
46
+ def public_action_allowed?
47
+ return unless permission_action.subject == :project && permission_action.action == :read
48
+
49
+ toggle_allow(project&.visible? && !project.deleted? && !project.budget.deleted?)
50
+ end
51
+
47
52
  def can_vote?(active_allow)
48
53
  is_allowed = workflow.vote_allowed?(budget)
49
54
 
@@ -57,7 +57,7 @@
57
57
  <% end %>
58
58
  <% else %>
59
59
  <div class="dropdown__button-disabled">
60
- <%= with_tooltip t("tooltips.deleted_projects_info", scope: "decidim.admin"), class: :left do %>
60
+ <%= with_tooltip t("tooltips.deleted_projects_info", scope: "decidim.admin") do %>
61
61
  <%= icon "delete-bin-line", class: "text-gray" %>
62
62
  <span>
63
63
  <%= t("actions.soft_delete", scope: "decidim.admin") %>
@@ -33,7 +33,7 @@
33
33
  </div>
34
34
  <% end %>
35
35
 
36
- <%= render partial: "decidim/admin/shared/attachments", locals: { form: } %>
36
+ <%= render partial: "decidim/admin/shared/gallery", locals: { form: } %>
37
37
 
38
38
  <% if form.object.persisted? %>
39
39
  <div class="row column">
@@ -2,9 +2,6 @@
2
2
  <td>
3
3
  <%= check_box_tag "project_ids_s[]", project.id, false, class: "js-check-all-resources js-project-list-check js-resource-id-#{project.id}" %><br>
4
4
  </td>
5
- <td data-label="<%= t("models.project.fields.id", scope: "decidim.budgets") %>">
6
- <%= project.id %><br>
7
- </td>
8
5
  <td class="!text-left" data-label="<%= t("models.project.fields.title", scope: "decidim.budgets") %>">
9
6
  <% if allowed_to? :update, :project, project: project %>
10
7
  <%= link_to translated_attribute(project.title), resource_locator([budget, project]).edit %><br>
@@ -1,7 +1,6 @@
1
1
  <thead>
2
2
  <tr>
3
3
  <th><%= check_box_tag "projects_bulk", "all", false, class: "js-check-all" %></th>
4
- <th><%= sort_link(query, :id, t("models.project.fields.id", scope: "decidim.budgets"), default_order: :desc) %></th>
5
4
  <th class="!text-left"><%= sort_link(query, :title, t("models.project.fields.title", scope: "decidim.budgets")) %></th>
6
5
  <th><%= sort_link(query, :taxonomies_name, t("models.project.fields.taxonomies", scope: "decidim.budgets") ) %></th>
7
6
  <th><%= sort_link(query, :confirmed_orders_count, t("index.confirmed_orders_count")) %></th>
@@ -1,7 +1,8 @@
1
- <% add_decidim_page_title("#{translated_attribute(budget.title)} - #{t(".title")}") %>
1
+ <% add_decidim_page_title(t(".title", budget: decidim_sanitize_translated(budget.title))) %>
2
+
2
3
  <div class="item_show__header">
3
4
  <h1 class="item_show__header-title">
4
- <%= "#{decidim_sanitize_translated(budget.title)} #{t(".title")}" %>
5
+ <%= t(".title", budget: decidim_sanitize_translated(budget.title)) %>
5
6
  </h1>
6
7
  </div>
7
8
  <div class="item__edit item__edit-1col">
@@ -1,7 +1,8 @@
1
- <% add_decidim_page_title("#{translated_attribute(budget.title)} - #{t(".title")}") %>
1
+ <% add_decidim_page_title(t(".title", budget: translated_attribute(budget.title))) %>
2
+
2
3
  <div class="item_show__header">
3
4
  <h1 class="item_show__header-title">
4
- <%= "#{decidim_escape_translated(budget.title)} &gt; #{t(".title")}".html_safe %>
5
+ <%= t(".title", budget: translated_attribute(budget.title)) %>
5
6
  </h1>
6
7
  </div>
7
8
  <div class="item__edit item__edit-1col">
@@ -1,6 +1,6 @@
1
1
  <div id="order-progress<%= "-responsive" if responsive %>" class="budget-summary <%= responsive ? "block md:hidden" : "hidden md:block" %>" data-progress-reference data-safe-url="<%= budget_url(budget) %>">
2
2
  <% if responsive %>
3
- <%= render partial: "decidim/budgets/projects/order_progress_summary/content_responsive", locals: { focus_mode_origin: focus_mode_origin } %>
3
+ <%= render partial: "decidim/budgets/projects/order_progress_summary/content_responsive", locals: { focus_mode_origin: } %>
4
4
  <% else %>
5
5
  <%= render partial: "decidim/budgets/projects/order_progress_summary/content" %>
6
6
  <% end %>
@@ -54,24 +54,8 @@ edit_link(
54
54
  </div>
55
55
  </section>
56
56
  <section class="layout-main__section">
57
- <% if tabs.any? %>
58
- <div class="mt-8" data-controller="accordion" data-multiselectable="false" data-collapsible="false">
59
- <ul class="tab-x-container">
60
- <% tabs.each_with_index do |tab, i| %>
61
- <li>
62
- <button id="trigger-<%= tab[:id] %>" class="tab-x" data-controls="panel-<%= tab[:id] %>" data-open="<%= "true" if i.zero? %>">
63
- <%= icon tab[:icon], class: "text-gray fill-current" %><%= tab[:text] %>
64
- </button>
65
- </li>
66
- <% end %>
67
- </ul>
68
-
69
- <% panels.each do |panel| %>
70
- <div id="panel-<%= panel[:id] %>" class="py-8 panel-container">
71
- <%= send(panel[:method], *panel[:args]) %>
72
- </div>
73
- <% end %>
74
- </div>
57
+ <% if tab_panel_items.any? %>
58
+ <%= cell "decidim/tab_panels", tab_panel_items %>
75
59
  <% end %>
76
60
  </section>
77
61
 
@@ -1,4 +1,3 @@
1
- ---
2
1
  ar:
3
2
  activemodel:
4
3
  attributes:
@@ -39,7 +38,6 @@ ar:
39
38
  name: مشروع
40
39
  projects:
41
40
  edit:
42
- title: تحرير المشروع
43
41
  update: تحديث
44
42
  index:
45
43
  actions: الإجراءات
@@ -54,7 +52,6 @@ ar:
54
52
  update_budget_button: تحديث ميزانية المشروع
55
53
  new:
56
54
  create: إنشاء
57
- title: مشروع جديد
58
55
  proposals_imports:
59
56
  new:
60
57
  create: استيراد مقترحات للمشاريع
@@ -1,4 +1,3 @@
1
- ---
2
1
  bg:
3
2
  activemodel:
4
3
  attributes:
@@ -72,7 +71,6 @@ bg:
72
71
  invalid: Възникна проблем при създаването на този проект.
73
72
  success: Проектът беше създаден успешно.
74
73
  edit:
75
- title: Редактиране на проект
76
74
  update: Актуализация
77
75
  index:
78
76
  actions: Активности
@@ -92,7 +90,6 @@ bg:
92
90
  update_budget_button: Актуализирайте бюджета на проекта
93
91
  new:
94
92
  create: Създаване
95
- title: Нов проект
96
93
  update:
97
94
  invalid: Възникна проблем при актуализирането на този проект.
98
95
  success: Проектът беше актуализиран успешно.
@@ -168,7 +165,6 @@ bg:
168
165
  total_budget: Общ бюджет
169
166
  project:
170
167
  fields:
171
- id: ID
172
168
  map: Карта
173
169
  title: Заглавие
174
170
  order:
@@ -272,6 +268,7 @@ bg:
272
268
  global:
273
269
  announcement: Обявление
274
270
  comments_enabled: Коментарите са активирани
271
+ comments_max_length: Максимална дължина на коментарите (Оставете 0 за стойност по подразбиране)
275
272
  form:
276
273
  errors:
277
274
  budget_voting_rule_only_one: Трябва да бъде активирано само едно правило за гласуване.
@@ -307,13 +304,6 @@ bg:
307
304
  disabled: Гласуването е деактивирано
308
305
  enabled: Гласуването е активирано
309
306
  finished: Гласуването е приключило
310
- events:
311
- budgets:
312
- budget_published:
313
- email_intro: 'Бюджетът %{resource_title} вече е активен за %{participatory_space_title}. Можете да го видите от тази страница:'
314
- email_outro: Получавате това известие, защото следвате %{participatory_space_title}. Може да прекратите известията чрез предходния линк.
315
- email_subject: Бюджетът %{resource_title} вече е активен за %{participatory_space_title}.
316
- notification_title: Бюджетът <a href="%{resource_path}">%{resource_title}</a> вече е активен за %{participatory_space_title}.
317
307
  orders:
318
308
  checkout:
319
309
  error: Възникна проблем при обработването на Вашия глас.
@@ -1,4 +1,3 @@
1
- ---
2
1
  bs:
3
2
  decidim:
4
3
  budgets: