decidim-admin 0.10.1 → 0.11.0.pre1

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

Potentially problematic release.


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

Files changed (190) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -2
  3. data/app/assets/config/decidim_admin_manifest.js +1 -0
  4. data/app/assets/javascripts/decidim/admin/application.js.es6 +13 -5
  5. data/app/assets/javascripts/decidim/admin/auto_buttons_by_position.component.js.es6 +42 -0
  6. data/app/assets/javascripts/decidim/admin/auto_label_by_position.component.js.es6 +33 -0
  7. data/app/assets/javascripts/decidim/admin/dynamic_fields.component.js.es6 +163 -0
  8. data/app/assets/javascripts/decidim/admin/field_dependent_inputs.component.js.es6 +39 -0
  9. data/app/assets/javascripts/decidim/admin/managed_users.js.es6 +12 -0
  10. data/app/assets/javascripts/decidim/admin/sort_list.component.js.es6 +1 -1
  11. data/app/assets/javascripts/decidim/admin/subform_toggler.component.js.es6 +35 -0
  12. data/app/assets/javascripts/decidim/admin/tab_focus.js.es6 +4 -4
  13. data/app/assets/stylesheets/decidim/admin/application.scss.erb +1 -1
  14. data/app/assets/stylesheets/decidim/admin/extra/_dropdown_inverted.scss +7 -5
  15. data/app/assets/stylesheets/decidim/admin/modules/_agenda.scss +34 -0
  16. data/app/assets/stylesheets/decidim/admin/modules/_buttons.scss +5 -0
  17. data/app/assets/stylesheets/decidim/admin/modules/_cards.scss +15 -0
  18. data/app/assets/stylesheets/decidim/admin/modules/_forms.scss +4 -0
  19. data/app/assets/stylesheets/decidim/admin/modules/_modules.scss +1 -0
  20. data/app/assets/stylesheets/decidim/admin/modules/_typography.scss +8 -0
  21. data/app/assets/stylesheets/decidim/admin/utils/_flex.scss +2 -2
  22. data/app/assets/stylesheets/decidim/admin/utils/_helpers.scss +28 -0
  23. data/app/assets/stylesheets/decidim/admin/utils/_mixins.scss +44 -0
  24. data/app/commands/decidim/admin/create_area.rb +3 -1
  25. data/app/commands/decidim/admin/{create_feature.rb → create_component.rb} +11 -11
  26. data/app/commands/decidim/admin/create_oauth_application.rb +36 -0
  27. data/app/commands/decidim/admin/create_participatory_space_private_user.rb +85 -0
  28. data/app/commands/decidim/admin/destroy_area.rb +42 -0
  29. data/app/commands/decidim/admin/{destroy_feature.rb → destroy_component.rb} +11 -11
  30. data/app/commands/decidim/admin/destroy_oauth_application.rb +39 -0
  31. data/app/commands/decidim/admin/{impersonate_managed_user.rb → impersonate_user.rb} +19 -13
  32. data/app/commands/decidim/admin/publish_component.rb +51 -0
  33. data/app/commands/decidim/admin/{unpublish_feature.rb → unpublish_component.rb} +12 -12
  34. data/app/commands/decidim/admin/update_area.rb +5 -1
  35. data/app/commands/decidim/admin/update_component.rb +62 -0
  36. data/app/commands/decidim/admin/{update_feature_permissions.rb → update_component_permissions.rb} +10 -10
  37. data/app/commands/decidim/admin/update_oauth_application.rb +39 -0
  38. data/app/controllers/decidim/admin/application_controller.rb +1 -1
  39. data/app/controllers/decidim/admin/areas_controller.rb +6 -4
  40. data/app/controllers/decidim/admin/{feature_permissions_controller.rb → component_permissions_controller.rb} +12 -12
  41. data/app/controllers/decidim/admin/{features → components}/base_controller.rb +9 -9
  42. data/app/controllers/decidim/admin/components_controller.rb +142 -0
  43. data/app/controllers/decidim/admin/concerns/has_private_users.rb +102 -0
  44. data/app/controllers/decidim/admin/dashboard_controller.rb +1 -1
  45. data/app/controllers/decidim/admin/exports_controller.rb +6 -6
  46. data/app/controllers/decidim/admin/impersonatable_users_controller.rb +29 -0
  47. data/app/controllers/decidim/admin/impersonations_controller.rb +122 -0
  48. data/app/controllers/decidim/admin/logs_controller.rb +1 -1
  49. data/app/controllers/decidim/admin/managed_users/impersonation_logs_controller.rb +25 -0
  50. data/app/controllers/decidim/admin/managed_users/promotions_controller.rb +3 -5
  51. data/app/controllers/decidim/admin/newsletters_controller.rb +1 -1
  52. data/app/controllers/decidim/admin/oauth_applications_controller.rb +90 -0
  53. data/app/controllers/decidim/admin/officializations_controller.rb +4 -3
  54. data/app/events/decidim/component_published_event.rb +6 -0
  55. data/app/forms/decidim/admin/{feature_form.rb → component_form.rb} +3 -3
  56. data/app/forms/decidim/admin/impersonate_user_form.rb +26 -0
  57. data/app/forms/decidim/admin/oauth_application_form.rb +32 -0
  58. data/app/forms/decidim/admin/organization_appearance_form.rb +6 -1
  59. data/app/forms/decidim/admin/organization_form.rb +1 -1
  60. data/app/forms/decidim/admin/participatory_space_private_user_form.rb +18 -0
  61. data/app/forms/decidim/admin/permissions_form.rb +1 -1
  62. data/app/helpers/decidim/admin/attributes_display_helper.rb +10 -3
  63. data/app/helpers/decidim/admin/bulk_actions_helper.rb +36 -0
  64. data/app/helpers/decidim/admin/exports_helper.rb +10 -10
  65. data/app/helpers/decidim/admin/settings_helper.rb +1 -1
  66. data/app/models/decidim/admin/abilities/admin_ability.rb +12 -9
  67. data/app/models/decidim/admin/abilities/participatory_process_admin_ability.rb +2 -2
  68. data/app/models/decidim/admin/abilities/user_manager_ability.rb +7 -6
  69. data/app/queries/decidim/admin/user_filter.rb +59 -0
  70. data/app/views/decidim/admin/area_types/edit.html.erb +1 -1
  71. data/app/views/decidim/admin/area_types/index.html.erb +2 -2
  72. data/app/views/decidim/admin/area_types/new.html.erb +1 -1
  73. data/app/views/decidim/admin/areas/edit.html.erb +1 -1
  74. data/app/views/decidim/admin/areas/index.html.erb +2 -2
  75. data/app/views/decidim/admin/areas/new.html.erb +1 -1
  76. data/app/views/decidim/admin/attachment_collections/edit.html.erb +1 -1
  77. data/app/views/decidim/admin/attachment_collections/index.html.erb +2 -2
  78. data/app/views/decidim/admin/attachment_collections/new.html.erb +1 -1
  79. data/app/views/decidim/admin/attachment_collections/show.html.erb +2 -3
  80. data/app/views/decidim/admin/attachments/edit.html.erb +1 -1
  81. data/app/views/decidim/admin/attachments/index.html.erb +1 -1
  82. data/app/views/decidim/admin/attachments/new.html.erb +1 -1
  83. data/app/views/decidim/admin/attachments/show.html.erb +2 -3
  84. data/app/views/decidim/admin/bulk_actions/_recategorize.html.erb +1 -1
  85. data/app/views/decidim/admin/categories/edit.html.erb +1 -1
  86. data/app/views/decidim/admin/categories/index.html.erb +2 -2
  87. data/app/views/decidim/admin/categories/new.html.erb +1 -1
  88. data/app/views/decidim/admin/categories/show.html.erb +2 -3
  89. data/app/views/decidim/admin/{feature_permissions → component_permissions}/edit.html.erb +3 -3
  90. data/app/views/decidim/admin/components/_component.html.erb +37 -0
  91. data/app/views/decidim/admin/{features → components}/_form.html.erb +6 -6
  92. data/app/views/decidim/admin/{features → components}/_settings_fields.html.erb +2 -2
  93. data/app/views/decidim/admin/components/edit.html.erb +7 -0
  94. data/app/views/decidim/admin/{features → components}/index.html.erb +6 -6
  95. data/app/views/decidim/admin/components/new.html.erb +8 -0
  96. data/app/views/decidim/admin/devise/mailers/reset_password_instructions.html.erb +1 -1
  97. data/app/views/decidim/admin/exports/_dropdown.html.erb +3 -3
  98. data/app/views/decidim/admin/impersonatable_users/index.html.erb +84 -0
  99. data/app/views/decidim/admin/impersonations/_form.html.erb +40 -0
  100. data/app/views/decidim/admin/impersonations/_handler_form.html.erb +5 -0
  101. data/app/views/decidim/admin/impersonations/new.html.erb +23 -0
  102. data/app/views/decidim/admin/managed_users/{impersonations → impersonation_logs}/index.html.erb +2 -0
  103. data/app/views/decidim/admin/managed_users/promotions/new.html.erb +4 -4
  104. data/app/views/decidim/admin/moderations/index.html.erb +2 -2
  105. data/app/views/decidim/admin/newsletters/_form.html.erb +1 -1
  106. data/app/views/decidim/admin/newsletters/edit.html.erb +1 -1
  107. data/app/views/decidim/admin/newsletters/index.html.erb +1 -1
  108. data/app/views/decidim/admin/newsletters/new.html.erb +1 -1
  109. data/app/views/decidim/admin/newsletters/show.html.erb +1 -1
  110. data/app/views/decidim/admin/oauth_applications/_form.html.erb +19 -0
  111. data/app/views/decidim/admin/oauth_applications/edit.html.erb +13 -0
  112. data/app/views/decidim/admin/oauth_applications/index.html.erb +38 -0
  113. data/app/views/decidim/admin/oauth_applications/new.html.erb +13 -0
  114. data/app/views/decidim/admin/oauth_applications/show.html.erb +27 -0
  115. data/app/views/decidim/admin/officializations/index.html.erb +2 -2
  116. data/app/views/decidim/admin/officializations/new.html.erb +2 -2
  117. data/app/views/decidim/admin/organization/_form.html.erb +1 -1
  118. data/app/views/decidim/admin/organization/edit.html.erb +1 -2
  119. data/app/views/decidim/admin/organization_appearance/edit.html.erb +1 -2
  120. data/app/views/decidim/admin/participatory_space_private_users/_form.html.erb +18 -0
  121. data/app/views/decidim/admin/participatory_space_private_users/index.html.erb +59 -0
  122. data/app/views/decidim/admin/participatory_space_private_users/new.html.erb +7 -0
  123. data/app/views/decidim/admin/scope_types/edit.html.erb +1 -1
  124. data/app/views/decidim/admin/scope_types/index.html.erb +2 -2
  125. data/app/views/decidim/admin/scope_types/new.html.erb +1 -1
  126. data/app/views/decidim/admin/scopes/edit.html.erb +1 -1
  127. data/app/views/decidim/admin/scopes/index.html.erb +3 -3
  128. data/app/views/decidim/admin/scopes/new.html.erb +1 -1
  129. data/app/views/decidim/admin/static_pages/edit.html.erb +1 -1
  130. data/app/views/decidim/admin/static_pages/index.html.erb +3 -3
  131. data/app/views/decidim/admin/static_pages/new.html.erb +1 -1
  132. data/app/views/decidim/admin/static_pages/show.html.erb +2 -3
  133. data/app/views/decidim/admin/user_groups/index.html.erb +3 -3
  134. data/app/views/decidim/admin/users/_form.html.erb +3 -3
  135. data/app/views/decidim/admin/users/index.html.erb +2 -2
  136. data/app/views/decidim/admin/users/new.html.erb +1 -1
  137. data/app/views/layouts/decidim/admin/_application.html.erb +9 -9
  138. data/app/views/layouts/decidim/admin/_header.html.erb +3 -4
  139. data/app/views/layouts/decidim/admin/_template_top.html.erb +1 -1
  140. data/app/views/layouts/decidim/admin/_title_bar.html.erb +1 -1
  141. data/app/views/layouts/decidim/admin/login.html.erb +1 -1
  142. data/app/views/layouts/decidim/admin/pages.html.erb +1 -1
  143. data/app/views/layouts/decidim/admin/users.html.erb +5 -3
  144. data/config/locales/ca.yml +119 -50
  145. data/config/locales/en.yml +119 -50
  146. data/config/locales/es.yml +120 -51
  147. data/config/locales/eu.yml +122 -53
  148. data/config/locales/fi.yml +121 -52
  149. data/config/locales/fr.yml +159 -90
  150. data/config/locales/gl.yml +119 -50
  151. data/config/locales/it.yml +120 -51
  152. data/config/locales/nl.yml +207 -138
  153. data/config/locales/pl.yml +119 -50
  154. data/config/locales/pt-BR.yml +120 -51
  155. data/config/locales/pt.yml +120 -51
  156. data/config/locales/ru.yml +7 -51
  157. data/config/locales/sv.yml +120 -51
  158. data/config/locales/uk.yml +7 -52
  159. data/config/routes.rb +6 -2
  160. data/db/migrate/20180413233318_add_reason_to_decidim_impersonation_logs.rb +7 -0
  161. data/lib/decidim/admin/components.rb +11 -0
  162. data/lib/decidim/admin/engine.rb +12 -3
  163. data/lib/decidim/admin/test/forms/attachment_collection_form_examples.rb +9 -9
  164. data/lib/decidim/admin/test/forms/attachment_form_examples.rb +1 -1
  165. data/lib/decidim/admin/test/forms/category_form_examples.rb +11 -11
  166. data/lib/decidim/admin/test/{manage_feature_permissions_examples.rb → manage_component_permissions_examples.rb} +9 -9
  167. data/lib/decidim/admin/test/manage_moderations_examples.rb +2 -2
  168. data/lib/decidim/admin/test.rb +1 -1
  169. data/lib/decidim/admin/version.rb +1 -1
  170. data/lib/decidim/admin.rb +1 -1
  171. metadata +66 -43
  172. data/app/commands/decidim/admin/create_managed_user.rb +0 -69
  173. data/app/commands/decidim/admin/publish_feature.rb +0 -51
  174. data/app/commands/decidim/admin/update_feature.rb +0 -62
  175. data/app/controllers/decidim/admin/features_controller.rb +0 -142
  176. data/app/controllers/decidim/admin/managed_users/impersonations_controller.rb +0 -78
  177. data/app/controllers/decidim/admin/managed_users_controller.rb +0 -83
  178. data/app/events/decidim/feature_published_event.rb +0 -6
  179. data/app/forms/decidim/admin/impersonate_managed_user_form.rb +0 -20
  180. data/app/forms/decidim/admin/managed_user_form.rb +0 -24
  181. data/app/queries/decidim/admin/users_officialization.rb +0 -56
  182. data/app/views/decidim/admin/features/_feature.html.erb +0 -37
  183. data/app/views/decidim/admin/features/edit.html.erb +0 -7
  184. data/app/views/decidim/admin/features/new.html.erb +0 -8
  185. data/app/views/decidim/admin/managed_users/_form.html.erb +0 -12
  186. data/app/views/decidim/admin/managed_users/impersonations/_form.html.erb +0 -10
  187. data/app/views/decidim/admin/managed_users/impersonations/new.html.erb +0 -15
  188. data/app/views/decidim/admin/managed_users/index.html.erb +0 -44
  189. data/app/views/decidim/admin/managed_users/new.html.erb +0 -47
  190. data/lib/decidim/admin/features.rb +0 -11
