decidim-department_admin 0.7.2 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/app/decorators/decidim/admin/newsletters_controller_decorator.rb +1 -1
  3. data/app/decorators/decidim/admin/users_controller_decorator.rb +1 -1
  4. data/app/decorators/decidim/area_decorator.rb +2 -2
  5. data/app/decorators/decidim/assemblies/admin/assemblies_controller_decorator.rb +1 -1
  6. data/app/decorators/decidim/assemblies/admin/assemblies_helper_decorator.rb +1 -1
  7. data/app/decorators/decidim/assemblies/create_assembly_decorator.rb +1 -1
  8. data/app/decorators/decidim/assemblies/parent_assemblies_for_select_decorator.rb +1 -1
  9. data/app/decorators/decidim/assemblies/permissions_decorator.rb +1 -1
  10. data/app/decorators/decidim/assemblies/update_assembly_decorator.rb +1 -1
  11. data/app/decorators/decidim/assemblies_decorator.rb +1 -1
  12. data/app/decorators/decidim/assemblies_with_user_role_decorator.rb +1 -1
  13. data/app/decorators/decidim/conference_form_decorator.rb +1 -1
  14. data/app/decorators/decidim/conferences/admin/conferences_controller_decorator.rb +1 -1
  15. data/app/decorators/decidim/conferences/create_conference_decorator.rb +2 -1
  16. data/app/decorators/decidim/conferences/permissions_decorator.rb +1 -1
  17. data/app/decorators/decidim/conferences/update_conference_decorator.rb +1 -1
  18. data/app/decorators/decidim/conferences_decorator.rb +1 -1
  19. data/app/decorators/decidim/conferences_with_user_role_decorator.rb +1 -1
  20. data/app/decorators/decidim/decidim_form_helper_decorator.rb +1 -1
  21. data/app/decorators/decidim/invite_user_decorator.rb +1 -1
  22. data/app/decorators/decidim/invite_user_form_decorator.rb +1 -1
  23. data/app/decorators/decidim/newsletter_decorator.rb +1 -1
  24. data/app/decorators/decidim/newsletters_helper_decorator.rb +1 -1
  25. data/app/decorators/decidim/participatory_process_decorator.rb +1 -1
  26. data/app/decorators/decidim/participatory_process_group_decorator.rb +1 -1
  27. data/app/decorators/decidim/participatory_processes/admin/participatory_processes_controller_decorator.rb +1 -1
  28. data/app/decorators/decidim/participatory_processes/create_participatory_process_decorator.rb +1 -1
  29. data/app/decorators/decidim/participatory_processes/permissions_decorator.rb +1 -1
  30. data/app/decorators/decidim/participatory_processes/update_participatory_process_decorator.rb +1 -1
  31. data/app/decorators/decidim/participatory_processes_with_user_role_decorator.rb +1 -1
  32. data/app/decorators/decidim/user_decorator.rb +8 -8
  33. data/app/decorators/lib/decidim/participatory_space_resourceable_decorator.rb +3 -3
  34. data/app/helpers/decidim/department_admin/application_helper.rb +1 -1
  35. data/app/packs/stylesheets/decidim/admin/department_admin.scss +2 -0
  36. data/app/views/decidim/admin/users/_filters.html.erb +30 -26
  37. data/app/views/decidim/admin/users/_form.html.erb +21 -15
  38. data/app/views/decidim/admin/users/index.html.erb +77 -79
  39. data/app/views/decidim/admin/users/show.html.erb +9 -10
  40. data/app/views/decidim/assemblies/admin/assemblies/index.html.erb +130 -138
  41. data/app/views/decidim/conferences/admin/conferences/_form.html.erb +33 -26
  42. data/app/views/decidim/conferences/admin/conferences/index.html.erb +73 -80
  43. data/app/views/decidim/participatory_processes/admin/participatory_processes/index.html.erb +108 -151
  44. data/lib/decidim/department_admin/version.rb +1 -1
  45. metadata +15 -55
  46. data/spec/commands/decidim/admin/deliver_newsletter_spec.rb +0 -175
  47. data/spec/commands/decidim/invite_user_spec.rb +0 -42
  48. data/spec/controllers/decidim/admin/users_controller_spec.rb +0 -119
  49. data/spec/factories.rb +0 -4
  50. data/spec/features/check_overrides_spec.rb +0 -11
  51. data/spec/i18n_spec.rb +0 -29
  52. data/spec/models/decidim/area_spec.rb +0 -23
  53. data/spec/permissions/decidim/department_admin/department_admin_permissions_spec.rb +0 -120
  54. data/spec/queries/parent_assemblies_for_select_spec.rb +0 -52
  55. data/spec/spec_helper.rb +0 -47
  56. data/spec/system/admin_explores_processes_spec.rb +0 -53
  57. data/spec/system/admin_invite_department_admin_spec.rb +0 -118
  58. data/spec/system/department_admin_manages_newsletters_spec.rb +0 -237
  59. data/spec/system/department_admin_should_be_able_to_access_admin_dashboard_spec.rb +0 -75
  60. data/spec/system/department_admin_should_be_able_to_manage_assemblies_spec.rb +0 -99
  61. data/spec/system/department_admin_should_be_able_to_manage_conferences_spec.rb +0 -74
  62. data/spec/system/department_admin_should_be_able_to_manage_processes_spec.rb +0 -117
  63. data/spec/system/department_admin_should_be_able_to_see_only_assemblies_from_her_area_spec.rb +0 -46
  64. data/spec/system/department_admin_should_be_able_to_see_only_newsletters_from_her_area_spec.rb +0 -53
  65. data/spec/system/department_admin_should_be_able_to_see_only_processes_from_her_area_spec.rb +0 -50
