decidim-consultations 0.11.0.pre1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +51 -0
- data/Rakefile +3 -0
- data/app/assets/config/decidim_consultations_manifest.js +5 -0
- data/app/assets/config/decidim_consultations_manifest.scss +3 -0
- data/app/assets/images/decidim/consultations/icon.svg +70 -0
- data/app/assets/images/decidim/consultations/icon2.svg +88 -0
- data/app/assets/javascripts/decidim/consultations/show_more.js.es6 +12 -0
- data/app/assets/javascripts/decidim/consultations/social_share.js +2 -0
- data/app/assets/javascripts/decidim/consultations/utils.js.es6 +19 -0
- data/app/assets/javascripts/decidim/consultations/vote_dialog.js +36 -0
- data/app/assets/stylesheets/decidim/consultations/_question.scss +46 -0
- data/app/assets/stylesheets/decidim/consultations/_stats.scss +22 -0
- data/app/assets/stylesheets/decidim/consultations/_video_wrapper.scss +14 -0
- data/app/assets/stylesheets/decidim/consultations/banners/_block-banner.scss +39 -0
- data/app/assets/stylesheets/decidim/consultations/consultations.scss +6 -0
- data/app/assets/stylesheets/decidim/consultations/consultations/_consultations-banner.scss +13 -0
- data/app/assets/stylesheets/decidim/consultations/consultations/_consultations-card.scss +17 -0
- data/app/assets/stylesheets/decidim/consultations/consultations/_consultations-header.scss +115 -0
- data/app/assets/stylesheets/decidim/consultations/consultations/_consultations-home-banner.scss +15 -0
- data/app/assets/stylesheets/decidim/consultations/consultations/_consultations-home-intro.scss +30 -0
- data/app/assets/stylesheets/decidim/consultations/consultations/_consultations-intro.scss +11 -0
- data/app/assets/stylesheets/decidim/consultations/consultations/_consultations-title.scss +26 -0
- data/app/assets/stylesheets/decidim/consultations/consultations/_consultations_nav.scss +7 -0
- data/app/assets/stylesheets/decidim/consultations/consultations/introductory_image.scss +3 -0
- data/app/assets/stylesheets/decidim/consultations/highlighted-content-banner.css.scss +42 -0
- data/app/assets/stylesheets/decidim/consultations/social_share.css.scss +18 -0
- data/app/commands/decidim/consultations/admin/create_consultation.rb +61 -0
- data/app/commands/decidim/consultations/admin/create_question.rb +68 -0
- data/app/commands/decidim/consultations/admin/create_response.rb +39 -0
- data/app/commands/decidim/consultations/admin/publish_consultation.rb +34 -0
- data/app/commands/decidim/consultations/admin/publish_consultation_results.rb +34 -0
- data/app/commands/decidim/consultations/admin/publish_question.rb +34 -0
- data/app/commands/decidim/consultations/admin/unpublish_consultation.rb +34 -0
- data/app/commands/decidim/consultations/admin/unpublish_consultation_results.rb +34 -0
- data/app/commands/decidim/consultations/admin/unpublish_question.rb +34 -0
- data/app/commands/decidim/consultations/admin/update_consultation.rb +64 -0
- data/app/commands/decidim/consultations/admin/update_question.rb +72 -0
- data/app/commands/decidim/consultations/admin/update_response.rb +46 -0
- data/app/commands/decidim/consultations/unvote_question.rb +37 -0
- data/app/commands/decidim/consultations/vote_question.rb +42 -0
- data/app/constraints/decidim/consultations/current_component.rb +28 -0
- data/app/constraints/decidim/consultations/current_question.rb +36 -0
- data/app/controllers/concerns/decidim/consultations/action_authorization.rb +38 -0
- data/app/controllers/concerns/decidim/consultations/admin/consultation_admin.rb +24 -0
- data/app/controllers/concerns/decidim/consultations/admin/question_admin.rb +28 -0
- data/app/controllers/concerns/decidim/consultations/needs_consultation.rb +54 -0
- data/app/controllers/concerns/decidim/consultations/needs_question.rb +79 -0
- data/app/controllers/concerns/decidim/consultations/orderable.rb +52 -0
- data/app/controllers/decidim/consultations/admin/application_controller.rb +14 -0
- data/app/controllers/decidim/consultations/admin/categories_controller.rb +13 -0
- data/app/controllers/decidim/consultations/admin/component_permissions_controller.rb +13 -0
- data/app/controllers/decidim/consultations/admin/components_controller.rb +13 -0
- data/app/controllers/decidim/consultations/admin/consultation_publications_controller.rb +44 -0
- data/app/controllers/decidim/consultations/admin/consultation_results_publications_controller.rb +44 -0
- data/app/controllers/decidim/consultations/admin/consultations_controller.rb +100 -0
- data/app/controllers/decidim/consultations/admin/question_attachments_controller.rb +25 -0
- data/app/controllers/decidim/consultations/admin/question_publications_controller.rb +44 -0
- data/app/controllers/decidim/consultations/admin/questions_controller.rb +88 -0
- data/app/controllers/decidim/consultations/admin/responses_controller.rb +85 -0
- data/app/controllers/decidim/consultations/consultation_widgets_controller.rb +25 -0
- data/app/controllers/decidim/consultations/consultations_controller.rb +75 -0
- data/app/controllers/decidim/consultations/question_votes_controller.rb +40 -0
- data/app/controllers/decidim/consultations/question_widgets_controller.rb +26 -0
- data/app/controllers/decidim/consultations/questions_controller.rb +23 -0
- data/app/forms/decidim/consultations/admin/consultation_form.rb +56 -0
- data/app/forms/decidim/consultations/admin/question_form.rb +74 -0
- data/app/forms/decidim/consultations/admin/response_form.rb +18 -0
- data/app/forms/decidim/consultations/vote_form.rb +28 -0
- data/app/helpers/decidim/consultations/admin/consultations_helper.rb +14 -0
- data/app/helpers/decidim/consultations/admin/questions_helper.rb +14 -0
- data/app/helpers/decidim/consultations/consultations_helper.rb +17 -0
- data/app/models/concerns/decidim/consultations/override_categorization.rb +21 -0
- data/app/models/concerns/decidim/consultations/publicable_results.rb +51 -0
- data/app/models/decidim/consultation.rb +79 -0
- data/app/models/decidim/consultations/abilities/admin/consultation_admin_ability.rb +34 -0
- data/app/models/decidim/consultations/abilities/admin/question_admin_ability.rb +30 -0
- data/app/models/decidim/consultations/abilities/admin/response_admin_ability.rb +26 -0
- data/app/models/decidim/consultations/abilities/current_user_ability.rb +45 -0
- data/app/models/decidim/consultations/abilities/everyone_ability.rb +23 -0
- data/app/models/decidim/consultations/application_record.rb +9 -0
- data/app/models/decidim/consultations/question.rb +127 -0
- data/app/models/decidim/consultations/response.rb +19 -0
- data/app/models/decidim/consultations/vote.rb +26 -0
- data/app/presenters/decidim/consultations/question_stats_presenter.rb +52 -0
- data/app/queries/decidim/consultations/admin/admin_users.rb +40 -0
- data/app/queries/decidim/consultations/organization_active_consultations.rb +20 -0
- data/app/queries/decidim/consultations/organization_consultations.rb +20 -0
- data/app/queries/decidim/consultations/organization_questions.rb +20 -0
- data/app/services/decidim/consultations/consultation_search.rb +51 -0
- data/app/views/decidim/consultations/_consultation.html.erb +32 -0
- data/app/views/decidim/consultations/admin/consultations/_form.html.erb +58 -0
- data/app/views/decidim/consultations/admin/consultations/edit.html.erb +42 -0
- data/app/views/decidim/consultations/admin/consultations/index.html.erb +74 -0
- data/app/views/decidim/consultations/admin/consultations/new.html.erb +11 -0
- data/app/views/decidim/consultations/admin/questions/_form.html.erb +84 -0
- data/app/views/decidim/consultations/admin/questions/edit.html.erb +32 -0
- data/app/views/decidim/consultations/admin/questions/index.html.erb +74 -0
- data/app/views/decidim/consultations/admin/questions/new.html.erb +13 -0
- data/app/views/decidim/consultations/admin/responses/_form.html.erb +11 -0
- data/app/views/decidim/consultations/admin/responses/edit.html.erb +18 -0
- data/app/views/decidim/consultations/admin/responses/index.html.erb +48 -0
- data/app/views/decidim/consultations/admin/responses/new.html.erb +13 -0
- data/app/views/decidim/consultations/consultation_widgets/show.html.erb +5 -0
- data/app/views/decidim/consultations/consultations/_consultation_card.html.erb +24 -0
- data/app/views/decidim/consultations/consultations/_consultation_details.html.erb +17 -0
- data/app/views/decidim/consultations/consultations/_consultations.html.erb +16 -0
- data/app/views/decidim/consultations/consultations/_count.html.erb +1 -0
- data/app/views/decidim/consultations/consultations/_filters.html.erb +25 -0
- data/app/views/decidim/consultations/consultations/_filters_small_view.html.erb +23 -0
- data/app/views/decidim/consultations/consultations/_highlighted_questions.html.erb +13 -0
- data/app/views/decidim/consultations/consultations/_question.html.erb +40 -0
- data/app/views/decidim/consultations/consultations/_regular_questions.html.erb +14 -0
- data/app/views/decidim/consultations/consultations/finished.html.erb +15 -0
- data/app/views/decidim/consultations/consultations/index.html.erb +27 -0
- data/app/views/decidim/consultations/consultations/index.js.erb +10 -0
- data/app/views/decidim/consultations/consultations/show.html.erb +11 -0
- data/app/views/decidim/consultations/question_votes/update_vote_button.js.erb +9 -0
- data/app/views/decidim/consultations/question_widgets/show.html.erb +2 -0
- data/app/views/decidim/consultations/questions/_results.html.erb +15 -0
- data/app/views/decidim/consultations/questions/_right_column.html.erb +20 -0
- data/app/views/decidim/consultations/questions/_statistics.html.erb +31 -0
- data/app/views/decidim/consultations/questions/_technical_data.html.erb +38 -0
- data/app/views/decidim/consultations/questions/_vote_button.html.erb +76 -0
- data/app/views/decidim/consultations/questions/_vote_modal.html.erb +27 -0
- data/app/views/decidim/consultations/questions/_vote_modal_confirm.html.erb +33 -0
- data/app/views/decidim/consultations/questions/show.html.erb +58 -0
- data/app/views/layouts/decidim/_consultation_header.html.erb +16 -0
- data/app/views/layouts/decidim/_consultation_voting_data.html.erb +10 -0
- data/app/views/layouts/decidim/_question_components.html.erb +38 -0
- data/app/views/layouts/decidim/_question_header.html.erb +46 -0
- data/app/views/layouts/decidim/admin/consultation.html.erb +28 -0
- data/app/views/layouts/decidim/admin/consultations.html.erb +16 -0
- data/app/views/layouts/decidim/admin/question.html.erb +72 -0
- data/app/views/layouts/decidim/consultation.html.erb +17 -0
- data/app/views/layouts/decidim/consultation_choose.html.erb +7 -0
- data/app/views/layouts/decidim/question.html.erb +19 -0
- data/config/locales/ca.yml +248 -0
- data/config/locales/en.yml +249 -0
- data/config/locales/es.yml +248 -0
- data/config/locales/eu.yml +248 -0
- data/config/locales/fi.yml +248 -0
- data/config/locales/fr.yml +248 -0
- data/config/locales/gl.yml +248 -0
- data/config/locales/it.yml +248 -0
- data/config/locales/nl.yml +248 -0
- data/config/locales/pl.yml +258 -0
- data/config/locales/pt-BR.yml +248 -0
- data/config/locales/pt.yml +248 -0
- data/config/locales/ru.yml +6 -0
- data/config/locales/sv.yml +248 -0
- data/config/locales/uk.yml +6 -0
- data/db/migrate/20180109092205_create_decidim_consultations.rb +37 -0
- data/db/migrate/20180112053247_create_decidim_consultations_questions.rb +35 -0
- data/db/migrate/20180115132000_add_end_voting_date_to_decidim_consultations.rb +18 -0
- data/db/migrate/20180115170933_add_slug_to_decidim_consultations_questions.rb +32 -0
- data/db/migrate/20180119084217_create_decidim_consultations_votes.rb +17 -0
- data/db/migrate/20180119084331_add_votes_count_to_decidim_consultations_question.rb +7 -0
- data/db/migrate/20180122113155_add_origin_scope_to_decidim_consultations_questions.rb +8 -0
- data/db/migrate/20180122113400_add_origin_title_to_decidim_consultations_questions.rb +8 -0
- data/db/migrate/20180122113447_add_origin_string_to_decidim_consultations_questions.rb +7 -0
- data/db/migrate/20180126142459_add_enable_highlighted_banner_to_decidim_consultations.rb +7 -0
- data/db/migrate/20180129063438_add_i_frame_url_to_decidim_consultations_questions.rb +8 -0
- data/db/migrate/20180129063700_create_decidim_consultations_responses.rb +14 -0
- data/db/migrate/20180129122226_rename_decidim_consultations_vote_to_decidim_consultations_endorsement.rb +7 -0
- data/db/migrate/20180129122504_rename_decidim_consultations_questions_votes_count_to_endorsements_count.rb +7 -0
- data/db/migrate/20180130060754_add_responses_count_to_decidim_consultations_questions.rb +22 -0
- data/db/migrate/20180130110449_rename_vote_related_attributes.rb +9 -0
- data/db/migrate/20180130142018_add_decidim_user_group_id_to_decidim_consultations_endorsements.rb +7 -0
- data/db/migrate/20180130142411_rename_vote_indexes_to_endorsement_indexes.rb +36 -0
- data/db/migrate/20180131083844_add_response_to_decidim_consultations_endorsements.rb +10 -0
- data/db/migrate/20180201135823_rename_endorsement_to_vote.rb +23 -0
- data/db/migrate/20180202050920_add_hero_image_to_decidim_consultations_question.rb +8 -0
- data/db/migrate/20180202085309_add_results_published_at_to_decidim_consultations.rb +7 -0
- data/db/migrate/20180202133655_add_votes_count_to_decidim_consultations_response.rb +7 -0
- data/db/migrate/20180212100503_remove_enable_highlighted_banner_flag.rb +7 -0
- data/db/migrate/20180219092120_add_order_to_decidim_consultations_questions.rb +7 -0
- data/db/migrate/20180320100658_add_introductory_image_to_decidim_consultations.rb +7 -0
- data/db/seeds/Exampledocument.pdf +0 -0
- data/db/seeds/city.jpeg +0 -0
- data/db/seeds/city2.jpeg +0 -0
- data/db/seeds/homepage_image.jpg +0 -0
- data/lib/decidim/consultations.rb +18 -0
- data/lib/decidim/consultations/admin.rb +10 -0
- data/lib/decidim/consultations/admin_engine.rb +72 -0
- data/lib/decidim/consultations/engine.rb +83 -0
- data/lib/decidim/consultations/participatory_space.rb +171 -0
- data/lib/decidim/consultations/test/factories.rb +104 -0
- data/lib/decidim/consultations/version.rb +9 -0
- metadata +288 -0
@@ -0,0 +1,13 @@
|
|
1
|
+
<h2 class="questions-title-summary">
|
2
|
+
<%= t "questions.new.title", scope: "decidim.admin" %>
|
3
|
+
</h2>
|
4
|
+
|
5
|
+
<%= decidim_form_for @form,
|
6
|
+
url: consultation_questions_path(current_consultation),
|
7
|
+
html: { class: "form new_question" } do |f| %>
|
8
|
+
<%= render partial: "form", object: f %>
|
9
|
+
|
10
|
+
<div class="button--double form-general-submit">
|
11
|
+
<%= f.submit t("questions.new.create", scope: "decidim.admin"), data: { disable_with: true } %>
|
12
|
+
</div>
|
13
|
+
<% end %>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<div class="card">
|
2
|
+
<div class="card-divider">
|
3
|
+
<h2 class="card-title"><%= t "responses.form.title", scope: "decidim.admin" %></h2>
|
4
|
+
</div>
|
5
|
+
|
6
|
+
<div class="card-section">
|
7
|
+
<div class="row column">
|
8
|
+
<%= form.translated :text_field, :title, autofocus: true %>
|
9
|
+
</div>
|
10
|
+
</div>
|
11
|
+
</div>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<%= decidim_form_for @form,
|
2
|
+
url: response_path(current_question, current_response),
|
3
|
+
html: { class: "form edit_response" } do |f| %>
|
4
|
+
<%= render partial: "form", object: f %>
|
5
|
+
<div class="button--double form-general-submit">
|
6
|
+
<%= f.submit t("responses.edit.update", scope: "decidim.admin"),
|
7
|
+
class: "button",
|
8
|
+
data: { disable_with: true } %>
|
9
|
+
|
10
|
+
<% if can? :destroy, current_response %>
|
11
|
+
<%= link_to t("decidim.admin.actions.destroy"),
|
12
|
+
response_path(current_question, current_response),
|
13
|
+
method: :delete,
|
14
|
+
class: "alert button",
|
15
|
+
data: { confirm: t("decidim.admin.actions.confirm_destroy") } %>
|
16
|
+
<% end %>
|
17
|
+
</div>
|
18
|
+
<% end %>
|
@@ -0,0 +1,48 @@
|
|
1
|
+
<div class="card" id="questions">
|
2
|
+
<div class="card-divider">
|
3
|
+
<h2 class="card-title">
|
4
|
+
<%= t "decidim.admin.titles.responses" %>
|
5
|
+
<%= link_to t("actions.new", scope: "decidim.admin", name: t("models.response.name", scope: "decidim.admin")),
|
6
|
+
new_response_path(current_question),
|
7
|
+
class: "button tiny button--title" if can? :create, Decidim::Consultations::Response %>
|
8
|
+
</h2>
|
9
|
+
</div>
|
10
|
+
<div class="card-section">
|
11
|
+
<div class="table-scroll">
|
12
|
+
<table class="table-list">
|
13
|
+
<thead>
|
14
|
+
<tr>
|
15
|
+
<th><%= t("models.response.fields.title", scope: "decidim.admin") %></th>
|
16
|
+
<th><%= t("models.response.fields.created_at", scope: "decidim.admin") %></th>
|
17
|
+
<th></th>
|
18
|
+
</tr>
|
19
|
+
</thead>
|
20
|
+
<tbody>
|
21
|
+
<% current_question.responses.each do |response| %>
|
22
|
+
<tr>
|
23
|
+
<td>
|
24
|
+
<% if can? :update, response %>
|
25
|
+
<%= link_to translated_attribute(response.title),
|
26
|
+
edit_response_path(current_question, response) %>
|
27
|
+
<% else %>
|
28
|
+
<%= translated_attribute(response.title) %>
|
29
|
+
<% end %>
|
30
|
+
</td>
|
31
|
+
<td>
|
32
|
+
<%= l response.created_at, format: :short %>
|
33
|
+
</td>
|
34
|
+
<td class="table-list__actions">
|
35
|
+
<% if can? :update, response %>
|
36
|
+
<%= icon_link_to "pencil",
|
37
|
+
edit_response_path(current_question, response),
|
38
|
+
t("actions.configure", scope: "decidim.admin"),
|
39
|
+
class: "action-icon--edit" %>
|
40
|
+
<% end %>
|
41
|
+
</td>
|
42
|
+
</tr>
|
43
|
+
<% end %>
|
44
|
+
</tbody>
|
45
|
+
</table>
|
46
|
+
</div>
|
47
|
+
</div>
|
48
|
+
</div>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<h2 class="questions-title-summary">
|
2
|
+
<%= t "responses.new.title", scope: "decidim.admin" %>
|
3
|
+
</h2>
|
4
|
+
|
5
|
+
<%= decidim_form_for @form,
|
6
|
+
url: responses_path(current_question),
|
7
|
+
html: { class: "form new_response" } do |f| %>
|
8
|
+
<%= render partial: "form", object: f %>
|
9
|
+
|
10
|
+
<div class="button--double form-general-submit">
|
11
|
+
<%= f.submit t("responses.new.create", scope: "decidim.admin"), data: { disable_with: true } %>
|
12
|
+
</div>
|
13
|
+
<% end %>
|
@@ -0,0 +1,5 @@
|
|
1
|
+
<%= render partial: "decidim/consultations/consultations/consultation_details", locals: { consultation: model } %>
|
2
|
+
<%= render partial: "decidim/consultations/consultations/highlighted_questions", locals: { consultation: model } %>
|
3
|
+
<%= render partial: "decidim/consultations/consultations/regular_questions", locals: { consultation: model } %>
|
4
|
+
|
5
|
+
<%= stylesheet_link_tag "decidim/consultations/consultations", media: :all %>
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<div class="column">
|
2
|
+
<article class="card card--process">
|
3
|
+
<%= link_to consultation_path(consultation), class: "card__link" do %>
|
4
|
+
<div class="card__image-top"
|
5
|
+
style="background-image:url(<%= consultation.banner_image.url %>)"></div>
|
6
|
+
<% end %>
|
7
|
+
<div class="card__content">
|
8
|
+
<%= link_to consultation_path(consultation), class: "card__link" do %>
|
9
|
+
<h4 class="card__title"><%= translated_attribute consultation.title %></h4>
|
10
|
+
<% end %>
|
11
|
+
<p class="card__desc">
|
12
|
+
<%= decidim_sanitize html_truncate(translated_attribute(consultation.subtitle), length: 630, separator: "...") %>
|
13
|
+
</p>
|
14
|
+
</div>
|
15
|
+
<div class="card__footer">
|
16
|
+
<div class="card__support">
|
17
|
+
<span class="card--process__small"></span>
|
18
|
+
<%= link_to consultation_path(consultation), class: "card__button button small" do %>
|
19
|
+
<%= t("consultations.consultation_card.view_results", scope: "decidim") %>
|
20
|
+
<% end %>
|
21
|
+
</div>
|
22
|
+
</div>
|
23
|
+
</article>
|
24
|
+
</div>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<div class="row section" id="consultation-details">
|
2
|
+
<div class="columns medium-6 large-5 large-push-1">
|
3
|
+
<p class="lead"><%= decidim_sanitize translated_attribute consultation.description %></p>
|
4
|
+
</div>
|
5
|
+
<div class="columns medium-6 large-5 large-pull-1">
|
6
|
+
<% if consultation.introductory_video_url.blank? %>
|
7
|
+
<div class="card--full__image consultations-card__image introductory-image"
|
8
|
+
style="background-image: url(<%= consultation.introductory_image_url %>);">
|
9
|
+
</div>
|
10
|
+
<% else %>
|
11
|
+
<div class="embed-container">
|
12
|
+
<iframe src="<%= consultation.introductory_video_url %>" frameborder=0 allowfullscreen>
|
13
|
+
</iframe>
|
14
|
+
</div>
|
15
|
+
<% end %>
|
16
|
+
</div>
|
17
|
+
</div>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<div class="collection-sort-controls row small-up-1 medium-up-3 card-grid">
|
2
|
+
<div class="column">
|
3
|
+
<%= order_selector available_orders, i18n_scope: "decidim.consultations.consultations.orders" %>
|
4
|
+
</div>
|
5
|
+
|
6
|
+
<div class="column">
|
7
|
+
<%= render partial: "decidim/shared/results_per_page" %>
|
8
|
+
</div>
|
9
|
+
</div>
|
10
|
+
|
11
|
+
<div class="row small-up-1 medium-up-2 card-grid">
|
12
|
+
<% consultations.each do |consultation| %>
|
13
|
+
<%= render partial: "consultation_card", locals: { consultation: consultation } %>
|
14
|
+
<% end %>
|
15
|
+
</div>
|
16
|
+
<%= decidim_paginate consultations, random_seed: random_seed %>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= t("decidim.consultations.count.title", count: count) %>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<%= filter_form_for filter do |form| %>
|
2
|
+
<div class="filters__section">
|
3
|
+
<div class="filters__search">
|
4
|
+
<div class="input-group">
|
5
|
+
<%= form.search_field :search_text,
|
6
|
+
label: false,
|
7
|
+
class: "input-group-field",
|
8
|
+
placeholder: t("consultations.filters.search", scope: "decidim") %>
|
9
|
+
<div class="input-group-button">
|
10
|
+
<button type="submit" class="button button--muted">
|
11
|
+
<%= icon "magnifying-glass", aria_label: t("consultations.filters.search", scope: "decidim") %>
|
12
|
+
</button>
|
13
|
+
</div>
|
14
|
+
</div>
|
15
|
+
</div>
|
16
|
+
</div>
|
17
|
+
|
18
|
+
<%= form.collection_radio_buttons :state,
|
19
|
+
options_for_state_filter,
|
20
|
+
:first,
|
21
|
+
:last,
|
22
|
+
legend_title: t("consultations.filters.state", scope: "decidim") %>
|
23
|
+
|
24
|
+
<%= hidden_field_tag :order, order, id: nil, class: "order_filter" %>
|
25
|
+
<% end %>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<div class="filters-controls hide-for-mediumlarge">
|
2
|
+
<button data-open="filter-box" class="filters-controls__trigger">
|
3
|
+
<%= t "consultations.filters_small_view.filter", scope: "decidim" %>
|
4
|
+
<%= icon "caret-bottom",
|
5
|
+
class: "icon--small float-right",
|
6
|
+
aria_label: t("consultations.filters_small_view.unfold", scope: "decidim"),
|
7
|
+
role: "img" %>
|
8
|
+
</button>
|
9
|
+
</div>
|
10
|
+
|
11
|
+
<div class="reveal" id="filter-box" data-reveal>
|
12
|
+
<div class="reveal__header">
|
13
|
+
<h3 class="reveal__title"><%= t "consultations.filters_small_view.filter_by", scope: "decidim" %>:</h3>
|
14
|
+
<button class="close-button" data-close
|
15
|
+
aria-label="<%= t("consultations.filters_small_view.close_modal", scope: "decidim") %>"
|
16
|
+
type="button">
|
17
|
+
<span aria-hidden="true">×</span>
|
18
|
+
</button>
|
19
|
+
</div>
|
20
|
+
<div class="filters">
|
21
|
+
<%= render partial: "filters" %>
|
22
|
+
</div>
|
23
|
+
</div>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<% if consultation.highlighted_questions.any? %>
|
2
|
+
<div class="row section" id="highlighted-questions">
|
3
|
+
<h2 class=section-heading>
|
4
|
+
<%= t "consultations.highlighted_questions.title",
|
5
|
+
scope: "decidim",
|
6
|
+
scope_name: translated_attribute(consultation.highlighted_scope.name) %>
|
7
|
+
</h2>
|
8
|
+
|
9
|
+
<% consultation.highlighted_questions.each do |question| %>
|
10
|
+
<%= render partial: "decidim/consultations/consultations/question", locals: { question: question } %>
|
11
|
+
<% end %>
|
12
|
+
</div>
|
13
|
+
<% end %>
|
@@ -0,0 +1,40 @@
|
|
1
|
+
<article class="card consultations-card">
|
2
|
+
<div class="row collapse card--process__row">
|
3
|
+
<div class="columns mediumlarge-8 large-9 card--process__column">
|
4
|
+
<div class="card__content">
|
5
|
+
<%= link_to decidim_consultations.question_path(question), class: "card__link" do %>
|
6
|
+
<h2 class="heading5"><%= decidim_sanitize translated_attribute question.title %></h2>
|
7
|
+
<% end %>
|
8
|
+
<p><%= translated_attribute question.subtitle %></p>
|
9
|
+
</div>
|
10
|
+
</div>
|
11
|
+
|
12
|
+
<div class="columns mediumlarge-8 large-3 card--process__column">
|
13
|
+
<div class="card--full__image consultations-card__image"
|
14
|
+
style="background-image: url(<%= question.banner_image_url %>)">
|
15
|
+
<div class="card__content row collapse">
|
16
|
+
<div class="columns large-10 large-push-1">
|
17
|
+
<% if question.results_published? %>
|
18
|
+
<%= link_to decidim_consultations.question_path(question),
|
19
|
+
class: "button expanded button--sc" do %>
|
20
|
+
<%= t "consultations.question.view_results", scope: "decidim" %>
|
21
|
+
<% if question.most_voted_response.present? %>
|
22
|
+
<span class="button__info"><%= translated_attribute question.most_voted_response.title %></span>
|
23
|
+
<span class="button__info">
|
24
|
+
<%= question.most_voted_response.votes_count %>
|
25
|
+
<%= t "consultations.question.votes_out_of", scope: "decidim", count: question.most_voted_response.votes_count %>
|
26
|
+
<%= question.total_votes %>
|
27
|
+
</span>
|
28
|
+
<% end %>
|
29
|
+
<% end %>
|
30
|
+
<% else %>
|
31
|
+
<%= link_to t("consultations.question.take_part", scope: "decidim"),
|
32
|
+
decidim_consultations.question_path(question),
|
33
|
+
class: "button expanded button--sc" %>
|
34
|
+
<% end %>
|
35
|
+
</div>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
</div>
|
39
|
+
</div>
|
40
|
+
</article>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<% if consultation.regular_questions.any? %>
|
2
|
+
<section id="regular-questions" class="row section">
|
3
|
+
<h2 class=section-heading>
|
4
|
+
<%= t "consultations.regular_questions.title", scope: "decidim" %>
|
5
|
+
</h2>
|
6
|
+
|
7
|
+
<% consultation.regular_questions.each do |scope_id, questions| %>
|
8
|
+
<h3 class="heading6"><%= translated_attribute questions.first.scope.name %></h3>
|
9
|
+
<% questions.each do |question| %>
|
10
|
+
<%= render partial: "decidim/consultations/consultations/question", locals: { question: question } %>
|
11
|
+
<% end %>
|
12
|
+
<% end %>
|
13
|
+
</section>
|
14
|
+
<% end %>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<% if active_consultations.any? %>
|
2
|
+
<div class="row section">
|
3
|
+
<h2 class="section-heading"><%= t "consultations.finished.active_consultations", scope: "decidim" %></h2>
|
4
|
+
<%= render active_consultations %>
|
5
|
+
</div>
|
6
|
+
<% end %>
|
7
|
+
|
8
|
+
<% if finished_consultations.any? %>
|
9
|
+
<div class="row section">
|
10
|
+
<h2 class="section-heading">
|
11
|
+
<%= t "consultations.finished.past_consultations", scope: "decidim" %>
|
12
|
+
</h2>
|
13
|
+
<%= render finished_consultations %>
|
14
|
+
</div>
|
15
|
+
<% end %>
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<% provide :meta_title, t("consultations.index.title", scope: "decidim") %>
|
2
|
+
<main class="wrapper">
|
3
|
+
<div class="row columns">
|
4
|
+
<div class="title-action">
|
5
|
+
<div class="row collapse">
|
6
|
+
<h2 id="consultations-count" class="title-action__title section-heading">
|
7
|
+
<%= render partial: "count", locals: { count: consultations.count } %>
|
8
|
+
</h2>
|
9
|
+
</div>
|
10
|
+
</div>
|
11
|
+
</div>
|
12
|
+
|
13
|
+
<div class="row">
|
14
|
+
<div class="columns mediumlarge-4 large-3">
|
15
|
+
<%= render partial: "filters_small_view" %>
|
16
|
+
<div class="card card--secondary show-for-mediumlarge">
|
17
|
+
<%= render partial: "filters" %>
|
18
|
+
</div>
|
19
|
+
</div>
|
20
|
+
<div id="consultations" class="columns mediumlarge-8 large-9">
|
21
|
+
<%= render partial: "consultations" %>
|
22
|
+
</div>
|
23
|
+
</div>
|
24
|
+
</main>
|
25
|
+
|
26
|
+
<%= javascript_include_tag "decidim/filters" %>
|
27
|
+
<%= javascript_include_tag "decidim/orders" %>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
var $consultations = $('#consultations');
|
2
|
+
var $consultationsCount = $('#consultations-count');
|
3
|
+
var $orderFilterInput = $('.order_filter');
|
4
|
+
|
5
|
+
$consultations.html('<%= j(render partial: "consultations") %>');
|
6
|
+
$consultationsCount.html('<%= j(render partial: "count", locals: { count: consultations.count }) %>');
|
7
|
+
$orderFilterInput.val('<%= order %>');
|
8
|
+
|
9
|
+
var $dropdownMenu = $('.dropdown.menu', $consultations);
|
10
|
+
$dropdownMenu.foundation();
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<%= render partial: "consultation_details", locals: { consultation: current_consultation } %>
|
2
|
+
<%= render partial: "highlighted_questions", locals: { consultation: current_consultation } %>
|
3
|
+
<%= render partial: "regular_questions", locals: { consultation: current_consultation } %>
|
4
|
+
|
5
|
+
<% if finished_consultations.any? %>
|
6
|
+
<div class="text-center">
|
7
|
+
<%= link_to t("consultations.show.see_finished_consultations", scope: "decidim"),
|
8
|
+
finished_consultations_path,
|
9
|
+
class: "button hollow button--sc" %>
|
10
|
+
</div>
|
11
|
+
<% end %>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
(function () {
|
2
|
+
'use strict';
|
3
|
+
|
4
|
+
var voteButton = $('#question-<%= current_question.id %>-vote-button');
|
5
|
+
voteButton.html('<%= j(render partial: "decidim/consultations/questions/vote_button", locals: { question: current_question }) %>');
|
6
|
+
|
7
|
+
$('#question-vote-modal').foundation();
|
8
|
+
$('#question-vote-confirm-modal').foundation();
|
9
|
+
}());
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<% if question.sorted_results.any? %>
|
2
|
+
<div class=row>
|
3
|
+
<h2 class=section-heading><%= t "questions.results.title", scope: "decidim" %></h2>
|
4
|
+
<div class="card card--list">
|
5
|
+
<% question.sorted_results.each do |response| %>
|
6
|
+
<div class=card--list__item>
|
7
|
+
<div class="card--list__text"><%= translated_attribute response.title %></div>
|
8
|
+
<div class="card--list__data">
|
9
|
+
<span class="card--list__data__number"><%= response.votes_count %></span>
|
10
|
+
</div>
|
11
|
+
</div>
|
12
|
+
<% end %>
|
13
|
+
</div>
|
14
|
+
</div>
|
15
|
+
<% end %>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<% add_decidim_meta_tags({
|
2
|
+
image_url: current_participatory_space.hero_image_url,
|
3
|
+
description: translated_attribute(current_participatory_space.question_context),
|
4
|
+
title: strip_tags(translated_attribute(current_participatory_space.title)),
|
5
|
+
url: decidim_consultations.question_url(current_participatory_space),
|
6
|
+
twitter_handler: current_organization.twitter_handler
|
7
|
+
}) %>
|
8
|
+
|
9
|
+
<div class="section columns medium-5 mediumlarge-4 large-3">
|
10
|
+
<% if user_signed_in? %>
|
11
|
+
<div class="card extra">
|
12
|
+
<div class="card__content">
|
13
|
+
<%= render partial: "decidim/shared/follow_button", locals: { followable: question } %>
|
14
|
+
</div>
|
15
|
+
</div>
|
16
|
+
<% end %>
|
17
|
+
<%= resource_reference(current_question) %>
|
18
|
+
<%= render partial: "decidim/consultations/questions/statistics" %>
|
19
|
+
<%= render partial: "decidim/shared/share_modal" %>
|
20
|
+
</div>
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<div class="card extra">
|
2
|
+
<div class="definition-data">
|
3
|
+
<div class="definition-data__item definition-data__item--double">
|
4
|
+
<span class="definition-data__title">
|
5
|
+
<%= t "questions.statistics.supports_count_title", scope: "decidim" %>
|
6
|
+
</span>
|
7
|
+
<span class="definition-data__number"><%= stats.supports_count %></span>
|
8
|
+
</div>
|
9
|
+
|
10
|
+
<div class="definition-data__item definition-data__item--double">
|
11
|
+
<span class="definition-data__title">
|
12
|
+
<%= t "questions.statistics.comments_count_title", scope: "decidim" %>
|
13
|
+
</span>
|
14
|
+
<span class="definition-data__number"><%= stats.comments_count %></span>
|
15
|
+
</div>
|
16
|
+
|
17
|
+
<div class="definition-data__item definition-data__item--double">
|
18
|
+
<span class="definition-data__title">
|
19
|
+
<%= t "questions.statistics.meetings_count_title", scope: "decidim" %>
|
20
|
+
</span>
|
21
|
+
<span class="definition-data__number"><%= stats.meetings_count %></span>
|
22
|
+
</div>
|
23
|
+
|
24
|
+
<div class="definition-data__item definition-data__item--double">
|
25
|
+
<span class="definition-data__title">
|
26
|
+
<%= t "questions.statistics.assistants_count_title", scope: "decidim" %>
|
27
|
+
</span>
|
28
|
+
<span class="definition-data__number"><%= stats.assistants_count %></span>
|
29
|
+
</div>
|
30
|
+
</div>
|
31
|
+
</div>
|