@@ -1,5 +1,5 @@
1
1
  <%= decidim_form_for(@form, url: url_for([@attachment.attached_to, @attachment]), html: { class: "form edit_attachment" }) do |f| %>
2
- <%= render partial: 'decidim/admin/attachments/form', object: f, locals: { title: t(".title") } %>
2
+ <%= render partial: "decidim/admin/attachments/form", object: f, locals: { title: t(".title") } %>
3
3
 
4
4
  <div class="button--double form-general-submit">
5
5
  <%= f.submit t(".update") %>
@@ -3,7 +3,7 @@
3
3
  <h2 class="card-title">
4
4
  <%= t(".attachments_title") %>
5
5
  <% if can? :create, authorization_object %>
6
- <%= link_to t("actions.new", scope: "decidim.admin", name: t("models.attachment.name", scope: "decidim.admin")), url_for(action: :new), class: 'button tiny button--title new' %>
6
+ <%= link_to t("actions.new", scope: "decidim.admin", name: t("models.attachment.name", scope: "decidim.admin")), url_for(action: :new), class: "button tiny button--title new" %>
7
7
  <% end %>
8
8
  </h2>
9
9
  </div>
@@ -1,5 +1,5 @@
1
1
  <%= decidim_form_for(@form, url: url_for([attached_to, @form]), html: { class: "form new_attachment" }) do |f| %>
