decidim-plans 0.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (182) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE-AGPLv3.txt +661 -0
  3. data/README.md +157 -0
  4. data/Rakefile +48 -0
  5. data/app/assets/config/admin/decidim_plans_manifest.js +3 -0
  6. data/app/assets/config/decidim_plans_manifest.css +4 -0
  7. data/app/assets/config/decidim_plans_manifest.js +2 -0
  8. data/app/assets/images/decidim/plans/icon.svg +3 -0
  9. data/app/assets/javascripts/decidim/plans/admin/plans.js.es6 +3 -0
  10. data/app/assets/javascripts/decidim/plans/admin/sections.js.es6 +78 -0
  11. data/app/assets/javascripts/decidim/plans/multifield/component.js.es6 +101 -0
  12. data/app/assets/javascripts/decidim/plans/multifield.js.es6 +5 -0
  13. data/app/assets/javascripts/decidim/plans/plans_form.js.es6 +9 -0
  14. data/app/assets/javascripts/decidim/plans/proposal_picker.js.es6 +41 -0
  15. data/app/assets/javascripts/decidim/plans/remaining_characters.es6 +42 -0
  16. data/app/assets/javascripts/decidim/plans/social_share.js +2 -0
  17. data/app/assets/javascripts/decidim/plans/tab_focus.es6 +20 -0
  18. data/app/assets/stylesheets/decidim/plans/plans_form.scss +26 -0
  19. data/app/assets/stylesheets/decidim/plans/proposal_picker.scss +3 -0
  20. data/app/assets/stylesheets/decidim/plans/social_share.css.scss +22 -0
  21. data/app/cells/decidim/plans/author/flag.erb +5 -0
  22. data/app/cells/decidim/plans/author/withdraw.erb +6 -0
  23. data/app/cells/decidim/plans/author_cell.rb +9 -0
  24. data/app/cells/decidim/plans/coauthorships_cell.rb +23 -0
  25. data/app/cells/decidim/plans/collapsible_authors/show.erb +17 -0
  26. data/app/cells/decidim/plans/collapsible_authors_cell.rb +9 -0
  27. data/app/cells/decidim/plans/plan_activity_cell.rb +19 -0
  28. data/app/cells/decidim/plans/plan_cell.rb +59 -0
  29. data/app/cells/decidim/plans/plan_m/footer.erb +8 -0
  30. data/app/cells/decidim/plans/plan_m_cell.rb +62 -0
  31. data/app/commands/decidim/plans/accept_access_to_plan.rb +53 -0
  32. data/app/commands/decidim/plans/admin/answer_plan.rb +82 -0
  33. data/app/commands/decidim/plans/admin/create_plan.rb +102 -0
  34. data/app/commands/decidim/plans/admin/update_plan.rb +98 -0
  35. data/app/commands/decidim/plans/admin/update_sections.rb +54 -0
  36. data/app/commands/decidim/plans/attachment_methods.rb +78 -0
  37. data/app/commands/decidim/plans/create_plan.rb +90 -0
  38. data/app/commands/decidim/plans/destroy_plan.rb +33 -0
  39. data/app/commands/decidim/plans/nested_updater.rb +26 -0
  40. data/app/commands/decidim/plans/publish_plan.rb +79 -0
  41. data/app/commands/decidim/plans/reject_access_to_plan.rb +46 -0
  42. data/app/commands/decidim/plans/request_access_to_plan.rb +50 -0
  43. data/app/commands/decidim/plans/respond_to_access_request.rb +76 -0
  44. data/app/commands/decidim/plans/update_plan.rb +90 -0
  45. data/app/commands/decidim/plans/withdraw_plan.rb +50 -0
  46. data/app/controllers/concerns/decidim/plans/orderable.rb +53 -0
  47. data/app/controllers/decidim/plans/admin/application_controller.rb +16 -0
  48. data/app/controllers/decidim/plans/admin/plan_answers_controller.rb +40 -0
  49. data/app/controllers/decidim/plans/admin/plans_controller.rb +80 -0
  50. data/app/controllers/decidim/plans/admin/sections_controller.rb +75 -0
  51. data/app/controllers/decidim/plans/application_controller.rb +30 -0
  52. data/app/controllers/decidim/plans/plan_collaborator_requests_controller.rb +53 -0
  53. data/app/controllers/decidim/plans/plan_widgets_controller.rb +19 -0
  54. data/app/controllers/decidim/plans/plans_controller.rb +192 -0
  55. data/app/controllers/decidim/plans/versions_controller.rb +51 -0
  56. data/app/events/decidim/plans/accepted_plan_event.rb +9 -0
  57. data/app/events/decidim/plans/evaluating_plan_event.rb +8 -0
  58. data/app/events/decidim/plans/plan_access_accepted_event.rb +8 -0
  59. data/app/events/decidim/plans/plan_access_rejected_event.rb +8 -0
  60. data/app/events/decidim/plans/plan_access_request_event.rb +27 -0
  61. data/app/events/decidim/plans/plan_access_requested_event.rb +8 -0
  62. data/app/events/decidim/plans/plan_access_requester_accepted_event.rb +8 -0
  63. data/app/events/decidim/plans/plan_access_requester_rejected_event.rb +8 -0
  64. data/app/events/decidim/plans/publish_plan_event.rb +25 -0
  65. data/app/events/decidim/plans/rejected_plan_event.rb +9 -0
  66. data/app/forms/decidim/plans/accept_access_to_plan_form.rb +10 -0
  67. data/app/forms/decidim/plans/access_to_plan_form.rb +35 -0
  68. data/app/forms/decidim/plans/admin/plan_answer_form.rb +19 -0
  69. data/app/forms/decidim/plans/admin/plan_form.rb +88 -0
  70. data/app/forms/decidim/plans/admin/plan_sections_form.rb +20 -0
  71. data/app/forms/decidim/plans/admin/section_form.rb +34 -0
  72. data/app/forms/decidim/plans/attachment_form.rb +20 -0
  73. data/app/forms/decidim/plans/content_form.rb +58 -0
  74. data/app/forms/decidim/plans/plan_form.rb +85 -0
  75. data/app/forms/decidim/plans/reject_access_to_plan_form.rb +9 -0
  76. data/app/forms/decidim/plans/request_access_to_plan_form.rb +20 -0
  77. data/app/helpers/decidim/plans/admin/application_helper.rb +19 -0
  78. data/app/helpers/decidim/plans/application_helper.rb +78 -0
  79. data/app/helpers/decidim/plans/attached_proposals_helper.rb +44 -0
  80. data/app/helpers/decidim/plans/attachments_helper.rb +59 -0
  81. data/app/helpers/decidim/plans/cells_helper.rb +26 -0
  82. data/app/helpers/decidim/plans/plan_cells_helper.rb +67 -0
  83. data/app/helpers/decidim/plans/remaining_characters_helper.rb +32 -0
  84. data/app/helpers/decidim/plans/traceability_helper.rb +79 -0
  85. data/app/helpers/decidim/plans/user_group_helper.rb +23 -0
  86. data/app/models/concerns/decidim/plans/traceable.rb +48 -0
  87. data/app/models/decidim/plans/application_record.rb +10 -0
  88. data/app/models/decidim/plans/attached_proposal.rb +12 -0
  89. data/app/models/decidim/plans/content.rb +21 -0
  90. data/app/models/decidim/plans/paper_trail/version.rb +26 -0
  91. data/app/models/decidim/plans/paper_trail/version_association.rb +14 -0
  92. data/app/models/decidim/plans/plan.rb +206 -0
  93. data/app/models/decidim/plans/plan_collaborator_request.rb +13 -0
  94. data/app/models/decidim/plans/section.rb +16 -0
  95. data/app/permissions/decidim/plans/admin/permissions.rb +44 -0
  96. data/app/permissions/decidim/plans/permissions.rb +67 -0
  97. data/app/presenters/decidim/plans/admin_log/plan_presenter.rb +49 -0
  98. data/app/presenters/decidim/plans/admin_log/value_types/plan_state_presenter.rb +16 -0
  99. data/app/presenters/decidim/plans/content_presenter.rb +25 -0
  100. data/app/presenters/decidim/plans/log/resource_presenter.rb +18 -0
  101. data/app/presenters/decidim/plans/official_author_presenter.rb +38 -0
  102. data/app/presenters/decidim/plans/plan_presenter.rb +48 -0
  103. data/app/queries/decidim/plans/filtered_plans.rb +37 -0
  104. data/app/services/decidim/plans/diff_renderer/base.rb +108 -0
  105. data/app/services/decidim/plans/diff_renderer/categorization.rb +23 -0
  106. data/app/services/decidim/plans/diff_renderer/content.rb +33 -0
  107. data/app/services/decidim/plans/diff_renderer/plan.rb +25 -0
  108. data/app/services/decidim/plans/loggability.rb +19 -0
  109. data/app/services/decidim/plans/plan_builder.rb +68 -0
  110. data/app/services/decidim/plans/plan_search.rb +95 -0
  111. data/app/services/decidim/plans/tracer.rb +29 -0
  112. data/app/views/decidim/plans/admin/plan_answers/edit.html.erb +22 -0
  113. data/app/views/decidim/plans/admin/plans/_bulk-actions.html.erb +9 -0
  114. data/app/views/decidim/plans/admin/plans/_form.html.erb +62 -0
  115. data/app/views/decidim/plans/admin/plans/_js-callout.html.erb +6 -0
  116. data/app/views/decidim/plans/admin/plans/_plan-tr.html.erb +53 -0
  117. data/app/views/decidim/plans/admin/plans/edit.html.erb +7 -0
  118. data/app/views/decidim/plans/admin/plans/index.html.erb +64 -0
  119. data/app/views/decidim/plans/admin/plans/new.html.erb +7 -0
  120. data/app/views/decidim/plans/admin/sections/_bulk-actions.html.erb +7 -0
  121. data/app/views/decidim/plans/admin/sections/_form.html.erb +27 -0
  122. data/app/views/decidim/plans/admin/sections/_section.html.erb +66 -0
  123. data/app/views/decidim/plans/admin/sections/index.html.erb +7 -0
  124. data/app/views/decidim/plans/admin/shared/_info_plan.html.erb +17 -0
  125. data/app/views/decidim/plans/attached_proposals/_proposals.html.erb +12 -0
  126. data/app/views/decidim/plans/plan_widgets/show.html.erb +3 -0
  127. data/app/views/decidim/plans/plans/_accept_request_access_form.html.erb +8 -0
  128. data/app/views/decidim/plans/plans/_attached_proposals.html.erb +10 -0
  129. data/app/views/decidim/plans/plans/_collaborator_requests.html.erb +20 -0
  130. data/app/views/decidim/plans/plans/_content.html.erb +6 -0
  131. data/app/views/decidim/plans/plans/_contents.html.erb +8 -0
  132. data/app/views/decidim/plans/plans/_count.html.erb +1 -0
  133. data/app/views/decidim/plans/plans/_filters.html.erb +32 -0
  134. data/app/views/decidim/plans/plans/_filters_small_view.html.erb +18 -0
  135. data/app/views/decidim/plans/plans/_form.html.erb +57 -0
  136. data/app/views/decidim/plans/plans/_new_plan_button.html.erb +11 -0
  137. data/app/views/decidim/plans/plans/_plan.html.erb +1 -0
  138. data/app/views/decidim/plans/plans/_plan_preview.html.erb +1 -0
  139. data/app/views/decidim/plans/plans/_plans.html.erb +14 -0
  140. data/app/views/decidim/plans/plans/_reject_request_access_form.html.erb +10 -0
  141. data/app/views/decidim/plans/plans/_request_access_form.html.erb +7 -0
  142. data/app/views/decidim/plans/plans/edit.html.erb +21 -0
  143. data/app/views/decidim/plans/plans/index.html.erb +28 -0
  144. data/app/views/decidim/plans/plans/index.js.erb +10 -0
  145. data/app/views/decidim/plans/plans/new.html.erb +15 -0
  146. data/app/views/decidim/plans/plans/preview.html.erb +15 -0
  147. data/app/views/decidim/plans/plans/show.html.erb +133 -0
  148. data/app/views/decidim/plans/shared/_attachment_fields.html.erb +45 -0
  149. data/app/views/decidim/plans/shared/_attachments.html.erb +23 -0
  150. data/app/views/decidim/plans/shared/_remaining_characters_container.html.erb +12 -0
  151. data/app/views/decidim/plans/shared/_section_content_field.html.erb +39 -0
  152. data/app/views/decidim/plans/versions/_version.html.erb +20 -0
  153. data/app/views/decidim/plans/versions/index.html.erb +34 -0
  154. data/app/views/decidim/plans/versions/show.html.erb +41 -0
  155. data/config/locales/en.yml +341 -0
  156. data/config/locales/fi.yml +341 -0
  157. data/config/locales/sv.yml +341 -0
  158. data/db/migrate/20181230110225_enable_pg_trgm_extension_for_plans.rb +18 -0
  159. data/db/migrate/20181230110848_create_decidim_plans.rb +20 -0
  160. data/db/migrate/20181230111731_create_decidim_plans_sections.rb +13 -0
  161. data/db/migrate/20181230111931_create_decidim_plans_plan_contents.rb +14 -0
  162. data/db/migrate/20181230122035_create_decidim_plans_plan_collaborator_requests.rb +12 -0
  163. data/db/migrate/20190110125855_create_decidim_plans_attached_proposals.rb +12 -0
  164. data/db/migrate/20190129140441_add_help_to_decidim_plans_sections.rb +7 -0
  165. data/db/migrate/20190129143607_add_mandatory_to_decidim_plans_sections.rb +7 -0
  166. data/db/migrate/20190129172040_add_section_type_to_decidim_plans_sections.rb +12 -0
  167. data/db/migrate/20190129231439_add_answer_length_to_decidim_plans_sections.rb +11 -0
  168. data/db/migrate/20190202123044_create_version_associations.rb +25 -0
  169. data/db/migrate/20190202123045_add_transaction_id_column_to_versions.rb +15 -0
  170. data/db/migrate/20190202200716_add_update_token_to_decidim_plans.rb +7 -0
  171. data/lib/decidim/plans/admin.rb +10 -0
  172. data/lib/decidim/plans/admin_engine.rb +29 -0
  173. data/lib/decidim/plans/component.rb +163 -0
  174. data/lib/decidim/plans/engine.rb +43 -0
  175. data/lib/decidim/plans/locale_aware.rb +32 -0
  176. data/lib/decidim/plans/optionally_translatable_attributes.rb +85 -0
  177. data/lib/decidim/plans/paper_trail/record_trail.rb +24 -0
  178. data/lib/decidim/plans/paper_trail.rb +10 -0
  179. data/lib/decidim/plans/test/factories.rb +130 -0
  180. data/lib/decidim/plans/version.rb +8 -0
  181. data/lib/decidim/plans.rb +24 -0
  182. metadata +323 -0