@@ -1,15 +1,14 @@
1
1
  <% @user = Decidim::User.find_by_id(params[:id]) %>
2
- <div class="process-title">
3
- <div class="process-title-content">
4
- <a target="_blank" href="/admin/users?role=space_admin"><%= t("models.user.fields.administrated_spaces", scope: "decidim.admin") %></a>
5
- </div>
2
+ <div class="card">
3
+ <div class="item_show__header">
4
+ <h1 class="item_show__header-title">
5
+ <%= @user.name + '(' + @user.email + ')' %>
6
+ </h1>
7
+ </div>
8
+ <a target="_blank" href="/admin/users?role=space_admin"><%= t("models.user.fields.administrated_spaces", scope: "decidim.admin") %></a>
6
9
  </div>
7
10
  <div class="card">
8
- <div class="card-divider">
9
- <h2 class="card-title">
10
- <%= @user.name + '(' + @user.email + ')' %>
11
- </h2>
12
- </div>
11
+ <div class="card-divider"></div>
13
12
  <div class="card-section">
14
13
  <div class="table-scroll">
15
14
  <table class="table-list">
@@ -88,7 +87,7 @@
88
87
  <% if space["published"] %>
89
88
  <strong class="text-success"><%= t("assemblies.index.published", scope: "decidim.admin") %></strong>
90
89
  <% else %>
91
- <strong class="text-alert"><%= t("assemblies.index.not_published", scope: "decidim.admin") %></strong>
90
+ <strong class="text-alert"><%= t("assemblies.index.unpublished", scope: "decidim.admin") %></strong>
92
91
  <% end %></td>
93
92
  </tr>
94
93
  <% end %>
@@ -1,147 +1,139 @@
1
- <div class="card with-overflow" id="assemblies">
2
- <div class="card-divider">
3
- <h2 class="card-title">
4
- <% parent_assembly.self_and_ancestors.each do |assembly| %>
5
- <%= link_to translated_attribute(assembly.title), edit_assembly_path(assembly) %>
6
- <span>&gt;</span>
7
- <% end if parent_assembly %>
8
-
9
- <%= t("assemblies", scope: "decidim.admin.titles") %>
10
-
11
- <% if allowed_to? :create, :assembly %>
12
- <%= link_to t("actions.new_assembly", scope: "decidim.admin"),
13
- new_assembly_path(parent_id: parent_assembly&.id),
14
- class: "button tiny button--title" %>
15
- <% end %>
1
+ <% add_decidim_page_title(t("assemblies", scope: "decidim.admin.titles")) %>
2
+ <div class="card" id="assemblies">
3
+ <% if parent_assembly && parent_assembly.self_and_ancestors.length %>
4
+ <div class="item_show__header">
5
+ <h1 class="item_show__header-title">
6
+ <% parent_assembly.self_and_ancestors.each_with_index do |assembly, ix| %>
7
+ <%= translated_attribute(assembly.title) %>
8
+ <% unless ix == parent_assembly.self_and_ancestors.length - 1 %>
9
+ &gt;
10
+ <% end %>
11
+ <% end if parent_assembly %>
12
+ </h1>
13
+ </div>
14
+ <% end %>
16
15
 