2
- <%= render partial: 'decidim/admin/attachments/form', object: f, locals: { title: t(".title") } %>
2
+ <%= render partial: "decidim/admin/attachments/form", object: f, locals: { title: t(".title") } %>
3
3
 
4
4
  <div class="button--double form-general-submit">
5
5
  <%= f.submit t(".create") %>
@@ -2,7 +2,7 @@
2
2
 
3
3
  <div class="actions">
4
4
  <hr />
5
- <%= link_to t("decidim.admin.actions.edit"), ['edit', @attachment.attached_to, @attachment] if can? :update, @attachment %>
5
+ <%= link_to t("decidim.admin.actions.edit"), ["edit", @attachment.attached_to, @attachment] if can? :update, @attachment %>
6
6
  <%= link_to t("decidim.admin.actions.destroy"), [@attachment.attached_to, @attachment], method: :delete, class: "alert button", data: { confirm: t("decidim.admin.actions.confirm_destroy") } if can? :destroy, @attachment %>
7
7
  </div>
8
8
 
@@ -10,8 +10,7 @@
10
10
  <%= display_for @attachment,
11
11
  :title,
12
12
  :description,
13
- :file_type
14
- %>
13
+ :file_type %>
15
14
  <dt><%= display_label(@attachment, :file_size) %></dt>
