decidim-department_admin 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE-AGPLv3.txt +661 -0
- data/README.md +132 -0
- data/Rakefile +9 -0
- data/app/controllers/decidim/department_admin/admin/application_controller.rb +15 -0
- data/app/controllers/decidim/department_admin/application_controller.rb +13 -0
- data/app/decorators/decidim/admin/newsletters_controller_decorator.rb +30 -0
- data/app/decorators/decidim/admin/users_controller_decorator.rb +128 -0
- data/app/decorators/decidim/area_decorator.rb +44 -0
- data/app/decorators/decidim/assemblies/admin/assemblies_controller_decorator.rb +25 -0
- data/app/decorators/decidim/assemblies/admin/assemblies_helper_decorator.rb +24 -0
- data/app/decorators/decidim/assemblies/create_assembly_decorator.rb +19 -0
- data/app/decorators/decidim/assemblies/parent_assemblies_for_select_decorator.rb +38 -0
- data/app/decorators/decidim/assemblies/permissions_decorator.rb +22 -0
- data/app/decorators/decidim/assemblies/update_assembly_decorator.rb +19 -0
- data/app/decorators/decidim/assemblies_decorator.rb +21 -0
- data/app/decorators/decidim/assemblies_with_user_role_decorator.rb +27 -0
- data/app/decorators/decidim/conference_form_decorator.rb +23 -0
- data/app/decorators/decidim/conferences/admin/conferences_controller_decorator.rb +27 -0
- data/app/decorators/decidim/conferences/create_conference_decorator.rb +52 -0
- data/app/decorators/decidim/conferences/permissions_decorator.rb +24 -0
- data/app/decorators/decidim/conferences/update_conference_decorator.rb +21 -0
- data/app/decorators/decidim/conferences_decorator.rb +27 -0
- data/app/decorators/decidim/conferences_with_user_role_decorator.rb +29 -0
- data/app/decorators/decidim/decidim_form_helper_decorator.rb +23 -0
- data/app/decorators/decidim/invite_user_decorator.rb +56 -0
- data/app/decorators/decidim/invite_user_form_decorator.rb +45 -0
- data/app/decorators/decidim/newsletter_decorator.rb +20 -0
- data/app/decorators/decidim/newsletters_helper_decorator.rb +44 -0
- data/app/decorators/decidim/participatory_process_decorator.rb +21 -0
- data/app/decorators/decidim/participatory_process_group_decorator.rb +17 -0
- data/app/decorators/decidim/participatory_processes/admin/participatory_processes_controller_decorator.rb +25 -0
- data/app/decorators/decidim/participatory_processes/create_participatory_process_decorator.rb +19 -0
- data/app/decorators/decidim/participatory_processes/permissions_decorator.rb +22 -0
- data/app/decorators/decidim/participatory_processes/update_participatory_process_decorator.rb +19 -0
- data/app/decorators/decidim/participatory_processes_with_user_role_decorator.rb +27 -0
- data/app/decorators/decidim/user_decorator.rb +59 -0
- data/app/decorators/lib/decidim/participatory_space_resourceable_decorator.rb +33 -0
- data/app/helpers/decidim/admin/user_roles_helper.rb +25 -0
- data/app/helpers/decidim/department_admin/application_helper.rb +54 -0
- data/app/models/decidim/participatory_space_role_config/department_admin.rb +8 -0
- data/app/overrides/decidim/admin/shared/add_radio_buttons_to_filters.rb +6 -0
- data/app/packs/entrypoints/decidim_department_admin.js +4 -0
- data/app/packs/entrypoints/decidim_department_admin.scss +1 -0
- data/app/packs/images/decidim/department_admin/icon.svg +1 -0
- data/app/packs/stylesheets/decidim/admin/department_admin.scss +7 -0
- data/app/permissions/decidim/assemblies/participatory_space_permissions.rb +14 -0
- data/app/permissions/decidim/conferences/participatory_space_permissions.rb +17 -0
- data/app/permissions/decidim/department_admin/permissions.rb +240 -0
- data/app/permissions/decidim/participatory_processes/participatory_space_permissions.rb +14 -0
- data/app/queries/decidim/admin/user_admin_by_space_name_filter.rb +67 -0
- data/app/queries/decidim/admin/user_admin_filter.rb +50 -0
- data/app/views/decidim/admin/users/_filters.html.erb +32 -0
- data/app/views/decidim/admin/users/_form.html.erb +36 -0
- data/app/views/decidim/admin/users/index.html.erb +91 -0
- data/app/views/decidim/admin/users/show.html.erb +98 -0
- data/app/views/decidim/assemblies/admin/assemblies/index.html.erb +139 -0
- data/app/views/decidim/conferences/admin/conferences/_form.html.erb +134 -0
- data/app/views/decidim/conferences/admin/conferences/index.html.erb +78 -0
- data/app/views/decidim/participatory_processes/admin/participatory_processes/index.html.erb +117 -0
- data/config/assets.rb +27 -0
- data/config/i18n-tasks.yml +148 -0
- data/config/initializers/user_roles.rb +4 -0
- data/config/locales/ca.yml +61 -0
- data/config/locales/cs.yml +46 -0
- data/config/locales/en.yml +61 -0
- data/config/locales/es.yml +61 -0
- data/db/migrate/20190328130102_create_department_admin_areas.rb +10 -0
- data/db/migrate/20210420143021_add_area_to_conferences.rb +7 -0
- data/lib/decidim/department_admin/admin.rb +10 -0
- data/lib/decidim/department_admin/admin_engine.rb +27 -0
- data/lib/decidim/department_admin/engine.rb +136 -0
- data/lib/decidim/department_admin/test/factories.rb +17 -0
- data/lib/decidim/department_admin/version.rb +11 -0
- data/lib/decidim/department_admin.rb +15 -0
- metadata +189 -0
@@ -0,0 +1,91 @@
|
|
1
|
+
<% add_decidim_page_title(t("decidim.admin.titles.users")) %>
|
2
|
+
<div class="card">
|
3
|
+
<div class="item_show__header">
|
4
|
+
<h1 class="item_show__header-title">
|
5
|
+
<%= t "decidim.admin.titles.users" %>
|
6
|
+
<% if allowed_to? :create, :admin_user %>
|
7
|
+
<%= link_to t("actions.user.new", scope: "decidim.admin"), [:new, :user], class: "button button__sm button__secondary" %>
|
8
|
+
<% end %>
|
9
|
+
</h1>
|
10
|
+
</div>
|
11
|
+
<%= admin_filter_selector %>
|
12
|
+
<div class="table-scroll">
|
13
|
+
<table class="table-list">
|
14
|
+
<thead>
|
15
|
+
<tr>
|
16
|
+
<th><%= sort_link(query, :role, t("models.user.fields.role", scope: "decidim.admin"), default_order: :desc) %></th>
|
17
|
+
<th><%= sort_link(query, :name, t("models.user.fields.name", scope: "decidim.admin"), default_order: :desc) %></th>
|
18
|
+
<th><%= sort_link(query, :email, t("models.user.fields.email", scope: "decidim.admin"), default_order: :desc) %></th>
|
19
|
+
<th><%= sort_link(query, :department, t("models.user.fields.department", scope: "decidim.admin"), default_order: :desc) %></th>
|
20
|
+
<th><%= sort_link(query, :spaces, t("models.user.fields.spaces", scope: "decidim.admin"), default_order: :desc) %></th>
|
21
|
+
<th><%= sort_link(query, :invitation_sent_at, t("models.user.fields.invitation_sent_at", scope: "decidim.admin"), default_order: :desc) %></th>
|
22
|
+
<th><%= sort_link(query, :invitation_accepted_at, t("models.user.fields.invitation_accepted_at", scope: "decidim.admin"), default_order: :desc) %></th>
|
23
|
+
<th><%= sort_link(query, :last_sign_in_at, t("models.user.fields.last_sign_in_at", scope: "decidim.admin"), default_order: :desc) %></th>
|
24
|
+
<th><%= sort_link(query, :created_at, t("models.user.fields.created_at", scope: "decidim.admin"), default_order: :desc) %></th>
|
25
|
+
<th></th>
|
26
|
+
</tr>
|
27
|
+
</thead>
|
28
|
+
<tbody>
|
29
|
+
<% @users.each do |user| %>
|
30
|
+
<% roles_with_title(user).each do |role_and_title| %>
|
31
|
+
<% if @role.blank? || (@role == role_and_title[0] || @role == 'space_admin' && (role_and_title[0] == 'process_admin' || role_and_title[0] == 'assembly_admin' || role_and_title[0] == 'conference_admin')) %>
|
32
|
+
<tr data-user-id="<%= user.id %>">
|
33
|
+
<td>
|
34
|
+
<% if role_and_title.nil? || role_and_title[0].empty? %>
|
35
|
+
<%= t("models.user.fields.roles.#{user.active_role}", scope: "decidim.admin") %>
|
36
|
+
<% else %>
|
37
|
+
<%= t("models.user.fields.roles.#{role_and_title[0] }", scope: "decidim.admin") %>
|
38
|
+
<% end %>
|
39
|
+
</td>
|
40
|
+
<td><%= user.name %></td>
|
41
|
+
<td><%= user.email %></td>
|
42
|
+
<td>
|
43
|
+
<% if user.department_admin? %>
|
44
|
+
<%= translated_attribute(user.areas.first&.name) %>
|
45
|
+
<% end %>
|
46
|
+
</td>
|
47
|
+
<td>
|
48
|
+
<% if !role_and_title.nil? && !role_and_title[1].empty? %>
|
49
|
+
<%= role_and_title[1] %>
|
50
|
+
<% end %>
|
51
|
+
</td>
|
52
|
+
<td>
|
53
|
+
<% if user.invitation_sent_at %>
|
54
|
+
<%= l user.invitation_sent_at, format: :short %>
|
55
|
+
<% end %>
|
56
|
+
</td>
|
57
|
+
<td>
|
58
|
+
<% if user.invitation_accepted_at %>
|
59
|
+
<%= l user.invitation_accepted_at, format: :short %>
|
60
|
+
<% end %>
|
61
|
+
</td>
|
62
|
+
<td>
|
63
|
+
<% if user.last_sign_in_at %>
|
64
|
+
<%= l user.last_sign_in_at, format: :short %>
|
65
|
+
<% end %>
|
66
|
+
</td>
|
67
|
+
<td><%= l user.created_at, format: :short %></td>
|
68
|
+
<td class="table-list__actions">
|
69
|
+
<% if user.participatory_processes.size > 0 || user.assemblies.size > 0 || (Decidim::DepartmentAdmin.conferences_defined? && user.conferences.size > 0) %>
|
70
|
+
<% if allowed_to?(:preview, :user, user: user) %>
|
71
|
+
<%= icon_link_to "eye-line", user_path(user.id), t("actions.preview", scope: "decidim.admin"), class: "action-icon--preview" %>
|
72
|
+
<% end %>
|
73
|
+
<% end %>
|
74
|
+
|
75
|
+
<% if allowed_to?(:invite, :admin_user, user: user) && user.invited_to_sign_up? %>
|
76
|
+
<%= icon_link_to "refresh-line", [:resend_invitation, user], t("actions.resend_invitation", scope: "decidim.admin"), class: "resend-invitation", method: :post %>
|
77
|
+
<% end %>
|
78
|
+
|
79
|
+
<% if allowed_to? :destroy, :admin_user, user: user %>
|
80
|
+
<%= icon_link_to "delete-bin-line", user, t("actions.destroy", scope: "decidim.admin"), class: "action-icon--remove", method: :delete, data: { confirm: t("actions.confirm_destroy", scope: "decidim.admin") } %>
|
81
|
+
<% end %>
|
82
|
+
</td>
|
83
|
+
</tr>
|
84
|
+
<% end %>
|
85
|
+
<% end %>
|
86
|
+
<% end %>
|
87
|
+
</tbody>
|
88
|
+
</table>
|
89
|
+
<%= paginate @users, theme: "decidim" %>
|
90
|
+
</div>
|
91
|
+
</div>
|
@@ -0,0 +1,98 @@
|
|
1
|
+
<% @user = Decidim::User.find_by_id(params[:id]) %>
|
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>
|
9
|
+
</div>
|
10
|
+
<div class="card">
|
11
|
+
<div class="card-divider"></div>
|
12
|
+
<div class="card-section">
|
13
|
+
<div class="table-scroll">
|
14
|
+
<table class="table-list">
|
15
|
+
<thead>
|
16
|
+
<tr>
|
17
|
+
<th class="table-list__actions">
|
18
|
+
<% if params[:sort_column] == 'title' && params[:sort_order] == 'asc' %>
|
19
|
+
<%= link_to(t("models.user.fields.title", scope: "decidim.admin") + '▲', :sort_column => 'title', :sort_order => 'desc') %>
|
20
|
+
<% elsif params[:sort_column] == 'title' && params[:sort_order] == 'desc' %>
|
21
|
+
<%= link_to(t("models.user.fields.title", scope: "decidim.admin") + '▼', :sort_column => '', :sort_order => '') %>
|
22
|
+
<% else %>
|
23
|
+
<%= link_to(t("models.user.fields.title", scope: "decidim.admin"), :sort_column => 'title', :sort_order => 'asc') %>
|
24
|
+
<% end %>
|
25
|
+
</th>
|
26
|
+
<th class="table-list__actions">
|
27
|
+
<% if params[:sort_column] == 'type' && params[:sort_order] == 'asc' %>
|
28
|
+
<%= link_to(t("models.user.fields.type", scope: "decidim.admin") + '▲', :sort_column => 'type', :sort_order => 'desc') %>
|
29
|
+
<% elsif params[:sort_column] == 'type' && params[:sort_order] == 'desc' %>
|
30
|
+
<%= link_to(t("models.user.fields.type", scope: "decidim.admin") + '▼', :sort_column => '', :sort_order => '') %>
|
31
|
+
<% else %>
|
32
|
+
<%= link_to(t("models.user.fields.type", scope: "decidim.admin"), :sort_column => 'type', :sort_order => 'asc') %>
|
33
|
+
<% end %>
|
34
|
+
</th>
|
35
|
+
<th class="table-list__actions">
|
36
|
+
<% if params[:sort_column] == 'area' && params[:sort_order] == 'asc' %>
|
37
|
+
<%= link_to(t("models.user.fields.department", scope: "decidim.admin") + '▲', :sort_column => 'area', :sort_order => 'desc') %>
|
38
|
+
<% elsif params[:sort_column] == 'area' && params[:sort_order] == 'desc' %>
|
39
|
+
<%= link_to(t("models.user.fields.department", scope: "decidim.admin") + '▼', :sort_column => '', :sort_order => '') %>
|
40
|
+
<% else %>
|
41
|
+
<%= link_to(t("models.user.fields.department", scope: "decidim.admin"), :sort_column => 'area', :sort_order => 'asc') %>
|
42
|
+
<% end %>
|
43
|
+
</th>
|
44
|
+
<th class="table-list__actions">
|
45
|
+
<% if params[:sort_column] == 'created_at' && params[:sort_order] == 'desc' %>
|
46
|
+
<%= link_to(t("models.user.fields.created_at", scope: "decidim.admin") + '▲', :sort_column => 'created_at', :sort_order => 'asc') %>
|
47
|
+
<% elsif params[:sort_column] == 'created_at' && params[:sort_order] == 'asc' %>
|
48
|
+
<%= link_to(t("models.user.fields.created_at", scope: "decidim.admin") + '▼', :sort_column => '', :sort_order => '') %>
|
49
|
+
<% else %>
|
50
|
+
<%= link_to(t("models.user.fields.created_at", scope: "decidim.admin"), :sort_column => 'created_at', :sort_order => 'desc') %>
|
51
|
+
<% end %>
|
52
|
+
</th>
|
53
|
+
<th class="table-list__actions">
|
54
|
+
<% if params[:sort_column] == 'private' && params[:sort_order] == 'desc' %>
|
55
|
+
<%= link_to(t("models.user.fields.private", scope: "decidim.admin") + '▲', :sort_column => 'private', :sort_order => 'asc') %>
|
56
|
+
<% elsif params[:sort_column] == 'private' && params[:sort_order] == 'asc' %>
|
57
|
+
<%= link_to(t("models.user.fields.private", scope: "decidim.admin") + '▼', :sort_column => '', :sort_order => '') %>
|
58
|
+
<% else %>
|
59
|
+
<%= link_to(t("models.user.fields.private", scope: "decidim.admin"), :sort_column => 'private', :sort_order => 'desc') %>
|
60
|
+
<% end %>
|
61
|
+
</th>
|
62
|
+
<th class="table-list__actions">
|
63
|
+
<% if params[:sort_column] == 'published' && params[:sort_order] == 'desc' %>
|
64
|
+
<%= link_to(t("models.user.fields.published", scope: "decidim.admin") + '▲', :sort_column => 'published', :sort_order => 'asc') %>
|
65
|
+
<% elsif params[:sort_column] == 'published' && params[:sort_order] == 'asc' %>
|
66
|
+
<%= link_to(t("models.user.fields.published", scope: "decidim.admin") + '▼', :sort_column => '', :sort_order => '') %>
|
67
|
+
<% else %>
|
68
|
+
<%= link_to(t("models.user.fields.published", scope: "decidim.admin"), :sort_column => 'published', :sort_order => 'desc') %>
|
69
|
+
<% end %>
|
70
|
+
</th>
|
71
|
+
</tr>
|
72
|
+
</thead>
|
73
|
+
<tbody>
|
74
|
+
<% @spaces.each do |space| %>
|
75
|
+
<tr>
|
76
|
+
<td><%= space["title"] %></td>
|
77
|
+
<td><%= space["type"] %></td>
|
78
|
+
<td><%= space["area"] %></td>
|
79
|
+
<td><%= l space["created_at"], format: :short %></td>
|
80
|
+
<td>
|
81
|
+
<% if space["private"] %>
|
82
|
+
<strong class="text-alert"><%= t("assemblies.index.private", scope: "decidim.admin") %></strong>
|
83
|
+
<% else %>
|
84
|
+
<strong class="text-success"><%= t("assemblies.index.public", scope: "decidim.admin") %></strong>
|
85
|
+
<% end %></td>
|
86
|
+
<td>
|
87
|
+
<% if space["published"] %>
|
88
|
+
<strong class="text-success"><%= t("assemblies.index.published", scope: "decidim.admin") %></strong>
|
89
|
+
<% else %>
|
90
|
+
<strong class="text-alert"><%= t("assemblies.index.unpublished", scope: "decidim.admin") %></strong>
|
91
|
+
<% end %></td>
|
92
|
+
</tr>
|
93
|
+
<% end %>
|
94
|
+
</tbody>
|
95
|
+
</table>
|
96
|
+
</div>
|
97
|
+
</div>
|
98
|
+
</div>
|
@@ -0,0 +1,139 @@
|
|
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
|
+
>
|
10
|
+
<% end %>
|
11
|
+
<% end if parent_assembly %>
|
12
|
+
</h1>
|
13
|
+
</div>
|
14
|
+
<% end %>
|
15
|
+
|
16
|
+
<%= admin_filter_selector %>
|
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 %>
|
51
|
+
<tr>
|
52
|
+
<td>
|
53
|
+
<% if assembly.promoted? %>
|
54
|
+
<%= icon_with_tooltip "star-s-fill", t("models.assembly.fields.promoted", scope: "decidim.admin") %>
|
55
|
+
<% end %>
|
56
|
+
|
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 %>
|
114
|
+
|
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 %>
|
120
|
+
|
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 %>
|
126
|
+
|
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>
|
137
|
+
</div>
|
138
|
+
<%= decidim_paginate @assemblies %>
|
139
|
+
</div>
|
@@ -0,0 +1,134 @@
|
|
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>
|
15
|
+
|
16
|
+
<div class="row column">
|
17
|
+
<%= form.translated :text_field, :slogan, aria: { label: :slogan } %>
|
18
|
+
</div>
|
19
|
+
|
20
|
+
<div class="row column">
|
21
|
+
<%= form.number_field :weight %>
|
22
|
+
</div>
|
23
|
+
|
24
|
+
<div class="row">
|
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)) %>
|
27
|
+
</div>
|
28
|
+
|
29
|
+
<div class="columns">
|
30
|
+
<%= form.text_field :hashtag %>
|
31
|
+
</div>
|
32
|
+
</div>
|
33
|
+
|
34
|
+
<div class="row column">
|
35
|
+
<%= form.check_box :promoted %>
|
36
|
+
</div>
|
37
|
+
|
38
|
+
<div class="row column">
|
39
|
+
<%= form.translated :editor, :short_description, aria: { label: :short_description } %>
|
40
|
+
</div>
|
41
|
+
|
42
|
+
<div class="row column">
|
43
|
+
<%= form.translated :editor, :description, aria: { label: :description } %>
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div class="row column">
|
47
|
+
<%= form.translated :editor, :objectives, aria: { label: :objectives } %>
|
48
|
+
</div>
|
49
|
+
|
50
|
+
<div class="row column">
|
51
|
+
<%= form.text_field :location %>
|
52
|
+
</div>
|
53
|
+
|
54
|
+
<div class="row">
|
55
|
+
<div class="columns xlarge-6">
|
56
|
+
<%= form.upload :hero_image, button_class: "button button__sm button__transparent-secondary" %>
|
57
|
+
</div>
|
58
|
+
|
59
|
+
<div class="columns xlarge-6">
|
60
|
+
<%= form.upload :banner_image, button_class: "button button__sm button__transparent-secondary" %>
|
61
|
+
</div>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
<div class="row column">
|
65
|
+
<%= form.check_box :scopes_enabled %>
|
66
|
+
</div>
|
67
|
+
|
68
|
+
<div class="row column">
|
69
|
+
<%= scopes_picker_field form, :scope_id, root: nil %>
|
70
|
+
</div>
|
71
|
+
|
72
|
+
<div class="row column">
|
73
|
+
<%= form.areas_select :area_id,
|
74
|
+
areas_for_select(current_organization),
|
75
|
+
selected: current_participatory_space.try(:decidim_area_id),
|
76
|
+
include_blank: t(".select_an_area") %>
|
77
|
+
</div>
|
78
|
+
|
79
|
+
<div class="row column">
|
80
|
+
<%= form.check_box :show_statistics %>
|
81
|
+
</div>
|
82
|
+
|
83
|
+
<div class="row column">
|
84
|
+
<%= form.date_field :start_date %>
|
85
|
+
</div>
|
86
|
+
|
87
|
+
<div class="row column">
|
88
|
+
<%= form.date_field :end_date %>
|
89
|
+
</div>
|
90
|
+
|
91
|
+
<div class="row column">
|
92
|
+
<%= form.check_box :registrations_enabled %>
|
93
|
+
</div>
|
94
|
+
|
95
|
+
<div class="row column">
|
96
|
+
<p><%= t(".registrations_count", count: current_participatory_space.present? ? current_participatory_space.conference_registrations.count : 0) %></p>
|
97
|
+
<%= form.number_field :available_slots, help_text: t(".available_slots_help") %>
|
98
|
+
</div>
|
99
|
+
|
100
|
+
<div class="row column" id="conference_registrations_terms">
|
101
|
+
<%= form.translated :editor, :registration_terms, toolbar: :content, aria: { label: :registration_terms } %>
|
102
|
+
</div>
|
103
|
+
|
104
|
+
<div class="row column">
|
105
|
+
<% if @form.processes_for_select %>
|
106
|
+
<%= form.select :participatory_processes_ids,
|
107
|
+
options_for_select(@form.processes_for_select, selected: processes_selected ),
|
108
|
+
{ include_blank: true },
|
109
|
+
{ multiple: true, class: "chosen-select" } %>
|
110
|
+
<% end %>
|
111
|
+
</div>
|
112
|
+
|
113
|
+
<div class="row column">
|
114
|
+
<% if @form.processes_for_select %>
|
115
|
+
<%= form.select :participatory_processes_ids,
|
116
|
+
options_for_select(@form.processes_for_select, selected: processes_selected ),
|
117
|
+
{ include_blank: true },
|
118
|
+
{ multiple: true, class: "chosen-select" } %>
|
119
|
+
<% end %>
|
120
|
+
</div>
|
121
|
+
|
122
|
+
<div class="row column">
|
123
|
+
<% if @form.assemblies_for_select %>
|
124
|
+
<%= form.select :assemblies_ids,
|
125
|
+
options_for_select(@form.assemblies_for_select, selected: assemblies_selected ),
|
126
|
+
{ include_blank: true },
|
127
|
+
{ multiple: true, class: "chosen-select" } %>
|
128
|
+
<% end %>
|
129
|
+
</div>
|
130
|
+
|
131
|
+
</div>
|
132
|
+
</div>
|
133
|
+
|
134
|
+
<%= append_javascript_pack_tag "decidim_conferences_admin" %>
|
@@ -0,0 +1,78 @@
|
|
1
|
+
<% add_decidim_page_title(t("decidim.admin.titles.conferences")) %>
|
2
|
+
<div class="card" id="conferences">
|
3
|
+
<%= admin_filter_selector %>
|
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| %>
|
19
|
+
<tr>
|
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>
|
73
|
+
</tr>
|
74
|
+
<% end %>
|
75
|
+
</tbody>
|
76
|
+
</div>
|
77
|
+
<%= decidim_paginate @conferences %>
|
78
|
+
</div>
|