decidim-core 0.13.1 → 0.14.1

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

Potentially problematic release.


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

Files changed (236) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/config/decidim_core_manifest.js +1 -1
  3. data/app/assets/images/decidim/gamification/badges/invitations.svg +117 -0
  4. data/app/assets/javascripts/decidim.js.es6 +4 -1
  5. data/app/assets/javascripts/decidim/ajax_modals.js.es6 +17 -0
  6. data/app/assets/javascripts/decidim/conferences.js.es6 +16 -0
  7. data/app/assets/javascripts/decidim/input_hashtags.js.es6 +115 -0
  8. data/app/assets/javascripts/decidim/input_mentions.js.es6 +2 -3
  9. data/app/assets/javascripts/decidim/vizzs/areachart.js.es6 +226 -0
  10. data/app/assets/javascripts/decidim/vizzs/metrics.js.es6 +26 -0
  11. data/app/assets/javascripts/decidim/vizzs/orgchart.js.es6 +701 -0
  12. data/app/assets/javascripts/decidim/vizzs/renders.js.es6 +11 -0
  13. data/app/assets/stylesheets/decidim/extras/_proposal_form.scss +3 -1
  14. data/app/assets/stylesheets/decidim/layouts/_home.scss +1 -1
  15. data/app/assets/stylesheets/decidim/modules/_areachart.scss +74 -0
  16. data/app/assets/stylesheets/decidim/modules/_badges.scss +116 -0
  17. data/app/assets/stylesheets/decidim/modules/_buttons.scss +5 -0
  18. data/app/assets/stylesheets/decidim/modules/_cards.scss +21 -4
  19. data/app/assets/stylesheets/decidim/modules/_chart-tooltip.scss +42 -0
  20. data/app/assets/stylesheets/decidim/modules/_collapsible-list.scss +12 -8
  21. data/app/assets/stylesheets/decidim/modules/_conference-nav.scss +31 -0
  22. data/app/assets/stylesheets/decidim/modules/_conference-programme.scss +110 -0
  23. data/app/assets/stylesheets/decidim/modules/_conference-speaker.scss +86 -0
  24. data/app/assets/stylesheets/decidim/modules/_conversation.scss +58 -0
  25. data/app/assets/stylesheets/decidim/modules/_help.scss +38 -0
  26. data/app/assets/stylesheets/decidim/modules/_hover-section.scss +29 -0
  27. data/app/assets/stylesheets/decidim/modules/_icons.scss +10 -4
  28. data/app/assets/stylesheets/decidim/modules/_input-hashtags.scss +124 -0
  29. data/app/assets/stylesheets/decidim/modules/_loading-spinner.scss +12 -0
  30. data/app/assets/stylesheets/decidim/modules/_margins.scss +2 -2
  31. data/app/assets/stylesheets/decidim/modules/_modules.scss +15 -0
  32. data/app/assets/stylesheets/decidim/modules/_navbar.scss +9 -0
  33. data/app/assets/stylesheets/decidim/modules/_orgchart.scss +62 -0
  34. data/app/assets/stylesheets/decidim/modules/_status-labels.scss +2 -1
  35. data/app/assets/stylesheets/decidim/modules/_typography.scss +9 -0
  36. data/app/assets/stylesheets/decidim/utils/_helpers.scss +28 -0
  37. data/app/assets/stylesheets/decidim/utils/_mixins.scss +63 -0
  38. data/app/cells/decidim/author/withdraw.erb +1 -1
  39. data/app/cells/decidim/author_cell.rb +1 -1
  40. data/app/cells/decidim/badge/show.erb +36 -0
  41. data/app/cells/decidim/badge_cell.rb +53 -0
  42. data/app/cells/decidim/badges/show.erb +6 -0
  43. data/app/cells/decidim/badges_cell.rb +14 -0
  44. data/app/cells/decidim/card_m/header.erb +1 -1
  45. data/app/cells/decidim/card_m/show.erb +1 -2
  46. data/app/cells/decidim/card_m/top.erb +7 -0
  47. data/app/cells/decidim/card_m_cell.rb +14 -17
  48. data/app/cells/decidim/coauthorships_cell.rb +77 -0
  49. data/app/cells/decidim/collapsible_authors/show.erb +0 -1
  50. data/app/cells/decidim/collapsible_authors_cell.rb +4 -4
  51. data/app/cells/decidim/collapsible_list/show.erb +12 -4
  52. data/app/cells/decidim/collapsible_list_cell.rb +14 -12
  53. data/app/cells/decidim/content_blocks/footer_sub_hero/show.erb +14 -0
  54. data/app/cells/decidim/content_blocks/footer_sub_hero_cell.rb +12 -0
  55. data/app/{views/decidim/pages/home/_hero.html.erb → cells/decidim/content_blocks/hero/show.erb} +4 -4
  56. data/app/cells/decidim/content_blocks/hero_cell.rb +25 -0
  57. data/app/cells/decidim/content_blocks/hero_settings_form/show.erb +7 -0
  58. data/app/cells/decidim/content_blocks/hero_settings_form_cell.rb +13 -0
  59. data/app/cells/decidim/content_blocks/highlighted_content_banner/show.erb +24 -0
  60. data/app/cells/decidim/content_blocks/highlighted_content_banner_cell.rb +16 -0
  61. data/app/{views/decidim/pages/home/_extended.html.erb → cells/decidim/content_blocks/how_to_participate/show.erb} +10 -10
  62. data/app/cells/decidim/content_blocks/how_to_participate_cell.rb +9 -0
  63. data/app/{views/decidim/pages/home/_statistics.html.erb → cells/decidim/content_blocks/stats/show.erb} +2 -2
  64. data/app/cells/decidim/content_blocks/stats_cell.rb +18 -0
  65. data/app/{views/decidim/pages/home/_sub_hero.html.erb → cells/decidim/content_blocks/sub_hero/show.erb} +2 -2
  66. data/app/cells/decidim/content_blocks/sub_hero_cell.rb +17 -0
  67. data/app/cells/decidim/conversation/show.erb +18 -0
  68. data/app/cells/decidim/conversation_cell.rb +23 -0
  69. data/app/cells/decidim/conversation_header/show.erb +17 -0
  70. data/app/cells/decidim/conversation_header_cell.rb +16 -0
  71. data/app/cells/decidim/conversations/show.erb +45 -0
  72. data/app/cells/decidim/conversations_cell.rb +24 -0
  73. data/app/cells/decidim/follow_button/show.erb +3 -3
  74. data/app/cells/decidim/follow_button_cell.rb +1 -5
  75. data/app/cells/decidim/following_cell.rb +1 -7
  76. data/app/cells/decidim/message/show.erb +15 -0
  77. data/app/cells/decidim/message_cell.rb +23 -0
  78. data/app/cells/decidim/new_conversation/show.erb +19 -0
  79. data/app/cells/decidim/new_conversation_cell.rb +19 -0
  80. data/app/cells/decidim/notifications/show.erb +1 -1
  81. data/app/cells/decidim/profile/show.erb +27 -0
  82. data/app/cells/decidim/profile_cell.rb +33 -0
  83. data/app/cells/decidim/profile_sidebar/show.erb +57 -0
  84. data/app/cells/decidim/profile_sidebar_cell.rb +31 -0
  85. data/app/cells/decidim/tos_page_cell.rb +0 -4
  86. data/app/cells/decidim/user_profile/header.erb +1 -1
  87. data/app/controllers/concerns/decidim/action_authorization.rb +13 -38
  88. data/app/controllers/concerns/decidim/needs_permission.rb +15 -6
  89. data/app/controllers/decidim/application_controller.rb +1 -0
  90. data/app/controllers/decidim/authorization_modals_controller.rb +35 -0
  91. data/app/controllers/decidim/components/base_controller.rb +0 -1
  92. data/app/controllers/decidim/devise/invitations_controller.rb +2 -1
  93. data/app/controllers/decidim/messaging/conversations_controller.rb +2 -11
  94. data/app/controllers/decidim/newsletters_controller.rb +4 -6
  95. data/app/controllers/decidim/notifications_controller.rb +4 -0
  96. data/app/controllers/decidim/pages_controller.rb +3 -7
  97. data/app/controllers/decidim/profiles_controller.rb +17 -7
  98. data/app/forms/decidim/notifications_settings_form.rb +1 -1
  99. data/app/forms/decidim/registration_form.rb +1 -1
  100. data/app/helpers/decidim/action_authorization_helper.rb +51 -46
  101. data/app/helpers/decidim/application_helper.rb +18 -0
  102. data/app/helpers/decidim/card_helper.rb +1 -1
  103. data/app/helpers/decidim/cells_helper.rb +6 -2
  104. data/app/helpers/decidim/resource_helper.rb +8 -1
  105. data/app/helpers/decidim/searches_helper.rb +5 -4
  106. data/app/helpers/decidim/traceability_helper.rb +5 -1
  107. data/app/models/decidim/authorization.rb +2 -2
  108. data/app/models/decidim/content_block.rb +144 -0
  109. data/app/models/decidim/gamification/badge_score.rb +13 -0
  110. data/app/models/decidim/messaging/message.rb +1 -1
  111. data/app/models/decidim/messaging/receipt.rb +1 -1
  112. data/app/models/decidim/organization.rb +1 -5
  113. data/app/models/decidim/resource_permission.rb +8 -0
  114. data/app/models/decidim/searchable_resource.rb +1 -1
  115. data/app/models/decidim/user.rb +17 -1
  116. data/app/permissions/decidim/default_permissions.rb +4 -3
  117. data/app/permissions/decidim/permissions.rb +33 -1
  118. data/app/presenters/decidim/hashtag_presenter.rb +32 -0
  119. data/app/presenters/decidim/resource_locator_presenter.rb +13 -0
  120. data/app/presenters/decidim/user_presenter.rb +1 -1
  121. data/app/queries/decidim/messaging/user_conversations.rb +1 -1
  122. data/app/resolvers/decidim/hashtags_resolver.rb +15 -0
  123. data/app/services/decidim/action_authorizer.rb +9 -8
  124. data/app/types/decidim/core/date_time_type.rb +1 -1
  125. data/app/types/decidim/core/hashtag_type.rb +13 -0
  126. data/app/uploaders/decidim/homepage_image_uploader.rb +1 -1
  127. data/app/uploaders/decidim/image_uploader.rb +1 -0
  128. data/app/views/decidim/authorization_modals/show.html.erb +32 -0
  129. data/app/views/decidim/messaging/conversations/create.js.erb +1 -1
  130. data/app/views/decidim/messaging/conversations/index.html.erb +1 -51
  131. data/app/views/decidim/messaging/conversations/new.html.erb +1 -5
  132. data/app/views/decidim/messaging/conversations/show.html.erb +1 -9
  133. data/app/views/decidim/messaging/conversations/update.js.erb +1 -1
  134. data/app/views/decidim/notifications/index.html.erb +1 -0
  135. data/app/views/decidim/pages/decidim_page.html.erb +9 -0
  136. data/app/views/decidim/pages/home.html.erb +12 -16
  137. data/app/views/decidim/pages/index.html.erb +8 -0
  138. data/app/views/decidim/profiles/_user_follow.erb +2 -2
  139. data/app/views/decidim/profiles/show.html.erb +1 -37
  140. data/app/views/decidim/searches/_results.html.erb +1 -1
  141. data/app/views/decidim/shared/_author_reference.html.erb +1 -1
  142. data/app/views/decidim/shared/_authorization_modal.html.erb +1 -0
  143. data/app/views/decidim/shared/_tags.html.erb +1 -1
  144. data/app/views/kaminari/decidim/_page.html.erb +1 -1
  145. data/app/views/layouts/decidim/_application.html.erb +6 -1
  146. data/app/views/layouts/decidim/_edit_link.html.erb +8 -0
  147. data/app/views/layouts/decidim/_impersonation_warning.html.erb +1 -1
  148. data/app/views/layouts/decidim/_user_menu.html.erb +2 -2
  149. data/app/views/layouts/decidim/_wrapper.html.erb +14 -1
  150. data/config/initializers/carrierwave.rb +15 -0
  151. data/config/locales/ca.yml +78 -30
  152. data/config/locales/en.yml +78 -30
  153. data/config/locales/es-PY.yml +78 -30
  154. data/config/locales/es.yml +78 -30
  155. data/config/locales/eu.yml +78 -30
  156. data/config/locales/fi.yml +262 -214
  157. data/config/locales/fr.yml +78 -30
  158. data/config/locales/gl.yml +78 -30
  159. data/config/locales/hu.yml +781 -0
  160. data/config/locales/it.yml +78 -30
  161. data/config/locales/nl.yml +78 -30
  162. data/config/locales/pl.yml +78 -30
  163. data/config/locales/pt-BR.yml +106 -58
  164. data/config/locales/pt.yml +78 -30
  165. data/config/locales/ru.yml +52 -32
  166. data/config/locales/sv.yml +183 -135
  167. data/config/locales/uk.yml +60 -40
  168. data/config/routes.rb +8 -6
  169. data/db/migrate/20180705091019_create_decidim_resource_permissions.rb +12 -0
  170. data/db/migrate/20180706104107_add_nickname_to_managed_users.rb +14 -0
  171. data/db/migrate/20180706111847_fix_result_follows.rb +9 -0
  172. data/db/migrate/20180724103814_add_content_blocks.rb +22 -0
  173. data/db/migrate/20180726112510_create_decidim_hashtags.rb +17 -0
  174. data/db/migrate/20180730071851_add_core_content_blocks.rb +28 -0
  175. data/db/migrate/20180802132147_rename_content_block_options_to_settings.rb +7 -0
  176. data/db/migrate/20180806095628_add_badge_scores.rb +11 -0
  177. data/db/migrate/20180808135006_add_images_to_content_blocks.rb +7 -0
  178. data/db/migrate/20180810092428_move_organization_fields_to_hero_content_block.rb +23 -0
  179. data/db/seeds.rb +10 -2
  180. data/lib/decidim/api/authorable_interface.rb +1 -1
  181. data/lib/decidim/coauthorable.rb +1 -0
  182. data/lib/decidim/content_block_manifest.rb +58 -0
  183. data/lib/decidim/content_block_registry.rb +87 -0
  184. data/lib/decidim/content_parsers.rb +1 -0
  185. data/lib/decidim/content_parsers/hashtag_parser.rb +36 -0
  186. data/lib/decidim/content_processor.rb +11 -0
  187. data/lib/decidim/content_renderers.rb +1 -0
  188. data/lib/decidim/content_renderers/hashtag_renderer.rb +43 -0
  189. data/lib/decidim/core.rb +28 -6
  190. data/lib/decidim/core/api.rb +1 -0
  191. data/lib/decidim/core/engine.rb +52 -1
  192. data/lib/decidim/core/test.rb +3 -0
  193. data/lib/decidim/core/test/factories.rb +32 -17
  194. data/lib/decidim/core/test/shared_examples/authorable_interface_examples.rb +10 -0
  195. data/lib/decidim/core/test/shared_examples/coauthorable.rb +3 -0
  196. data/lib/decidim/core/test/shared_examples/edit_link_shared_examples.rb +30 -0
  197. data/lib/decidim/core/test/shared_examples/has_space_in_mcell_examples.rb +15 -0
  198. data/lib/decidim/core/test/shared_examples/publicable.rb +1 -1
  199. data/lib/decidim/core/test/shared_examples/railtie_examples.rb +15 -0
  200. data/lib/decidim/core/test/shared_examples/scope_helper_examples.rb +1 -0
  201. data/lib/decidim/core/version.rb +1 -1
  202. data/lib/decidim/events/base_event.rb +2 -1
  203. data/lib/decidim/form_builder.rb +9 -3
  204. data/lib/decidim/friendly_dates.rb +1 -1
  205. data/lib/decidim/gamification.rb +109 -0
  206. data/lib/decidim/gamification/badge.rb +54 -0
  207. data/lib/decidim/gamification/badge_earned_event.rb +9 -0
  208. data/lib/decidim/gamification/badge_registry.rb +63 -0
  209. data/lib/decidim/gamification/badge_scorer.rb +118 -0
  210. data/lib/decidim/gamification/badge_status.rb +41 -0
  211. data/lib/decidim/gamification/base_event.rb +40 -0
  212. data/lib/decidim/gamification/level_up_event.rb +9 -0
  213. data/lib/decidim/hashtag.rb +15 -0
  214. data/lib/decidim/hashtaggable.rb +20 -0
  215. data/lib/decidim/query_extensions.rb +10 -0
  216. data/lib/decidim/resource_manifest.rb +10 -0
  217. data/lib/decidim/resourceable.rb +13 -0
  218. data/lib/decidim/search_resource_fields_mapper.rb +8 -3
  219. data/lib/decidim/searchable.rb +8 -0
  220. data/lib/decidim/translatable_attributes.rb +6 -18
  221. data/lib/decidim/view_model.rb +6 -0
  222. data/lib/devise/models/decidim_newsletterable.rb +1 -1
  223. data/vendor/assets/javascripts/d3.js +17813 -0
  224. metadata +125 -27
  225. data/app/cells/decidim/card_m/author.erb +0 -3
  226. data/app/cells/decidim/card_m/authors.erb +0 -9
  227. data/app/views/decidim/messaging/conversations/_message.html.erb +0 -14
  228. data/app/views/decidim/messaging/conversations/_reply.html.erb +0 -11
  229. data/app/views/decidim/messaging/conversations/_show.html.erb +0 -21
  230. data/app/views/decidim/messaging/conversations/_start.html.erb +0 -12
  231. data/app/views/decidim/pages/home/_footer_sub_hero.html.erb +0 -14
  232. data/app/views/decidim/pages/home/_highlighted_content_banner.html.erb +0 -26
  233. data/app/views/decidim/pages/home/_highlighted_processes.html.erb +0 -7
  234. data/app/views/decidim/profiles/_user.html.erb +0 -59
  235. data/app/views/decidim/shared/_action_authorization_modal.html.erb +0 -39
  236. data/app/views/layouts/decidim/_component_authorization_modals.html.erb +0 -5