16
15
  <dd><%= number_to_human_size(@attachment.file_size) %></dd>
17
16
  <dt><%= display_label(@attachment, :file) %></dt>
@@ -6,7 +6,7 @@
6
6
  <% end %>
7
7
  </div>
8
8
 
9
- <%= grouped_collection_select(:category, :id, current_feature.categories.first_class, :descendants, :translated_name, :id, :translated_name, prompt: t("decidim.proposals.admin.proposals.index.change_category")) %>
9
+ <%= bulk_categories_select current_component.categories %>
10
10
 
11
11
  <%= submit_tag(t("decidim.proposals.admin.proposals.index.update"), id: "js-submit-edit-category", class: "button small button--simple float-left") %>
12
12
 
@@ -1,5 +1,5 @@
1
1
  <%= decidim_form_for(@form, url: category_path(@category.participatory_space, @category), html: { class: "form edit_category" }) do |f| %>
2
- <%= render partial: 'form', object: f, locals: { title: t('.title') } %>
2
+ <%= render partial: "form", object: f, locals: { title: t(".title") } %>
3
3
 
4
4
  <div class="button--double form-general-submit">
5
5
  <%= f.submit t("categories.edit.update", scope: "decidim.admin") %>
@@ -3,7 +3,7 @@
3
3
  <h2 class='card-title'>
4
4
  <%= t("categories.index.categories_title", scope: "decidim.admin") %>
5
5
  <% if can? :create, Decidim::Category %>
6
- <%= link_to t("actions.new", scope: "decidim.admin", name: t("models.category.name", scope: "decidim.admin")), new_category_path(current_participatory_space), class: 'button tiny button--title new' %>
6
+ <%= link_to t("actions.new", scope: "decidim.admin", name: t("models.category.name", scope: "decidim.admin")), new_category_path(current_participatory_space), class: "button tiny button--title new" %>
7
7
  <% end %>
8
8
  </h2>
9
9
  </div>
@@ -33,7 +33,7 @@
33
33
  <% if category.unused? %>
34
34
  <%= icon_link_to "circle-x", category_path(current_participatory_space, category), t("actions.destroy", scope: "decidim.admin"), class: "action-icon--remove", method: :delete, data: { confirm: t("actions.confirm_destroy", scope: "decidim.admin") } %>
35
35
  <% else %>
36
- <span class="action-icon" title="<%= t('categories.index.category_used', scope: "decidim.admin") %>" data-tooltip="true" data-disable-hover="false">
36
+ <span class="action-icon" title="<%= t("categories.index.category_used", scope: "decidim.admin") %>" data-tooltip="true" data-disable-hover="false">
37
37
  <%= icon "circle-x", class: "action-icon action-icon--disabled" %>
38
38
  </span>
39
39
  <% end %>
@@ -1,5 +1,5 @@
1
1
  <%= decidim_form_for(@form, url: categories_path(current_participatory_space), html: { class: "form new_category" }) do |f| %>
2
- <%= render partial: 'form', object: f, locals: { title: t('categories.new.title', scope: "decidim.admin") } %>
2
+ <%= render partial: "form", object: f, locals: { title: t("categories.new.title", scope: "decidim.admin") } %>
3
3
 
4
4
  <div class="button--double form-general-submit">
5
5
  <%= f.submit t("categories.new.create", scope: "decidim.admin") %>
@@ -2,13 +2,12 @@
2
2
 
3
3
  <div class="actions">
4
4
  <hr />
5
- <%= link_to t("decidim.admin.actions.edit"), ['edit', participatory_space, @category] if can? :update, @category %>
5
+ <%= link_to t("decidim.admin.actions.edit"), ["edit", participatory_space, @category] if can? :update, @category %>
6
6
  <%= link_to t("decidim.admin.actions.destroy"), [participatory_space, @category], method: :delete, class: "alert button", data: { confirm: t("decidim.admin.actions.confirm_destroy") } if can? :destroy, @category %>
7
7
  </div>
8
8
 
9
9
  <dl>
10
10
  <%= display_for @category,
11
11
  :name,
12
- :description
13
- %>
12
+ :description %>
14
13
  </dl>
@@ -1,4 +1,4 @@
1
- <section id="features">
1
+ <section id="components">
2
2
  <div class="row">
3
3
  <div class="columns">
4
4
  <h3><%= t(".title") %></h3>
@@ -9,8 +9,8 @@
9
9
  <%= form.fields_for :permissions, form.object do |form| %>
10
10
  <% form.object.permissions.each do |action, permission| %>
11
11
  <%= form.fields_for(action, permission) do |form| %>
12
- <fieldset class="card <%=action %>-permission">
13
- <div class="card-divider"><%= t("#{feature.manifest.name}.actions.#{action}", scope: "decidim.features") %></div>
12
+ <fieldset class="card <%= action %>-permission">
13
+ <div class="card-divider"><%= t("#{component.manifest.name}.actions.#{action}", scope: "decidim.components") %></div>
14
14
  <div class="card-section">
15
15
  <%= form.select :authorization_handler_name,