17
- <% if allowed_to? :import, :assembly %>
18
- <%= link_to t("actions.import_assembly", scope: "decidim.admin"),
19
- new_import_path,
20
- class: "button tiny button--title" %>
21
- <% end %>
22
- </h2>
23
- </div>
24
16
  <%= admin_filter_selector %>
25
- <div class="card-section">
26
- <div class="table-scroll">
27
- <table class="table-list">
28
- <thead>
17
+
18
+ <div class="table-scroll">
19
+ <table class="table-list">
20
+ <thead>
21
+ <tr>
22
+ <th>
23
+ <%= sort_link(query, :title, t("models.assembly.fields.title", scope: "decidim.admin")) %>
24
+ </th>
25
+ <th>
26
+ <%= sort_link(query, :area_name, t("models.assembly.fields.department", scope: "decidim.admin")) %>
27
+ </th>
28
+ <th>
29
+ <%= t("models.assembly.fields.department_role", scope: "decidim.admin") %>
30
+ </th>
31
+ <th>
32
+ <%= t("models.assembly.fields.assembly_role", scope: "decidim.admin") %>
33
+ </th>
34
+ <th>
35
+ <%= sort_link(query, :created_at, t("models.assembly.fields.created_at", scope: "decidim.admin"), default_order: :desc) %>
36
+ </th>
37
+ <th>
38
+ <%= sort_link(query, :private_space, t("models.assembly.fields.private", scope: "decidim.admin")) %>
39
+ </th>
40
+ <th class="table-list__actions">
41
+ <%= sort_link(query, :published_at, t("models.assembly.fields.published", scope: "decidim.admin")) %>
42
+ </th>
43
+ <th>
44
+ <%= t("models.assembly.fields.actions", scope: "decidim.admin") %>
45
+ </th>
46
+ </tr>
47
+ </thead>
48
+ <tbody>
49
+ <% @assemblies.each do |assembly| %>
50
+ <% next unless allowed_to? :list, :assembly, assembly: assembly %>
29
51
  <tr>
30
- <th>
31
- <%= sort_link(query, :title, t("models.assembly.fields.title", scope: "decidim.admin")) %>
32
- </th>
33
- <th>
34
- <%= sort_link(query, :area_name, t("models.assembly.fields.department", scope: "decidim.admin")) %>
35
- </th>
36
- <th>
37
- <%= t("models.assembly.fields.department_role", scope: "decidim.admin") %>
38
- </th>
39
- <th>
40
- <%= t("models.assembly.fields.assembly_role", scope: "decidim.admin") %>
41
- </th>
42
- <th>
43
- <%= sort_link(query, :created_at, t("models.assembly.fields.created_at", scope: "decidim.admin"), default_order: :desc) %>
44
- </th>
45
- <th>
46
- <%= sort_link(query, :private_space, t("models.assembly.fields.private", scope: "decidim.admin")) %>
47
- </th>
48
- <th class="table-list__actions">
49
- <%= sort_link(query, :published_at, t("models.assembly.fields.published", scope: "decidim.admin")) %>
50
- </th>
51
- <th></th>
52
- </tr>
53
- </thead>
54
- <tbody>
55
- <% @assemblies.each do |assembly| %>
56
- <% next unless allowed_to? :list, :assembly, assembly: assembly %>
57
- <tr>
58
- <td>
59
- <% if assembly.promoted? %>
60
- <span data-tooltip class="icon-state icon-highlight" aria-haspopup="true" data-disable-hover="false" title="<%= t("models.assembly.fields.promoted", scope: "decidim.admin") %>">
61
- <%= icon "star", role: "img", "aria-hidden": true %>
62
- </span>
63
- <% end %>
64
- <% if allowed_to? :update, :assembly, assembly: assembly %>
65
- <%= link_to translated_attribute(assembly.title), edit_assembly_path(assembly) %><br>
66
- <% elsif allowed_to? :read, :component, assembly: assembly %>
67
- <%= link_to translated_attribute(assembly.title), components_path(assembly) %><br>
68
- <% elsif allowed_to? :preview, :assembly, assembly: assembly %>
69
- <%= link_to translated_attribute(assembly.title), decidim_assemblies.assembly_path(assembly) %><br>
70
- <% elsif allowed_to? :read, :moderation, assembly: assembly %>
71
- <%= link_to translated_attribute(assembly.title), moderations_path(assembly) %><br>
72
- <% else %>
73
- <%= translated_attribute(assembly.title) %>
74
- <% end %>
75
- </td>
76
- <td>
77
- <% if(assembly.area != nil) %>
78
- <%= translated_attribute(assembly.area.name)%>
79
- <% end %>
80
- </td>
81
- <td>
82
- <% if(assembly.area != nil) %>
83
- <%= assembly.area.users.map(&:name).join(", ") %>
84
- <% end %>
85
- </td>
86
- <td>
87
- <%= assembly.users_with_any_role.map(&:name).join(", ") %>
88
- </td>
89
- <td>
90
- <%= l(assembly.created_at, format: :short) %>
91
- </td>
92
- <td class="table-list__state">
93
- <% if assembly.private_space? %>
94
- <strong class="text-alert"><%= t("assemblies.index.private", scope: "decidim.admin") %></strong>
95
- <% else %>
96
- <strong class="text-success"><%= t("assemblies.index.public", scope: "decidim.admin") %></strong>
97
- <% end %>
98
- </td>
99
- <td class="table-list__state">
100
- <% if assembly.published? %>
101
- <strong class="text-success"><%= t("assemblies.index.published", scope: "decidim.admin") %></strong>
102
- <% else %>
103
- <strong class="text-alert"><%= t("assemblies.index.not_published", scope: "decidim.admin") %></strong>
104
- <% end %>
105
- </td>
106
- <td class="table-list__actions">
107
- <% if allowed_to? :export, :assembly, assembly: assembly %>
108
- <%= icon_link_to "data-transfer-download", assembly_export_path(assembly), t("actions.export", scope: "decidim.admin"), method: :post, class: "action-icon--export" %>
109
- <% else %>
110
- <span class="action-space icon"></span>
111
- <% end %>
52
+ <td>
53
+ <% if assembly.promoted? %>
54
+ <%= icon_with_tooltip "star-s-fill", t("models.assembly.fields.promoted", scope: "decidim.admin") %>
55
+ <% end %>
112
56
 