@@ -1,3 +0,0 @@
1
- <div class="card__author">
2
- <%= cell "decidim/author", author, options: { extra_classes: ["author-data--small"] }, has_actions: has_actions? %>
3
- </div>
@@ -1,9 +0,0 @@
1
- <%= cell(
2
- "decidim/collapsible_list",
3
- authors_for(model),
4
- cell_name: "decidim/author",
5
- cell_options: { extra_classes: ["author-data--small"] },
6
- hidden_elements_count_i18n_key: hidden_elements_count_i18n_key,
7
- size: :small,
8
- has_actions: has_actions?
9
- ) %>
@@ -1,14 +0,0 @@
1
- <article class="message">
2
- <div class="message__header">
3
- <div class="card__author author-data author-data--small">
4
- <%= cell "decidim/author", present(message.sender), context: {extra_classes: ["author-data--small"]} %>
5
-
6
- <time datetime="<%= message.created_at.utc %>">
7
- <%= message.friendly_created_at %>
8
- </time>
9
- </div>
10
- </div>
11
- <div class="message__content">
12
- <%= simple_format(message.body) %>
13
- </div>
14
- </article>
@@ -1,11 +0,0 @@
1
- <div class="add-message">
2
- <h5 class="section-heading">
3
- <%= t(".title") %>
4
- </h5>
5
-
6
- <%= form_for form, url: decidim.conversation_path(conversation.id), method: :put, remote: true do |f| %>
7
- <%= f.text_area :body, label: false, rows: 4, required: true %>
8
-
9
- <%= f.submit t(".send"), data: { disable: true } %>
10
- <% end %>
11
- </div>
@@ -1,21 +0,0 @@
1
- <main class="wrapper">
2
- <div class="row">
3
- <div class="columns">
4
- <div class="title-action">
5
- <h1 class="heading1 title-action__title">
6
- <%= link_to decidim.conversations_path, class: "card--list__data__icon card--list__data__icon--back" do %>
7
- <%= icon "chevron-left" %>
8
- <% end %>
9
-
10
- <%= t(".title", usernames: username_list(participants)) %>
11
- </h1>
12
- </div>
13
- </div>
14
- </div>
15
-
16
- <div class="row">
17
- <div id="conversation" class="columns large-8">
18
- <%= yield %>
19
- </div>
20
- </div>
21
- </main>
@@ -1,12 +0,0 @@
1
- <div class="add-message">
2
- <h5 class="section-heading">
3
- <%= t(".title") %>
4
- </h5>
5
-
6
- <%= form_for form, url: decidim.conversations_path, remote: true do |f| %>
7
- <%= f.hidden_field :recipient_id %>
8
- <%= f.text_area :body, label: false, rows: 4, required: true %>
9
-
10
- <%= f.submit t(".send") %>
11
- <% end %>
12
- </div>
@@ -1,14 +0,0 @@
1
- <section class="footer__subhero extended subhero<%= " home-section" if current_organization.show_statistics? %>">
2
- <div class="row">
3
- <div class="columns small-centered large-10">
4
- <h2 class="heading3"><%= t(".footer_sub_hero_headline", organization: current_organization.name) %></h2>
5
- <h5 class="heading4"><%== t(".footer_sub_hero_body") %></h5>
6
- <% unless current_user %>
7
- <%= link_to new_user_registration_path, class: "button--sc link subhero-cta" do %>
8
- <%= t(".register") %>
9
- <%= icon "chevron-right", aria_hidden: true %>
10
- <% end %>
11
- <% end %>
12
- </div>
13
- </div>
14
- </section>
@@ -1,26 +0,0 @@
1
- <% if current_organization.highlighted_content_banner_enabled %>
2
- <section class="extended highligted-content-banner"
3
- style="background-image:url(<%= current_organization.highlighted_content_banner_image.url %>);">
4
- <div class="highligted-content-banner__container">
5
- <div class="row">
6
- <div class="columns large-10">
7
- <h1 class="text-highlight heading1 highligted-content-banner-heading">
8
- <%= translated_attribute current_organization.highlighted_content_banner_title %>
9
- </h1>
10
- <span class="text-highlight">
11
- <%= decidim_sanitize translated_attribute current_organization.highlighted_content_banner_short_description %>
12
- </span>
13
- </div>
14
- <div class="columns large-2">
15
- <%= link_to current_organization.highlighted_content_banner_action_url,
16
- class: "button expanded button--sc" do %>
17
- <%= translated_attribute current_organization.highlighted_content_banner_action_title %>
18
- <span class="button__info">
19
- <%= translated_attribute current_organization.highlighted_content_banner_action_subtitle %>
20
- </span>
21
- <% end %>
22
- </div>
23
- </div>
24
- </div>
25
- </section>
26
- <% end %>
@@ -1,7 +0,0 @@
1
- <% highlighted_elements = render_hook(:highlighted_elements) %>
2
-
3
- <% if !highlighted_elements.blank? %>
4
- <section class="wrapper-home">
5
- <%= highlighted_elements %>
6
- </section>
7
- <% end %>
@@ -1,59 +0,0 @@
1
- <% present(user) do |profile_user| %>
2
- <div class="card">
3
- <%= image_tag profile_user.avatar_url(:profile), class: "card__image card__image--larger" %>
4
- <div class="card__content">
5
- <h5>
6
- <div><strong><%= profile_user.name %></strong></div>
7
- <span class="text-small"><%= user.nickname %></span>
8
- <% if !current_user || (current_user && current_user != user) %>
9
- <span class="user-contact_link">
10
- <%= link_to_current_or_new_conversation_with(user) %>
11
- </span>
12
- <% end %>
13
- </h5>
14
- <p><%= profile_user.about %></p>
15
- <% if profile_user.personal_url.present? %>
16
- <%= link_to html_truncate(profile_user.personal_url.gsub(%r{https?\:\/\/}, ""), length: 30), profile_user.personal_url %>
17
- <% end %>
18
- </div>
19
- <% if profile_user.badge.present? %>
20
- <div class="badge-card__content">
21
- <span>
22
- <%= icon profile_user.badge, class: "author__verified" %>
23
- </span>
24
- <span>
25
- <%= translated_attribute(profile_user.officialized_as).presence || t("decidim.profiles.default_officialization_text") %>
26
- </span>
27
- </div>
28
- <% end %>
29
- <%= render_hook(:user_profile_bottom) %>
30
- <div class="card__footer card__footer--transparent">
31
- <div class="flex--cc p-s text-center">
32
- <div class="mr-s">
33
- <%= link_to profile_followers_path(nickname: user.nickname) do %>
34
- <%= t("decidim.profiles.show.followers") %>
35
- <h1 class="heading1"><%= profile_user.followers_count %></h1>
36
- <% end %>
37
- </div>
38
- <div class="ml-s">
39
- <%= link_to profile_following_path(nickname: user.nickname) do %>
40
- <%= t("decidim.profiles.show.following") %>
41
- <h1 class="heading1"><%= profile_user.following_count %></h1>
42
- <% end %>
43
- </div>
44
- </div>
45
- </div>
46
- </div>
47
-
48
- <% if current_user && current_user != user %>
49
- <%= render partial: "decidim/shared/follow_button", locals: { followable: user } %>
50
- <% elsif current_user == user %>
51
- <div class="text-center">
52
- <%= link_to decidim.account_path, class: "button" do %>
53
- <span>
54
- <%= t(".edit_profile") %>
55
- </span>
56
- <% end %>
57
- </div>
58
- <% end %>
59
- <% end %>
@@ -1,39 +0,0 @@
1
- <% if current_user %>
2
- <% status = action_authorization(action) %>
3
- <% if !status.ok? %>
4
- <div class="reveal" id="<%= action.underscore %>AuthorizationModal" data-reveal>
5
- <button class="close-button" data-close aria-label="Close modal"
6
- type="button">
7
- <span aria-hidden="true">&times;</span>
8
- </button>
9
- <div class="reveal__header <%= status.code %>-authorization">
10
- <h3 class="reveal__title"><%= t ".#{status.code}.title" %></h3>
11
- </div>
12
- <p><%= t ".#{status.code}.explanation", authorization: t("#{status.handler_name}.name", scope: "decidim.authorization_handlers") %></p>
13
- <% if status.data[:extra_explanation] %>
14
- <p><%= t status.data[:extra_explanation][:key], **status.data[:extra_explanation][:params] %></p>
15
- <% end %>
16
- <% if status.data[:fields] %>
17
- <ul>
18
- <% status.data[:fields].each do |field, value| %>
19
- <li><strong><%= t ".#{status.code}.invalid_field", field: t("#{status.handler_name}.fields.#{field}", scope: "decidim.authorization_handlers"), value: value ? "(#{value})" : "" %></strong></li>
20
- <% end %>
21
- </ul>
22
- <% end %>
23
- <div class="row">
24
- <div class="columns medium-8 medium-offset-2">
25
- <% if status.data[:action].present? %>
26
- <%= link_to t(".#{status.code}.#{status.data[:action]}", authorization: t("#{status.handler_name}.name", scope: "decidim.authorization_handlers")), authorize_action_path(action), class: "button expanded" %>
27
- <% else %>
28
- <button class="button expanded" data-close><%= t ".#{status.code}.ok" %></button>
29
- <% end %>
30
- </div>
31
- </div>
32
- <% if status.data[:cancel] %>
33
- <div class="text-center">
34
- <button class="link" data-close><%= t ".#{status.code}.cancel" %></button>
35
- </div>
36
- <% end %>
37
- </div>
38
- <% end %>
39
- <% end %>
@@ -1,5 +0,0 @@
1
- <% if try(:current_component) %>
2
- <% current_component.manifest.actions.each do |action| %>
3
- <%= action_authorization_modal(action) %>
4
- <% end %>
5
- <% end %>