16
16
  authorizations.map { |authorization|
@@ -0,0 +1,37 @@
1
+ <tr class="component-<%= component.id %>">
2
+ <td>
3
+ <%= link_to main_component_path(component), target: "_blank" do %>
4
+ <%= translated_attribute component.name %>
5
+ <% end %>
6
+ </td>
7
+ <td>
8
+ <%= t "decidim.components.#{component.manifest.name}.name" %>
9
+ </td>
10
+ <td class="table-list__actions">
11
+ <% if component.manifest.admin_engine %>
12
+ <%= icon_link_to "pencil", manage_component_path(component), t("actions.manage", scope: "decidim.admin"), class: "action-icon--manage" %>
13
+ <% end %>
14
+
15
+ <% if can?(:update, component) %>
16
+ <% if component.published? %>
17
+ <%= icon_link_to "x", url_for(action: :unpublish, id: component, controller: "components"), t("actions.unpublish", scope: "decidim.admin"), class: "action-icon--unpublish", method: :put %>
18
+ <% else %>
19
+ <%= icon_link_to "check", url_for(action: :publish, id: component, controller: "components"), t("actions.publish", scope: "decidim.admin"), class: "action-icon--publish", method: :put %>
20
+ <% end %>
21
+ <% end %>
22
+
23
+ <% if can? :update, component %>
24
+ <%= icon_link_to "cog", url_for(action: :edit, id: component, controller: "components"), t("actions.configure", scope: "decidim.admin"), class: "action-icon--configure" %>
25
+ <% end %>
26
+
27
+ <% if can? :update, component %>
28
+ <% if component.manifest.actions.empty? %>
29
+ <%= icon "key", class: "action-icon action-icon--disabled" %>
30
+ <% else %>
31
+ <%= icon_link_to "key", url_for(action: :edit, component_id: component, controller: "component_permissions"), t("actions.permissions", scope: "decidim.admin"), class: "action-icon--permissions" %>
32
+ <% end %>
33
+ <% end %>
34
+
35
+ <%= icon_link_to "circle-x", url_for(action: :destroy, id: component, controller: "components"), t("actions.destroy", scope: "decidim.admin"), class: "action-icon--remove", method: :delete %>
36
+ </td>
37
+ </tr>
@@ -16,10 +16,10 @@
16
16
  </div>
17
17
  <div class="card-section">
18
18
  <%= form.fields_for :settings, form.object.settings do |settings_fields| %>
19
- <%= render partial: "decidim/admin/features/settings_fields",
19
+ <%= render partial: "decidim/admin/components/settings_fields",
20
20
  locals: {
21
21
  form: settings_fields,
22
- feature: @feature,
22
+ component: @component,
23
23
  settings_name: "global",
24
24
  tabs_prefix: "global-settings"
25
25
  } %>
@@ -43,10 +43,10 @@
43
43
 
44
44
  <%= form.fields_for :step_settings, nil do |settings_fields| %>
45
45
  <%= settings_fields.fields_for step.id.to_s, step_settings do |settings_fields| %>
46
- <%= render partial: "decidim/admin/features/settings_fields",
46
+ <%= render partial: "decidim/admin/components/settings_fields",
47
47
  locals: {
48
48
  form: settings_fields,
49
- feature: feature,
49
+ component: component,
50
50
  settings_name: "step",
51
51
  tabs_prefix: "step-#{step.id}-settings"
52
52
  } %>
@@ -65,10 +65,10 @@
65
65
  </div>
66
66
  <div class="card-section">
67
67
  <%= form.fields_for :default_step_settings, form.object.default_step_settings do |settings_fields| %>
68
- <%= render partial: "decidim/admin/features/settings_fields",
68
+ <%= render partial: "decidim/admin/components/settings_fields",
69
69
  locals: {
70
70
  form: settings_fields,
71
- feature: @feature,
71
+ component: @component,
72
72
  settings_name: "step",
73
73
  tabs_prefix: "default-step-settings"
74
74
  } %>
@@ -3,7 +3,7 @@
3
3
  form,
4
4
  attribute,
5
5
  name,
6
- label: t("decidim.features.#{feature.manifest.name}.settings.#{settings_name}.#{name}"),
6
+ label: t("decidim.components.#{component.manifest.name}.settings.#{settings_name}.#{name}"),
7
7
  tabs_prefix: tabs_prefix
8
- )%>
8
+ ) %>
9
9
  <% end %>
@@ -0,0 +1,7 @@
1
+ <%= decidim_form_for([current_participatory_space, @form], url: component_path(current_participatory_space, @component), method: "put", html: { class: "form edit_component" }) do |form| %>
2
+ <%= render partial: "form", object: form, locals: { component: @component, title: t(".title", name: t("#{@component.manifest.name}.name", scope: "decidim.components"))} %>
3
+
4
+ <div class="button--double form-general-submit">
5
+ <%= form.submit t(".update") %>
6
+ </div>
7
+ <% end %>
@@ -1,12 +1,12 @@
1
1
  <div class="card">
2
2
  <div class="card-divider">
3
3
  <h2 class="card-title">
4
- <%= t("features.title", scope: "decidim.admin") %>
5
- <button class="dropdown tiny button button--title" data-toggle="add-feature-dropdown"><%= t "features.index.add", scope: "decidim.admin" %></button>
6
- <div class="dropdown-pane" id="add-feature-dropdown" data-dropdown data-auto-focus="true" data-close-on-click="true">
7
- <ul class="vertical menu add-features">
4
+ <%= t("components.title", scope: "decidim.admin") %>
5
+ <button class="dropdown tiny button button--title" data-toggle="add-component-dropdown"><%= t "components.index.add", scope: "decidim.admin" %></button>
6
+ <div class="dropdown-pane" id="add-component-dropdown" data-dropdown data-auto-focus="true" data-close-on-click="true">
7
+ <ul class="vertical menu add-components">
8
8
  <% @manifests.each do |manifest| %>
9
- <li><%= link_to t("#{manifest.name}.name", scope: "decidim.features"), new_feature_path(type: manifest.name), class: manifest.name %></li>
9
+ <li><%= link_to t("#{manifest.name}.name", scope: "decidim.components"), new_component_path(type: manifest.name), class: manifest.name %></li>
10
10
  <% end %>
