decidim-reporting_proposals 0.2.0 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.eslintrc.json +1 -0
- data/.github/workflows/lint.yml +1 -0
- data/.github/workflows/test_integration.yml +5 -1
- data/.github/workflows/test_unit.yml +5 -1
- data/Gemfile +1 -0
- data/Gemfile.lock +269 -227
- data/README.md +108 -16
- data/app/cells/concerns/decidim/reporting_proposals/proposals_picker_cell_override.rb +24 -0
- data/app/commands/concerns/decidim/admin/hide_resource_override.rb +34 -0
- data/app/commands/concerns/decidim/proposals/admin/answer_proposal_override.rb +41 -0
- data/app/commands/concerns/decidim/proposals/admin/assign_proposals_to_valuator_override.rb +30 -0
- data/app/commands/concerns/decidim/proposals/publish_proposal_override.rb +72 -0
- data/app/commands/concerns/decidim/reporting_proposals/admin/create_answer_override.rb +17 -0
- data/app/commands/concerns/decidim/reporting_proposals/admin/create_result_override.rb +17 -0
- data/app/commands/concerns/decidim/reporting_proposals/admin/update_result_override.rb +34 -0
- data/app/commands/concerns/decidim/reporting_proposals/close_meeting_override.rb +15 -0
- data/app/commands/concerns/decidim/reporting_proposals/create_project_override.rb +15 -0
- data/app/commands/concerns/decidim/templates/admin/copy_questionnaire_template_override.rb +32 -0
- data/app/commands/concerns/decidim/templates/admin/create_questionnaire_template_override.rb +32 -0
- data/app/commands/decidim/templates/admin/copy_proposal_answer_template.rb +35 -0
- data/app/commands/decidim/templates/admin/create_proposal_answer_template.rb +48 -0
- data/app/commands/decidim/templates/admin/update_proposal_answer_template.rb +52 -0
- data/app/controllers/concerns/decidim/proposals/admin/valuation_assignments_controller_override.rb +35 -0
- data/app/controllers/concerns/decidim/templates/admin/application_controller_override.rb +20 -0
- data/app/controllers/decidim/reporting_proposals/admin/proposal_notes_controller.rb +4 -5
- data/app/controllers/decidim/templates/admin/proposal_answer_templates_controller.rb +181 -0
- data/app/events/concerns/decidim/proposals/publish_proposal_event_override.rb +35 -0
- data/app/forms/concerns/decidim/reporting_proposals/close_meeting_form_override.rb +28 -0
- data/app/forms/concerns/decidim/reporting_proposals/form_builder_override.rb +1 -3
- data/app/forms/concerns/decidim/reporting_proposals/map_included_proposals_for_form_override.rb +28 -0
- data/app/forms/concerns/decidim/reporting_proposals/map_related_proposals_for_form_override.rb +28 -0
- data/app/forms/decidim/templates/admin/proposal_answer_template_form.rb +21 -0
- data/app/helpers/concerns/decidim/reporting_proposals/resource_helper_override.rb +25 -0
- data/app/mailers/concerns/decidim/admin/hidden_resource_mailer.rb +28 -0
- data/app/mailers/concerns/decidim/proposals/admin/notification_answer_proposal_mailer.rb +25 -0
- data/app/mailers/concerns/decidim/proposals/admin/proposals_valuator_mailer.rb +30 -0
- data/app/mailers/concerns/decidim/proposals/notification_publish_proposal_mailer.rb +23 -0
- data/app/mailers/concerns/decidim/reported_mailer_override.rb +16 -0
- data/app/models/concerns/decidim/reporting_proposals/participatory_space_role_config/valuator_override.rb +4 -1
- data/app/overrides/decidim/proposals/admin/proposal_answers/_form/add_template_chooser.html.erb.deface +5 -0
- data/app/overrides/decidim/proposals/admin/proposals/show/add_address.html.erb.deface +3 -0
- data/app/overrides/decidim/proposals/admin/proposals/show/add_valuators_form.html.erb.deface +19 -0
- data/app/overrides/decidim/reported_mailer/report/add_link_to_admin.html.erb.deface +5 -0
- data/app/packs/entrypoints/decidim_templates_admin.js +1 -0
- data/app/packs/src/decidim/reporting_proposals/user_camera_inputs.js +37 -39
- data/app/packs/src/decidim/templates/admin/proposal_answer_template_chooser.js +27 -0
- data/app/packs/stylesheets/decidim/reporting_proposals/manage_component_admin.scss +31 -0
- data/app/presenters/concerns/decidim/resource_locator_presenter_override.rb +38 -0
- data/app/resources/concerns/decidim/resource_manifest_override.rb +14 -0
- data/app/views/decidim/admin/hidden_resource_mailer/notify_mail.html.erb +12 -0
- data/app/views/decidim/proposals/admin/notification_answer_proposal_mailer/notify_proposal_author.html.erb +7 -0
- data/app/views/decidim/proposals/admin/proposals/_address.html.erb +13 -0
- data/app/views/decidim/proposals/admin/proposals_valuator_mailer/notify_proposals_valuator.html.erb +17 -0
- data/app/views/decidim/proposals/notification_publish_proposal_mailer/notify_proposal_author.html.erb +7 -0
- data/app/views/decidim/proposals/proposals/index.js.erb +19 -0
- data/app/views/decidim/templates/admin/proposal_answer_templates/_form.html.erb +34 -0
- data/app/views/decidim/templates/admin/proposal_answer_templates/_template_chooser.html.erb +16 -0
- data/app/views/decidim/templates/admin/proposal_answer_templates/edit.html.erb +3 -0
- data/app/views/decidim/templates/admin/proposal_answer_templates/index.html.erb +52 -0
- data/app/views/decidim/templates/admin/proposal_answer_templates/new.html.erb +6 -0
- data/config/assets.rb +2 -1
- data/config/i18n-tasks.yml +3 -0
- data/config/locales/ca.yml +81 -7
- data/config/locales/de.yml +77 -3
- data/config/locales/en.yml +87 -0
- data/config/locales/es.yml +328 -254
- data/db/migrate/20230404103706_add_target_and_field_values_to_decidim_templates_templates.rb +12 -0
- data/db/migrate/20230404104741_migrate_templatable.rb +13 -0
- data/decidim-reporting_proposals.gemspec +5 -0
- data/lib/decidim/reporting_proposals/admin_engine.rb +16 -1
- data/lib/decidim/reporting_proposals/component.rb +1 -1
- data/lib/decidim/reporting_proposals/config.rb +10 -5
- data/lib/decidim/reporting_proposals/engine.rb +38 -1
- data/lib/decidim/reporting_proposals/test/factories.rb +10 -0
- data/lib/decidim/reporting_proposals/version.rb +2 -7
- metadata +152 -2
@@ -0,0 +1 @@
|
|
1
|
+
import "src/decidim/templates/admin/proposal_answer_template_chooser";
|
@@ -1,49 +1,47 @@
|
|
1
1
|
$(() => {
|
2
|
-
$
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
const $labelInput = $("label[for='proposal_add_photos']")
|
2
|
+
const $input = $("#proposal_add_photos");
|
3
|
+
const $inputField = $input.closest(".row.column");
|
4
|
+
const $button = $inputField.find("button:first");
|
5
|
+
const $checkbox = $inputField.find("input:checkbox[name$='[has_no_image]']");
|
6
|
+
const $formError = $inputField.find("span.form-error")
|
7
|
+
const $labelInput = $("label[for='proposal_add_photos']")
|
9
8
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
9
|
+
const removeErrors = () => {
|
10
|
+
$input.removeClass("is-invalid-input");
|
11
|
+
$formError.removeClass("is-visible");
|
12
|
+
$labelInput.removeClass("is-invalid-label");
|
13
|
+
};
|
15
14
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
}
|
15
|
+
const toggleInput = () => {
|
16
|
+
if ($checkbox[0].checked) {
|
17
|
+
removeErrors();
|
18
|
+
$input.prop("disabled", true);
|
19
|
+
$button.prop("disabled", true);
|
20
|
+
} else {
|
21
|
+
$input.prop("disabled", false);
|
22
|
+
$button.prop("disabled", false);
|
25
23
|
}
|
24
|
+
}
|
26
25
|
|
27
|
-
|
26
|
+
$input.attr("accept", "image/*");
|
28
27
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
28
|
+
$button.on("click", () => {
|
29
|
+
console.log("click button")
|
30
|
+
$input.attr("capture", "camera");
|
31
|
+
$input.click();
|
32
|
+
$input.removeAttr("capture", "camera");
|
33
|
+
});
|
35
34
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
});
|
35
|
+
$input.on("click", () => {
|
36
|
+
console.log("click", $input);
|
37
|
+
$input.one("blur", () => {
|
38
|
+
console.log("blur", $input);
|
39
|
+
removeErrors();
|
42
40
|
});
|
43
|
-
|
44
|
-
if ($checkbox.length > 0) {
|
45
|
-
$checkbox.on("change", toggleInput);
|
46
|
-
toggleInput();
|
47
|
-
}
|
48
41
|
});
|
42
|
+
|
43
|
+
if ($checkbox.length > 0) {
|
44
|
+
$checkbox.on("change", toggleInput);
|
45
|
+
toggleInput();
|
46
|
+
}
|
49
47
|
});
|
@@ -0,0 +1,27 @@
|
|
1
|
+
$(() => {
|
2
|
+
$("#proposal_answer_template_chooser").change(() => {
|
3
|
+
const $dropDown = $("#proposal_answer_template_chooser");
|
4
|
+
$dropDown.next("#template-error").remove();
|
5
|
+
if ($dropDown.val() === "") {
|
6
|
+
return;
|
7
|
+
}
|
8
|
+
$.getJSON($dropDown.data("url"), {
|
9
|
+
id: $dropDown.val(),
|
10
|
+
/* eslint camelcase: [0] */
|
11
|
+
proposal_id: $dropDown.data("proposal")
|
12
|
+
}).done((data) => {
|
13
|
+
$(`#proposal_answer_internal_state_${data.state}`).trigger("click");
|
14
|
+
|
15
|
+
const $editors = $dropDown.parent().parent().find(".editor-container");
|
16
|
+
$editors.each((index, element) => {
|
17
|
+
const localElement = $(element);
|
18
|
+
const $locale = localElement.siblings("input[type=hidden]").attr("id").replace("proposal_answer_answer_", "");
|
19
|
+
const editor = Quill.find(element);
|
20
|
+
const delta = editor.clipboard.convert(data.template[$locale]);
|
21
|
+
editor.setContents(delta);
|
22
|
+
});
|
23
|
+
}).fail((err) => {
|
24
|
+
$dropDown.after(`<p id="template-error" class="text-alert">${err.responseJSON.msg || err.responseJSON.error || err.responseJSON}</p>`);
|
25
|
+
});
|
26
|
+
});
|
27
|
+
});
|
@@ -29,3 +29,34 @@
|
|
29
29
|
border-radius: 50%;
|
30
30
|
text-align: center;
|
31
31
|
}
|
32
|
+
|
33
|
+
//Variables
|
34
|
+
|
35
|
+
/* Card address */
|
36
|
+
.address {
|
37
|
+
display: flex;
|
38
|
+
padding: 1rem;
|
39
|
+
}
|
40
|
+
|
41
|
+
.address--alone {
|
42
|
+
flex-grow: 1;
|
43
|
+
}
|
44
|
+
|
45
|
+
.address__info {
|
46
|
+
display: flex;
|
47
|
+
flex-grow: 1;
|
48
|
+
}
|
49
|
+
|
50
|
+
.address__icon {
|
51
|
+
float: left;
|
52
|
+
display: flex;
|
53
|
+
align-self: center;
|
54
|
+
fill: var(--primary);
|
55
|
+
}
|
56
|
+
|
57
|
+
.address__details {
|
58
|
+
float: left;
|
59
|
+
max-width: 100%; //IE10 bug fix
|
60
|
+
padding-left: .5em;
|
61
|
+
align-self: center;
|
62
|
+
}
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module ResourceLocatorPresenterOverride
|
5
|
+
extend ActiveSupport::Concern
|
6
|
+
|
7
|
+
included do
|
8
|
+
# Generates and admin url only if the manifest has the property :admin_route_name defined
|
9
|
+
# this allows to distinct from resources that can be administrated from those that are not
|
10
|
+
def admin_url(options = {})
|
11
|
+
admin_member_route("url", options.merge(host: root_resource.organization.host))
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def admin_member_route(route_type, options)
|
17
|
+
return if manifest_for(target).admin_route_name.blank?
|
18
|
+
|
19
|
+
options.merge!(options_for_polymorphic)
|
20
|
+
admin_route_proxy.send("#{admin_member_route_name}_#{route_type}", target, options)
|
21
|
+
end
|
22
|
+
|
23
|
+
def admin_member_route_name
|
24
|
+
if polymorphic?
|
25
|
+
admin_polymorphic_member_route_name
|
26
|
+
else
|
27
|
+
manifest_for(target).admin_route_name
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def admin_polymorphic_member_route_name
|
32
|
+
return unless polymorphic?
|
33
|
+
|
34
|
+
resource.map { |record| manifest_for(record).admin_route_name }.join("_")
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module ResourceManifestOverride
|
5
|
+
extend ActiveSupport::Concern
|
6
|
+
|
7
|
+
included do
|
8
|
+
# The name of the named Rails route to create the url to admin the resource
|
9
|
+
# If it is not defined, the resource will be considered non-administrable
|
10
|
+
# and no link will be generated in some places
|
11
|
+
attribute :admin_route_name, String
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<p class="email-greeting"><%= t "hello", scope: "decidim.admin.hidden_resource_mailer.notify_mail" %></p>
|
2
|
+
|
3
|
+
<p class="email-instructions"><%= t "body_1", scope: "decidim.admin.hidden_resource_mailer.notify_mail" %></p>
|
4
|
+
|
5
|
+
<p><strong><%= t "reason", scope: "decidim.admin.hidden_resource_mailer.notify_mail", reason: h(@reason.join(", ")) %></strong></p>
|
6
|
+
|
7
|
+
<p><strong><%= translated_attribute(@resource.title) %></strong></p>
|
8
|
+
|
9
|
+
<p class="email-instructions">
|
10
|
+
<%= t "body_2", scope: "decidim.admin.hidden_resource_mailer.notify_mail" %>
|
11
|
+
<%= link_to @organization.name, decidim.root_url(host: @organization.host).html_safe %>
|
12
|
+
</p>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<p class="email-greeting"><%= t("greeting", scope: "decidim.reporting_proposals.admin.notification_answer_proposal_mailer.notify_proposal_author", recipient: @recipient.name) %></p>
|
2
|
+
|
3
|
+
<p class="email-instructions">
|
4
|
+
<%= sanitize t("email_body", scope: "decidim.reporting_proposals.admin.notification_answer_proposal_mailer.notify_proposal_author",
|
5
|
+
proposal_title: translated_attribute(@proposal.title),
|
6
|
+
answer_url: Decidim::ResourceLocatorPresenter.new(@proposal).url) %>
|
7
|
+
</p>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<% if component_settings.geocoding_enabled? %>
|
2
|
+
<div class="row column">
|
3
|
+
<strong><%= t ".geolocated_at" %>:</strong>
|
4
|
+
<div class="address__info">
|
5
|
+
<div class="address__icon">
|
6
|
+
<%= icon "proposals", role: "img", "aria-hidden": true, width: 40, height: 70 %>
|
7
|
+
</div>
|
8
|
+
<div class="address__details">
|
9
|
+
<%= render partial: "decidim/shared/address_details", locals: { geolocalizable: proposal } %>
|
10
|
+
</div>
|
11
|
+
</div>
|
12
|
+
</div>
|
13
|
+
<% end %>
|
data/app/views/decidim/proposals/admin/proposals_valuator_mailer/notify_proposals_valuator.html.erb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
<p class="email-greeting"><%= t(".greeting", name: @valuator_user.name) %></p>
|
2
|
+
|
3
|
+
<p class="email-instructions"><%= t(".email_body") %></p>
|
4
|
+
|
5
|
+
<p class="email-instructions">
|
6
|
+
<ul>
|
7
|
+
<% @proposals.each do |proposal| %>
|
8
|
+
<li class="mb-sm">
|
9
|
+
<span><%= translated_attribute(proposal.title) %></span>:
|
10
|
+
<%= sanitize link_to(t(".public_side"), Decidim::ResourceLocatorPresenter.new(proposal).url), tags: ["a"], attributes: ["href"] %>,
|
11
|
+
<%= sanitize link_to(t(".admin_panel"), Decidim::ResourceLocatorPresenter.new(proposal).admin_url), tags: ["a"], attributes: ["href"] %>
|
12
|
+
</li>
|
13
|
+
<% end %>
|
14
|
+
</ul>
|
15
|
+
</p>
|
16
|
+
|
17
|
+
<p class="email-closing"><%= t(".gratitude") %></p>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<p class="email-greeting"><%= t("greeting", scope: "decidim.reporting_proposals.notification_publish_proposal_mailer.notify_proposal_author", recipient: @recipient.name) %></p>
|
2
|
+
|
3
|
+
<p class="email-instructions">
|
4
|
+
<%= sanitize t("email_body", scope: "decidim.reporting_proposals.notification_publish_proposal_mailer.notify_proposal_author",
|
5
|
+
proposal_title: translated_attribute(@proposal.title),
|
6
|
+
answer_url: Decidim::ResourceLocatorPresenter.new(@proposal).url) %>
|
7
|
+
</p>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
var $proposals = $('#proposals');
|
2
|
+
var $proposalsCount = $('#proposals-count');
|
3
|
+
var $orderFilterInput = $('.order_filter');
|
4
|
+
$proposals.html('<%= j(render partial: "proposals").strip.html_safe %>');
|
5
|
+
$proposalsCount.html('<%= j(render partial: "count").strip.html_safe %>');
|
6
|
+
$orderFilterInput.val('<%= order %>');
|
7
|
+
|
8
|
+
var $dropdownMenu = $('.dropdown.menu', $proposals);
|
9
|
+
$dropdownMenu.foundation();
|
10
|
+
|
11
|
+
var markerData = JSON.parse('<%= escape_javascript proposals_data_for_map(search.results.select(&:geocoded_and_valid?))
|
12
|
+
.to_json.html_safe %>');
|
13
|
+
|
14
|
+
var $map = $("#map");
|
15
|
+
var controller = $map.data("map-controller");
|
16
|
+
if (controller) {
|
17
|
+
controller.clearMarkers();
|
18
|
+
controller.addMarkers(markerData);
|
19
|
+
}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
<div class="card">
|
2
|
+
<div class="card-divider">
|
3
|
+
<h2 class="card-title"><%= t(".template_title") %></h2>
|
4
|
+
<%= form.submit t(".save"), class: "button tiny button--title" %>
|
5
|
+
</div>
|
6
|
+
|
7
|
+
<div class="card-section">
|
8
|
+
<div class="row column">
|
9
|
+
<%= form.translated :text_field, :name %>
|
10
|
+
</div>
|
11
|
+
|
12
|
+
<div class="row column">
|
13
|
+
<%= form.translated :editor, :description, rows: 15, label: t(".answer_template") %>
|
14
|
+
<%= t(".hint").html_safe %>
|
15
|
+
<ul>
|
16
|
+
<li><%= t(".hint1").html_safe %></li>
|
17
|
+
<li><%= t(".hint2").html_safe %></li>
|
18
|
+
<li><%= t(".hint3").html_safe %></li>
|
19
|
+
</ul>
|
20
|
+
</div>
|
21
|
+
|
22
|
+
<div class="row column">
|
23
|
+
<%= form.label :internal_state %>
|
24
|
+
<%= form.collection_radio_buttons :internal_state,
|
25
|
+
Decidim::Proposals::Proposal::POSSIBLE_STATES - %w(withdrawn),
|
26
|
+
:to_s,
|
27
|
+
->(mode) { t(mode, scope: "decidim.proposals.admin.proposal_answers.form") } %>
|
28
|
+
</div>
|
29
|
+
|
30
|
+
<div class="row column">
|
31
|
+
<%= form.select :scope_for_availability, availability_options_for_select, help_text: t(".scope_for_availability_help") %>
|
32
|
+
</div>
|
33
|
+
</div>
|
34
|
+
</div>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<% templates = Decidim::Templates::Template .where(
|
2
|
+
target: :proposal_answer,
|
3
|
+
templatable: [current_organization, current_component]
|
4
|
+
).order(:templatable_id) %>
|
5
|
+
<% if templates.any? %>
|
6
|
+
<div class="row column">
|
7
|
+
<%= javascript_pack_tag "decidim_templates_admin" %>
|
8
|
+
|
9
|
+
<select id="proposal_answer_template_chooser" data-locale="en" data-proposal="<%= proposal.id %>" data-url="<%= decidim_admin_templates.fetch_proposal_answer_templates_url %>">
|
10
|
+
<option value=""><%= t(".select_template") %></option>
|
11
|
+
<% templates.each do |template| %>
|
12
|
+
<option value="<%= template.id %>"><%= translated_attribute(template.name) %></option>
|
13
|
+
<% end %>
|
14
|
+
</select>
|
15
|
+
</div>
|
16
|
+
<% end %>
|
@@ -0,0 +1,52 @@
|
|
1
|
+
<div class="card">
|
2
|
+
<div class="card-divider">
|
3
|
+
<h2 class="card-title">
|
4
|
+
<%= t ".title" %>
|
5
|
+
<% if allowed_to?(:create, :template) %>
|
6
|
+
<%= link_to t("actions.new", scope: "decidim.admin", name: t("template.name", scope: "decidim.models").downcase), [:new, :proposal_answer_template], class: "button tiny button--title new" %>
|
7
|
+
<% end %>
|
8
|
+
</h2>
|
9
|
+
</div>
|
10
|
+
<div class="card-section">
|
11
|
+
<% if @templates.any? %>
|
12
|
+
<div class="table-scroll">
|
13
|
+
<table class="table-list questionnaire-templates">
|
14
|
+
<thead>
|
15
|
+
<tr>
|
16
|
+
<th><%= t("template.name", scope: "decidim.models") %></th>
|
17
|
+
<th><%= t(".internal_state") %></th>
|
18
|
+
<th><%= t(".scope_for_availability") %></th>
|
19
|
+
<th><%= t("template.fields.created_at", scope: "decidim.models") %></th>
|
20
|
+
<th></th>
|
21
|
+
</tr>
|
22
|
+
</thead>
|
23
|
+
<tbody>
|
24
|
+
<% @templates.each do |template| %>
|
25
|
+
<tr data-proposal_answer-id="<%= template.id %>">
|
26
|
+
<td><%= link_to_if allowed_to?(:update, :template, template: template) , translated_attribute(template.name), edit_proposal_answer_template_path(template) %></td>
|
27
|
+
<td> <%= t(template.field_values.dig("internal_state"), scope: "decidim.proposals.admin.proposal_answers.form") %></td>
|
28
|
+
<td><%= availability_option_as_text(template) %></td>
|
29
|
+
<td><%= l template.created_at, format: :long %></td>
|
30
|
+
<td class="table-list__actions">
|
31
|
+
<% if allowed_to?(:update, :template, template: template) %>
|
32
|
+
<%= icon_link_to "pencil", edit_proposal_answer_template_path(template), t("actions.edit", scope: "decidim.admin"), class: "edit" %>
|
33
|
+
<% end %>
|
34
|
+
<% if allowed_to?(:copy, :template, template: template) %>
|
35
|
+
<%= icon_link_to "clipboard", copy_proposal_answer_template_path(template), t("actions.duplicate", scope: "decidim.admin"), method: :post %>
|
36
|
+
<% end %>
|
37
|
+
<% if allowed_to?(:destroy, :template, template: template) %>
|
38
|
+
<%= icon_link_to "circle-x", proposal_answer_template_path(template), t("actions.destroy", scope: "decidim.admin"), method: :delete, data: { confirm: t(".confirm_delete") }, class: "action-icon--remove" %>
|
39
|
+
<% end %>
|
40
|
+
</td>
|
41
|
+
</tr>
|
42
|
+
<% end %>
|
43
|
+
|
44
|
+
</tbody>
|
45
|
+
</table>
|
46
|
+
<%= paginate @templates, theme: "decidim" %>
|
47
|
+
</div>
|
48
|
+
<% else %>
|
49
|
+
<%= t("templates.empty", scope: "decidim.admin") %>
|
50
|
+
<% end %>
|
51
|
+
</div>
|
52
|
+
</div>
|
@@ -0,0 +1,6 @@
|
|
1
|
+
<% content_for :title do %>
|
2
|
+
<%= t("templates", scope: "decidim.admin.titles") %>
|
3
|
+
<% end %>
|
4
|
+
<%= decidim_form_for(@form, url: proposal_answer_templates_path, html: { class: "form new_proposal_answer_template" }) do |f| %>
|
5
|
+
<%= render partial: "form", object: f %>
|
6
|
+
<% end %>
|
data/config/assets.rb
CHANGED
@@ -9,5 +9,6 @@ Decidim::Webpacker.register_entrypoints(
|
|
9
9
|
decidim_reporting_proposals_list_component_admin: "#{base_path}/app/packs/entrypoints/decidim_reporting_proposals_list_component_admin.js",
|
10
10
|
decidim_reporting_proposals_geocoding: "#{base_path}/app/packs/entrypoints/decidim_reporting_proposals_geocoding.js",
|
11
11
|
decidim_reporting_proposals_camera: "#{base_path}/app/packs/entrypoints/decidim_reporting_proposals_camera.js",
|
12
|
-
decidim_reporting_proposals_js_validations: "#{base_path}/app/packs/entrypoints/decidim_reporting_proposals_js_validations.js"
|
12
|
+
decidim_reporting_proposals_js_validations: "#{base_path}/app/packs/entrypoints/decidim_reporting_proposals_js_validations.js",
|
13
|
+
decidim_templates_admin: "#{base_path}/app/packs/entrypoints/decidim_templates_admin.js"
|
13
14
|
)
|
data/config/i18n-tasks.yml
CHANGED
@@ -7,6 +7,9 @@ data:
|
|
7
7
|
external:
|
8
8
|
- "<%= %x[bundle info decidim-core --path].chomp %>/config/locales/%{locale}.yml"
|
9
9
|
- "<%= %x[bundle info decidim-proposals --path].chomp %>/config/locales/%{locale}.yml"
|
10
|
+
- "<%= %x[bundle info decidim-admin --path].chomp %>/config/locales/%{locale}.yml"
|
11
|
+
- "<%= %x[bundle info decidim-participatory_processes --path].chomp %>/config/locales/%{locale}.yml"
|
12
|
+
- "<%= %x[bundle info decidim-templates --path].chomp %>/config/locales/%{locale}.yml"
|
10
13
|
|
11
14
|
ignore_unused:
|
12
15
|
|
data/config/locales/ca.yml
CHANGED
@@ -6,7 +6,22 @@ ca:
|
|
6
6
|
valuator_ids: Avaluadores assignades
|
7
7
|
proposal:
|
8
8
|
has_no_address: No té adreça
|
9
|
+
has_no_image: Sense imatge
|
10
|
+
template:
|
11
|
+
scope_for_availability: Limita la disponibilitat al component
|
9
12
|
decidim:
|
13
|
+
admin:
|
14
|
+
hidden_resource_mailer:
|
15
|
+
notify_mail:
|
16
|
+
body_1: Un administrador ha esborrat la vostra proposta perquè ha estat denunciada.
|
17
|
+
body_2: Si penseu que ha estat un error, si us plau, contacteu els adminstradors de
|
18
|
+
hello: Hola,
|
19
|
+
reason: 'Motiu: %{reason}'
|
20
|
+
subject: La teva proposta ha estat amagada
|
21
|
+
templates:
|
22
|
+
fetch:
|
23
|
+
error: No s'ha trobat aquesta plantilla, potser ha estat esborrada?
|
24
|
+
missing_resource: "(recurs absent)"
|
10
25
|
application:
|
11
26
|
geocoding:
|
12
27
|
unconfigured: La geocodificació no està configurada!
|
@@ -129,6 +144,15 @@ ca:
|
|
129
144
|
votes_blocked: Suports bloquejats
|
130
145
|
votes_enabled: Suports habilitats
|
131
146
|
votes_hidden: Suports ocults (si els suports estan habilitats, marcant aquesta opció s'amagarà el nombre de suports)
|
147
|
+
events:
|
148
|
+
proposals:
|
149
|
+
proposal_published_for_admin:
|
150
|
+
admin_panel: panell d'administració
|
151
|
+
email_intro: '%{author} ha afegit la proposta <a href="%{resource_path}">%{resource_title}</a> a %{participatory_space_title}. Podeu administrar-la a %{admin_url}'
|
152
|
+
email_outro: Has rebut aquesta notificació perquè ets un administrador de l'espai participatiu "%{participatory_space_title}".
|
153
|
+
email_subject: Nova proposta "%{resource_title}" afegida a %{participatory_space_title}
|
154
|
+
notification_title: '%{author} ha afegit la proposta <a href="%{resource_path}">%{resource_title}</a> a %{participatory_space_title}. Podeu administrar-la a %{admin_url}'
|
155
|
+
notification_title_official: La proposta oficial <a href="%{resource_path}">%{resource_title}</a> a %{participatory_space_title}. Podeu administrar-la a %{admin_url}
|
132
156
|
moderations:
|
133
157
|
actions:
|
134
158
|
hide: Amagar
|
@@ -140,8 +164,21 @@ ca:
|
|
140
164
|
proposals:
|
141
165
|
admin:
|
142
166
|
proposals:
|
167
|
+
address:
|
168
|
+
geolocated_at: Geolocalització
|
143
169
|
send_email_button:
|
144
|
-
send_mail:
|
170
|
+
send_mail: Envia un correu electrònic a l'usuari
|
171
|
+
proposals_valuator_mailer:
|
172
|
+
notify_proposals_valuator:
|
173
|
+
admin_panel: panell d'administració
|
174
|
+
email_body: Has estat assignat com a avaluador de les propostes llistades a sota. Això significa que s'ha confiat en tu per donar-hi resposta en els propoers dies.
|
175
|
+
gratitude: Gràcies per la teva ajuda!
|
176
|
+
greeting: Hola %{name},
|
177
|
+
public_side: lloc públic
|
178
|
+
subject: Nova proposta asignada per la teva avaluació
|
179
|
+
reported_mailer:
|
180
|
+
report:
|
181
|
+
admin_resource: Administra el recurs
|
145
182
|
reporting_proposals:
|
146
183
|
actions:
|
147
184
|
answer_proposal: Resposta de la proposta
|
@@ -283,15 +320,23 @@ ca:
|
|
283
320
|
exports:
|
284
321
|
proposal_comments: Comentaris
|
285
322
|
proposals: Propostes directes
|
323
|
+
notification_answer_proposal_mailer:
|
324
|
+
notify_proposal_author:
|
325
|
+
email_body: |
|
326
|
+
La teva proposta ha estat contestada.
|
327
|
+
Pots llegir la resposta aquí:<br>
|
328
|
+
<a href=%{answer_url} target="_blank">%{proposal_title}</a>
|
329
|
+
greeting: Hola, %{recipient}!
|
330
|
+
subject: La teva proposta ha estat contestada
|
286
331
|
proposal_notes:
|
287
332
|
modal:
|
288
|
-
body:
|
289
|
-
title:
|
290
|
-
update:
|
333
|
+
body: Nota
|
334
|
+
title: Edita la nota
|
335
|
+
update: Actualitza
|
291
336
|
update:
|
292
|
-
edited:
|
293
|
-
invalid:
|
294
|
-
success:
|
337
|
+
edited: Editada
|
338
|
+
invalid: Hi ha hagut un problema en actualitzar la nota.
|
339
|
+
success: Nota creada correctament.
|
295
340
|
proposals:
|
296
341
|
photo_form:
|
297
342
|
action: Afageix imatge
|
@@ -356,6 +401,13 @@ ca:
|
|
356
401
|
no_device_location: Ho sentim, no hem pogut detectar la teva localització.
|
357
402
|
use_my_camera: Usa la meva càmera
|
358
403
|
use_my_location: Usa la meva localització
|
404
|
+
notification_publish_proposal_mailer:
|
405
|
+
notify_proposal_author:
|
406
|
+
email_body: |
|
407
|
+
La teva proposta ha estat publicada.
|
408
|
+
Pots veure-la aquí: <a href=%{answer_url} target="_blank">%{proposal_title}</a>
|
409
|
+
greeting: Hola, %{recipient}!
|
410
|
+
subject: La teva proposta ha estat publicada
|
359
411
|
proposals:
|
360
412
|
compare:
|
361
413
|
geocoding:
|
@@ -364,3 +416,25 @@ ca:
|
|
364
416
|
title: Propostes properes
|
365
417
|
form:
|
366
418
|
image: Imatge/fotografia
|
419
|
+
templates:
|
420
|
+
admin:
|
421
|
+
proposal_answer_templates:
|
422
|
+
form:
|
423
|
+
answer_template: Plantilla de resposta
|
424
|
+
hint: "<strong>Suggeriment:</strong> Pots fer servir aquestes variables a qualsevol lloc a la plantilla de resposta i seran substituïdes pels valors en actiu quan es faci servir"
|
425
|
+
hint1: "<strong>%{organization}</strong> se substituirà pel nom de l'organització"
|
426
|
+
hint2: "<strong>%{name}</strong> se substituirà pel nom de l'autor"
|
427
|
+
hint3: "<strong>%{admin}</strong> se substituirà pel nom de l'administrador (el que està responent a la proposta)"
|
428
|
+
save: Desa
|
429
|
+
scope_for_availability_help: Noteu que només es llistaran els espais participatius que tinguin components de tipus "propostes".
|
430
|
+
template_title: Informació de la plantilla
|
431
|
+
index:
|
432
|
+
confirm_delete: Està segur que vol suprimir aquesta plantilla?
|
433
|
+
global_scope: Global (disponible a tot arreu)
|
434
|
+
internal_state: Estat intern
|
435
|
+
scope_for_availability: Àmbit
|
436
|
+
title: Respostes a la proposta
|
437
|
+
template_chooser:
|
438
|
+
select_template: Selecciona una plantilla de resposta
|
439
|
+
template_types:
|
440
|
+
proposal_answer_templates: Respostes a la proposta
|