decidim-admin 0.20.1 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +13 -0
- data/app/assets/javascripts/decidim/admin/application.js.es6 +1 -0
- data/app/assets/javascripts/decidim/admin/bundle.js +5 -5
- data/app/assets/javascripts/decidim/admin/bundle.js.map +1 -1
- data/app/assets/javascripts/decidim/admin/newsletters.js.es6 +8 -0
- data/app/assets/stylesheets/decidim/admin/_variables.scss +1 -1
- data/app/assets/stylesheets/decidim/admin/extra/_action-icon.scss +6 -0
- data/app/assets/stylesheets/decidim/admin/extra/_cards.scss +11 -0
- data/app/assets/stylesheets/decidim/admin/modules/_buttons.scss +5 -0
- data/app/assets/stylesheets/decidim/admin/modules/_cards.scss +11 -0
- data/app/assets/stylesheets/decidim/admin/modules/_filters.scss +78 -1
- data/app/assets/stylesheets/decidim/admin/modules/_layout.scss +1 -1
- data/app/assets/stylesheets/decidim/admin/modules/_secondary-nav.scss +5 -1
- data/app/assets/stylesheets/decidim/admin/modules/_table-list.scss +24 -3
- data/app/cells/decidim/admin/results_per_page/show.erb +16 -0
- data/app/cells/decidim/admin/results_per_page_cell.rb +14 -0
- data/app/commands/decidim/admin/deliver_newsletter.rb +1 -1
- data/app/commands/decidim/admin/update_organization.rb +4 -1
- data/app/controllers/concerns/decidim/admin/filterable.rb +152 -0
- data/app/controllers/concerns/decidim/admin/officializations/filterable.rb +31 -0
- data/app/controllers/concerns/decidim/admin/paginable.rb +20 -0
- data/app/controllers/decidim/admin/admin_terms_controller.rb +20 -0
- data/app/controllers/decidim/admin/application_controller.rb +2 -0
- data/app/controllers/decidim/admin/components/base_controller.rb +5 -1
- data/app/controllers/decidim/admin/components_controller.rb +16 -20
- data/app/controllers/decidim/admin/concerns/has_private_users.rb +4 -0
- data/app/controllers/decidim/admin/newsletters_controller.rb +12 -1
- data/app/controllers/decidim/admin/officializations_controller.rb +7 -6
- data/app/forms/decidim/admin/organization_form.rb +7 -0
- data/app/helpers/decidim/admin/admin_terms_helper.rb +47 -0
- data/app/helpers/decidim/admin/application_helper.rb +1 -0
- data/app/helpers/decidim/admin/dashboard_helper.rb +25 -0
- data/app/helpers/decidim/admin/filterable_helper.rb +121 -0
- data/app/helpers/decidim/admin/newsletters_helper.rb +18 -0
- data/app/helpers/decidim/admin/paginable/per_page_helper.rb +22 -0
- data/app/helpers/decidim/admin/scopes_helper.rb +6 -0
- data/app/helpers/decidim/admin/settings_helper.rb +18 -2
- data/app/helpers/decidim/admin/user_roles_helper.rb +19 -0
- data/app/permissions/decidim/admin/permissions.rb +23 -6
- data/app/queries/decidim/admin/newsletter_recipients.rb +11 -4
- data/app/views/decidim/admin/admin_terms/show.html.erb +26 -0
- data/app/views/decidim/admin/components/_component.html.erb +35 -33
- data/app/views/decidim/admin/components/index.html.erb +10 -8
- data/app/views/decidim/admin/dashboard/show.html.erb +15 -0
- data/app/views/decidim/admin/newsletters/index.html.erb +9 -3
- data/app/views/decidim/admin/newsletters/select_recipients_to_deliver.html.erb +4 -4
- data/app/views/decidim/admin/officializations/index.html.erb +2 -38
- data/app/views/decidim/admin/organization/_form.html.erb +16 -0
- data/app/views/decidim/admin/shared/_filters.html.erb +40 -0
- data/app/views/layouts/decidim/admin/_application.html.erb +1 -1
- data/config/locales/ar.yml +40 -6
- data/config/locales/ca.yml +45 -6
- data/config/locales/cs.yml +45 -6
- data/config/locales/de.yml +9 -6
- data/config/locales/el.yml +1 -0
- data/config/locales/en.yml +45 -6
- data/config/locales/es-MX.yml +45 -6
- data/config/locales/es-PY.yml +45 -6
- data/config/locales/es.yml +45 -6
- data/config/locales/eu.yml +9 -6
- data/config/locales/fi-plain.yml +45 -6
- data/config/locales/fi.yml +45 -6
- data/config/locales/fr.yml +9 -6
- data/config/locales/gl.yml +9 -6
- data/config/locales/hu.yml +45 -6
- data/config/locales/id-ID.yml +9 -6
- data/config/locales/is-IS.yml +9 -6
- data/config/locales/it.yml +45 -6
- data/config/locales/nl.yml +28 -6
- data/config/locales/no.yml +45 -6
- data/config/locales/pl.yml +9 -6
- data/config/locales/pt-BR.yml +9 -6
- data/config/locales/pt.yml +9 -6
- data/config/locales/ru.yml +9 -6
- data/config/locales/sv.yml +9 -6
- data/config/locales/tr-TR.yml +9 -6
- data/config/locales/uk.yml +9 -6
- data/config/routes.rb +6 -0
- data/db/migrate/20191118112040_add_accepted_admin_terms_at_field_to_users.rb +7 -0
- data/lib/decidim/admin.rb +17 -0
- data/lib/decidim/admin/form_builder.rb +5 -0
- data/lib/decidim/admin/test.rb +2 -0
- data/lib/decidim/admin/test/filterable_examples.rb +129 -0
- data/lib/decidim/admin/test/manage_paginated_collection_examples.rb +22 -0
- data/lib/decidim/admin/version.rb +1 -1
- data/vendor/assets/javascripts/jquery.serializejson.js +344 -0
- metadata +26 -8
|
@@ -130,6 +130,24 @@ module Decidim
|
|
|
130
130
|
{ class: space.try(:closed?) ? "red" : "green", title: translated_attribute(space.title).to_s }
|
|
131
131
|
]
|
|
132
132
|
end
|
|
133
|
+
|
|
134
|
+
def newsletter_attention_callout_args
|
|
135
|
+
{
|
|
136
|
+
announcement: {
|
|
137
|
+
body: t("warning", scope: "decidim.admin.newsletters.select_recipients_to_deliver").html_safe
|
|
138
|
+
},
|
|
139
|
+
callout_class: "warning"
|
|
140
|
+
}
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
def newsletter_recipients_count_callout_args
|
|
144
|
+
{
|
|
145
|
+
announcement: {
|
|
146
|
+
body: t("recipients_count", scope: "decidim.admin.newsletters.select_recipients_to_deliver", count: recipients_count_query)
|
|
147
|
+
},
|
|
148
|
+
callout_class: "warning"
|
|
149
|
+
}
|
|
150
|
+
end
|
|
133
151
|
end
|
|
134
152
|
end
|
|
135
153
|
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Decidim
|
|
4
|
+
module Admin
|
|
5
|
+
module Paginable
|
|
6
|
+
# This module includes helpers the :per_page cell's option
|
|
7
|
+
module PerPageHelper
|
|
8
|
+
def per_page_options
|
|
9
|
+
OpenStruct.new(
|
|
10
|
+
per_page: per_page,
|
|
11
|
+
per_page_range: Decidim::Admin.per_page_range
|
|
12
|
+
)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# Renders the pagination dropdown menu in the admin panel.
|
|
16
|
+
def admin_filters_pagination
|
|
17
|
+
cell("decidim/admin/results_per_page", per_page_options)
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -32,6 +32,12 @@ module Decidim
|
|
|
32
32
|
Option.new(scope_type.id, translated_attribute(scope_type.name))
|
|
33
33
|
end
|
|
34
34
|
end
|
|
35
|
+
|
|
36
|
+
def organization_scope_depths(organization = current_organization)
|
|
37
|
+
organization.scope_types.map do |scope_type|
|
|
38
|
+
Option.new(scope_type.id, translated_attribute(scope_type.name))
|
|
39
|
+
end.reverse
|
|
40
|
+
end
|
|
35
41
|
end
|
|
36
42
|
end
|
|
37
43
|
end
|
|
@@ -26,9 +26,14 @@ module Decidim
|
|
|
26
26
|
if name == :amendments_visibility
|
|
27
27
|
amendments_visibility_form_field(form, options)
|
|
28
28
|
elsif attribute.translated?
|
|
29
|
-
|
|
29
|
+
form_method = form_method_for_attribute(attribute)
|
|
30
|
+
tab_options = { tabs_id: "#{options[:tabs_prefix]}-#{name}-tabs" }
|
|
31
|
+
extra_options = tab_options.merge(extra_options_for_type(form_method))
|
|
32
|
+
form.send(:translated, form_method, name, options.merge(extra_options))
|
|
30
33
|
else
|
|
31
|
-
|
|
34
|
+
form_method = form_method_for_attribute(attribute)
|
|
35
|
+
extra_options = extra_options_for(name).merge(extra_options_for_type(form_method))
|
|
36
|
+
form.send(form_method, name, options.merge(extra_options))
|
|
32
37
|
end
|
|
33
38
|
end
|
|
34
39
|
|
|
@@ -78,6 +83,17 @@ module Decidim
|
|
|
78
83
|
end
|
|
79
84
|
end
|
|
80
85
|
|
|
86
|
+
# Handles special cases.
|
|
87
|
+
# Returns an empty Hash or a Hash with extra HTML options.
|
|
88
|
+
def extra_options_for_type(input_type)
|
|
89
|
+
case input_type
|
|
90
|
+
when :text_area
|
|
91
|
+
{ rows: 6 }
|
|
92
|
+
else
|
|
93
|
+
{}
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
|
|
81
97
|
# Marks :participatory_texts_enabled setting with a CSS class if the
|
|
82
98
|
# Proposals component has existing proposals, so it can be identified
|
|
83
99
|
# in "decidim/admin/form.js". Also, adds a help_text.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Decidim
|
|
4
|
+
module Admin
|
|
5
|
+
module UserRolesHelper
|
|
6
|
+
def user_role_config
|
|
7
|
+
return @user_role_config if @user_role_config
|
|
8
|
+
|
|
9
|
+
space = current_participatory_space
|
|
10
|
+
@user_role_config = if current_user.admin?
|
|
11
|
+
space.user_role_config_for(current_user, :organization_admin)
|
|
12
|
+
else
|
|
13
|
+
role = space.user_roles.find_by(user: current_user)
|
|
14
|
+
space.user_role_config_for(current_user, role&.role)
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -16,14 +16,20 @@ module Decidim
|
|
|
16
16
|
return permission_action
|
|
17
17
|
end
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
if user_manager?
|
|
20
|
+
begin
|
|
21
|
+
allow! if user_manager_permissions.allowed?
|
|
22
|
+
rescue Decidim::PermissionAction::PermissionNotSetError
|
|
23
|
+
nil
|
|
24
|
+
end
|
|
25
|
+
end
|
|
20
26
|
|
|
21
|
-
allow! if user_can_enter_space_area?
|
|
27
|
+
allow! if user_can_enter_space_area?(require_admin_terms_accepted: true)
|
|
22
28
|
|
|
23
29
|
read_admin_dashboard_action?
|
|
24
30
|
apply_newsletter_permissions_for_admin!
|
|
25
31
|
|
|
26
|
-
if user.admin?
|
|
32
|
+
if user.admin? && admin_terms_accepted?
|
|
27
33
|
allow! if read_admin_log_action?
|
|
28
34
|
allow! if static_page_action?
|
|
29
35
|
allow! if organization_action?
|
|
@@ -66,6 +72,7 @@ module Decidim
|
|
|
66
72
|
end
|
|
67
73
|
|
|
68
74
|
def apply_newsletter_permissions_for_admin!
|
|
75
|
+
return unless admin_terms_accepted?
|
|
69
76
|
return unless permission_action.subject == :newsletter
|
|
70
77
|
return allow! if user.admin?
|
|
71
78
|
return unless space_allows_admin_access?
|
|
@@ -157,15 +164,19 @@ module Decidim
|
|
|
157
164
|
@organization ||= context.fetch(:organization, nil) || context.fetch(:current_organization, nil)
|
|
158
165
|
end
|
|
159
166
|
|
|
160
|
-
def user_can_enter_space_area?
|
|
167
|
+
def user_can_enter_space_area?(**args)
|
|
161
168
|
return unless permission_action.action == :enter &&
|
|
162
169
|
permission_action.subject == :space_area
|
|
163
170
|
|
|
164
|
-
space_allows_admin_access_to_current_action?
|
|
171
|
+
space_allows_admin_access_to_current_action?(args)
|
|
165
172
|
end
|
|
166
173
|
|
|
167
|
-
def space_allows_admin_access_to_current_action?
|
|
174
|
+
def space_allows_admin_access_to_current_action?(require_admin_terms_accepted: false)
|
|
168
175
|
Decidim.participatory_space_manifests.any? do |manifest|
|
|
176
|
+
if manifest.name != :initiatives && require_admin_terms_accepted
|
|
177
|
+
next unless admin_terms_accepted?
|
|
178
|
+
end
|
|
179
|
+
|
|
169
180
|
new_permission_action = Decidim::PermissionAction.new(
|
|
170
181
|
action: permission_action.action,
|
|
171
182
|
scope: permission_action.scope,
|
|
@@ -181,6 +192,12 @@ module Decidim
|
|
|
181
192
|
Decidim::Admin::UserManagerPermissions.new(user, permission_action, context).permissions
|
|
182
193
|
end
|
|
183
194
|
|
|
195
|
+
def admin_terms_accepted?
|
|
196
|
+
return unless permission_action.scope == :admin
|
|
197
|
+
|
|
198
|
+
user&.admin_terms_accepted?
|
|
199
|
+
end
|
|
200
|
+
|
|
184
201
|
def available_authorization_handlers?
|
|
185
202
|
user.organization.available_authorization_handlers.any?
|
|
186
203
|
end
|
|
@@ -5,15 +5,22 @@ module Decidim
|
|
|
5
5
|
# A class used to find the recipients of the
|
|
6
6
|
# Newsletter depending on the params of the form
|
|
7
7
|
class NewsletterRecipients < Rectify::Query
|
|
8
|
-
#
|
|
8
|
+
# Syntactic sugar to initialize the class and return the queried objects.
|
|
9
|
+
#
|
|
9
10
|
# form - params to filter the query
|
|
10
|
-
def
|
|
11
|
-
|
|
11
|
+
def self.for(form)
|
|
12
|
+
new(form).query
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# Initializes the class.
|
|
16
|
+
#
|
|
17
|
+
# form - params to filter the query
|
|
18
|
+
def initialize(form)
|
|
12
19
|
@form = form
|
|
13
20
|
end
|
|
14
21
|
|
|
15
22
|
def query
|
|
16
|
-
recipients = Decidim::User.where(organization: @
|
|
23
|
+
recipients = Decidim::User.where(organization: @form.current_organization)
|
|
17
24
|
.where.not(newsletter_notifications_at: nil, email: nil, confirmed_at: nil)
|
|
18
25
|
.not_deleted
|
|
19
26
|
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<%= cell("decidim/announcement", admin_terms_announcement_args ) %>
|
|
2
|
+
|
|
3
|
+
<article class="card">
|
|
4
|
+
<div class="card-section grid-x grid-margin-x">
|
|
5
|
+
<div class="cell medium-12">
|
|
6
|
+
|
|
7
|
+
<div class="content">
|
|
8
|
+
<%= admin_terms_of_use_body %>
|
|
9
|
+
</div>
|
|
10
|
+
</div>
|
|
11
|
+
|
|
12
|
+
<% unless current_user.admin_terms_accepted? %>
|
|
13
|
+
<h4 class="cell medium-12 text-center">
|
|
14
|
+
<%= t("decidim.admin.admin_terms_of_use.actions.title") %>
|
|
15
|
+
</h4>
|
|
16
|
+
|
|
17
|
+
<div class="cell medium-6 small-order-2 medium-order-1 text-center">
|
|
18
|
+
<%= button_to_refuse_admin_terms %>
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
<div class="cell medium-6 small-order-1 medium-order-2 text-center">
|
|
22
|
+
<%= button_to_accept_admin_terms %>
|
|
23
|
+
</div>
|
|
24
|
+
<% end %>
|
|
25
|
+
</div>
|
|
26
|
+
</article>
|
|
@@ -1,39 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
<%=
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
<% if user_role_config.component_is_accessible?(component.manifest_name) %>
|
|
2
|
+
<tr class="component-<%= component.id %>">
|
|
3
|
+
<td>
|
|
4
|
+
<%= link_to main_component_path(component), target: "_blank" do %>
|
|
5
|
+
<%= translated_attribute component.name %>
|
|
6
|
+
<% end %>
|
|
7
|
+
</td>
|
|
8
|
+
<td>
|
|
9
|
+
<%= t "decidim.components.#{component.manifest.name}.name" %>
|
|
10
|
+
</td>
|
|
11
|
+
<td class="table-list__actions">
|
|
12
|
+
<% if component.manifest.admin_engine %>
|
|
13
|
+
<%= icon_link_to "pencil", manage_component_path(component), t("actions.manage", scope: "decidim.admin"), class: "action-icon--manage" %>
|
|
14
|
+
<% end %>
|
|
14
15
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
<% if allowed_to?(:update, :component, component: component) %>
|
|
17
|
+
<% if component.published? %>
|
|
18
|
+
<%= icon_link_to "x", url_for(action: :unpublish, id: component, controller: "components"), t("actions.unpublish", scope: "decidim.admin"), class: "action-icon--unpublish", method: :put %>
|
|
19
|
+
<% else %>
|
|
20
|
+
<%= icon_link_to "check", url_for(action: :publish, id: component, controller: "components"), t("actions.publish", scope: "decidim.admin"), class: "action-icon--publish", method: :put %>
|
|
21
|
+
<% end %>
|
|
20
22
|
<% end %>
|
|
21
|
-
<% end %>
|
|
22
23
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
<% if allowed_to? :update, :component, component: component %>
|
|
25
|
+
<%= icon_link_to "cog", url_for(action: :edit, id: component, controller: "components"), t("actions.configure", scope: "decidim.admin"), class: "action-icon--configure" %>
|
|
26
|
+
<% end %>
|
|
26
27
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
<% if allowed_to? :update, :component, component: component %>
|
|
29
|
+
<% if component.manifest.actions.empty? %>
|
|
30
|
+
<%= icon "key", class: "action-icon action-icon--disabled" %>
|
|
31
|
+
<% else %>
|
|
32
|
+
<%= icon_link_to "key", url_for(action: :edit, component_id: component, controller: "component_permissions"), t("actions.permissions", scope: "decidim.admin"), class: "action-icon--permissions" %>
|
|
33
|
+
<% end %>
|
|
32
34
|
<% end %>
|
|
33
|
-
<% end %>
|
|
34
35
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
</tr>
|
|
36
|
+
<% if allowed_to? :destroy, :component, component: component %>
|
|
37
|
+
<%= 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 %>
|
|
38
|
+
<% end %>
|
|
39
|
+
</td>
|
|
40
|
+
</tr>
|
|
41
|
+
<% end %>
|
|
@@ -2,14 +2,16 @@
|
|
|
2
2
|
<div class="card-divider">
|
|
3
3
|
<h2 class="card-title">
|
|
4
4
|
<%= t("components.title", scope: "decidim.admin") %>
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
<
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
<% if allowed_to?(:create, :component) %>
|
|
6
|
+
<button class="dropdown tiny button button--title" data-toggle="add-component-dropdown"><%= t "components.index.add", scope: "decidim.admin" %></button>
|
|
7
|
+
<div class="dropdown-pane" id="add-component-dropdown" data-dropdown data-auto-focus="true" data-close-on-click="true">
|
|
8
|
+
<ul class="vertical menu add-components">
|
|
9
|
+
<% @manifests.each do |manifest| %>
|
|
10
|
+
<li><%= link_to t("#{manifest.name}.name", scope: "decidim.components"), new_component_path(type: manifest.name), class: manifest.name %></li>
|
|
11
|
+
<% end %>
|
|
12
|
+
</ul>
|
|
13
|
+
</div>
|
|
14
|
+
<% end %>
|
|
13
15
|
</h2>
|
|
14
16
|
</div>
|
|
15
17
|
|
|
@@ -1,8 +1,15 @@
|
|
|
1
|
+
|
|
1
2
|
<h2 class="card-title">
|
|
2
3
|
<%= t "decidim.admin.titles.dashboard" %>
|
|
3
4
|
</h2>
|
|
5
|
+
|
|
4
6
|
<div class="content">
|
|
5
7
|
<p><%= t ".welcome" %></p>
|
|
8
|
+
|
|
9
|
+
<% unless current_user.admin_terms_accepted? %>
|
|
10
|
+
<%= cell("decidim/announcement", admin_terms_announcement_args ) %>
|
|
11
|
+
<% end %>
|
|
12
|
+
|
|
6
13
|
<% if allowed_to? :read, :admin_log %>
|
|
7
14
|
<div class="row">
|
|
8
15
|
<h3 class="card-title">
|
|
@@ -13,4 +20,12 @@
|
|
|
13
20
|
<% end %>
|
|
14
21
|
</div>
|
|
15
22
|
<% end %>
|
|
23
|
+
|
|
24
|
+
<% if current_user.admin_terms_accepted? %>
|
|
25
|
+
<p class="text-right">
|
|
26
|
+
<small>
|
|
27
|
+
<%= link_to( t("title", scope: "decidim.admin.admin_terms_of_use"), admin_terms_show_path) %>
|
|
28
|
+
</small>
|
|
29
|
+
</p>
|
|
30
|
+
<% end %>
|
|
16
31
|
</div>
|
|
@@ -2,10 +2,16 @@
|
|
|
2
2
|
<div class="card-divider">
|
|
3
3
|
<h2 class="card-title">
|
|
4
4
|
<%= t ".title" %>
|
|
5
|
-
<% if allowed_to? :create, :newsletter %>
|
|
6
|
-
<%= 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" %>
|
|
7
|
-
<% end %>
|
|
8
5
|
</h2>
|
|
6
|
+
<div class="card-title">
|
|
7
|
+
<div class="text-right">
|
|
8
|
+
<strong class="subscribed_title"><%= t("newsletters.index.subscribed_count", scope: "decidim.admin") %></strong>
|
|
9
|
+
<span class="subscribed_count"><%= recipients_count_query %></span>
|
|
10
|
+
<% if allowed_to? :create, :newsletter %>
|
|
11
|
+
<%= 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" %>
|
|
12
|
+
<% end %>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
9
15
|
</div>
|
|
10
16
|
<div class="card-section">
|
|
11
17
|
<div class="table-scroll">
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
<%= decidim_form_for(@form, url: deliver_newsletter_path(@newsletter), method: :post, html: { class: "form newsletter_deliver" }) do |f| %>
|
|
1
|
+
<%= decidim_form_for(@form, url: deliver_newsletter_path(@newsletter), method: :post, html: { class: "form newsletter_deliver" }, data: { "recipients-count-newsletter-path": recipients_count_newsletter_path(@newsletter) }) do |f| %>
|
|
2
2
|
<div class="card">
|
|
3
3
|
|
|
4
4
|
<div class="card-divider">
|
|
5
5
|
<h2 class="card-title"><%= t ".title" %></h2>
|
|
6
6
|
</div>
|
|
7
7
|
<div class="card-section">
|
|
8
|
-
|
|
9
|
-
<%= t(".warning").html_safe %>
|
|
10
|
-
</div>
|
|
8
|
+
<%= cell("decidim/announcement", newsletter_attention_callout_args) %>
|
|
11
9
|
|
|
12
10
|
<div class="card">
|
|
13
11
|
<div class="card-divider">
|
|
@@ -63,6 +61,8 @@
|
|
|
63
61
|
</div>
|
|
64
62
|
<% end %>
|
|
65
63
|
|
|
64
|
+
<%= cell("decidim/announcement", newsletter_recipients_count_callout_args) %>
|
|
65
|
+
|
|
66
66
|
<div class="button--double form-general-submit">
|
|
67
67
|
<% if allowed_to?(:update, :newsletter, newsletter: @newsletter) && !@newsletter.sent? %>
|
|
68
68
|
<%= link_to t("actions.edit", scope: "decidim.admin"), ["edit", @newsletter], class: "button" %>
|
|
@@ -1,44 +1,8 @@
|
|
|
1
|
-
<div class="
|
|
2
|
-
<div class="column medium-3">
|
|
3
|
-
<span class="dropdown-menu-inverted_label"><%= t(".filter_by") %> :</span>
|
|
4
|
-
<ul class="dropdown menu dropdown-inverted" data-dropdown-menu data-close-on-click-inside="false">
|
|
5
|
-
<li class="is-dropdown-submenu-parent">
|
|
6
|
-
<a href="#">
|
|
7
|
-
<% if @state.present? %>
|
|
8
|
-
<%= t(".filter.#{@state}") %>
|
|
9
|
-
<% else %>
|
|
10
|
-
<%= t(".filter.all") %>
|
|
11
|
-
<% end %>
|
|
12
|
-
</a>
|
|
13
|
-
<ul class="menu is-dropdown-submenu">
|
|
14
|
-
<li><%= link_to t(".filter.officialized"), url_for(state: "officialized", q: @query) %></li>
|
|
15
|
-
<li><%= link_to t(".filter.not_officialized"), url_for(state: "not_officialized", q: @query) %></li>
|
|
16
|
-
<li><%= link_to t(".filter.all"), url_for(q: @query) %></li>
|
|
17
|
-
</ul>
|
|
18
|
-
</li>
|
|
19
|
-
</ul>
|
|
20
|
-
</div>
|
|
21
|
-
<div class="column medium-4">
|
|
22
|
-
<%= form_tag "", method: :get do %>
|
|
23
|
-
<div class="filters__search">
|
|
24
|
-
<div class="input-group">
|
|
25
|
-
<%= search_field_tag :q, @query,label: false, class: "input-group-field", placeholder: t(".search") %>
|
|
26
|
-
<%= hidden_field_tag :state, @state %>
|
|
27
|
-
<div class="input-group-button">
|
|
28
|
-
<button type="submit" class="button button--muted">
|
|
29
|
-
<%= icon "magnifying-glass", aria_label: t(".search") %>
|
|
30
|
-
</button>
|
|
31
|
-
</div>
|
|
32
|
-
</div>
|
|
33
|
-
</div>
|
|
34
|
-
<% end %>
|
|
35
|
-
</div>
|
|
36
|
-
</div>
|
|
37
|
-
|
|
38
|
-
<div class="card" id='user-groups'>
|
|
1
|
+
<div class="card with-overflow" id='user-groups'>
|
|
39
2
|
<div class="card-divider">
|
|
40
3
|
<h2 class="card-title"><%= t "decidim.admin.titles.participants" %></h2>
|
|
41
4
|
</div>
|
|
5
|
+
<%= admin_filter_selector %>
|
|
42
6
|
<div class="card-section">
|
|
43
7
|
<div class="table-scroll">
|
|
44
8
|
<table class="table-list">
|