11
11
  </ul>
12
12
  </div>
@@ -23,7 +23,7 @@
23
23
  </thead>
24
24
 
25
25
  <tbody>
26
- <%= render partial: "feature", collection: @features %>
26
+ <%= render partial: "component", collection: @components %>
27
27
  </tbody>
28
28
  </table>
29
29
  </div>
@@ -0,0 +1,8 @@
1
+
2
+ <%= decidim_form_for([current_participatory_space, @form], url: components_path(type: params[:type]), method: "post", html: { class: "form new_component" }) do |form| %>
3
+ <%= render partial: "form", object: form, locals: { component: @component, title: t(".title", name: t("#{manifest.name}.name", scope: "decidim.components"))} %>
4
+
5
+ <div class="button--double form-general-submit">
6
+ <%= form.submit t(".add") %>
7
+ </div>
8
+ <% end %>
@@ -2,7 +2,7 @@
2
2
 
3
3
  <p>Someone has requested a link to change your password. You can do this through the link below.</p>
4
4
 
5
- <p><%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %></p>
5
+ <p><%= link_to "Change my password", edit_password_url(@resource, reset_password_token: @token) %></p>
6
6
 
7
7
  <p>If you didn't request this, please ignore this email.</p>
8
8
  <p>Your password won't change until you access the link above and create a new one.</p>
@@ -1,9 +1,9 @@
1
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-position=bottom data-alignment=right data-auto-focus="true" data-close-on-click="true">
3
- <ul class="vertical menu add-features">
4
- <% feature.manifest.export_manifests.each do |manifest| %>
3
+ <ul class="vertical menu add-components">
4
+ <% component.manifest.export_manifests.each do |manifest| %>
5
5
  <% %w{CSV JSON Excel}.each do |format| %>
6
- <li class="exports--format--<%= format.downcase %> exports--<%= manifest.name %>"><%= link_to t("decidim.admin.exports.export_as", name: t("decidim.#{feature.manifest.name}.admin.exports.#{manifest.name}"), export_format: format.upcase), exports_path(feature, id: manifest.name, format: format), method: :post %></li>
6
+ <li class="exports--format--<%= format.downcase %> exports--<%= manifest.name %>"><%= link_to t("decidim.admin.exports.export_as", name: t("decidim.#{component.manifest.name}.admin.exports.#{manifest.name}"), export_format: format.upcase), exports_path(component, id: manifest.name, format: format), method: :post %></li>
7
7
  <% end %>
8
8
  <% end %>
9
9
  </ul>