@@ -0,0 +1,133 @@
1
+ <% add_decidim_meta_tags({
2
+ title: present(@plan).title,
3
+ url: plan_url(@plan.id)
4
+ }) %>
5
+
6
+ <% if current_user.nil? || allowed_to?(:request_access, :plan, plan: @plan) %>
7
+ <div class="row">
8
+ <div class="columns">
9
+ <div class="callout secondary"><%= t(".info-message").html_safe %></div>
10
+ </div>
11
+ </div>
12
+ <% end %>
13
+
14
+ <div class="row column view-header">
15
+ <%= link_to plans_path do %>
16
+ <%= icon "chevron-left", class: "icon--small" %>
17
+ <%= t(".back") %>
18
+ <% end %>
19
+
20
+ <h2 class="heading2">
21
+ <%= present(@plan).title %>
22
+ </h2>
23
+
24
+ <%= cell("decidim/plans/coauthorships", @plan, has_actions: true, size: 3, context: { current_user: current_user }) %>
25
+ </div>
26
+ <div class="row">
27
+ <div class="columns section view-side mediumlarge-4 mediumlarge-push-8 large-3 large-push-9">
28
+ <div class="card text-center">
29
+ <div class="card__content">
30
+ <div>
31
+ <strong class="text-large text-uppercase">
32
+ <%= t("version", scope:"decidim.plans.plans.show", number: "#{@plan.versions_count}") %>
33
+ </strong>
34
+ <small class="text-medium">
35
+ <%= t("of_versions", scope:"decidim.plans.plans.show", number: "#{@plan.versions_count}") %>
36
+ </small>
37
+ </div>
38
+
39
+ <div>
40
+ <span class="text-medium">
41
+ <%= link_to t("see_other_versions", scope:"decidim.plans.plans.show"), plan_versions_path(@plan) %>
42
+ </span>
43
+ </div>
44
+
45
+ <% if allowed_to?(:edit, :plan, plan: @plan) %>
46
+ <%= link_to t("edit", scope:"decidim.plans.plans.show"), edit_plan_path(@plan), class: "button secondary hollow expanded button--sc mt-s", id: "plan_edit" %>
47
+ <% end %>
48
+
49
+ <%= render "request_access_form" %>
50
+
51
+ <% if @plan.requesters.include? current_user %>
52
+ <button type="button" class="button secondary light expanded button--sc mt-s">
53
+ <%= t("requested_access", scope:"decidim.plans.plans.show") %>
54
+ </button>
55
+ <% end %>
56
+ </div>
57
+
58
+ <div class="card__status">
59
+ <ul class="card-data">
60
+ <li class="card-data__item authors_status">
61
+ <%= with_tooltip t("decidim.plans.models.plan.fields.authors") do %>
62
+ <%= icon("people", class: "icon--small") + " " + "#{@plan.versions.group_by(&:whodunnit).size}" %>
63
+ <% end %>
64
+ </li>
65
+
66
+ <li class="card-data__item versions_status">
67
+ <%= link_to plan_versions_path(@plan) do %>
68
+ <%= with_tooltip t("decidim.plans.models.plan.fields.contributions") do %>
69
+ <%= icon("pencil", class: "icon--small") + " " + "#{@plan.versions.count}" %>
70
+ <% end %>
71
+ <% end %>
72
+ </li>
73
+ <li class="card-data__item">
74
+ <%= link_to "#comments" do %>
75
+ <%= with_tooltip t("decidim.plans.models.plan.fields.comments") do %>
76
+ <%= icon("comment-square", class: "icon--small") + " " + "#{@plan.comments.count}" %>
77
+ <% end %>
78
+ <% end %>
79
+ </li>
80
+ </ul>
81
+ </div>
82
+ </div>
83
+
84
+ <%= render partial: "collaborator_requests" %>
85
+ <%= render partial: "decidim/shared/share_modal" %>
86
+ </div>
87
+ <div class="columns mediumlarge-8 mediumlarge-pull-4">
88
+ <div class="section">
89
+ <%== cell("decidim/plans/plan_m", @plan, full_badge: true).badge %>
90
+ <%= render partial: "contents" %>
91
+ <%= cell "decidim/tags", @plan, context: { extra_classes: ["tags--plan"] } %>
92
+ </div>
93
+ <% if @plan.answered? && translated_attribute(@plan.answer).present? %>
94
+ <% if @plan.accepted? %>
95
+ <div class="section">
96
+ <div class="callout success">
97
+ <h5><%= t(".plan_accepted_reason") %></h5>
98
+ <p><%= decidim_sanitize translated_attribute @plan.answer %></p>
99
+ </div>
100
+ </div>
101
+ <% elsif @plan.rejected? %>
102
+ <div class="section">
103
+ <div class="callout warning">
104
+ <h5><%= t(".plan_rejected_reason") %></h5>
105
+ <p><%= decidim_sanitize translated_attribute @plan.answer %></p>
106
+ </div>
107
+ </div>
108
+ <% else %>
109
+ <div class="section">
110
+ <div class="callout secondary">
111
+ <h5><%= t(".plan_in_evaluation_reason") %></h5>
112
+ <p><%= decidim_sanitize translated_attribute @plan.answer %></p>
113
+ </div>
114
+ </div>
115
+ <% end %>
116
+ <% end %>
117
+ <%= render partial: "attached_proposals" %>
118
+ </div>
119
+ </div>
120
+ <%= attachments_for @plan %>
121
+
122
+ <%= comments_for @plan %>
123
+
124
+ <%= javascript_include_tag "decidim/plans/social_share" %>
125
+ <%= stylesheet_link_tag "decidim/plans/social_share" %>
126
+
127
+ <%=
128
+ render partial: "decidim/shared/flag_modal", locals: {
129
+ reportable: @plan,
130
+ form: @report_form,
131
+ url: decidim.report_path(sgid: @plan.to_sgid.to_s)
132
+ }
133
+ %>
@@ -0,0 +1,45 @@
1
+ <div class="card multifield-field" id="<%= id %>-field">
2
+ <div class="card-divider multifield-field-divider">
3
+ <h3 class="heading6 card-title">
4
+ <span class="card-title-text">
5
+ <%== t(".attachment_legend") %>
6
+ </span>
7
+
8
+ <button class="button tiny hollow remove-field button--title" aria-label="<%= t(".remove") %>">
9
+ <%== icon("trash") %>
10
+ </button>
11
+
12
+ <button class="button tiny hollow move-down-field button--title hide-for-small-only" aria-label="<%= t(".down") %>">
13
+ <%== icon("arrow-bottom") %>
14
+ </button>
15
+
16
+ <button class="button tiny hollow move-up-field button--title hide-for-small-only" aria-label="<%= t(".up") %>">
17
+ <%== icon("arrow-top") %>
18
+ </button>
19
+ </h3>
20
+ </div>
21
+
22
+ <div class="card-section">
23
+ <div class="row column">
24
+ <div class="field">
25
+ <% if form.send(:attribute_required?, :title) %>
26
+ <%= form.text_field :title %>
27
+ <% else %>
28
+ <%
29
+ # Force the required tag on the form to indicate the user that the
30
+ # title is required always when the file is given.
31
+ %>
32
+ <%= form.text_field :title, label: form.label_for(:title) + required_tag %>
33
+ <% end %>
34
+ </div>
35
+
36
+ <div class="field">
37
+ <%= upload_field form, :file %>
38
+ </div>
39
+
40
+ <%= form.hidden_field :id %>
41
+ <%= form.hidden_field :weight, value: form.object.weight || 0, class: "position-input" %>
42
+ <%= form.hidden_field :deleted %>
43
+ </div>
44
+ </div>
45
+ </div>
@@ -0,0 +1,23 @@
1
+ <% if component_settings.attachments_allowed? %>
2
+ <div class="multifield-fields attachments-container" data-placeholder-id="<%= blank_attachment.to_param %>">
3
+ <template>
4
+ <%= fields_for "#{form.object_name}[attachments][#{blank_attachment.to_param}]", blank_attachment do |attachment_form| %>
5
+ <%= render partial: "decidim/plans/shared/attachment_fields", object: attachment_form, locals: { form: attachment_form, id: tabs_id_for_attachment(blank_attachment) } %>
6
+ <% end %>
7
+ </template>
8
+
9
+ <fieldset>
10
+ <legend><%= t(".legend") %></legend>
11
+
12
+ <div class="multifield-fields-list attachments-list">
13
+ <% form.object.attachments.each do |attachment| %>
14
+ <%= form.fields_for "attachments[]", attachment do |attachment_form| %>
15
+ <%= render partial: "decidim/plans/shared/attachment_fields", object: attachment_form, locals: { form: attachment_form, id: tabs_id_for_attachment(attachment) } %>
16
+ <% end %>
17
+ <% end %>
18
+ </div>
19
+ </fieldset>
20
+
21
+ <button class="button small hollow add-field add-attachment"><%= t(".add_attachment") %></button>
22
+ </div>
23
+ <% end %>
@@ -0,0 +1,12 @@
1
+ <%= content_tag(
2
+ :p,
3
+ nil,
4
+ id: remaining_characters_id,
5
+ class: "form-extra help-text",
6
+ data: {
7
+ remaining_characters_messages: {
8
+ one: t('decidim.components.add_comment_form.remaining_characters_1', count: '%count%'),
9
+ many: t('decidim.components.add_comment_form.remaining_characters', count: '%count%'),
10
+ }
11
+ }
12
+ ) %>
@@ -0,0 +1,39 @@
1
+ <%
2
+ content = form.object
3
+ options = {
4
+ id: "plan_section_answer_#{content.section.id}",
5
+ label: content.label,
6
+ help_text: content.help
7
+ }
8
+
9
+ form_field = case content.section.section_type
10
+ when 'field_text'
11
+ :text_field
12
+ else
13
+ options[:rows] = 4
14
+ :text_area
15
+ end
16
+ %>
17
+
18
+ <div class="row column">
19
+ <%= remaining_characters("plan_section_#{content.section.id}", content.section.answer_length) do |rc_opts| %>
20
+ <% if component_settings.multilingual_answers? %>
21
+ <%= form.translated(
22
+ form_field,
23
+ :body,
24
+ {
25
+ tabs_id: id
26
+ }.merge(options).merge(rc_opts)
27
+ ) %>
28
+ <% else %>
29
+ <%= form.public_send(
30
+ form_field,
31
+ "body_#{current_locale}".to_sym,
32
+ options.merge(rc_opts)
33
+ ) %>
34
+ <% end %>
35
+ <% end %>
36
+ </div>
37
+
38
+ <%= form.hidden_field :id %>
39
+ <%= form.hidden_field :section_id %>
@@ -0,0 +1,20 @@
1
+ <div class="card--list__item">
2
+ <div class="card--list__text">
3
+ <div>
4
+ <%= link_to plan_version_path(item, index + 1) do %>
5
+ <h6 class="card--list__heading heading6">
6
+ <%= t(".version_index", index: index + 1) %>
7
+ </h6>
8
+ <% end %>
9
+ <div class="author-data">
10
+ <%= render_resource_editor(version) %>
11
+ <%= l version.created_at, format: :decidim_short %>
12
+ </div>
13
+ </div>
14
+ </div>
15
+ <div class="card--list__data">
16
+ <%= link_to plan_version_path(item, index + 1), class: "card--list__data__icon" do %>
17
+ <%= icon "chevron-right" %>
18
+ <% end %>
19
+ </div>
20
+ </div>
@@ -0,0 +1,34 @@
1
+ <div class="row">
2
+ <div class="small-12 columns">
3
+ <h2 class="heading2">
4
+ <%= t("changes_at_title", scope: "decidim.plans.versions", title: present(item).title) %>
5
+ </h2>
6
+
7
+ <h3 class="section-heading">
8
+ <%= t(".title") %>
9
+ </h3>
10
+
11
+ <div class="row">
12
+ <div class="mediumlarge-8 columns">
13
+ <div class="section">
14
+ <div class="card card--list">
15
+ <% item.versions.each_with_index do |version, index| %>
16
+ <%= render partial: "version", locals: { version: version, index: index } %>
17
+ <% end %>
18
+ </div>
19
+ </div>
20
+ </div>
21
+
22
+ <div class="columns section mediumlarge-4 large-3">
23
+ <div class="card extra definition-data">
24
+ <div class="definition-data__item versions_count">
25
+ <span class="definition-data__title"><%= t("versions.stats.number_of_versions", scope: "decidim.plans") %></span>
26
+ <%= item.versions.count %>
27
+
28
+ <%= link_to t("versions.stats.back_to_plan", scope: "decidim.plans"), plan_path(item), class: "button button--sc hollow secondary small expanded" %>
29
+ </div>
30
+ </div>
31
+ </div>
32
+ </div>
33
+ </div>
34
+ </div>
@@ -0,0 +1,41 @@
1
+ <div class="row">
2
+ <div class="small-12 columns">
3
+ <h2 class="heading2">
4
+ <%= t("changes_at_title", scope: "decidim.plans.versions", title: present(item).title) %>
5
+ </h2>
6
+
7
+ <div class="row">
8
+ <div class="mediumlarge-8 columns">
9
+ <div class="section">
10
+ <% diff_renderers.each do |renderer| %>
11
+ <% renderer.diff.each_value do |data| %>
12
+ <h3 class="section-heading"><%= data[:label] %></h3>
13
+ <%= render_diff_data(data) %>
14
+ <% end %>
15
+ <% end %>
16
+ </div>
17
+ </div>
18
+
19
+ <div class="columns section mediumlarge-4 large-3">
20
+ <div class="card extra definition-data">
21
+ <div class="definition-data__item versions_count">
22
+ <span class="definition-data__title"><%= t("versions.stats.version_number", scope: "decidim.plans") %></span>
23
+ <%= t("versions.stats.version_number_out_of_total", scope: "decidim.plans", current_version: params[:id], total_count: item.versions_count) %>
24
+ <%= link_to t("versions.stats.show_all_versions", scope: "decidim.plans"), plan_versions_path(item), class: "button button--sc hollow secondary small expanded" %>
25
+ <%= link_to t("versions.stats.back_to_plan", scope: "decidim.plans"), plan_path(item), class: "button button--sc hollow secondary small expanded" %>
26
+ </div>
27
+ <% if current_version.whodunnit.present? %>
28
+ <div class="definition-data__item last_revision_by">
29
+ <span class="definition-data__title"><%= t("versions.stats.version_author", scope: "decidim.plans") %></span>
30
+ <%= render_resource_editor(current_version) %>
31
+ </div>
32
+ <% end %>
33
+ <div class="definition-data__item versions_count">
34
+ <span class="definition-data__title"><%= t("versions.stats.version_created_at", scope: "decidim.plans") %></span>
35
+ <%= l current_version.created_at, format: :decidim_short %>
36
+ </div>
37
+ </div>
38
+ </div>
39
+ </div>
40
+ </div>
41
+ </div>