decidim 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of decidim might be problematic. Click here for more details.

Files changed (322) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +3 -1
  3. data/.codeclimate.yml +2 -3
  4. data/.rubocop.yml +1 -48
  5. data/.travis.yml +1 -0
  6. data/Dockerfile +1 -0
  7. data/Gemfile +1 -0
  8. data/Gemfile.lock +119 -115
  9. data/README.md +24 -9
  10. data/Rakefile +14 -10
  11. data/decidim-admin/app/assets/javascripts/decidim/admin/application.js.es6 +21 -9
  12. data/decidim-admin/app/assets/javascripts/decidim/admin/sort_list.component.js.es6 +35 -0
  13. data/decidim-admin/app/assets/stylesheets/decidim/admin/extra/_language-chooser.scss +4 -0
  14. data/decidim-admin/app/assets/stylesheets/decidim/admin/extra/_sort.scss +12 -0
  15. data/decidim-admin/app/controllers/decidim/admin/application_controller.rb +1 -0
  16. data/decidim-admin/app/controllers/decidim/admin/participatory_process_attachments_controller.rb +4 -0
  17. data/decidim-admin/app/helpers/decidim/admin/menu_helper.rb +0 -1
  18. data/decidim-admin/app/models/decidim/admin/participatory_process_user_role.rb +2 -2
  19. data/decidim-admin/app/views/decidim/admin/categories/index.html.erb +7 -1
  20. data/decidim-admin/app/views/decidim/admin/exports/_dropdown.html.erb +1 -1
  21. data/decidim-admin/app/views/decidim/admin/moderations/index.html.erb +6 -2
  22. data/decidim-admin/app/views/decidim/admin/participatory_process_steps/index.html.erb +1 -0
  23. data/decidim-admin/app/views/layouts/decidim/admin/_title_bar.html.erb +10 -0
  24. data/decidim-admin/bin/rails +3 -3
  25. data/decidim-admin/config/locales/ca.yml +3 -1
  26. data/decidim-admin/config/locales/en.yml +3 -1
  27. data/decidim-admin/config/locales/es.yml +3 -1
  28. data/decidim-admin/config/locales/eu.yml +0 -1
  29. data/decidim-admin/config/locales/fi.yml +0 -1
  30. data/decidim-admin/config/locales/fr.yml +0 -1
  31. data/decidim-admin/config/locales/it.yml +490 -0
  32. data/decidim-admin/db/migrate/20161102144648_add_admin_participatory_process_user_roles.rb +5 -3
  33. data/decidim-admin/db/migrate/20170128112958_change_user_groups_verified_to_timestamp.rb +2 -0
  34. data/decidim-admin/decidim-admin.gemspec +2 -1
  35. data/decidim-admin/lib/decidim/admin/engine.rb +1 -1
  36. data/decidim-admin/lib/decidim/admin/test/manage_attachments_examples.rb +3 -3
  37. data/decidim-admin/spec/commands/reject_user_group_spec.rb +2 -2
  38. data/decidim-admin/spec/features/admin_copy_participatory_process_spec.rb +2 -2
  39. data/decidim-admin/spec/features/admin_invite_spec.rb +1 -1
  40. data/decidim-admin/spec/features/admin_manages_features_spec.rb +2 -2
  41. data/decidim-admin/spec/features/admin_manages_newsletters_spec.rb +4 -4
  42. data/decidim-admin/spec/features/admin_manages_organization_spec.rb +6 -6
  43. data/decidim-admin/spec/features/admin_manages_participatory_process_groups_spec.rb +4 -4
  44. data/decidim-admin/spec/features/admin_manages_participatory_processes_spec.rb +4 -4
  45. data/decidim-admin/spec/features/static_pages_spec.rb +4 -4
  46. data/decidim-admin/spec/forms/organization_form_spec.rb +1 -1
  47. data/decidim-admin/spec/shared/manage_process_categories_examples.rb +44 -29
  48. data/decidim-admin/spec/shared/manage_process_steps_examples.rb +3 -3
  49. data/decidim-admin/spec/shared/manage_processes_examples.rb +1 -1
  50. data/decidim-admin/spec/shared/participatory_admin_shared_context.rb +3 -3
  51. data/decidim-admin/spec/spec_helper.rb +3 -2
  52. data/decidim-api/bin/rails +3 -3
  53. data/decidim-api/decidim-api.gemspec +2 -1
  54. data/decidim-api/lib/decidim/api/engine.rb +1 -1
  55. data/decidim-api/spec/spec_helper.rb +3 -2
  56. data/decidim-budgets/app/controllers/decidim/budgets/application_controller.rb +1 -1
  57. data/decidim-budgets/app/models/decidim/budgets/line_item.rb +1 -2
  58. data/decidim-budgets/app/models/decidim/budgets/order.rb +2 -2
  59. data/decidim-budgets/app/views/decidim/budgets/projects/_linked_projects.html.erb +1 -1
  60. data/decidim-budgets/bin/rails +3 -3
  61. data/decidim-budgets/config/locales/it.yml +126 -0
  62. data/decidim-budgets/db/migrate/20170127114122_create_projects.rb +2 -0
  63. data/decidim-budgets/db/migrate/20170130095615_create_orders.rb +2 -0
  64. data/decidim-budgets/db/migrate/20170130101825_create_line_items.rb +2 -0
  65. data/decidim-budgets/db/migrate/20170207101750_remove_short_description_from_decidim_projects.rb +2 -0
  66. data/decidim-budgets/db/migrate/20170215132708_add_reference_to_projects.rb +2 -0
  67. data/decidim-budgets/db/migrate/20170410074214_remove_not_null_reference_budgets.rb +2 -0
  68. data/decidim-budgets/db/migrate/20170612101846_migrate_projects_category.rb +15 -0
  69. data/decidim-budgets/decidim-budgets.gemspec +3 -1
  70. data/decidim-budgets/lib/decidim/budgets/feature.rb +2 -2
  71. data/decidim-budgets/spec/features/admin_manages_project_attachments_spec.rb +5 -3
  72. data/decidim-budgets/spec/features/admin_manages_projects_spec.rb +5 -7
  73. data/decidim-budgets/spec/features/process_admin_manages_project_attachments_spec.rb +4 -4
  74. data/decidim-budgets/spec/features/process_admin_manages_projects_spec.rb +5 -8
  75. data/decidim-budgets/spec/shared/manage_attachments_examples.rb +0 -4
  76. data/decidim-budgets/spec/shared/manage_projects_examples.rb +3 -3
  77. data/decidim-budgets/spec/spec_helper.rb +2 -1
  78. data/decidim-comments/app/assets/javascripts/decidim/comments/bundle.js +0 -0
  79. data/decidim-comments/app/commands/decidim/comments/create_comment.rb +2 -2
  80. data/decidim-comments/app/frontend/comments/add_comment_form.component.tsx +1 -0
  81. data/decidim-comments/app/frontend/comments/comment.component.test.tsx +12 -1
  82. data/decidim-comments/app/frontend/comments/comment.component.tsx +42 -4
  83. data/decidim-comments/app/frontend/comments/comment_thread.component.test.tsx +11 -0
  84. data/decidim-comments/app/frontend/comments/comment_thread.component.tsx +5 -1
  85. data/decidim-comments/app/frontend/fragments/comment_data.fragment.graphql +3 -0
  86. data/decidim-comments/app/frontend/support/generate_comments_data.ts +3 -0
  87. data/decidim-comments/app/frontend/support/schema.ts +18 -12
  88. data/decidim-comments/app/mailers/decidim/comments/comment_notification_mailer.rb +6 -4
  89. data/decidim-comments/app/models/decidim/comments/comment.rb +6 -4
  90. data/decidim-comments/app/models/decidim/comments/comment_vote.rb +1 -2
  91. data/decidim-comments/app/models/decidim/comments/seed.rb +5 -2
  92. data/decidim-comments/app/resolvers/decidim/comments/vote_comment_resolver.rb +3 -0
  93. data/decidim-comments/app/types/decidim/comments/commentable_interface.rb +3 -3
  94. data/decidim-comments/app/views/decidim/comments/comment_notification_mailer/comment_created.html.erb +1 -1
  95. data/decidim-comments/app/views/decidim/comments/comment_notification_mailer/reply_created.html.erb +1 -1
  96. data/decidim-comments/bin/rails +3 -3
  97. data/decidim-comments/config/locales/ca.yml +5 -0
  98. data/decidim-comments/config/locales/en.yml +5 -0
  99. data/decidim-comments/config/locales/es.yml +5 -0
  100. data/decidim-comments/config/locales/it.yml +65 -0
  101. data/decidim-comments/db/migrate/20161130143508_create_comments.rb +2 -0
  102. data/decidim-comments/db/migrate/20161214082645_add_depth_to_comments.rb +2 -0
  103. data/decidim-comments/db/migrate/20161216102820_add_alignment_to_comments.rb +2 -0
  104. data/decidim-comments/db/migrate/20161219150806_create_comment_votes.rb +3 -1
  105. data/decidim-comments/db/migrate/20170123102043_add_user_group_id_to_comments.rb +2 -0
  106. data/decidim-comments/db/migrate/20170504085413_add_root_commentable_to_comments.rb +2 -0
  107. data/decidim-comments/db/migrate/20170510091348_update_root_commentable_for_comments.rb +3 -2
  108. data/decidim-comments/db/migrate/20170510091409_set_root_commentable_null_constraints.rb +2 -0
  109. data/decidim-comments/decidim-comments.gemspec +2 -1
  110. data/decidim-comments/lib/decidim/comments/comment_serializer.rb +1 -1
  111. data/decidim-comments/lib/decidim/comments/commentable.rb +4 -4
  112. data/decidim-comments/spec/commands/create_comment_spec.rb +2 -2
  113. data/decidim-comments/spec/features/admin_manages_comments_spec.rb +4 -9
  114. data/decidim-comments/spec/features/process_admin_manages_comments_spec.rb +5 -11
  115. data/decidim-comments/spec/mailers/comment_notification_mailer_spec.rb +12 -7
  116. data/decidim-comments/spec/shared/author_localised_email.rb +26 -0
  117. data/decidim-comments/spec/spec_helper.rb +1 -1
  118. data/decidim-dev/config/locales/it.yml +9 -0
  119. data/decidim-dev/decidim-dev.gemspec +8 -3
  120. data/decidim-dev/lib/decidim/dev.rb +1 -8
  121. data/decidim-dev/lib/decidim/dev/railtie.rb +1 -1
  122. data/decidim-dev/lib/decidim/dev/test/base_spec_helper.rb +6 -4
  123. data/decidim-dev/lib/decidim/dev/test/rspec_support/capybara.rb +2 -2
  124. data/decidim-dev/lib/decidim/dev/test/rspec_support/feature.rb +4 -2
  125. data/decidim-dev/lib/decidim/dev/test/rspec_support/feature_context.rb +28 -8
  126. data/decidim-dev/lib/decidim/dev/test/rspec_support/translation_helpers.rb +7 -2
  127. data/decidim-dev/lib/decidim/dev/test/spec_helper.rb +2 -2
  128. data/decidim-dev/lib/generators/decidim/dummy_generator.rb +1 -1
  129. data/decidim-meetings/README.md +1 -1
  130. data/decidim-meetings/app/controllers/decidim/meetings/application_controller.rb +1 -1
  131. data/decidim-meetings/app/views/decidim/meetings/meetings/_linked_meetings.html.erb +1 -1
  132. data/decidim-meetings/bin/rails +3 -3
  133. data/decidim-meetings/config/locales/it.yml +87 -0
  134. data/decidim-meetings/db/migrate/20161130121354_create_meetings.rb +2 -0
  135. data/decidim-meetings/db/migrate/20170110142105_close_a_meeting.rb +2 -0
  136. data/decidim-meetings/db/migrate/20170123151650_add_latitude_and_longitude_to_meetings.rb +2 -0
  137. data/decidim-meetings/db/migrate/20170129153716_remove_short_description_from_meetings.rb +2 -0
  138. data/decidim-meetings/db/migrate/20170215132546_add_reference_to_meetings.rb +2 -0
  139. data/decidim-meetings/db/migrate/20170410074252_remove_not_null_reference_meetings.rb +2 -0
  140. data/decidim-meetings/db/migrate/20170612101925_migrate_meetings_category.rb +15 -0
  141. data/decidim-meetings/decidim-meetings.gemspec +3 -1
  142. data/decidim-meetings/lib/decidim/meetings/feature.rb +2 -2
  143. data/decidim-meetings/spec/features/admin_manages_meetings_attachments_spec.rb +5 -1
  144. data/decidim-meetings/spec/features/admin_manages_meetings_spec.rb +5 -7
  145. data/decidim-meetings/spec/features/explore_meetings_spec.rb +32 -6
  146. data/decidim-meetings/spec/features/process_admin_manages_meetings_attachments_spec.rb +4 -2
  147. data/decidim-meetings/spec/features/process_admin_manages_meetings_spec.rb +5 -8
  148. data/decidim-meetings/spec/shared/manage_attachments_examples.rb +0 -3
  149. data/decidim-meetings/spec/shared/manage_meetings_examples.rb +11 -11
  150. data/decidim-meetings/spec/spec_helper.rb +2 -1
  151. data/decidim-pages/bin/rails +3 -3
  152. data/decidim-pages/config/locales/it.yml +22 -0
  153. data/decidim-pages/db/migrate/20161116121353_create_decidim_pages.rb +2 -0
  154. data/decidim-pages/db/migrate/20161214150429_add_commentable_to_pages.rb +2 -0
  155. data/decidim-pages/db/migrate/20170110145040_remove_commentable_flag_from_pages.rb +2 -0
  156. data/decidim-pages/db/migrate/20170220091402_remove_page_feature_titles.rb +2 -0
  157. data/decidim-pages/decidim-pages.gemspec +3 -1
  158. data/decidim-pages/spec/features/admin_spec.rb +1 -1
  159. data/decidim-pages/spec/spec_helper.rb +2 -3
  160. data/decidim-proposals/app/commands/decidim/proposals/unvote_proposal.rb +34 -0
  161. data/decidim-proposals/app/commands/decidim/proposals/vote_proposal.rb +39 -0
  162. data/decidim-proposals/app/controllers/concerns/decidim/proposals/orderable.rb +7 -3
  163. data/decidim-proposals/app/controllers/decidim/proposals/proposal_votes_controller.rb +18 -8
  164. data/decidim-proposals/app/models/decidim/proposals/proposal.rb +3 -3
  165. data/decidim-proposals/app/models/decidim/proposals/proposal_vote.rb +0 -1
  166. data/decidim-proposals/app/views/decidim/proposals/proposals/_author.html.erb +23 -0
  167. data/decidim-proposals/app/views/decidim/proposals/proposals/_linked_proposals.html.erb +2 -2
  168. data/decidim-proposals/app/views/decidim/proposals/proposals/_proposal.html.erb +1 -9
  169. data/decidim-proposals/app/views/decidim/proposals/proposals/_vote_button.html.erb +2 -6
  170. data/decidim-proposals/app/views/decidim/proposals/proposals/new.html.erb +1 -1
  171. data/decidim-proposals/app/views/decidim/proposals/proposals/show.html.erb +1 -11
  172. data/decidim-proposals/bin/rails +3 -3
  173. data/decidim-proposals/config/locales/ca.yml +6 -0
  174. data/decidim-proposals/config/locales/en.yml +6 -0
  175. data/decidim-proposals/config/locales/es.yml +6 -0
  176. data/decidim-proposals/config/locales/eu.yml +0 -2
  177. data/decidim-proposals/config/locales/fi.yml +0 -2
  178. data/decidim-proposals/config/locales/fr.yml +0 -2
  179. data/decidim-proposals/config/locales/it.yml +147 -0
  180. data/decidim-proposals/db/migrate/20161212110850_create_decidim_proposals.rb +2 -0
  181. data/decidim-proposals/db/migrate/20170112115253_create_proposal_votes.rb +3 -1
  182. data/decidim-proposals/db/migrate/20170113114245_add_text_search_indexes.rb +2 -0
  183. data/decidim-proposals/db/migrate/20170118120151_add_counter_cache_votes_to_proposals.rb +2 -0
  184. data/decidim-proposals/db/migrate/20170120151202_add_user_group_id_to_proposals.rb +2 -0
  185. data/decidim-proposals/db/migrate/20170131092413_add_answers_to_proposals.rb +2 -0
  186. data/decidim-proposals/db/migrate/20170205082832_add_index_to_decidim_proposals_proposals_proposal_votes_count.rb +2 -0
  187. data/decidim-proposals/db/migrate/20170215113152_create_proposal_reports.rb +2 -0
  188. data/decidim-proposals/db/migrate/20170215131720_add_report_count_to_proposals.rb +2 -0
  189. data/decidim-proposals/db/migrate/20170215132030_add_reference_to_proposals.rb +2 -0
  190. data/decidim-proposals/db/migrate/20170220152416_add_hidden_at_to_proposals.rb +2 -0
  191. data/decidim-proposals/db/migrate/20170228105156_add_geolocalization_fields_to_proposals.rb +2 -0
  192. data/decidim-proposals/db/migrate/20170307085300_migrate_proposal_reports_data_to_reports.rb +8 -10
  193. data/decidim-proposals/db/migrate/20170410073742_remove_not_null_reference_proposals.rb +2 -0
  194. data/decidim-proposals/db/migrate/20170612101809_migrate_proposals_category.rb +15 -0
  195. data/decidim-proposals/decidim-proposals.gemspec +4 -2
  196. data/decidim-proposals/lib/decidim/proposals/feature.rb +5 -1
  197. data/decidim-proposals/lib/decidim/proposals/proposal_serializer.rb +1 -6
  198. data/decidim-proposals/spec/commands/decidim/proposals/unvote_proposal_spec.rb +26 -0
  199. data/decidim-proposals/spec/commands/decidim/proposals/vote_proposal_spec.rb +47 -0
  200. data/decidim-proposals/spec/features/admin_manages_proposals_spec.rb +6 -11
  201. data/decidim-proposals/spec/features/process_admin_manages_proposals_spec.rb +6 -12
  202. data/decidim-proposals/spec/features/proposals_spec.rb +38 -12
  203. data/decidim-proposals/spec/shared/manage_proposals_examples.rb +3 -6
  204. data/decidim-proposals/spec/spec_helper.rb +2 -1
  205. data/decidim-results/app/controllers/decidim/results/application_controller.rb +1 -1
  206. data/decidim-results/app/views/decidim/results/results/_linked_results.html.erb +1 -1
  207. data/decidim-results/bin/rails +3 -3
  208. data/decidim-results/config/locales/it.yml +78 -0
  209. data/decidim-results/db/migrate/20170116104125_create_results.rb +2 -0
  210. data/decidim-results/db/migrate/20170129164553_remove_short_description_from_results.rb +2 -0
  211. data/decidim-results/db/migrate/20170215132624_add_reference_to_results.rb +2 -0
  212. data/decidim-results/db/migrate/20170410074358_remove_not_null_reference_results.rb +2 -0
  213. data/decidim-results/db/migrate/20170612101951_migrate_results_category.rb +15 -0
  214. data/decidim-results/decidim-results.gemspec +3 -1
  215. data/decidim-results/spec/features/admin_manages_results_spec.rb +5 -7
  216. data/decidim-results/spec/features/process_admin_manages_results_spec.rb +5 -8
  217. data/decidim-results/spec/shared/manage_results_examples.rb +3 -3
  218. data/decidim-results/spec/spec_helper.rb +2 -1
  219. data/decidim-surveys/README.md +24 -0
  220. data/decidim-surveys/Rakefile +3 -0
  221. data/decidim-surveys/app/assets/config/admin/decidim_surveys_manifest.js +1 -0
  222. data/decidim-surveys/app/assets/images/decidim/surveys/icon.svg +1 -0
  223. data/decidim-surveys/app/assets/javascripts/decidim/surveys/admin/auto_label_by_position.component.js.es6 +33 -0
  224. data/decidim-surveys/app/assets/javascripts/decidim/surveys/admin/dynamic_fields.component.js.es6 +95 -0
  225. data/decidim-surveys/app/assets/javascripts/decidim/surveys/admin/surveys.js.es6 +85 -0
  226. data/decidim-surveys/app/assets/stylesheets/decidim/surveys/surveys.scss +9 -0
  227. data/decidim-surveys/app/commands/decidim/surveys/admin/update_survey.rb +65 -0
  228. data/decidim-surveys/app/commands/decidim/surveys/answer_survey.rb +43 -0
  229. data/decidim-surveys/app/commands/decidim/surveys/create_survey.rb +19 -0
  230. data/decidim-surveys/app/controllers/decidim/surveys/admin/application_controller.rb +15 -0
  231. data/decidim-surveys/app/controllers/decidim/surveys/admin/surveys_controller.rb +55 -0
  232. data/decidim-surveys/app/controllers/decidim/surveys/application_controller.rb +13 -0
  233. data/decidim-surveys/app/controllers/decidim/surveys/surveys_controller.rb +39 -0
  234. data/decidim-surveys/app/forms/decidim/surveys/admin/survey_form.rb +19 -0
  235. data/decidim-surveys/app/forms/decidim/surveys/admin/survey_question_answer_option_form.rb +15 -0
  236. data/decidim-surveys/app/forms/decidim/surveys/admin/survey_question_form.rb +24 -0
  237. data/decidim-surveys/app/forms/decidim/surveys/survey_answer_form.rb +36 -0
  238. data/decidim-surveys/app/forms/decidim/surveys/survey_form.rb +22 -0
  239. data/decidim-surveys/app/helpers/decidim/surveys/admin/application_helper.rb +39 -0
  240. data/decidim-surveys/app/models/decidim/surveys/abilities/admin_user.rb +34 -0
  241. data/decidim-surveys/app/models/decidim/surveys/abilities/current_user.rb +47 -0
  242. data/decidim-surveys/app/models/decidim/surveys/abilities/process_admin_user.rb +44 -0
  243. data/decidim-surveys/app/models/decidim/surveys/application_record.rb +10 -0
  244. data/decidim-surveys/app/models/decidim/surveys/survey.rb +25 -0
  245. data/decidim-surveys/app/models/decidim/surveys/survey_answer.rb +27 -0
  246. data/decidim-surveys/app/models/decidim/surveys/survey_question.rb +18 -0
  247. data/decidim-surveys/app/queries/decidim/surveys/survey_user_answers.rb +28 -0
  248. data/decidim-surveys/app/views/decidim/surveys/admin/surveys/_answer_option.html.erb +23 -0
  249. data/decidim-surveys/app/views/decidim/surveys/admin/surveys/_form.html.erb +47 -0
  250. data/decidim-surveys/app/views/decidim/surveys/admin/surveys/_question.html.erb +57 -0
  251. data/decidim-surveys/app/views/decidim/surveys/admin/surveys/edit.html.erb +7 -0
  252. data/decidim-surveys/app/views/decidim/surveys/surveys/show.html.erb +102 -0
  253. data/decidim-surveys/bin/rails +15 -0
  254. data/decidim-surveys/config/i18n-tasks.yml +11 -0
  255. data/decidim-surveys/config/locales/ca.yml +69 -0
  256. data/decidim-surveys/config/locales/en.yml +73 -0
  257. data/decidim-surveys/config/locales/es.yml +69 -0
  258. data/decidim-surveys/config/locales/eu.yml +5 -0
  259. data/decidim-surveys/config/locales/fi.yml +5 -0
  260. data/decidim-surveys/config/locales/fr.yml +5 -0
  261. data/decidim-surveys/config/locales/it.yml +5 -0
  262. data/decidim-surveys/config/locales/nl.yml +5 -0
  263. data/decidim-surveys/db/migrate/20170511092231_create_decidim_surveys.rb +15 -0
  264. data/decidim-surveys/db/migrate/20170515090916_create_decidim_survey_questions.rb +12 -0
  265. data/decidim-surveys/db/migrate/20170515144119_create_decidim_survey_answers.rb +14 -0
  266. data/decidim-surveys/db/migrate/20170518085302_add_position_to_surveys_questions.rb +7 -0
  267. data/decidim-surveys/db/migrate/20170522075938_add_mandatory_to_surveys_questions.rb +7 -0
  268. data/decidim-surveys/db/migrate/20170524122229_add_question_type_to_surveys_questions.rb +7 -0
  269. data/decidim-surveys/db/migrate/20170525132233_add_answer_options_to_surveys_questions.rb +7 -0
  270. data/decidim-surveys/decidim-surveys.gemspec +22 -0
  271. data/decidim-surveys/lib/decidim/surveys.rb +14 -0
  272. data/decidim-surveys/lib/decidim/surveys/admin.rb +10 -0
  273. data/decidim-surveys/lib/decidim/surveys/admin_engine.rb +34 -0
  274. data/decidim-surveys/lib/decidim/surveys/engine.rb +25 -0
  275. data/decidim-surveys/lib/decidim/surveys/feature.rb +85 -0
  276. data/decidim-surveys/lib/decidim/surveys/survey_user_answers_serializer.rb +23 -0
  277. data/decidim-surveys/lib/decidim/surveys/test/factories.rb +39 -0
  278. data/decidim-surveys/spec/commands/decidim/surveys/admin/update_survey_spec.rb +147 -0
  279. data/decidim-surveys/spec/commands/decidim/surveys/answer_survey_spec.rb +71 -0
  280. data/decidim-surveys/spec/commands/decidim/surveys/create_survey_spec.rb +44 -0
  281. data/decidim-surveys/spec/factories.rb +3 -0
  282. data/decidim-surveys/spec/features/admin_manages_surveys_spec.rb +13 -0
  283. data/decidim-surveys/spec/features/process_admin_manages_surveys_spec.rb +13 -0
  284. data/decidim-surveys/spec/features/survey_spec.rb +235 -0
  285. data/decidim-surveys/spec/forms/decidim/surveys/admin/survey_form_spec.rb +64 -0
  286. data/decidim-surveys/spec/forms/decidim/surveys/admin/survey_question_form_spec.rb +36 -0
  287. data/decidim-surveys/spec/forms/decidim/surveys/survey_answer_form_spec.rb +36 -0
  288. data/decidim-surveys/spec/forms/decidim/surveys/survey_form_spec.rb +32 -0
  289. data/decidim-surveys/spec/models/decidim/surveys/abilities/admin_user_spec.rb +22 -0
  290. data/decidim-surveys/spec/models/decidim/surveys/abilities/current_user_spec.rb +19 -0
  291. data/decidim-surveys/spec/models/decidim/surveys/abilities/process_admin_user_spec.rb +23 -0
  292. data/decidim-surveys/spec/models/decidim/surveys/survey_answer_spec.rb +55 -0
  293. data/decidim-surveys/spec/models/decidim/surveys/survey_question_spec.rb +19 -0
  294. data/decidim-surveys/spec/models/decidim/surveys/survey_spec.rb +65 -0
  295. data/decidim-surveys/spec/queries/decidim/surveys/survey_user_answers_spec.rb +21 -0
  296. data/decidim-surveys/spec/services/decidim/surveys/surveys/survey_user_answer_serializer_spec.rb +34 -0
  297. data/decidim-surveys/spec/shared/edit_survey_examples.rb +213 -0
  298. data/decidim-surveys/spec/shared/export_survey_user_answers_examples.rb +47 -0
  299. data/decidim-surveys/spec/spec_helper.rb +4 -0
  300. data/decidim-system/app/controllers/decidim/system/devise/passwords_controller.rb +2 -0
  301. data/decidim-system/app/helpers/decidim/system/menu_helper.rb +0 -1
  302. data/decidim-system/bin/rails +3 -3
  303. data/decidim-system/config/locales/it.yml +66 -0
  304. data/decidim-system/db/migrate/20160919105637_devise_create_decidim_admins.rb +2 -0
  305. data/decidim-system/decidim-system.gemspec +2 -1
  306. data/decidim-system/spec/spec_helper.rb +3 -2
  307. data/decidim.gemspec +5 -4
  308. data/docs/geocoding.md +2 -2
  309. data/docs/how_to_create_a_plugin.md +11 -11
  310. data/lib/decidim.rb +1 -0
  311. data/lib/generators/decidim/app_generator.rb +3 -2
  312. data/lib/generators/decidim/demo_generator.rb +1 -1
  313. data/lib/generators/decidim/docker_generator.rb +2 -2
  314. data/lib/generators/decidim/install_generator.rb +3 -6
  315. data/lib/generators/decidim/templates/initializer.rb +2 -2
  316. metadata +130 -47
  317. data/decidim-admin/app/assets/javascripts/decidim/admin/sort_steps.js.es6 +0 -30
  318. data/decidim-budgets/spec/shared/admin_shared_context.rb +0 -13
  319. data/decidim-comments/spec/shared/admin_shared_context.rb +0 -13
  320. data/decidim-meetings/spec/shared/admin_shared_context.rb +0 -13
  321. data/decidim-proposals/spec/shared/admin_shared_context.rb +0 -13
  322. data/decidim-results/spec/shared/admin_shared_context.rb +0 -13