@@ -0,0 +1,84 @@
1
+ <% if current_organization.available_authorizations.empty? %>
2
+ <div class="section">
3
+ <div class="callout warning">
4
+ <p><%= t(".needs_authorization_warning") %></p>
5
+ </div>
6
+ </div>
7
+ <% end %>
8
+
9
+ <div class="filters row">
10
+ <div class="column medium-3">
11
+ <span class="dropdown-menu-inverted_label"><%= t(".filter_by") %> :</span>
12
+ <ul class="dropdown menu dropdown-inverted" data-dropdown-menu data-close-on-click-inside="false">
13
+ <li class="is-dropdown-submenu-parent">
14
+ <a href="#">
15
+ <% if @state.present? %>
16
+ <%= t(".filter.#{@state}") %>
17
+ <% else %>
18
+ <%= t(".filter.all") %>
19
+ <% end %>
20
+ </a>
21
+ <ul class="menu is-dropdown-submenu">
22
+ <li><%= link_to t(".filter.managed"), url_for(state: "managed", q: @query) %></li>
23
+ <li><%= link_to t(".filter.not_managed"), url_for(state: "not_managed", q: @query) %></li>
24
+ <li><%= link_to t(".filter.all"), url_for(q: @query) %></li>
25
+ </ul>
26
+ </li>
27
+ </ul>
28
+ </div>
29
+ <div class="column medium-4">
30
+ <%= form_tag "", method: :get do %>
31
+ <div class="filters__search">
32
+ <div class="input-group">
33
+ <%= search_field_tag :q, @query,label: false, class: "input-group-field", placeholder: t(".search") %>
34
+ <%= hidden_field_tag :state, @state %>
35
+ <div class="input-group-button">
36
+ <button type="submit" class="button button--muted">
37
+ <%= icon "magnifying-glass", aria_label: t(".search") %>
38
+ </button>
39
+ </div>
40
+ </div>
41
+ </div>
42
+ <% end %>
43
+ </div>
44
+ </div>
45
+
46
+ <div class="card">
47
+ <div class="card-divider">
48
+ <h2 class="card-title">
49
+ <%= t "decidim.admin.titles.impersonatable_users" %>
50
+ <%= link_to t(".impersonate_new_managed_user"), new_impersonatable_user_impersonation_path(:new_managed_user), class: "button tiny button--title #{'disabled' if current_organization.available_authorizations.empty?}" %>
51
+ </h2>
52
+ </div>
53
+ <div class="card-section">
54
+ <div class="table-scroll">
55
+ <table class="table-list">
56
+ <thead>
57
+ <tr>
58
+ <th><%= t(".name") %></th>
59
+ <th><%= t(".status") %></th>
60
+ <th></th>
61
+ </tr>
62
+ </thead>
63
+ <tbody>
64
+ <% @users.each do |user| %>
65
+ <tr data-user-id="<%= user.id %>">
66
+ <td><%= user.name %></td>
67
+ <td><%= user.managed? ? t(".managed") : t(".not_managed") %></td>
68
+ <td class="table-list__actions">
69
+ <% if can? :impersonate, user %>
70
+ <%= icon_link_to "account-login", new_impersonatable_user_impersonation_path(user), t(".impersonate"), class: "action-icon--impersonate" %>
71
+ <% end %>
72
+ <%= icon_link_to "clock", impersonatable_user_impersonation_logs_path(user), t(".view_logs"), class: "action-icon--view-logs" %>
73
+ <% if can? :promote, user %>
74
+ <%= icon_link_to "badge", new_impersonatable_user_promotion_path(user), t(".promote"), class: "action-icon--promote" %>
75
+ <% end %>
76
+ </td>
77
+ </tr>
78
+ <% end %>
79
+ </tbody>
80
+ </table>
81
+ <%= paginate @users, theme: "decidim" %>
82
+ </div>
83
+ </div>
84
+ </div>
@@ -0,0 +1,40 @@
1
+ <div class="row column">
2
+ <% unless form.object.user.managed? %>
3
+ <%= form.text_field :reason, label: t(".reason") %>
4
+ <% end %>
5
+
6
+ <% if creating_managed_user? %>
7
+ <%= form.text_field :name, label: t(".name") %>
8
+ <% end %>
9
+
10
+ <%= form.fields_for :authorization, form.object.authorization, builder: Decidim::AuthorizationFormBuilder do |f| %>
11
+ <% if other_available_authorizations.any? %>
12
+ <%= f.collection_select :handler_name,
13
+ available_authorization_handlers,
14
+ :name,
15
+ :fullname,
16
+ { label: t(".authorization_method") } %>
17
+ <% else %>
18
+ <%= f.hidden_field :handler_name %>
19
+ <% end %>
20
+
21
+ <div id="authorization-handler-<%= f.object.handler_name %>"
22
+ class="authorization-handler">
23
+ <%= render "handler_form", handler_form: f %>
24
+ </div>
25
+ <% end %>
26
+
27
+ <% other_available_authorizations.each do |authorization| %>
28
+ <%= form.fields_for :authorization, authorization, builder: Decidim::AuthorizationFormBuilder do |f| %>
29
+ <div id="authorization-handler-<%= authorization.handler_name %>"
30
+ class="authorization-handler"
31
+ style="display:none">
32
+ <%= render "handler_form", handler_form: f %>
33
+ </div>
34
+ <% end %>
35
+ <% end %>
36
+ </div>
37
+
38
+ <% if other_available_authorizations.any? %>
39
+ <%= javascript_include_tag "decidim/admin/managed_users" %>
40
+ <% end %>
@@ -0,0 +1,5 @@
1
+ <% if lookup_context.exists?(handler_form.object.to_partial_path, [], true) %>
2
+ <%= render partial: handler_form.object.to_partial_path, locals: { handler: handler_form.object, form: handler_form } %>
3
+ <% else %>
4
+ <%= handler_form.all_fields %>
5
+ <% end %>
@@ -0,0 +1,23 @@
1
+ <h2 class="process-title-summary">
2
+ <% if creating_managed_user? %>
3
+ <%= t(".impersonate_new_managed_user") %>
4
+ <% else %>
5
+ <% if @form.user.managed? %>
6
+ <%= t(".impersonate_existing_managed_user", name: @form.user.name) %>
7
+ <% else %>
8
+ <%= t(".impersonate_existing_user", name: @form.user.name) %>
9
+ <% end %>
10
+ <% end %>
11
+ </h2>
12
+
13
+ <%= decidim_form_for(@form, url: impersonatable_user_impersonations_path, html: { class: "form new_impersonation" }) do |f| %>
14
+ <div class="card">
15
+ <div class="card-section">
16
+ <%= render partial: "form", object: f %>
17
+ </div>
18
+ </div>
19
+
20
+ <div class="button--double form-general-submit">
21
+ <%= f.submit t(".impersonate") %>
22
+ </div>
23
+ <% end %>
@@ -11,6 +11,7 @@
11
11
  <tr>
12
12
  <th><%= t("models.impersonation_log.fields.admin", scope: "decidim.admin") %></th>
13
13
  <th><%= t("models.impersonation_log.fields.user", scope: "decidim.admin") %></th>
14
+ <th><%= t("models.impersonation_log.fields.reason", scope: "decidim.admin") %></th>
14
15
  <th><%= t("models.impersonation_log.fields.started_at", scope: "decidim.admin") %></th>
15
16
  <th><%= t("models.impersonation_log.fields.ended_at", scope: "decidim.admin") %></th>
16
17
  <th><%= t("models.impersonation_log.fields.expired_at", scope: "decidim.admin") %></th>
@@ -21,6 +22,7 @@
21
22
  <tr>
22
23
  <td><%= impersonation_log.admin.name %></td>
23
24
  <td><%= impersonation_log.user.name %></td>
25
+ <td><%= impersonation_log.reason %></td>
24
26
  <td><%= impersonation_log.started_at ? l(impersonation_log.started_at, format: :long) : nil %></td>
25
27
  <td><%= impersonation_log.ended_at ? l(impersonation_log.ended_at, format: :long) : nil %></td>
26
28
  <td><%= impersonation_log.expired_at ? l(impersonation_log.expired_at, format: :long) : nil %></td>
@@ -1,17 +1,17 @@
1
1
  <h2 class="process-title-summary">
2
- <%= t('.new_managed_user_promotion') %>
2
+ <%= t(".new_managed_user_promotion") %>
3
3
  </h2>
4
4
 
5
5
  <div class="section">
6
6
  <div class="callout warning">
7
- <p><%= t('.explanation') %></p>
7
+ <p><%= t(".explanation") %></p>
8
8
  </div>
9
9
  </div>
10
10
 
11
- <%= decidim_form_for(@form, url: managed_user_promotions_path, html: { class: "form new_managed_user_promotion" }) do |f| %>
11
+ <%= decidim_form_for(@form, url: impersonatable_user_promotions_path, html: { class: "form new_managed_user_promotion" }) do |f| %>
12
12
  <div class="card">
13
13
  <div class="card-section">
14
- <%= render partial: 'form', object: f %>
14
+ <%= render partial: "form", object: f %>
15
15
  </div>
16
16
  </div>
17
17
 