113
- <% if allowed_to? :copy, :assembly, assembly: assembly %>
114
- <%= icon_link_to "clipboard", new_assembly_copy_path(assembly), t("actions.duplicate", scope: "decidim.admin"), class: "action-icon--copy" %>
115
- <% else %>
116
- <span class="action-space icon"></span>
117
- <% end %>
57
+ <% if allowed_to? :update, :assembly, assembly: assembly %>
58
+ <%= link_to translated_attribute(assembly.title), edit_assembly_path(assembly) %><br>
59
+ <% elsif allowed_to? :read, :component, assembly: assembly %>
60
+ <%= link_to translated_attribute(assembly.title), components_path(assembly) %><br>
61
+ <% else %>
62
+ <%= translated_attribute(assembly.title) %>
63
+ <% end %>
64
+ </td>
65
+ <td class="table-list__area">
66
+ <% if(assembly.area != nil) %>
67
+ <%= translated_attribute(assembly.area.name)%>
68
+ <% end %>
69
+ </td>
70
+ <td class="table-list__area-users">
71
+ <% if(assembly.area != nil) %>
72
+ <%= assembly.area.users.map(&:name).join(", ") %>
73
+ <% end %>
74
+ </td>
75
+ <td class="table-list__role">
76
+ <%= assembly.users_with_any_role.map(&:name).join(", ") %>
77
+ </td>
78
+ <td class="table-list__date">
79
+ <%= l(assembly.created_at, format: :short) %>
80
+ </td>
81
+ <td class="table-list__state">
82
+ <% if assembly.private_space? %>
83
+ <strong class="text-alert"><%= t("assemblies.index.private", scope: "decidim.admin") %></strong>
84
+ <% else %>
85
+ <strong class="text-success"><%= t("assemblies.index.public", scope: "decidim.admin") %></strong>
86
+ <% end %>
87
+ </td>
88
+ <td class="table-list__state">
89
+ <% if assembly.published? %>
90
+ <strong class="text-success"><%= t("assemblies.index.published", scope: "decidim.admin") %></strong>
91
+ <% else %>
92
+ <strong class="text-alert"><%= t("assemblies.index.unpublished", scope: "decidim.admin") %></strong>
93
+ <% end %>
94
+ </td>
95
+ <td class="table-list__actions">
96
+ <% if allowed_to? :update, :assembly, assembly: assembly %>
97
+ <%= icon_link_to "pencil-line", edit_assembly_path(assembly), t("actions.configure", scope: "decidim.admin"), class: "action-icon--new" %>
98
+ <% else %>
99
+ <span class="action-space icon"></span>
100
+ <% end %>
101
+ <% if assembly.children.count.positive? || allowed_to?(:create, :assembly) %>
102
+ <%= icon_link_to "government-line",
103
+ url_for(query_params_with(parent_id_eq: assembly.id)),
104
+ t("decidim.admin.titles.assemblies"),
105
+ class: "action-icon--dial #{"highlighted" if assembly.children.count.positive?}" %>
106
+ <% else %>
107
+ <span class="action-space icon"></span>
108
+ <% end %>
109
+ <% if allowed_to? :copy, :assembly, assembly: assembly %>
110
+ <%= icon_link_to "file-copy-line", new_assembly_copy_path(assembly), t("actions.duplicate", scope: "decidim.admin"), class: "action-icon--copy" %>
111
+ <% else %>
112
+ <span class="action-space icon"></span>
113
+ <% end %>
118
114
 
