decidim-proposals 0.26.9 → 0.27.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/proposals/collaborative_draft_m_cell.rb +1 -1
- data/app/cells/decidim/proposals/highlighted_proposals_for_component_cell.rb +9 -1
- data/app/cells/decidim/proposals/proposal_m_cell.rb +6 -8
- data/app/commands/decidim/proposals/accept_access_to_collaborative_draft.rb +1 -1
- data/app/commands/decidim/proposals/admin/answer_proposal.rb +1 -1
- data/app/commands/decidim/proposals/admin/assign_proposals_to_valuator.rb +1 -1
- data/app/commands/decidim/proposals/admin/create_proposal.rb +10 -7
- data/app/commands/decidim/proposals/admin/create_proposal_note.rb +2 -2
- data/app/commands/decidim/proposals/admin/discard_participatory_text.rb +1 -1
- data/app/commands/decidim/proposals/admin/import_participatory_text.rb +1 -1
- data/app/commands/decidim/proposals/admin/import_proposals.rb +2 -5
- data/app/commands/decidim/proposals/admin/merge_proposals.rb +1 -1
- data/app/commands/decidim/proposals/admin/notify_proposal_answer.rb +1 -3
- data/app/commands/decidim/proposals/admin/publish_answers.rb +1 -1
- data/app/commands/decidim/proposals/admin/split_proposals.rb +1 -1
- data/app/commands/decidim/proposals/admin/unassign_proposals_from_valuator.rb +1 -1
- data/app/commands/decidim/proposals/admin/update_participatory_text.rb +1 -1
- data/app/commands/decidim/proposals/admin/update_proposal.rb +8 -2
- data/app/commands/decidim/proposals/admin/update_proposal_category.rb +5 -3
- data/app/commands/decidim/proposals/admin/update_proposal_scope.rb +3 -3
- data/app/commands/decidim/proposals/create_collaborative_draft.rb +5 -5
- data/app/commands/decidim/proposals/create_proposal.rb +1 -1
- data/app/commands/decidim/proposals/destroy_proposal.rb +1 -1
- data/app/commands/decidim/proposals/publish_collaborative_draft.rb +1 -1
- data/app/commands/decidim/proposals/publish_proposal.rb +1 -1
- data/app/commands/decidim/proposals/reject_access_to_collaborative_draft.rb +1 -1
- data/app/commands/decidim/proposals/request_access_to_collaborative_draft.rb +1 -1
- data/app/commands/decidim/proposals/unvote_proposal.rb +1 -1
- data/app/commands/decidim/proposals/update_collaborative_draft.rb +1 -1
- data/app/commands/decidim/proposals/update_proposal.rb +8 -2
- data/app/commands/decidim/proposals/vote_proposal.rb +1 -1
- data/app/commands/decidim/proposals/withdraw_collaborative_draft.rb +1 -1
- data/app/commands/decidim/proposals/withdraw_proposal.rb +1 -1
- data/app/controllers/concerns/decidim/proposals/orderable.rb +7 -5
- data/app/controllers/decidim/proposals/admin/proposals_controller.rb +7 -7
- data/app/controllers/decidim/proposals/collaborative_drafts_controller.rb +10 -10
- data/app/controllers/decidim/proposals/proposal_votes_controller.rb +1 -1
- data/app/controllers/decidim/proposals/proposals_controller.rb +25 -18
- data/app/events/decidim/proposals/publish_proposal_event.rb +0 -8
- data/app/forms/decidim/proposals/admin/import_participatory_text_form.rb +4 -4
- data/app/forms/decidim/proposals/admin/proposal_base_form.rb +4 -4
- data/app/forms/decidim/proposals/admin/proposal_form.rb +2 -0
- data/app/forms/decidim/proposals/admin/proposals_fork_form.rb +2 -2
- data/app/forms/decidim/proposals/admin/proposals_import_form.rb +1 -1
- data/app/forms/decidim/proposals/proposal_form.rb +11 -4
- data/app/forms/decidim/proposals/proposal_wizard_create_step_form.rb +3 -0
- data/app/helpers/decidim/proposals/admin/proposal_bulk_actions_helper.rb +4 -0
- data/app/helpers/decidim/proposals/application_helper.rb +4 -17
- data/app/helpers/decidim/proposals/proposal_cells_helper.rb +1 -3
- data/app/helpers/decidim/proposals/proposal_wizard_helper.rb +7 -7
- data/app/helpers/decidim/proposals/proposals_helper.rb +1 -1
- data/app/jobs/decidim/proposals/notify_proposals_mentioned_job.rb +1 -1
- data/app/models/decidim/proposals/collaborative_draft.rb +10 -0
- data/app/models/decidim/proposals/collaborative_draft_collaborator_request.rb +0 -2
- data/app/models/decidim/proposals/proposal.rb +47 -8
- data/app/queries/decidim/proposals/filtered_proposals.rb +1 -1
- data/app/queries/decidim/proposals/similar_proposals.rb +1 -1
- data/app/services/decidim/proposals/proposal_search.rb +16 -71
- data/app/validators/proposal_length_validator.rb +2 -5
- data/app/views/decidim/proposals/admin/participatory_texts/_article-preview.html.erb +2 -2
- data/app/views/decidim/proposals/admin/proposals/_form.html.erb +1 -1
- data/app/views/decidim/proposals/admin/proposals/_proposal-tr.html.erb +2 -2
- data/app/views/decidim/proposals/admin/proposals/edit.html.erb +0 -1
- data/app/views/decidim/proposals/admin/proposals/index.html.erb +0 -1
- data/app/views/decidim/proposals/admin/proposals/new.html.erb +0 -1
- data/app/views/decidim/proposals/admin/proposals/publish_answers.js.erb +1 -1
- data/app/views/decidim/proposals/admin/proposals/show.html.erb +0 -1
- data/app/views/decidim/proposals/admin/proposals/update_attribute.js.erb +26 -0
- data/app/views/decidim/proposals/collaborative_drafts/_edit_form_fields.html.erb +9 -17
- data/app/views/decidim/proposals/collaborative_drafts/_filters.html.erb +4 -4
- data/app/views/decidim/proposals/collaborative_drafts/_wizard_aside.html.erb +1 -1
- data/app/views/decidim/proposals/collaborative_drafts/edit.html.erb +3 -1
- data/app/views/decidim/proposals/collaborative_drafts/new.html.erb +3 -1
- data/app/views/decidim/proposals/collaborative_drafts/show.html.erb +1 -1
- data/app/views/decidim/proposals/proposals/_edit_form_fields.html.erb +13 -36
- data/app/views/decidim/proposals/proposals/_filters.html.erb +5 -5
- data/app/views/decidim/proposals/proposals/_linked_proposals.html.erb +1 -2
- data/app/views/decidim/proposals/proposals/_proposals.html.erb +5 -5
- data/app/views/decidim/proposals/proposals/complete.html.erb +3 -1
- data/app/views/decidim/proposals/proposals/edit.html.erb +3 -1
- data/app/views/decidim/proposals/proposals/edit_draft.html.erb +3 -1
- data/app/views/decidim/proposals/proposals/new.html.erb +3 -1
- data/config/locales/am-ET.yml +1 -0
- data/config/locales/ar.yml +4 -262
- data/config/locales/bg.yml +1 -19
- data/config/locales/ca.yml +19 -31
- data/config/locales/cs.yml +34 -46
- data/config/locales/da.yml +1 -0
- data/config/locales/de.yml +10 -107
- data/config/locales/el.yml +5 -146
- data/config/locales/en.yml +12 -25
- data/config/locales/eo.yml +1 -0
- data/config/locales/es-MX.yml +20 -32
- data/config/locales/es-PY.yml +20 -32
- data/config/locales/es.yml +15 -27
- data/config/locales/et.yml +1 -0
- data/config/locales/eu.yml +283 -343
- data/config/locales/fi-plain.yml +17 -28
- data/config/locales/fi.yml +21 -32
- data/config/locales/fr-CA.yml +19 -32
- data/config/locales/fr.yml +31 -44
- data/config/locales/ga-IE.yml +1 -2
- data/config/locales/gl.yml +16 -13
- data/config/locales/hr.yml +1 -0
- data/config/locales/hu.yml +13 -64
- data/config/locales/id-ID.yml +5 -19
- data/config/locales/is-IS.yml +8 -17
- data/config/locales/it.yml +12 -18
- data/config/locales/ja.yml +67 -79
- data/config/locales/ko.yml +1 -0
- data/config/locales/lb.yml +1 -0
- data/config/locales/lt.yml +1 -1007
- data/config/locales/lv.yml +5 -17
- data/config/locales/mt.yml +1 -0
- data/config/locales/nl.yml +15 -20
- data/config/locales/no.yml +6 -11
- data/config/locales/om-ET.yml +1 -0
- data/config/locales/pl.yml +5 -28
- data/config/locales/pt-BR.yml +6 -33
- data/config/locales/pt.yml +6 -13
- data/config/locales/ro-RO.yml +9 -9
- data/config/locales/ru.yml +8 -16
- data/config/locales/si-LK.yml +1 -0
- data/config/locales/sk.yml +6 -18
- data/config/locales/sl.yml +4 -0
- data/config/locales/so-SO.yml +1 -0
- data/config/locales/sr-CS.yml +1 -2
- data/config/locales/sv.yml +12 -12
- data/config/locales/sw-KE.yml +1 -0
- data/config/locales/ti-ER.yml +1 -0
- data/config/locales/tr-TR.yml +7 -14
- data/config/locales/uk.yml +8 -16
- data/config/locales/val-ES.yml +1 -0
- data/config/locales/vi.yml +1 -0
- data/config/locales/zh-CN.yml +5 -16
- data/config/locales/zh-TW.yml +1 -964
- data/db/migrate/20180529110230_move_authorships_to_coauthorships.rb +1 -0
- data/db/migrate/20181003074440_fix_user_groups_ids_in_proposals_endorsements.rb +2 -9
- data/db/migrate/20200708091228_move_proposals_fields_to_i18n.rb +18 -28
- data/db/migrate/20201002085508_fix_proposals_data.rb +13 -25
- data/lib/decidim/proposals/component.rb +25 -21
- data/lib/decidim/proposals/engine.rb +0 -6
- data/lib/decidim/proposals/import/proposal_answer_creator.rb +4 -10
- data/lib/decidim/proposals/proposal_serializer.rb +1 -9
- data/lib/decidim/proposals/test/factories.rb +1 -1
- data/lib/decidim/proposals/version.rb +1 -1
- metadata +25 -52
- data/app/services/decidim/proposals/collaborative_draft_search.rb +0 -59
- data/app/views/decidim/proposals/admin/proposals/_js-callout.html.erb +0 -6
- data/app/views/decidim/proposals/admin/proposals/update_category.js.erb +0 -26
- data/app/views/decidim/proposals/admin/proposals/update_scope.js.erb +0 -27
- data/config/environment.rb +0 -3
- data/config/locales/fa-IR.yml +0 -1
- data/config/locales/gn-PY.yml +0 -1
- data/config/locales/ka-GE.yml +0 -1
- data/config/locales/kaa.yml +0 -1
- data/config/locales/lo-LA.yml +0 -1
- data/config/locales/oc-FR.yml +0 -1
- data/config/locales/sq-AL.yml +0 -1
- data/config/locales/th-TH.yml +0 -1
- data/lib/tasks/proposals/upgrade/decdim_proposal_upgrade_tasks.rake +0 -34
@@ -2,83 +2,28 @@
|
|
2
2
|
|
3
3
|
module Decidim
|
4
4
|
module Proposals
|
5
|
-
#
|
6
|
-
#
|
5
|
+
# This service scopes the proposal searches with parameters that cannot be
|
6
|
+
# passed from the user interface.
|
7
7
|
class ProposalSearch < ResourceSearch
|
8
|
-
|
8
|
+
attr_reader :type, :activity
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
# page - The page number to paginate the results.
|
13
|
-
# per_page - The number of proposals to return per page.
|
14
|
-
def initialize(options = {})
|
15
|
-
options[:scope] = options.fetch(:scope, Proposal)
|
16
|
-
options[:scope] = options[:state_withdraw] == "withdrawn" ? options[:scope].withdrawn : options[:scope].except_withdrawn
|
17
|
-
super(options[:scope], options)
|
18
|
-
end
|
19
|
-
|
20
|
-
# Handle the activity filter
|
21
|
-
def search_activity
|
22
|
-
case activity
|
23
|
-
when "voted"
|
24
|
-
query
|
25
|
-
.includes(:votes)
|
26
|
-
.where(decidim_proposals_proposal_votes: { decidim_author_id: user })
|
27
|
-
when "my_proposals"
|
28
|
-
query
|
29
|
-
.where.not(coauthorships_count: 0)
|
30
|
-
.joins(:coauthorships)
|
31
|
-
.where(decidim_coauthorships: { decidim_author_type: "Decidim::UserBaseEntity" })
|
32
|
-
.where(decidim_coauthorships: { decidim_author_id: user })
|
33
|
-
else # Assume 'all'
|
34
|
-
query
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
def search_state_withdraw
|
39
|
-
return query if state_withdraw == "withdrawn"
|
10
|
+
def build(params)
|
11
|
+
return super if search_context == :admin
|
40
12
|
|
41
|
-
|
42
|
-
|
13
|
+
@type = params[:type]
|
14
|
+
@activity = params[:activity]
|
43
15
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
case type
|
52
|
-
when "proposals"
|
53
|
-
query.only_amendables
|
54
|
-
when "amendments"
|
55
|
-
query.only_visible_emendations_for(user, component)
|
56
|
-
else # Assume 'all'
|
57
|
-
query.amendables_and_visible_emendations_for(user, component)
|
16
|
+
if params[:activity] && user
|
17
|
+
case params[:activity]
|
18
|
+
when "voted"
|
19
|
+
add_scope(:voted_by, user)
|
20
|
+
when "my_proposals"
|
21
|
+
add_scope(:coauthored_by, user)
|
22
|
+
end
|
58
23
|
end
|
59
|
-
|
60
|
-
|
61
|
-
# Filters Proposals by the name of the classes they are linked to. By default,
|
62
|
-
# returns all Proposals. When a `related_to` param is given, then it camelcases item
|
63
|
-
# to find the real class name and checks the links for the Proposals.
|
64
|
-
#
|
65
|
-
# The `related_to` param is expected to be in this form:
|
66
|
-
#
|
67
|
-
# "decidim/meetings/meeting"
|
68
|
-
#
|
69
|
-
# This can be achieved by performing `klass.name.underscore`.
|
70
|
-
#
|
71
|
-
# Returns only those proposals that are linked to the given class name.
|
72
|
-
def search_related_to
|
73
|
-
from = query
|
74
|
-
.joins(:resource_links_from)
|
75
|
-
.where(decidim_resource_links: { to_type: related_to.camelcase })
|
76
|
-
|
77
|
-
to = query
|
78
|
-
.joins(:resource_links_to)
|
79
|
-
.where(decidim_resource_links: { from_type: related_to.camelcase })
|
24
|
+
add_scope(:with_type, [params[:type], user, component]) if params[:type]
|
80
25
|
|
81
|
-
|
26
|
+
super
|
82
27
|
end
|
83
28
|
end
|
84
29
|
end
|
@@ -5,14 +5,11 @@
|
|
5
5
|
# allows the minimum and maximum values to be lambdas allowing us to fetch the
|
6
6
|
# maximum length dynamically for each proposals component.
|
7
7
|
class ProposalLengthValidator < ActiveModel::EachValidator
|
8
|
-
include ActionView::Helpers::SanitizeHelper
|
9
|
-
|
10
8
|
def validate_each(record, attribute, value)
|
11
9
|
return if value.blank?
|
12
10
|
|
13
|
-
|
14
|
-
|
15
|
-
validate_max_length(record, attribute, text_value)
|
11
|
+
validate_min_length(record, attribute, value)
|
12
|
+
validate_max_length(record, attribute, value)
|
16
13
|
end
|
17
14
|
|
18
15
|
private
|
@@ -1,13 +1,13 @@
|
|
1
1
|
<div class="grid-x">
|
2
2
|
<div class="cell">
|
3
3
|
<%= form.hidden_field :position, class: "position" %>
|
4
|
-
<%= form.text_field :title,
|
4
|
+
<%= form.text_field :title, optional: false %>
|
5
5
|
</div>
|
6
6
|
</div>
|
7
7
|
<% if proposal.article? %>
|
8
8
|
<div class="grid-x">
|
9
9
|
<div class="cell">
|
10
|
-
<%= form.text_area :body,
|
10
|
+
<%= form.text_area :body, optional: false, rows: 5 %>
|
11
11
|
</div>
|
12
12
|
</div>
|
13
13
|
<% end %>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
$("<%= escape_javascript(render partial: %q{js-callout}, locals: { css: %q{success}, text: flash.now[:notice] }) %>").appendTo(".callout-wrapper");
|
1
|
+
$("<%= escape_javascript(render partial: %q{decidim/admin/shared/js-callout}, locals: { css: %q{success}, text: flash.now[:notice] }) %>").appendTo(".callout-wrapper");
|
2
2
|
|
3
3
|
<% proposal_ids.each do |id| %>
|
4
4
|
$(".table-list [data-id='<%= id %>']")
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<% if flash.now[:error].present? %>
|
2
|
+
$("<%= form_selector %> <%= attribute_selector %>").addClass("is-invalid-input")
|
3
|
+
$("<%= escape_javascript(render partial: %q{decidim/admin/shared/js-callout}, locals: { css: %q{alert}, text: flash.now[:error] }) %>").appendTo(".callout-wrapper");
|
4
|
+
<% end %>
|
5
|
+
|
6
|
+
<% if flash.now[:alert].present? %>
|
7
|
+
$("<%= form_selector %> <%= attribute_selector %>").removeClass("is-invalid-input")
|
8
|
+
$("<%= escape_javascript(render partial: %q{decidim/admin/shared/js-callout}, locals: { css: %q{warning}, text: flash.now[:alert] }) %>").appendTo(".callout-wrapper");
|
9
|
+
<% end %>
|
10
|
+
|
11
|
+
<% if flash.now[:notice].present? %>
|
12
|
+
$("<%= escape_javascript(render partial: %q{decidim/admin/shared/js-callout}, locals: { css: %q{success}, text: flash.now[:notice] }) %>").appendTo(".callout-wrapper");
|
13
|
+
|
14
|
+
<% proposal_ids.each do |id| %>
|
15
|
+
$(".table-list [data-id='<%= id %>']")
|
16
|
+
.replaceWith("<%= escape_javascript(render partial: %q{proposal-tr}, locals: { proposal: proposal_find(id) }) %>");
|
17
|
+
<% end %>
|
18
|
+
|
19
|
+
$("<%= form_selector %> <%= attribute_selector %>").removeClass("is-invalid-input")
|
20
|
+
$(".js-check-all").prop('checked', false);
|
21
|
+
$(".js-check-all-resources").prop('checked', false);
|
22
|
+
window.hideBulkActionsButton();
|
23
|
+
window.hideBulkActionForms();
|
24
|
+
window.showOtherActionsButtons();
|
25
|
+
window.selectedResourcesCountUpdate();
|
26
|
+
<% end %>
|
@@ -5,7 +5,7 @@
|
|
5
5
|
</div>
|
6
6
|
|
7
7
|
<div class="field hashtags__container">
|
8
|
-
<%=
|
8
|
+
<%= form.text_area :body, rows: 10, class: "js-hashtags", value: form_presenter.body(extras: false).strip %>
|
9
9
|
</div>
|
10
10
|
|
11
11
|
<% if @form.component_automatic_hashtags.any? %>
|
@@ -63,21 +63,13 @@
|
|
63
63
|
<% if component_settings.attachments_allowed? %>
|
64
64
|
<fieldset class="attachments_container">
|
65
65
|
<legend><%= t("attachment_legend", scope: "decidim.proposals.collaborative_drafts.edit") %></legend>
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
<% @form.errors[:attachment].each do |message| %>
|
75
|
-
<small class="form-error is-visible">
|
76
|
-
<%= message %>
|
77
|
-
</small>
|
78
|
-
<% end %>
|
79
|
-
<% end %>
|
80
|
-
</div>
|
81
|
-
<% end %>
|
66
|
+
<div class="row column">
|
67
|
+
<%= form.attachment :documents,
|
68
|
+
multiple: false,
|
69
|
+
label: t("decidim.proposals.collaborative_drafts.new.add_file"),
|
70
|
+
button_label: t("decidim.proposals.collaborative_drafts.new.add_file"),
|
71
|
+
button_edit_label: t("decidim.proposals.collaborative_drafts.new.edit_file"),
|
72
|
+
help_i18n_scope: "decidim.forms.file_help.file" %>
|
73
|
+
</div>
|
82
74
|
</fieldset>
|
83
75
|
<% end %>
|
@@ -4,7 +4,7 @@
|
|
4
4
|
<div class="filters__section">
|
5
5
|
<div class="filters__search">
|
6
6
|
<div class="input-group">
|
7
|
-
<%= form.search_field :
|
7
|
+
<%= form.search_field :search_text_cont, label: false, class: "input-group-field", placeholder: t(".search"), title: t(".search"), "aria-label": t(".search"), data: { disable_dynamic_change: true } %>
|
8
8
|
<div class="input-group-button">
|
9
9
|
<button type="submit" class="button" aria-controls="collaborative_drafts">
|
10
10
|
<%= icon "magnifying-glass", aria_label: t(".search"), role: "img" %>
|
@@ -14,18 +14,18 @@
|
|
14
14
|
</div>
|
15
15
|
</div>
|
16
16
|
|
17
|
-
<%= form.check_boxes_tree :
|
17
|
+
<%= form.check_boxes_tree :with_any_state, filter_collaborative_drafts_state_values, legend_title: t(".state"), "aria-controls": "collaborative_drafts" %>
|
18
18
|
|
19
19
|
<% if linked_classes_for(Decidim::Proposals::CollaborativeDraft).any? %>
|
20
20
|
<%= form.collection_radio_buttons :related_to, linked_classes_filter_values_for(Decidim::Proposals::CollaborativeDraft), :first, :last, { legend_title: t(".related_to") }, "aria-controls": "collaborative_drafts" %>
|
21
21
|
<% end %>
|
22
22
|
|
23
23
|
<% if current_component.has_subscopes? %>
|
24
|
-
<%= form.check_boxes_tree :
|
24
|
+
<%= form.check_boxes_tree :with_any_scope, filter_scopes_values, legend_title: t(".scope"), "aria-controls": "collaborative_drafts" %>
|
25
25
|
<% end %>
|
26
26
|
|
27
27
|
<% if current_component.categories.any? %>
|
28
|
-
<%= form.check_boxes_tree :
|
28
|
+
<%= form.check_boxes_tree :with_any_category, filter_categories_values, legend_title: t(".category"), "aria-controls": "collaborative_drafts" %>
|
29
29
|
<% end %>
|
30
30
|
|
31
31
|
<%= hidden_field_tag :order, order, id: nil, class: "order_filter" %>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<div class="columns large-3">
|
2
2
|
<div class="m-bottom">
|
3
|
-
<%= link_to
|
3
|
+
<%= link_to :back do %>
|
4
4
|
<%= icon "chevron-left", class: "icon--small", role: "img", "aria-hidden": true %>
|
5
5
|
<%= t("back_from_collaborative_draft", scope: "decidim.proposals.collaborative_drafts.wizard_aside").html_safe %>
|
6
6
|
<% end %>
|
@@ -33,7 +33,7 @@
|
|
33
33
|
<div class="section">
|
34
34
|
<%== cell("decidim/proposals/collaborative_draft_m", @collaborative_draft, full_badge: true).badge %>
|
35
35
|
|
36
|
-
<%=
|
36
|
+
<%= simple_format(present(@collaborative_draft).body(links: true, strip_tags: true), nil, sanitize: false) %>
|
37
37
|
|
38
38
|
<% if component_settings.geocoding_enabled? %>
|
39
39
|
<%= render partial: "decidim/shared/static_map", locals: { icon_name: "proposals", geolocalizable: @collaborative_draft } %>
|
@@ -67,49 +67,26 @@
|
|
67
67
|
<% if component_settings.attachments_allowed? && @proposal %>
|
68
68
|
<fieldset class="gallery__container photos_container">
|
69
69
|
<legend><%= t("gallery_legend", scope: "decidim.proposals.proposals.edit") %></legend>
|
70
|
-
|
71
|
-
<% if @form.photos.any? %>
|
72
|
-
<% @form.photos.each do |photo| %>
|
73
|
-
<div class="callout gallery__item" id="attachment_<%= photo.id %>" data-closable>
|
74
|
-
<%= image_tag photo.thumbnail_url, class: "thumbnail", alt: photo.file.filename %>
|
75
|
-
<%= form.hidden_field :photos, multiple: true, value: photo.id, id: "photo-#{photo.id}" %>
|
76
|
-
<button class="close-button"
|
77
|
-
aria-label="<%= t("delete_image", scope: "decidim.proposals.proposals.edit") %>"
|
78
|
-
title="<%= t("delete_image", scope: "decidim.proposals.proposals.edit") %>"
|
79
|
-
type="button"
|
80
|
-
data-close>
|
81
|
-
<span aria-hidden="true">×</span>
|
82
|
-
</button>
|
83
|
-
</div>
|
84
|
-
<% end %>
|
85
|
-
<% end %>
|
86
|
-
|
87
70
|
<div class="row column">
|
88
|
-
<%= form.
|
71
|
+
<%= form.attachment :photos,
|
72
|
+
multiple: false,
|
73
|
+
label: t("decidim.proposals.proposals.edit.add_image"),
|
74
|
+
button_label: t("decidim.proposals.proposals.edit.add_image"),
|
75
|
+
button_edit_label: t("decidim.proposals.proposals.edit.edit_image"),
|
76
|
+
help_i18n_scope: "decidim.forms.file_help.image",
|
77
|
+
extension_allowlist: Decidim::OrganizationSettings.for(current_organization).upload_allowed_file_extensions_image %>
|
89
78
|
</div>
|
90
79
|
</fieldset>
|
91
80
|
|
92
81
|
<fieldset class="attachments_container gallery__container documents_container">
|
93
82
|
<legend><%= t("attachment_legend", scope: "decidim.proposals.proposals.edit") %></legend>
|
94
|
-
|
95
|
-
<% if @form.documents.any? %>
|
96
|
-
<% @form.documents.each do |document| %>
|
97
|
-
<div class="callout" id="attachment_<%= document.id %>" data-closable>
|
98
|
-
<%= link_to translated_attribute(document.title), document.url %>
|
99
|
-
<small><%= document.file_type %> <%= number_to_human_size(document.file_size) %></small>
|
100
|
-
<%= form.hidden_field :documents, multiple: true, value: document.id, id: "document-#{document.id}" %>
|
101
|
-
<button class="close-button"
|
102
|
-
aria-label="<%= t("delete_document", scope: "decidim.proposals.proposals.edit") %>"
|
103
|
-
title="<%= t("delete_document", scope: "decidim.proposals.proposals.edit") %>"
|
104
|
-
type="button" data-close>
|
105
|
-
<span aria-hidden="true">×</span>
|
106
|
-
</button>
|
107
|
-
</div>
|
108
|
-
<% end %>
|
109
|
-
<% end %>
|
110
|
-
|
111
83
|
<div class="row column">
|
112
|
-
<%= form.
|
84
|
+
<%= form.attachment :documents,
|
85
|
+
multiple: true,
|
86
|
+
label: t("decidim.proposals.proposals.edit.add_documents"),
|
87
|
+
button_label: t("decidim.proposals.proposals.edit.add_documents"),
|
88
|
+
button_edit_label: t("decidim.proposals.proposals.edit.edit_documents"),
|
89
|
+
help_i18n_scope: "decidim.forms.file_help.file" %>
|
113
90
|
</div>
|
114
91
|
</fieldset>
|
115
92
|
<% end %>
|
@@ -4,7 +4,7 @@
|
|
4
4
|
<div class="filters__section">
|
5
5
|
<div class="filters__search">
|
6
6
|
<div class="input-group">
|
7
|
-
<%= form.search_field :
|
7
|
+
<%= form.search_field :search_text_cont, label: false, class: "input-group-field", placeholder: t(".search"), title: t(".search"), "aria-label": t(".search"), data: { disable_dynamic_change: true } %>
|
8
8
|
<div class="input-group-button">
|
9
9
|
<button type="submit" class="button" aria-controls="proposals">
|
10
10
|
<%= icon "magnifying-glass", aria_label: t(".search"), role: "img" %>
|
@@ -17,19 +17,19 @@
|
|
17
17
|
<%= form.hidden_field "state_withdraw", value: params.dig("filter", "state_withdraw") %>
|
18
18
|
|
19
19
|
<% if component_settings.proposal_answering_enabled && current_settings.proposal_answering_enabled %>
|
20
|
-
<%= form.check_boxes_tree :
|
20
|
+
<%= form.check_boxes_tree :with_any_state, filter_proposals_state_values, legend_title: t(".state"), "aria-controls": "proposals" %>
|
21
21
|
<% end %>
|
22
22
|
|
23
23
|
<% if current_component.has_subscopes? %>
|
24
|
-
<%= form.check_boxes_tree :
|
24
|
+
<%= form.check_boxes_tree :with_any_scope, filter_scopes_values, legend_title: t(".scope"), "aria-controls": "proposals" %>
|
25
25
|
<% end %>
|
26
26
|
|
27
27
|
<% if current_component.categories.any? %>
|
28
|
-
<%= form.check_boxes_tree :
|
28
|
+
<%= form.check_boxes_tree :with_any_category, filter_categories_values, legend_title: t(".category"), "aria-controls": "proposals" %>
|
29
29
|
<% end %>
|
30
30
|
|
31
31
|
<% if component_settings.official_proposals_enabled %>
|
32
|
-
<%= form.check_boxes_tree :
|
32
|
+
<%= form.check_boxes_tree :with_any_origin, filter_origin_values, legend_title: t(".origin"), "aria-controls": "proposals" %>
|
33
33
|
<% end %>
|
34
34
|
|
35
35
|
<% if current_user %>
|
@@ -22,8 +22,7 @@
|
|
22
22
|
<% end %>
|
23
23
|
</div>
|
24
24
|
</div>
|
25
|
-
<% if !current_settings.try(:votes_hidden?) && !proposal.component.current_settings.votes_hidden?
|
26
|
-
proposal.component.current_settings.votes_enabled? %>
|
25
|
+
<% if !current_settings.try(:votes_hidden?) && !proposal.component.current_settings.votes_hidden? %>
|
27
26
|
<div class="card--list__data">
|
28
27
|
<span class="card--list__data__number">
|
29
28
|
<%= proposal.votes.size %>
|
@@ -1,7 +1,7 @@
|
|
1
|
-
<% if params.dig("filter", "
|
1
|
+
<% if params.dig("filter", "with_availability").present? && params["filter"]["with_availability"] == "withdrawn" %>
|
2
2
|
<div class="callout warning">
|
3
3
|
<%= t("decidim.proposals.proposals.index.text_banner",
|
4
|
-
go_back_link: link_to(t("decidim.proposals.proposals.index.click_here"), proposals_path("filter[
|
4
|
+
go_back_link: link_to(t("decidim.proposals.proposals.index.click_here"), proposals_path("filter[with_availability]" => nil)),
|
5
5
|
).html_safe %>
|
6
6
|
</div>
|
7
7
|
<% end %>
|
@@ -37,10 +37,10 @@
|
|
37
37
|
|
38
38
|
<div class="row">
|
39
39
|
<div class="text-right">
|
40
|
-
<% if params.dig("filter", "
|
41
|
-
<%= link_to t("decidim.proposals.proposals.index.see_all"), proposals_path("filter[
|
40
|
+
<% if params.dig("filter", "with_availability").present? && params["filter"]["with_availability"] == "withdrawn" %>
|
41
|
+
<%= link_to t("decidim.proposals.proposals.index.see_all"), proposals_path("filter[with_availability]" => nil) %>
|
42
42
|
<% else %>
|
43
|
-
<%= link_to t("decidim.proposals.proposals.index.see_all_withdrawn"), proposals_path(filter: {
|
43
|
+
<%= link_to t("decidim.proposals.proposals.index.see_all_withdrawn"), proposals_path(filter: { with_availability: "withdrawn", state: [""] }) %>
|
44
44
|
<% end %>
|
45
45
|
</div>
|
46
46
|
</div>
|
data/config/locales/am-ET.yml
CHANGED