@@ -38,8 +38,8 @@
38
38
  %>
39
39
  </td>
40
40
  <td>
41
- <% reports = moderation.reports.map { |report| render 'report', report: report } %>
42
- <%= safe_join(reports, ',') %>
41
+ <% reports = moderation.reports.map { |report| render "report", report: report } %>
42
+ <%= safe_join(reports, ",") %>
43
43
  </td>
44
44
  <td>
45
45
  <%= moderation.report_count %>
@@ -7,5 +7,5 @@
7
7
  </div>
8
8
 
9
9
  <div class="row column">
10
- <%= t('.interpolations_hint') %>
10
+ <%= t(".interpolations_hint") %>
11
11
  </div>
@@ -4,7 +4,7 @@
4
4
  <h2 class="card-title"><%= t ".title" %></h2>
5
5
  </div>
6
6
  <div class="card-section">
7
- <%= render partial: 'form', object: f %>
7
+ <%= render partial: "form", object: f %>
8
8
  </div>
9
9
  </div>
10
10
  <div class="button--double form-general-submit">
@@ -2,7 +2,7 @@
2
2
  <div class="card-divider">
3
3
  <h2 class="card-title">
4
4
  <%= t ".title" %>
5
- <%= link_to t("actions.new", scope: "decidim.admin", name: t("models.newsletter.name", scope: "decidim.admin").downcase), ['new', 'newsletter'], class: 'button tiny button--title new' %>
5
+ <%= link_to t("actions.new", scope: "decidim.admin", name: t("models.newsletter.name", scope: "decidim.admin").downcase), ["new", "newsletter"], class: "button tiny button--title new" %>
6
6
  </h2>
7
7
  </div>
8
8
  <div class="card-section">
@@ -4,7 +4,7 @@
4
4
  <h2 class="card-title"><%= t ".title" %></h2>
5
5
  </div>
6
6
  <div class="card-section">
7
- <%= render partial: 'form', object: f %>
7
+ <%= render partial: "form", object: f %>
8
8
  </div>
9
9
  </div>
10
10
  <div class="button--double form-general-submit">
@@ -14,7 +14,7 @@
14
14
  </div>
15
15
  <div class="button--double form-general-submit">
16
16
  <% if can?(:update, @newsletter) && !@newsletter.sent? %>
17
- <%= link_to t("actions.edit", scope: "decidim.admin"), ['edit', @newsletter], class: "button" %>
17
+ <%= link_to t("actions.edit", scope: "decidim.admin"), ["edit", @newsletter], class: "button" %>
18
18
  <% end %>
19
19
  <% unless @newsletter.sent? %>
20
20
  <%= link_to t(".deliver"), deliver_newsletter_path(@newsletter), method: :post, class: "button alert", data: { confirm: t(".confirm_deliver") } %>
@@ -0,0 +1,19 @@
1
+ <div class="row column">
2
+ <%= form.text_field :name %>
3
+ </div>
4
+
5
+ <div class="row column">
6
+ <%= form.text_field :redirect_uri %>
7
+ </div>
8
+
9
+ <div class="row column">
10
+ <%= form.text_field :organization_name %>
11
+ </div>
12
+
13
+ <div class="row column">
14
+ <%= form.text_field :organization_url %>
15
+ </div>
16
+
17
+ <div class="row column">
18
+ <%= form.upload :organization_logo %>
19
+ </div>
@@ -0,0 +1,13 @@
1
+ <%= decidim_form_for(@form, html: { class: "form edit_oauth_application" }) do |f| %>
2
+ <div class="card">
3
+ <div class="card-divider">
4
+ <h2 class="card-title"><%= t ".title" %></h2>
5
+ </div>
6
+ <div class="card-section">
7
+ <%= render partial: "form", object: f %>
8
+ </div>
9
+ </div>
10
+ <div class="button--double form-general-submit">
11
+ <%= f.submit t(".save") %>
12
+ </div>
13
+ <% end %>
@@ -0,0 +1,38 @@
1
+ <div class="card">
2
+ <div class="card-divider">
3
+ <h2 class="card-title">
4
+ <%= t ".title" %>
5
+ <%= link_to t("actions.new", scope: "decidim.admin", name: t("models.oauth_application.name", scope: "decidim.admin").downcase), ["new", "oauth_application"], class: "button tiny button--title new" %>
6
+ </h2>
7
+ </div>
8
+ <div class="card-section">
9
+ <div class="table-scroll">
10
+ <table class="table-list">
11
+ <thead>
12
+ <tr>
13
+ <th><%= t("models.oauth_application.fields.name", scope: "decidim.admin") %></th>
14
+ <th><%= t("models.oauth_application.fields.created_at", scope: "decidim.admin") %></th>
15
+ <th></th>
16
+ </tr>
17
+ </thead>
18
+ <tbody>
19
+ <% @oauth_applications.each do |oauth_application| %>
20
+ <tr data-oauth_application-id="<%= oauth_application.id %>">
21
+ <td><%= link_to oauth_application.name, decidim_admin.oauth_application_path(oauth_application) %></td>
22
+ <td><%= l oauth_application.created_at, format: :long %></td>
23
+ <td class="table-list__actions">
24
+ <% if can?(:update, oauth_application) %>
25
+ <%= icon_link_to "pencil", decidim_admin.edit_oauth_application_path(oauth_application), t("actions.edit", scope: "decidim.admin"), class: "edit" %>
26
+ <% end %>
27
+
28
+ <% if can?(:destroy, oauth_application) %>
29
+ <%= icon_link_to "circle-x", decidim_admin.oauth_application_path(oauth_application), t("actions.destroy", scope: "decidim.admin"), method: :delete, data: { confirm: t(".confirm_delete") }, class: "action-icon--remove" %>
30
+ <% end %>
31
+ </td>
32
+ </tr>
33
+ <% end %>
34
+ </tbody>
35
+ </table>
36
+ </div>
37
+ </div>
38
+ </div>