119
- <% if allowed_to? :update, :assembly, assembly: assembly %>
120
- <%= icon_link_to "pencil", edit_assembly_path(assembly), t("actions.configure", scope: "decidim.admin"), class: "action-icon--new" %>
121
- <% else %>
122
- <span class="action-space icon"></span>
123
- <% end %>
115
+ <% if allowed_to? :export, :assembly, assembly: assembly %>
116
+ <%= icon_link_to "download-line", assembly_export_path(assembly), t("actions.export", scope: "decidim.admin"), method: :post, class: "action-icon--export" %>
117
+ <% else %>
118
+ <span class="action-space icon"></span>
119
+ <% end %>
124
120
 
125
- <% if assembly.children.count.positive? || allowed_to?(:create, :assembly) %>
126
- <%= icon_link_to "dial",
127
- url_for(query_params_with(parent_id_eq: assembly.id)),
128
- t("decidim.admin.titles.assemblies"),
129
- class: "action-icon--dial #{'highlighted' if assembly.children.count.positive?}" %>
130
- <% else %>
131
- <span class="action-space icon"></span>
132
- <% end %>
121
+ <% if allowed_to? :preview, :assembly, assembly: assembly %>
122
+ <%= icon_link_to "eye-line", decidim_assemblies.assembly_path(assembly), t("actions.preview", scope: "decidim.admin"), class: "action-icon--preview", target: "_blank", data: { "external-link": false } %>
123
+ <% else %>
124
+ <span class="action-space icon"></span>
125
+ <% end %>
133
126
 
134
- <% if allowed_to? :preview, :assembly, assembly: assembly %>
135
- <%= icon_link_to "eye", decidim_assemblies.assembly_path(assembly), t("actions.preview", scope: "decidim.admin"), class: "action-icon--preview" %>
136
- <% else %>
137
- <span class="action-space icon"></span>
138
- <% end %>
139
- </td>
140
- </tr>
141
- <% end %>
142
- </tbody>
143
- </table>
144
- <%= paginate @assemblies, theme: "decidim" %>
145
- </div>
127
+ <% if allowed_to? :read, :moderation, assembly: assembly %>
128
+ <%= icon_link_to "flag-line", moderations_path(assembly), t("actions.moderate", scope: "decidim.admin"), class: "action-icon--moderate" %>
129
+ <% else %>
130
+ <span class="action-space icon"></span>
131
+ <% end %>
132
+ </td>
133
+ </tr>
134
+ <% end %>
135
+ </tbody>
136
+ </table>
146
137
  </div>
138
+ <%= decidim_paginate @assemblies %>
147
139
  </div>
@@ -1,24 +1,32 @@
1
- <div class="card">
2
- <div class="card-divider">
3
- <h2 class="card-title"><%= t "conferences.form.title", scope: "decidim.admin" %></h2>
4
- </div>
1
+ <div class="form__wrapper">
2
+ <div class="card" data-component="accordion" id="accordion-title">
3
+ <div class="card-divider">
4
+ <button class="card-divider-button" data-open="true" data-controls="panel-title" type="button">
5
+ <%= icon "arrow-right-s-line" %>
6
+ <h2 class="card-title" id="title">
7
+ <%= t("title", scope: "decidim.admin.conferences.form") %>
8
+ </h2>
9
+ </button>
10
+ </div>
11
+ <div id="panel-title" class="card-section">
12
+ <div class="row column">
13
+ <%= form.translated :text_field, :title, autofocus: true, aria: { label: :title } %>
14
+ </div>
5
15
 
6
- <div class="card-section">
7
16
  <div class="row column">
8
- <%= form.translated :text_field, :title, autofocus: true %>
17
+ <%= form.translated :text_field, :slogan, aria: { label: :slogan } %>
9
18
  </div>
10
19
 
11
20
  <div class="row column">
12
- <%= form.translated :text_field, :slogan %>
21
+ <%= form.number_field :weight %>
13
22
  </div>
14
23
 
15
24
  <div class="row">
16
- <div class="columns xlarge-6 slug">
17
- <%= form.text_field :slug %>
18
- <p class="help-text"><%== t(".slug_help", url: decidim_form_slug_url(:conferences, form.object.slug)) %></p>
25
+ <div class="columns slug">
26
+ <%= form.text_field :slug, help_text: t(".slug_help_html", url: decidim_form_slug_url(:conferences, form.object.slug)) %>
19
27
  </div>
20
28
 
21
- <div class="columns xlarge-6">
29
+ <div class="columns">
22
30
  <%= form.text_field :hashtag %>
23
31
  </div>
24
32
  </div>
@@ -28,15 +36,15 @@
28
36
  </div>
29
37
 
30
38
  <div class="row column">
31
- <%= form.translated :editor, :short_description %>
39
+ <%= form.translated :editor, :short_description, aria: { label: :short_description } %>
32
40
  </div>
33
41
 
34
42
  <div class="row column">
35
- <%= form.translated :editor, :description %>
43
+ <%= form.translated :editor, :description, aria: { label: :description } %>
36
44
  </div>
37
45
 
38
46
  <div class="row column">
39
- <%= form.translated :editor, :objectives %>
47
+ <%= form.translated :editor, :objectives, aria: { label: :objectives } %>
40
48
  </div>
41
49
 
42
50
  <div class="row column">
@@ -45,11 +53,11 @@
45
53
 
46
54
  <div class="row">
47
55
  <div class="columns xlarge-6">
48
- <%= form.upload :hero_image %>
56
+ <%= form.upload :hero_image, button_class: "button button__sm button__transparent-secondary" %>
49
57
  </div>
50
58
 
51
59
  <div class="columns xlarge-6">
52
- <%= form.upload :banner_image %>
60
+ <%= form.upload :banner_image, button_class: "button button__sm button__transparent-secondary" %>
53
61
  </div>
54
62
  </div>
55
63
 
@@ -86,12 +94,11 @@
86
94
 
87
95
  <div class="row column">
88
96
  <p><%= t(".registrations_count", count: current_participatory_space.present? ? current_participatory_space.conference_registrations.count : 0) %></p>
89
- <%= form.number_field :available_slots %>
90
- <p class="help-text"><%= t(".available_slots_help") %></p>
97
+ <%= form.number_field :available_slots, help_text: t(".available_slots_help") %>
91
98
  </div>
92
99
 
93
100
  <div class="row column" id="conference_registrations_terms">
94
- <%= form.translated :editor, :registration_terms, toolbar: :content %>
101
+ <%= form.translated :editor, :registration_terms, toolbar: :content, aria: { label: :registration_terms } %>
95
102
  </div>
96
103
 
97
104
  <div class="row column">
@@ -104,18 +111,18 @@
104
111
  </div>
105
112
 
106
113
  <div class="row column">
107
- <% if @form.assemblies_for_select %>
108
- <%= form.select :assemblies_ids,
109
- options_for_select(@form.assemblies_for_select, selected: assemblies_selected ),
114
+ <% if @form.processes_for_select %>
115
+ <%= form.select :participatory_processes_ids,
116
+ options_for_select(@form.processes_for_select, selected: processes_selected ),
110
117
  { include_blank: true },
111
118
  { multiple: true, class: "chosen-select" } %>
112
119
  <% end %>
113
120
  </div>
114
121
 
115
122
  <div class="row column">
116
- <% if @form.consultations_for_select %>
117
- <%= form.select :consultations_ids,
118
- options_for_select(@form.consultations_for_select, selected: consultations_selected ),
123
+ <% if @form.assemblies_for_select %>
124
+ <%= form.select :assemblies_ids,
125
+ options_for_select(@form.assemblies_for_select, selected: assemblies_selected ),
119
126
  { include_blank: true },
120
127
  { multiple: true, class: "chosen-select" } %>
121
128
  <% end %>
@@ -124,4 +131,4 @@
124
131
  </div>
125
132
  </div>
126
133
 
127
- <%= javascript_pack_tag "decidim_conferences_admin" %>
134
+ <%= append_javascript_pack_tag "decidim_conferences_admin" %>
@@ -1,85 +1,78 @@
1
- <div class="card with-overflow" id="conferences">
2
- <div class="card-divider">
3
- <h2 class="card-title">
4
- <%= t "decidim.admin.titles.conferences" %>
5
- <%= link_to t("actions.new_conference", scope: "decidim.admin"), new_conference_path, class: "button tiny button--title" if allowed_to? :create, :conference %>
6
- </h2>
7
- </div>
1
+ <% add_decidim_page_title(t("decidim.admin.titles.conferences")) %>
2
+ <div class="card" id="conferences">
8
3
  <%= admin_filter_selector %>
9
- <div class="card-section">
10
- <div class="table-scroll">
11
- <table class="table-list">
12
- <thead>
4
+ <div class="table-scroll">
5
+ <table class="table-list">
6
+ <thead>
7
+ <tr>
8
+ <th><%= t("models.conference.fields.title", scope: "decidim.admin") %></th>
9
+ <th><%= sort_link(query, :area_name, t("models.conference.fields.department", scope: "decidim.admin")) %></th>
10
+ <th><%= t("models.conference.fields.department_role", scope: "decidim.admin") %></th>
11
+ <th><%= t("models.conference.fields.conference_role", scope: "decidim.admin") %></th>
12
+ <th><%= sort_link(query, :created_at, t("models.conference.fields.created_at", scope: "decidim.admin"), default_order: :desc) %></th>
13
+ <th class="table-list__actions"><%= t("models.conference.fields.published", scope: "decidim.admin") %></th>
14
+ <th></th>
15
+ </tr>
16
+ </thead>
17
+ <tbody>
18
+ <% @conferences.each do |conference| %>
13
19
  <tr>
14
- <th><%= t("models.conference.fields.title", scope: "decidim.admin") %></th>
15
- <th><%= sort_link(query, :area_name, t("models.conference.fields.department", scope: "decidim.admin")) %></th>
16
- <th><%= t("models.conference.fields.department_role", scope: "decidim.admin") %></th>
17
- <th><%= t("models.conference.fields.conference_role", scope: "decidim.admin") %></th>
18
- <th><%= sort_link(query, :created_at, t("models.conference.fields.created_at", scope: "decidim.admin"), default_order: :desc) %></th>
19
- <th class="table-list__actions"><%= t("models.conference.fields.published", scope: "decidim.admin") %></th>
20
- <th></th>
20
+ <td>
21
+ <% if conference.promoted? %>
22
+ <%= icon_with_tooltip "star-s-fill", t("models.assembly.fields.promoted", scope: "decidim.admin") %>
23
+ <% end %>
24
+
25
+ <% if allowed_to? :update, :conference, conference: conference %>
26
+ <%= link_to translated_attribute(conference.title), edit_conference_path(conference) %><br>
27
+ <% elsif allowed_to? :read, :component, conference: conference %>
28
+ <%= link_to translated_attribute(conference.title), components_path(conference) %><br>
29
+ <% else %>
30
+ <%= translated_attribute(conference.title) %>
31
+ <% end %>
32
+ </td>
33
+ <td>
34
+ <% if(conference.area != nil) %>
35
+ <%= translated_attribute(conference.area.name) %>
36
+ <% end %>
37
+ </td>
38
+ <td>
39
+ <% if(conference.area != nil) %>
40
+ <%= conference.area.users.map(&:name).join(", ") %>
41
+ <% end %>
42
+ </td>
43
+ <td>
44
+ <%= conference.users_with_any_role.map(&:name).join(", ") %>
45
+ </td>
46
+ <td>
47
+ <%= l conference.created_at, format: :short %>
48
+ </td>
49
+ <td class="table-list__state">
50
+ <% if conference.published? %>
51
+ <strong class="text-success"><%= t("conferences.index.published", scope: "decidim.admin") %></strong>
52
+ <% else %>
53
+ <strong class="text-alert"><%= t("conferences.index.unpublished", scope: "decidim.admin") %></strong>
54
+ <% end %>
55
+ </td>
56
+ <td class="table-list__actions">
57
+ <% if allowed_to? :update, :conference, conference: conference %>
58
+ <%= icon_link_to "pencil-line", edit_conference_path(conference), t("actions.configure", scope: "decidim.admin"), class: "action-icon--new" %>
59
+ <% end %>
60
+
61
+ <% if allowed_to? :create, :conference, conference: conference %>
62
+ <%= icon_link_to "file-copy-line", new_conference_copy_path(conference), t("actions.duplicate", scope: "decidim.admin"), class: "action-icon--copy" %>
63
+ <% end %>
64
+
65
+ <% if allowed_to? :preview, :conference, conference: conference %>
66
+ <%= icon_link_to "eye-line", decidim_conferences.conference_path(conference), t("actions.preview", scope: "decidim.admin"), class: "action-icon--preview", target: "_blank", data: { "external-link": false } %>
67
+ <% end %>
68
+
69
+ <% if allowed_to? :read, :moderation, conference: conference %>
70
+ <%= icon_link_to "flag-line", moderations_path(conference), t("actions.moderate", scope: "decidim.admin"), class: "action-icon--moderate" %>
71
+ <% end %>
72
+ </td>
21
73
  </tr>
22
- </thead>
23
- <tbody>
24
- <% @conferences.each do |conference| %>
25
- <tr>
26
- <td>
27
- <% if conference.promoted? %>
28
- <span data-tooltip class="icon-state icon-highlight" aria-haspopup="true" data-disable-hover="false" title="<%= t("models.conference.fields.promoted", scope: "decidim.admin") %>">
29
- <%= icon "star", aria_label: t("models.conference.fields.promoted", scope: "decidim.admin"), role: "img" %>
30
- </span>
31
- <% end %>
32
- <% if allowed_to? :update, :conference, conference: conference %>
33
- <%= link_to translated_attribute(conference.title), edit_conference_path(conference) %><br>
34
- <% elsif allowed_to? :read, :component, conference: conference %>
35
- <%= link_to translated_attribute(conference.title), components_path(conference) %><br>
36
- <% elsif allowed_to? :preview, :conference, conference: conference %>
37
- <%= link_to translated_attribute(conference.title), decidim_conferences.conference_path(conference) %><br>
38
- <% elsif allowed_to? :read, :moderation, conference: conference %>
39
- <%= link_to translated_attribute(conference.title), moderations_path(conference) %><br>
40
- <% else %>
41
- <%= translated_attribute(conference.title) %>
42
- <% end %>
43
- </td>
44
- <td>
45
- <% if(conference.area != nil) %>
46
- <%= translated_attribute(conference.area.name) %>
47
- <% end %>
48
- </td>
49
- <td>
50
- <% if(conference.area != nil) %>
51
- <%= conference.area.users.map(&:name).join(", ") %>
52
- <% end %>
53
- </td>
54
- <td>
55
- <%= conference.users_with_any_role.map(&:name).join(", ") %>
56
- </td>
57
- <td>
58
- <%= l conference.created_at, format: :short %>
59
- </td>
60
- <td class="table-list__state">
61
- <% if conference.published? %>
62
- <strong class="text-success"><%= t("conferences.index.published", scope: "decidim.admin") %></strong>
63
- <% else %>
64
- <strong class="text-alert"><%= t("conferences.index.not_published", scope: "decidim.admin") %></strong>
65
- <% end %>
66
- </td>
67
- <td class="table-list__actions">
68
- <% if allowed_to? :create, :conference, conference: conference %>
69
- <%= icon_link_to "clipboard", new_conference_copy_path(conference), t("actions.duplicate", scope: "decidim.admin"), class: "action-icon--copy" %>
70
- <% end %>
71
- <% if allowed_to? :update, :conference, conference: conference %>
72
- <%= icon_link_to "pencil", edit_conference_path(conference), t("actions.configure", scope: "decidim.admin"), class: "action-icon--new" %>
73
- <% end %>
74
- <% if allowed_to? :preview, :conference, conference: conference %>
75
- <%= icon_link_to "eye", decidim_conferences.conference_path(conference), t("actions.preview", scope: "decidim.admin"), class: "action-icon--preview" %>
76
- <% end %>
77
- </td>
78
- </tr>
79
- <% end %>
80
- </tbody>
81
- </table>
82
- <%= paginate @conferences, theme: "decidim" %>
74
+ <% end %>
75
+ </tbody>
83
76
  </div>
84
- </div>
77
+ <%= decidim_paginate @conferences %>
85
78
  </div>