data/README.md CHANGED
@@ -20,7 +20,7 @@ Decidim is a participatory democracy framework written on Ruby on Rails original
20
20
  [![Code Climate](https://img.shields.io/codeclimate/github/decidim/decidim.svg)](https://codeclimate.com/github/decidim/decidim/trends)
21
21
  [![codecov](https://img.shields.io/codecov/c/github/decidim/decidim.svg)](https://codecov.io/gh/decidim/decidim)
22
22
  [![Dependency Status](https://img.shields.io/gemnasium/decidim/decidim.svg)](https://gemnasium.com/github.com/decidim/decidim)
23
- [![Crowdin](https://d322cqt584bo4o.cloudfront.net/decidim/localized.svg)](https://crowdin.com/project/decidim/invite)
23
+ [![Crowdin](https://d322cqt584bo4o.cloudfront.net/decidim/localized.svg)](https://crowdin.com/project/decidim)
24
24
  [![Inline docs](http://inch-ci.org/github/decidim/decidim.svg?branch=master)](http://inch-ci.org/github/decidim/decidim)
25
25
  [![Accessibility issues](https://rocketvalidator.com/badges/a11y_issues.svg?url=http://staging.decidim.codegram.com/)](https://rocketvalidator.com/badges/link?url=http://staging.decidim.codegram.com/&report=a11y)
26
26
  [![HTML issues](https://rocketvalidator.com/badges/html_issues.svg?url=http://staging.decidim.codegram.com/)](https://rocketvalidator.com/badges/link?url=http://staging.decidim.codegram.com/&report=html)
@@ -52,6 +52,12 @@ We've set up a guide on how to install, set up and upgrade Decidim. See the [Get
52
52
 
53
53
  ## How to contribute
54
54
 
55
+ ### As a Translator
56
+
57
+ Decidim is already translated on multiple languages (English, Spanish, Catalan, Basque, Italian, Finnish, Dutch and French). You can help us at [Crowdin, the translation service](https://crowdin.com/project/decidim), reviewing this translations or proposing a new language to add to the platform.
58
+
59
+ ### As a Developer
60
+
55
61
  In order to develop on decidim, you'll need:
56
62
 
57
63
  * **PostgreSQL** 9.4+
@@ -74,7 +80,7 @@ You have several rake tasks available for you:
74
80
  * `bundle exec rake development_app`: Creates a development app which you can use to run an application with the gems in your path.
75
81
  * `bundle exec rake test_all`: Generates a test app for every engine and runs their tests.
76
82
 
77
- ### Browse Decidim
83
+ #### Browse Decidim
78
84
 
79
85
  After you create a development app (`bundle exec rake development_app`):
80
86
  - `cd development_app`
@@ -86,7 +92,7 @@ Optionally, you can log in as: user@example.org | decidim123456
86
92
  Also, if you want to verify yourself against the default authorization handler use a document number ended with "X".
87
93
 
88
94
 
89
- ### Browse Admin Interface
95
+ #### Browse Admin Interface
90
96
 
91
97
  After you create a development app (`bundle exec rake development_app`):
92
98
  - `cd development_app`
@@ -95,10 +101,10 @@ After you create a development app (`bundle exec rake development_app`):
95
101
  - Login data: admin@example.org | decidim123456
96
102
 
97
103
 
98
- ## Components
104
+ ## Officially supported libraries
99
105
 
100
106
 
101
- | Component | Description |
107
+ | Library | Description |
102
108
  | ------------- |-------------|
103
109
  | [Admin](https://github.com/decidim/decidim/tree/master/decidim-admin) | This library adds an administration dashboard so users can manage their organization, participatory processes and all other entities. |
104
110
  | [API](https://github.com/decidim/decidim/tree/master/decidim-api) | This library exposes a GraphQL API to programatically interact with the Decidim platform via HTTP |
@@ -106,7 +112,7 @@ After you create a development app (`bundle exec rake development_app`):
106
112
  | [Comments](https://github.com/decidim/decidim/tree/master/decidim-comments) | The Comments module adds the ability to include comments to any resource which can be commentable by users. |
107
113
  | [Core](https://github.com/decidim/decidim/tree/master/decidim-core) | The basics of Decidim: users, participatory processes, etc. This is the only required engine to run Decidim, all the others are optional. |
108
114
  | [Dev](https://github.com/decidim/decidim/tree/master/decidim-dev) | This gem aids the local development of Decidim's features. |
109
- | [Meeting](https://github.com/decidim/decidim/tree/master/decidim-meetings) | The Meeeting module adds meeting to any participatory process. It adds a CRUD engine to the admin and public view scoped inside the participatory process. |
115
+ | [Meeting](https://github.com/decidim/decidim/tree/master/decidim-meetings) | The Meeting module adds meeting to any participatory process. It adds a CRUD engine to the admin and public view scoped inside the participatory process. |
110
116
  | [Pages](https://github.com/decidim/decidim/tree/master/decidim-pages) | The Pages module adds static page capabilities to any participatory process. It basically provides an interface to include arbitrary HTML content to any step. |
111
117
  | [Proposals](https://github.com/decidim/decidim/tree/master/decidim-proposals) | The Proposals module adds one of the main features of Decidim: allows users to contribute to a participatory process by creating proposals. |
112
118
  | [Results](https://github.com/decidim/decidim/tree/master/decidim-results) | Adds a results section to any participatory process so users can follow along the state of the accepted proposals. |
@@ -116,7 +122,7 @@ After you create a development app (`bundle exec rake development_app`):
116
122
 
117
123
  ### Architecture
118
124
 
119
- This is not your tipical Ruby on Rails Vanilla App. We've tried that using [Consul](http://decide.es) but we've found some problems on reutilization, adaptation, modularization and configuration. You can read more about that on "[Propuesta de Cambios de Arquitectura de Consul](https://www.gitbook.com/book/alabs/propuesta-de-cambios-en-la-arquitectura-de-consul/details)".
125
+ This is not your typical Ruby on Rails Vanilla App. We've tried that using [Consul](http://decide.es) but we've found some problems on reutilization, adaptation, modularization and configuration. You can read more about that on "[Propuesta de Cambios de Arquitectura de Consul](https://www.gitbook.com/book/alabs/propuesta-de-cambios-en-la-arquitectura-de-consul/details)".
120
126
 
121
127
  ### Turbolinks
122
128
 
@@ -133,6 +139,15 @@ If you plan to release your application you'll need to publish it using the same
133
139
 
134
140
  ## Example applications
135
141
 
142
+ Since Decidim is a ruby gem, you can check out the [dependent repositories](https://github.com/decidim/decidim/network/dependents?type=application) to see how many applications are on the wild or tests that other developers have made. Here's a partial list with some of the projects that have used Decidim:
143
+
136
144
  * [Demo](http://staging.decidim.codegram.com)
137
- * [Decidim Barcelona](https://decidim.barcelona)
138
- * [L'H ON dels barris](https://www.lhon-participa.cat)
145
+ * [Decidim Barcelona](https://decidim.barcelona) - [View code](https://github.com/AjuntamentdeBarcelona/decidim-barcelona)
146
+ * [L'H ON Participa](https://www.lhon-participa.cat) - [View code](https://github.com/HospitaletDeLlobregat/decidim-hospitalet)
147
+ * [Decidim Terrassa](https://participa.terrassa.cat) - [View code](https://github.com/AjuntamentDeTerrassa/decidim-terrassa)
148
+ * [Decidim Sabadell](https://decidim.sabadell.cat) - [View code](https://github.com/AjuntamentDeSabadell/decidim-sabadell)
149
+ * [Decidim Gavà](https://participa.gavaciutat.cat) - [View code](https://github.com/AjuntamentDeGava/decidim-gava)
150
+ * [Decidim Sant Cugat](https://decidim.santcugat.cat/) - [View code](https://github.com/AjuntamentdeSantCugat/decidim-sant_cugat)
151
+ * [Vilanova Participa](http://participa.vilanova.cat) - [View code](https://github.com/vilanovailageltru/decidim-vilanova)
152
+ * [Erabaki Pamplona](https://erabaki.pamplona.es) - [View code](https://github.com/ErabakiPamplona/erabaki)
153
+ * [Decidim Mataró](https://www.decidimmataro.cat) - [View code](https://github.com/AjuntamentDeMataro/decidim-mataro)
data/Rakefile CHANGED
@@ -8,7 +8,7 @@ require_relative "lib/generators/decidim/docker_generator"
8
8
  load "decidim-core/lib/tasks/decidim_tasks.rake"
9
9
  load "decidim-dev/lib/tasks/test_app.rake"
10
10
 
11
- DECIDIM_GEMS = %w(core system admin api pages meetings proposals comments results budgets dev).freeze
11
+ DECIDIM_GEMS = %w(core system admin api pages meetings proposals comments results budgets surveys dev).freeze
12
12
 
13
13
  RSpec::Core::RakeTask.new(:spec)
14
14
 
@@ -17,9 +17,12 @@ task default: :spec
17
17
  desc "Runs all tests in all Decidim engines"
18
18
  task test_all: ["decidim:generate_test_app"] do
19
19
  DECIDIM_GEMS.each do |gem_name|
20
- Dir.chdir("#{File.dirname(__FILE__)}/decidim-#{gem_name}") do
20
+ next if gem_name == "dev"
21
+
22
+ Dir.chdir("#{__dir__}/decidim-#{gem_name}") do
21
23
  puts "Running #{gem_name}'s tests..."
22
- sh "rake"
24
+ status = system "rake"
25
+ exit 1 unless status || ENV["FAIL_FAST"] == "false"
23
26
  end
24
27
  end
25
28
  end
@@ -28,7 +31,7 @@ desc "Pushes a new build for each gem."
28
31
  task release_all: [:check_locale_completeness, :webpack] do
29
32
  sh "rake release"
30
33
  DECIDIM_GEMS.each do |gem_name|
31
- Dir.chdir("#{File.dirname(__FILE__)}/decidim-#{gem_name}") do
34
+ Dir.chdir("#{__dir__}/decidim-#{gem_name}") do
32
35
  sh "rake release"
33
36
  end
34
37
  end
@@ -37,7 +40,7 @@ end
37
40
  desc "Makes sure all official locales are complete and clean."
38
41
  task :check_locale_completeness do
39
42
  DECIDIM_GEMS.each do |gem_name|
40
- Dir.chdir("#{File.dirname(__FILE__)}/decidim-#{gem_name}") do
43
+ Dir.chdir("#{__dir__}/decidim-#{gem_name}") do
41
44
  system({ "ENFORCED_LOCALES" => "en,ca,es" }, "rspec spec/i18n_spec.rb")
42
45
  end
43
46
  end
@@ -45,7 +48,7 @@ end
45
48
 
46
49
  desc "Generates a development app."
47
50
  task :development_app do
48
- Dir.chdir(File.dirname(__FILE__)) do
51
+ Dir.chdir(__dir__) do
49
52
  sh "rm -fR development_app"
50
53
  end
51
54
 
@@ -53,10 +56,11 @@ task :development_app do
53
56
  ["development_app", "--path", ".."]
54
57
  )
55
58
 
56
- Dir.chdir("#{File.dirname(__FILE__)}/development_app") do
59
+ Dir.chdir("#{__dir__}/development_app") do
57
60
  Bundler.with_clean_env do
58
61
  sh "bundle exec spring stop"
59
- sh "bundle exec rake db:drop db:create db:migrate db:seed"
62
+ sh "bundle exec rake db:drop db:create db:migrate"
63
+ sh "bundle exec rake db:seed"
60
64
  sh "bundle exec rails generate decidim:demo"
61
65
  end
62
66
  end
@@ -64,11 +68,11 @@ end
64
68
 
65
69
  desc "Generates a development app based on Docker."
66
70
  task :docker_development_app do
67
- Dir.chdir(File.dirname(__FILE__)) do
71
+ Dir.chdir(__dir__) do
68
72
  sh "rm -fR docker_development_app"
69
73
  end
70
74
 
71
- path = File.dirname(__FILE__) + "/docker_development_app"
75
+ path = __dir__ + "/docker_development_app"
72
76
 
73
77
  Decidim::Generators::DockerGenerator.start(
74
78
  ["docker_development_app", "--path", path]
@@ -1,12 +1,9 @@
1
- /* global sortSteps */
2
-
3
1
  // = require jquery
4
2
  // = require jquery_ujs
5
3
  // = require foundation
6
- // = require html.sortable
7
- // = require ./sort_steps
8
4
  // = require ./tab_focus
9
5
  // = require ./toggle_nav
6
+ // = require ./sort_list.component
10
7
  // = require decidim/editor
11
8
  // = require foundation-datepicker
12
9
  // = require form_datepicker
@@ -16,17 +13,32 @@
16
13
  window.Decidim = window.Decidim || {};
17
14
 
18
15
  const pageLoad = () => {
16
+ const { toggleNav, createSortList } = window.DecidimAdmin;
17
+
19
18
  $(document).foundation();
20
- sortSteps();
21
19
 
22
- if (DecidimAdmin) {
23
- DecidimAdmin.toggleNav();
24
- }
20
+ toggleNav();
21
+
22
+ createSortList('#steps tbody', {
23
+ placeholder: $('<tr style="border-style: dashed; border-color: #000"><td colspan="4">&nbsp;</td></tr>')[0],
24
+ onSortUpdate: ($children) => {
25
+ const sortUrl = $('#steps tbody').data('sort-url')
26
+ const order = $children.map((index, child) => $(child).data('id')).toArray();
27
+
28
+ $.ajax({
29
+ method: 'POST',
30
+ url: sortUrl,
31
+ contentType: 'application/json',
32
+ data: JSON.stringify({ items_ids: order }) }, // eslint-disable-line camelcase
33
+ );
34
+ }
35
+ })
25
36
  };
26
37
 
27
38
  $(() => {
28
39
  pageLoad();
29
- if (window.Decidim.formDatePicker) {
40
+
41
+ if (window.Decidim.formDatePicker) {
30
42
  window.Decidim.formDatePicker();
31
43
  }
32
44
  });
@@ -0,0 +1,35 @@
1
+ // = require html.sortable
2
+
3
+ ((exports) => {
4
+
5
+ class SortListComponent {
6
+
7
+ /**
8
+ * Creates a sortable list using hmtl5sortable function.
9
+ *
10
+ * @param {String} sortListSelector The list selector that has to be sortable.
11
+ * @param {Object} options An object containing the same options as html5sortable. It also includes
12
+ * an extra option `onSortUpdate`, a callback which returns the children collection
13
+ * whenever the list order has been changed.
14
+ *
15
+ * @returns {void} Nothing.
16
+ */
17
+ constructor(sortListSelector, options) {
18
+ if ($(sortListSelector).length > 0) {
19
+ exports.sortable(sortListSelector, options)[0].addEventListener('sortupdate', (event) => {
20
+ const $children = $(event.target).children();
21
+
22
+ if (options.onSortUpdate) {
23
+ options.onSortUpdate($children);
24
+ }
25
+ });
26
+ }
27
+ }
28
+ }
29
+
30
+ exports.DecidimAdmin = exports.DecidimAdmin || {};
31
+ exports.DecidimAdmin.SortListComponent = SortListComponent;
32
+ exports.DecidimAdmin.createSortList = (sortListSelector, options) => {
33
+ return new SortListComponent(sortListSelector, options);
34
+ };
35
+ })(window);
@@ -0,0 +1,4 @@
1
+ //Overrides position for the user-login block
2
+ .user-login{
3
+ top: 30%;
4
+ }
@@ -0,0 +1,12 @@
1
+ .survey-questions {
2
+ .question-divider {
3
+ cursor: move;
4
+ h2 {
5
+ line-height: 32px;
6
+ }
7
+ }
8
+ }
9
+
10
+ .icon--move {
11
+ vertical-align: middle;
12
+ }
@@ -20,6 +20,7 @@ module Decidim
20
20
  helper Decidim::ReplaceButtonsHelper
21
21
  helper Decidim::OrganizationScopesHelper
22
22
  helper Decidim::TranslationsHelper
23
+ helper Decidim::LanguageChooserHelper
23
24
 
24
25
  protect_from_forgery with: :exception, prepend: true
25
26
 
@@ -11,6 +11,10 @@ module Decidim
11
11
  include Concerns::ParticipatoryProcessAdmin
12
12
  include Concerns::HasAttachments
13
13
 
14
+ def after_destroy_path
15
+ participatory_process_attachments_path(participatory_process.id)
16
+ end
17
+
14
18
  def attached_to
15
19
  participatory_process
16
20
  end
@@ -1,4 +1,3 @@
1
- # encoding: utf-8
2
1
  # frozen_string_literal: true
3
2
 
4
3
  module Decidim
@@ -5,8 +5,8 @@ module Decidim
5
5
  # Defines a relation between a user and a participatory process, and what
6
6
  # kind of relation does the user has.
7
7
  class ParticipatoryProcessUserRole < ApplicationRecord
8
- belongs_to :user, foreign_key: "decidim_user_id", class_name: "Decidim::User"
9
- belongs_to :participatory_process, foreign_key: "decidim_participatory_process_id", class_name: "Decidim::ParticipatoryProcess"
8
+ belongs_to :user, foreign_key: "decidim_user_id", class_name: "Decidim::User", optional: true
9
+ belongs_to :participatory_process, foreign_key: "decidim_participatory_process_id", class_name: "Decidim::ParticipatoryProcess", optional: true
10
10
 
11
11
  ROLES = %w(admin collaborator).freeze
12
12
  validates :role, inclusion: { in: ROLES }, uniqueness: { scope: [:user, :participatory_process] }
@@ -30,7 +30,13 @@
30
30
  <% end %>
31
31
 
32
32
  <% if can? :destroy, category %>
33
- <%= icon_link_to "circle-x", participatory_process_category_path(participatory_process, category), t("actions.destroy", scope: "decidim.admin"), class: "action-icon--remove", method: :delete, data: { confirm: t("actions.confirm_destroy", scope: "decidim.admin") } %>
33
+ <% if category.unused? %>
34
+ <%= icon_link_to "circle-x", participatory_process_category_path(participatory_process, category), t("actions.destroy", scope: "decidim.admin"), class: "action-icon--remove", method: :delete, data: { confirm: t("actions.confirm_destroy", scope: "decidim.admin") } %>
35
+ <% else %>
36
+ <span class="action-icon" title="<%= t('.category_used') %>" data-tooltip="true" data-disable-hover="false">
37
+ <%= icon "circle-x", class: "action-icon action-icon--disabled" %>
38
+ </span>
39
+ <% end %>
34
40
  <% end %>
35
41
  </td>
36
42
  </tr>
@@ -1,4 +1,4 @@
1
- <button class="exports dropdown tiny button button--simple" data-toggle="export-dropdown"><%= t "actions.export", scope: "decidim.admin" %></button>
1
+ <span class="exports dropdown tiny button button--simple" data-toggle="export-dropdown"><%= t "actions.export", scope: "decidim.admin" %></span>
2
2
  <div class="dropdown-pane" id="export-dropdown" data-dropdown data-auto-focus="true" data-close-on-click="true">
3
3
  <ul class="vertical menu add-features">
4
4
  <% feature.manifest.export_manifests.each do |manifest| %>
@@ -17,7 +17,7 @@
17
17
  <thead>
18
18
  <tr>
19
19
  <th><%= t("models.moderation.fields.reportable", scope: "decidim.moderations") %></th>
20
- <th><%= t("models.moderation.fields.reported_content", scope: "decidim.moderations") %></th>
20
+ <th><%= t("models.moderation.fields.reported_content_url", scope: "decidim.moderations") %></th>
21
21
  <th><%= t("models.moderation.fields.reports", scope: "decidim.moderations") %></th>
22
22
  <th><%= t("models.moderation.fields.report_count", scope: "decidim.moderations") %></th>
23
23
  <% if params[:hidden] %>
@@ -33,7 +33,11 @@
33
33
  <%= moderation.reportable.class.name.demodulize %>
34
34
  </td>
35
35
  <td>
36
- <%= moderation.reportable.reported_content %>
36
+ <%=
37
+ link_to moderation.reportable.reported_content_url, target: "_blank" do
38
+ (moderation.reportable.reported_content_url + " " + icon("external-link")).html_safe
39
+ end
40
+ %>
37
41
  </td>
38
42
  <td>
39
43
  <% reports = moderation.reports.map { |report| render 'report', report: report } %>
@@ -24,6 +24,7 @@
24
24
  <% participatory_process.steps.each do |step| %>
25
25
  <tr data-id="<%= step.id %>">
26
26
  <td>
27
+ <span class="table-list__actions"><%= icon("move", class: "action-icon") %></span>
27
28
  <% if step.active? %>
28
29
  <span class="icon-active"></span>
29
30
  <% end %>
@@ -8,6 +8,16 @@
8
8
  <% end %>
9
9
  <% end %>
10
10
  <div class="user-login">
11
+ <ul class="dropdown menu language-chooser" data-dropdown-menu>
12
+ <li class="is-dropdown-submenu-parent">
13
+ <%= link_to t("name", scope: "locale") %>
14
+ <ul class="menu is-dropdown-submenu">
15
+ <% (available_locales - [I18n.locale.to_s]).each do |locale| %>
16
+ <li><%= link_to locale_name(locale), decidim.locale_path(locale: locale), method: :post%></li>
17
+ <% end %>
18
+ </ul>
19
+ </li>
20
+ </ul>
11
21
  <ul class="dropdown menu" data-dropdown-menu>
12
22
  <li class="is-dropdown-submenu-parent">
13
23
  <a href="#"><%= current_user.email %></a>
@@ -4,11 +4,11 @@
4
4
  # This command will automatically be run when you run "rails" with Rails gems
5
5
  # installed from the root of your application.
6
6
 
7
- ENGINE_ROOT = File.expand_path("../..", __FILE__)
8
- ENGINE_PATH = File.expand_path("../../lib/decidim/admin/engine", __FILE__)
7
+ ENGINE_ROOT = File.expand_path("..", __dir__)
8
+ ENGINE_PATH = File.expand_path("../lib/decidim/admin/engine", __dir__)
9
9
 
10
10
  # Set up gems listed in the Gemfile.
11
- ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", __FILE__)
11
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
12
12
  require "bundler/setup" if File.exist?(ENV["BUNDLE_GEMFILE"])
13
13
 
14
14
  require "rails/all"
@@ -155,6 +155,8 @@ ca:
155
155
  edit:
156
156
  title: Edita categoria
157
157
  update: Actualitzar
158
+ index:
159
+ category_used: Aquesta categoria no es pot suprimir perquè és en ús.
158
160
  new:
159
161
  create: Crea una categoria
160
162
  title: Nova categoria
@@ -542,7 +544,7 @@ ca:
542
544
  hidden_at: Data d'ocultació
543
545
  report_count: Recompte
544
546
  reportable: Tipus
545
- reported_content: Contingut
547
+ reported_content_url: URL contingut del contingut reportat
546
548
  reports: Denúncies
547
549
  participatory_processes:
548
550
  participatory_process_groups:
@@ -156,6 +156,8 @@ en:
156
156
  edit:
157
157
  title: Edit category
158
158
  update: Update
159
+ index:
160
+ category_used: This category cannot be removed because it is in use.
159
161
  new:
160
162
  create: Create category
161
163
  title: New category
@@ -543,7 +545,7 @@ en:
543
545
  hidden_at: Hidden at
544
546
  report_count: Count
545
547
  reportable: Reportable
546
- reported_content: Reported content
548
+ reported_content_url: Reported content URL
547
549
  reports: Reports
548
550
  participatory_processes:
549
551
  participatory_process_groups:
@@ -155,6 +155,8 @@ es:
155
155
  edit:
156
156
  title: Editar categoría
157
157
  update: Actualizar
158
+ index:
159
+ category_used: Esta categoría no se puede eliminar porque está en uso.
158
160
  new:
159
161
  create: Crear categoría
160
162
  title: Nueva categoría
@@ -542,7 +544,7 @@ es:
542
544
  hidden_at: Fecha de ocultación
543
545
  report_count: Recuento
544
546
  reportable: Tipo
545
- reported_content: Contenido
547
+ reported_content_url: URL del contenido reportado
546
548
  reports: Denuncias
547
549
  participatory_processes:
548
550
  participatory_process_groups: