decidim-admin 0.21.0 → 0.23.2
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.
- checksums.yaml +4 -4
- data/app/assets/javascripts/decidim/admin/application.js.es6 +7 -0
- data/app/assets/javascripts/decidim/admin/budget_rule_toggler.component.js.es6 +52 -0
- data/app/assets/javascripts/decidim/admin/bundle.js +26 -32
- data/app/assets/javascripts/decidim/admin/bundle.js.map +1 -1
- data/app/assets/javascripts/decidim/admin/choose_language.js +12 -0
- data/app/assets/javascripts/decidim/admin/dynamic_fields.component.js.es6 +24 -5
- data/app/assets/javascripts/decidim/admin/form.js.es6 +24 -10
- data/app/assets/javascripts/decidim/admin/gallery.js.es6 +5 -0
- data/app/assets/javascripts/decidim/admin/newsletters.js.es6 +4 -0
- data/app/assets/javascripts/decidim/admin/officializations.js.es6 +20 -0
- data/app/assets/javascripts/decidim/admin/scope_picker_enabler.component.js.es6 +14 -0
- data/app/assets/stylesheets/decidim/admin/_decidim.scss +2 -0
- data/app/assets/stylesheets/decidim/admin/_variables.scss +1 -1
- data/app/assets/stylesheets/decidim/admin/extra/_newsletter-templates-gallery.scss +3 -0
- data/app/assets/stylesheets/decidim/admin/extra/_organization-appearance.scss +141 -0
- data/app/assets/stylesheets/decidim/admin/extra/_show_email.scss +31 -0
- data/app/assets/stylesheets/decidim/admin/extra/_title_bar.scss +4 -0
- data/app/assets/stylesheets/decidim/admin/modules/_buttons.scss +11 -1
- data/app/assets/stylesheets/decidim/admin/modules/_callouts.scss +11 -0
- data/app/assets/stylesheets/decidim/admin/modules/_cards.scss +2 -2
- data/app/assets/stylesheets/decidim/admin/modules/_filters.scss +2 -2
- data/app/assets/stylesheets/decidim/admin/modules/_forms.scss +16 -2
- data/app/assets/stylesheets/decidim/admin/modules/_import_result.scss +10 -0
- data/app/assets/stylesheets/decidim/admin/modules/_loading-spinner.scss +19 -0
- data/app/assets/stylesheets/decidim/admin/modules/_main-nav.scss +0 -1
- data/app/assets/stylesheets/decidim/admin/modules/_modules.scss +5 -1
- data/app/assets/stylesheets/decidim/admin/modules/_process-header.scss +0 -1
- data/app/assets/stylesheets/decidim/admin/modules/_secondary-nav.scss +0 -1
- data/app/assets/stylesheets/decidim/admin/modules/_table-list.scss +0 -5
- data/app/assets/stylesheets/decidim/admin/modules/_tabs.scss +7 -0
- data/app/assets/stylesheets/decidim/admin/modules/_users_statistics.scss +18 -0
- data/app/assets/stylesheets/decidim/admin/utils/_mixins.scss +42 -0
- data/app/assets/stylesheets/decidim/admin/utils/_settings.scss +4 -1
- data/app/cells/decidim/admin/content_block/show.erb +2 -2
- data/app/commands/decidim/admin/create_attachment.rb +2 -2
- data/app/commands/decidim/admin/create_newsletter.rb +34 -9
- data/app/commands/decidim/admin/destroy_share_token.rb +46 -0
- data/app/commands/decidim/admin/reorder_content_blocks.rb +1 -1
- data/app/commands/decidim/admin/update_component.rb +27 -3
- data/app/commands/decidim/admin/update_content_block.rb +25 -1
- data/app/commands/decidim/admin/update_newsletter.rb +31 -9
- data/app/commands/decidim/admin/update_organization.rb +11 -0
- data/app/commands/decidim/admin/update_organization_appearance.rb +3 -1
- data/app/controllers/concerns/decidim/admin/participatory_space_export.rb +8 -2
- data/app/controllers/decidim/admin/application_controller.rb +1 -0
- data/app/controllers/decidim/admin/authorization_workflows_controller.rb +6 -0
- data/app/controllers/decidim/admin/components_controller.rb +17 -6
- data/app/controllers/decidim/admin/dashboard_controller.rb +33 -1
- data/app/controllers/decidim/admin/metrics_controller.rb +22 -0
- data/app/controllers/decidim/admin/newsletter_templates_controller.rb +41 -0
- data/app/controllers/decidim/admin/newsletters_controller.rb +32 -4
- data/app/controllers/decidim/admin/officializations_controller.rb +8 -0
- data/app/controllers/decidim/admin/organization_appearance_controller.rb +1 -0
- data/app/controllers/decidim/admin/organization_controller.rb +4 -3
- data/app/controllers/decidim/admin/organization_homepage_content_blocks_controller.rb +2 -1
- data/app/controllers/decidim/admin/share_tokens_controller.rb +30 -0
- data/app/forms/decidim/admin/attachment_form.rb +3 -0
- data/app/forms/decidim/admin/component_form.rb +5 -22
- data/app/forms/decidim/admin/newsletter_form.rb +15 -3
- data/app/forms/decidim/admin/organization_appearance_form.rb +7 -4
- data/app/forms/decidim/admin/organization_form.rb +20 -0
- data/app/forms/decidim/admin/participatory_space_private_user_csv_import_form.rb +13 -0
- data/app/forms/decidim/admin/participatory_space_private_user_form.rb +3 -2
- data/app/forms/decidim/admin/selective_newsletter_form.rb +6 -0
- data/app/frontend/components/autocomplete.component.test.tsx +2 -1
- data/app/frontend/components/autocomplete.component.tsx +29 -0
- data/app/helpers/decidim/admin/application_helper.rb +1 -0
- data/app/helpers/decidim/admin/filterable_helper.rb +35 -27
- data/app/helpers/decidim/admin/icon_link_helper.rb +1 -1
- data/app/helpers/decidim/admin/newsletters_helper.rb +3 -1
- data/app/helpers/decidim/admin/resource_scope_helper.rb +43 -0
- data/app/helpers/decidim/admin/settings_helper.rb +52 -59
- data/app/helpers/decidim/admin/uploader_image_dimensions_helper.rb +30 -0
- data/app/models/decidim/admin/fake_newsletter.rb +49 -0
- data/app/permissions/decidim/admin/permissions.rb +7 -1
- data/app/presenters/decidim/admin/dashboard_metric_charts_presenter.rb +57 -0
- data/app/queries/decidim/admin/active_users_counter.rb +35 -0
- data/app/queries/decidim/admin/newsletter_recipients.rb +5 -8
- data/app/views/decidim/admin/attachment_collections/index.html.erb +1 -1
- data/app/views/decidim/admin/authorization_workflows/index.html.erb +1 -0
- data/app/views/decidim/admin/categories/index.html.erb +1 -1
- data/app/views/decidim/admin/components/_component.html.erb +5 -0
- data/app/views/decidim/admin/components/_form.html.erb +4 -0
- data/app/views/decidim/admin/components/_settings_fields.html.erb +2 -2
- data/app/views/decidim/admin/components/index.html.erb +1 -0
- data/app/views/decidim/admin/dashboard/show.html.erb +35 -10
- data/app/views/decidim/admin/exports/_dropdown.html.erb +6 -2
- data/app/views/decidim/admin/impersonatable_users/index.html.erb +2 -2
- data/app/views/decidim/admin/metrics/_metrics.html.erb +21 -0
- data/app/views/decidim/admin/metrics/index.html.erb +7 -0
- data/app/views/decidim/admin/newsletter_templates/index.html.erb +28 -0
- data/app/views/decidim/admin/newsletter_templates/show.html.erb +12 -0
- data/app/views/decidim/admin/newsletters/_form.html.erb +1 -7
- data/app/views/decidim/admin/newsletters/edit.html.erb +1 -1
- data/app/views/decidim/admin/newsletters/index.html.erb +1 -1
- data/app/views/decidim/admin/newsletters/new.html.erb +1 -1
- data/app/views/decidim/admin/officializations/_show_email_modal.html.erb +31 -0
- data/app/views/decidim/admin/officializations/index.html.erb +7 -3
- data/app/views/decidim/admin/officializations/show_email.html.erb +2 -0
- data/app/views/decidim/admin/organization/_form.html.erb +21 -0
- data/app/views/decidim/admin/organization_appearance/_form.html.erb +2 -72
- data/app/views/decidim/admin/organization_appearance/form/_colors.html.erb +23 -0
- data/app/views/decidim/admin/organization_appearance/form/_images.html.erb +38 -0
- data/app/views/decidim/admin/organization_appearance/form/_minimap.html.erb +46 -0
- data/app/views/decidim/admin/resource_permissions/_options_form.html.erb +1 -1
- data/app/views/decidim/admin/share_tokens/_share_tokens.html.erb +57 -0
- data/app/views/decidim/admin/shared/_filters.html.erb +3 -3
- data/app/views/decidim/admin/shared/_gallery.html.erb +21 -0
- data/app/views/decidim/admin/static_pages/_form.html.erb +1 -1
- data/app/views/decidim/admin/user_groups/index.html.erb +4 -4
- data/app/views/decidim/admin/users_statistics/_users_count.html.erb +39 -0
- data/app/views/layouts/decidim/admin/_application.html.erb +1 -0
- data/app/views/layouts/decidim/admin/_header.html.erb +3 -0
- data/app/views/layouts/decidim/admin/_title_bar.html.erb +20 -10
- data/app/views/layouts/decidim/admin/newsletters.erb +1 -1
- data/config/locales/am-ET.yml +1 -0
- data/config/locales/ar.yml +12 -45
- data/config/locales/bg-BG.yml +16 -0
- data/config/locales/bg.yml +131 -0
- data/config/locales/ca.yml +84 -46
- data/config/locales/cs.yml +175 -137
- data/config/locales/da-DK.yml +1 -0
- data/config/locales/da.yml +1 -0
- data/config/locales/de.yml +150 -56
- data/config/locales/el.yml +814 -0
- data/config/locales/en.yml +84 -46
- data/config/locales/eo-UY.yml +0 -1
- data/config/locales/eo.yml +51 -0
- data/config/locales/es-MX.yml +84 -46
- data/config/locales/es-PY.yml +84 -46
- data/config/locales/es.yml +84 -46
- data/config/locales/et-EE.yml +1 -0
- data/config/locales/et.yml +1 -0
- data/config/locales/eu.yml +30 -59
- data/config/locales/fi-plain.yml +84 -46
- data/config/locales/fi.yml +98 -60
- data/config/locales/fr-CA.yml +847 -0
- data/config/locales/fr.yml +126 -51
- data/config/locales/ga-IE.yml +1 -0
- data/config/locales/gl.yml +156 -42
- data/config/locales/hr-HR.yml +1 -0
- data/config/locales/hr.yml +1 -0
- data/config/locales/hu.yml +55 -46
- data/config/locales/id-ID.yml +12 -41
- data/config/locales/is-IS.yml +10 -42
- data/config/locales/is.yml +568 -0
- data/config/locales/it.yml +106 -85
- data/config/locales/ja-JP.yml +855 -0
- data/config/locales/ja.yml +847 -0
- data/config/locales/ko-KR.yml +1 -0
- data/config/locales/ko.yml +1 -0
- data/config/locales/lt-LT.yml +1 -0
- data/config/locales/lt.yml +1 -0
- data/config/locales/lv.yml +795 -0
- data/config/locales/mt-MT.yml +1 -0
- data/config/locales/mt.yml +1 -0
- data/config/locales/nl.yml +74 -46
- data/config/locales/no.yml +108 -83
- data/config/locales/om-ET.yml +1 -0
- data/config/locales/pl.yml +354 -233
- data/config/locales/pt-BR.yml +13 -42
- data/config/locales/pt.yml +321 -231
- data/config/locales/ro-RO.yml +810 -0
- data/config/locales/ru.yml +11 -44
- data/config/locales/si-LK.yml +1 -0
- data/config/locales/sk-SK.yml +823 -0
- data/config/locales/sk.yml +802 -0
- data/config/locales/sl.yml +162 -0
- data/config/locales/so-SO.yml +1 -0
- data/config/locales/sr-CS.yml +586 -0
- data/config/locales/sv.yml +134 -54
- data/config/locales/sw-KE.yml +1 -0
- data/config/locales/ti-ER.yml +1 -0
- data/config/locales/tr-TR.yml +139 -50
- data/config/locales/uk.yml +10 -42
- data/config/locales/vi-VN.yml +1 -0
- data/config/locales/vi.yml +1 -0
- data/config/locales/zh-CN.yml +845 -0
- data/config/locales/zh-TW.yml +1 -0
- data/config/routes.rb +14 -3
- data/lib/decidim/admin/engine.rb +12 -9
- data/lib/decidim/admin/form_builder.rb +2 -2
- data/lib/decidim/admin/test/manage_attachment_collections_examples.rb +1 -1
- data/lib/decidim/admin/test/manage_component_permissions_examples.rb +15 -15
- data/lib/decidim/admin/version.rb +1 -1
- metadata +85 -33
- data/app/commands/decidim/admin/create_oauth_application.rb +0 -36
- data/app/commands/decidim/admin/destroy_oauth_application.rb +0 -39
- data/app/commands/decidim/admin/update_oauth_application.rb +0 -39
- data/app/controllers/decidim/admin/oauth_applications_controller.rb +0 -90
- data/app/forms/decidim/admin/oauth_application_form.rb +0 -32
- data/app/views/decidim/admin/oauth_applications/_form.html.erb +0 -19
- data/app/views/decidim/admin/oauth_applications/edit.html.erb +0 -13
- data/app/views/decidim/admin/oauth_applications/index.html.erb +0 -40
- data/app/views/decidim/admin/oauth_applications/new.html.erb +0 -13
- data/app/views/decidim/admin/oauth_applications/show.html.erb +0 -27
@@ -1,36 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Decidim
|
4
|
-
module Admin
|
5
|
-
# Creates an OAuthApplication.
|
6
|
-
class CreateOAuthApplication < Rectify::Command
|
7
|
-
# Initializes the command.
|
8
|
-
#
|
9
|
-
# form - The source fo data for this OAuthApplication.
|
10
|
-
def initialize(form)
|
11
|
-
@form = form
|
12
|
-
end
|
13
|
-
|
14
|
-
def call
|
15
|
-
return broadcast(:invalid) unless @form.valid?
|
16
|
-
|
17
|
-
@application = Decidim.traceability.create!(
|
18
|
-
OAuthApplication,
|
19
|
-
@form.current_user,
|
20
|
-
name: @form.name,
|
21
|
-
organization_name: @form.organization_name,
|
22
|
-
organization_url: @form.organization_url,
|
23
|
-
organization_logo: @form.organization_logo,
|
24
|
-
redirect_uri: @form.redirect_uri,
|
25
|
-
scopes: "public",
|
26
|
-
organization: @form.current_organization
|
27
|
-
)
|
28
|
-
|
29
|
-
broadcast(:ok, @application)
|
30
|
-
rescue ActiveRecord::RecordInvalid
|
31
|
-
@form.errors.add(:organization_logo, @application.errors[:organization_logo]) if @application.errors.include? :organization_logo
|
32
|
-
broadcast(:invalid)
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
@@ -1,39 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Decidim
|
4
|
-
module Admin
|
5
|
-
# This command deals with destroying an application from the admin panel.
|
6
|
-
class DestroyOAuthApplication < Rectify::Command
|
7
|
-
# Public: Initializes the command.
|
8
|
-
#
|
9
|
-
# application - The OAuthApplication to be destroyed.
|
10
|
-
# user - The user that destroys the application.
|
11
|
-
def initialize(application, current_user)
|
12
|
-
@application = application
|
13
|
-
@current_user = current_user
|
14
|
-
end
|
15
|
-
|
16
|
-
# Public: Executes the command.
|
17
|
-
#
|
18
|
-
# Broadcasts :ok if it got destroyed
|
19
|
-
def call
|
20
|
-
destroy_application
|
21
|
-
broadcast(:ok)
|
22
|
-
end
|
23
|
-
|
24
|
-
private
|
25
|
-
|
26
|
-
attr_reader :application, :current_user
|
27
|
-
|
28
|
-
def destroy_application
|
29
|
-
Decidim.traceability.perform_action!(
|
30
|
-
"delete",
|
31
|
-
application,
|
32
|
-
current_user
|
33
|
-
) do
|
34
|
-
application.destroy!
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
@@ -1,39 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Decidim
|
4
|
-
module Admin
|
5
|
-
# Updates the OAuth application given form data.
|
6
|
-
class UpdateOAuthApplication < Rectify::Command
|
7
|
-
# Initializes the command.
|
8
|
-
#
|
9
|
-
# application - The OAuthApplication to update.
|
10
|
-
# form - The form object containing the data to update.
|
11
|
-
# user - The user that updates the application.
|
12
|
-
def initialize(application, form, user)
|
13
|
-
@application = application
|
14
|
-
@form = form
|
15
|
-
@user = user
|
16
|
-
end
|
17
|
-
|
18
|
-
def call
|
19
|
-
return broadcast(:invalid) unless @form.valid?
|
20
|
-
return broadcast(:invalid) unless @user.organization == @application.organization
|
21
|
-
|
22
|
-
@application = Decidim.traceability.update!(
|
23
|
-
@application,
|
24
|
-
@user,
|
25
|
-
name: @form.name,
|
26
|
-
organization_name: @form.organization_name,
|
27
|
-
organization_url: @form.organization_url,
|
28
|
-
organization_logo: @form.organization_logo,
|
29
|
-
redirect_uri: @form.redirect_uri
|
30
|
-
)
|
31
|
-
|
32
|
-
broadcast(:ok, @application)
|
33
|
-
rescue ActiveRecord::RecordInvalid
|
34
|
-
@form.errors.add(:organization_logo, @application.errors[:organization_logo]) if @application.errors.include? :organization_logo
|
35
|
-
broadcast(:invalid)
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
@@ -1,90 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Decidim
|
4
|
-
module Admin
|
5
|
-
# Controller that allows managing OAuth applications at the admin panel.
|
6
|
-
#
|
7
|
-
class OAuthApplicationsController < Admin::ApplicationController
|
8
|
-
def index
|
9
|
-
enforce_permission_to :read, :oauth_application
|
10
|
-
@oauth_applications = collection.page(params[:page]).per(15)
|
11
|
-
end
|
12
|
-
|
13
|
-
def show
|
14
|
-
@oauth_application = collection.find(params[:id])
|
15
|
-
enforce_permission_to :read, :oauth_application
|
16
|
-
end
|
17
|
-
|
18
|
-
def new
|
19
|
-
enforce_permission_to :create, :oauth_application
|
20
|
-
@form = form(OAuthApplicationForm).instance
|
21
|
-
end
|
22
|
-
|
23
|
-
def create
|
24
|
-
enforce_permission_to :create, :oauth_application
|
25
|
-
|
26
|
-
@form = form(OAuthApplicationForm).from_params(params)
|
27
|
-
|
28
|
-
CreateOAuthApplication.call(@form) do
|
29
|
-
on(:ok) do
|
30
|
-
flash[:notice] = I18n.t("oauth_applications.create.success", scope: "decidim.admin")
|
31
|
-
redirect_to action: :index
|
32
|
-
end
|
33
|
-
|
34
|
-
on(:invalid) do
|
35
|
-
flash.now[:alert] = I18n.t("oauth_applications.create.error", scope: "decidim.admin")
|
36
|
-
render :new
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
def edit
|
42
|
-
@oauth_application = collection.find(params[:id])
|
43
|
-
enforce_permission_to :update, :oauth_application, oauth_application: @oauth_application
|
44
|
-
@form = form(OAuthApplicationForm).from_model(@oauth_application)
|
45
|
-
end
|
46
|
-
|
47
|
-
def update
|
48
|
-
@oauth_application = collection.find(params[:id])
|
49
|
-
enforce_permission_to :update, :oauth_application, oauth_application: @oauth_application
|
50
|
-
@form = form(OAuthApplicationForm).from_params({ organization_logo: @oauth_application.organization_logo }.merge(params.to_unsafe_h))
|
51
|
-
|
52
|
-
UpdateOAuthApplication.call(@oauth_application, @form, current_user) do
|
53
|
-
on(:ok) do |_application|
|
54
|
-
flash[:notice] = I18n.t("oauth_applications.update.success", scope: "decidim.admin")
|
55
|
-
redirect_to action: :index
|
56
|
-
end
|
57
|
-
|
58
|
-
on(:invalid) do |application|
|
59
|
-
@oauth_application = application
|
60
|
-
flash.now[:error] = I18n.t("oauth_applications.update.error", scope: "decidim.admin")
|
61
|
-
render action: :edit
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
def destroy
|
67
|
-
@oauth_application = collection.find(params[:id])
|
68
|
-
enforce_permission_to :destroy, :oauth_application, oauth_application: @oauth_application
|
69
|
-
|
70
|
-
DestroyOAuthApplication.call(@oauth_application, current_user) do
|
71
|
-
on(:ok) do
|
72
|
-
flash[:notice] = I18n.t("oauth_applications.destroy.success", scope: "decidim.admin")
|
73
|
-
redirect_to action: :index
|
74
|
-
end
|
75
|
-
|
76
|
-
on(:invalid) do
|
77
|
-
flash.now[:error] = I18n.t("oauth_applications.destroy.error", scope: "decidim.admin")
|
78
|
-
redirect_to :back
|
79
|
-
end
|
80
|
-
end
|
81
|
-
end
|
82
|
-
|
83
|
-
private
|
84
|
-
|
85
|
-
def collection
|
86
|
-
@collection ||= current_organization.oauth_applications
|
87
|
-
end
|
88
|
-
end
|
89
|
-
end
|
90
|
-
end
|
@@ -1,32 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Decidim
|
4
|
-
module Admin
|
5
|
-
# The form that validates the data to construct a valid OAuthApplication.
|
6
|
-
class OAuthApplicationForm < Decidim::Form
|
7
|
-
mimic :oauth_application
|
8
|
-
|
9
|
-
attribute :name, String
|
10
|
-
attribute :organization_name, String
|
11
|
-
attribute :organization_url, String
|
12
|
-
attribute :organization_logo
|
13
|
-
attribute :redirect_uri, String
|
14
|
-
|
15
|
-
validates :name, :redirect_uri, :current_user, :current_organization, :organization_name, :organization_url, :organization_logo, presence: true
|
16
|
-
validates :organization_logo,
|
17
|
-
file_size: { less_than_or_equal_to: ->(_record) { Decidim.maximum_attachment_size } },
|
18
|
-
file_content_type: { allow: ["image/jpeg", "image/png"] }
|
19
|
-
validate :redirect_uri_is_ssl
|
20
|
-
|
21
|
-
private
|
22
|
-
|
23
|
-
def redirect_uri_is_ssl
|
24
|
-
return if redirect_uri.blank?
|
25
|
-
|
26
|
-
uri = URI.parse(redirect_uri)
|
27
|
-
|
28
|
-
errors.add(:redirect_uri, :must_be_ssl) if uri.host != "localhost" && uri.scheme != "https"
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
@@ -1,19 +0,0 @@
|
|
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>
|
@@ -1,13 +0,0 @@
|
|
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 %>
|
@@ -1,40 +0,0 @@
|
|
1
|
-
<div class="card">
|
2
|
-
<div class="card-divider">
|
3
|
-
<h2 class="card-title">
|
4
|
-
<%= t ".title" %>
|
5
|
-
<% if allowed_to?(:create, :oauth_application) %>
|
6
|
-
<%= 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" %>
|
7
|
-
<% end %>
|
8
|
-
</h2>
|
9
|
-
</div>
|
10
|
-
<div class="card-section">
|
11
|
-
<div class="table-scroll">
|
12
|
-
<table class="table-list">
|
13
|
-
<thead>
|
14
|
-
<tr>
|
15
|
-
<th><%= t("models.oauth_application.fields.name", scope: "decidim.admin") %></th>
|
16
|
-
<th><%= t("models.oauth_application.fields.created_at", scope: "decidim.admin") %></th>
|
17
|
-
<th></th>
|
18
|
-
</tr>
|
19
|
-
</thead>
|
20
|
-
<tbody>
|
21
|
-
<% @oauth_applications.each do |oauth_application| %>
|
22
|
-
<tr data-oauth_application-id="<%= oauth_application.id %>">
|
23
|
-
<td><%= link_to oauth_application.name, decidim_admin.oauth_application_path(oauth_application) %></td>
|
24
|
-
<td><%= l oauth_application.created_at, format: :long %></td>
|
25
|
-
<td class="table-list__actions">
|
26
|
-
<% if allowed_to?(:update, :oauth_application, oauth_application: oauth_application) %>
|
27
|
-
<%= icon_link_to "pencil", decidim_admin.edit_oauth_application_path(oauth_application), t("actions.edit", scope: "decidim.admin"), class: "edit" %>
|
28
|
-
<% end %>
|
29
|
-
|
30
|
-
<% if allowed_to?(:destroy, :oauth_application, oauth_application: oauth_application) %>
|
31
|
-
<%= 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" %>
|
32
|
-
<% end %>
|
33
|
-
</td>
|
34
|
-
</tr>
|
35
|
-
<% end %>
|
36
|
-
</tbody>
|
37
|
-
</table>
|
38
|
-
</div>
|
39
|
-
</div>
|
40
|
-
</div>
|
@@ -1,13 +0,0 @@
|
|
1
|
-
<%= decidim_form_for(@form, html: { class: "form new_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 %>
|
@@ -1,27 +0,0 @@
|
|
1
|
-
<div class="card">
|
2
|
-
<div class="card-divider">
|
3
|
-
<h2 class="card-title"><%= @oauth_application.name %></h2>
|
4
|
-
</div>
|
5
|
-
<div class="card-section">
|
6
|
-
<dl>
|
7
|
-
<%= display_for @oauth_application,
|
8
|
-
{ uid: :client_id },
|
9
|
-
{ secret: :client_secret },
|
10
|
-
:organization_name,
|
11
|
-
:organization_url,
|
12
|
-
:redirect_uri %>
|
13
|
-
|
14
|
-
<dt><%= display_label(@oauth_application, :authorize_url) %></dt>
|
15
|
-
<dd><%= decidim.oauth_authorization_url(host: @oauth_application.owner.host) %></dd>
|
16
|
-
|
17
|
-
<dt><%= display_label(@oauth_application, :site) %></dt>
|
18
|
-
<dd><%= decidim.root_url(host: @oauth_application.owner.host) %></dd>
|
19
|
-
|
20
|
-
<dt><%= display_label(@oauth_application, :authorized_tokens) %></dt>
|
21
|
-
<dd><%= @oauth_application.authorized_tokens.count %></dd>
|
22
|
-
|
23
|
-
<dt><%= display_label(@oauth_application, :authorization_url) %></dt>
|
24
|
-
<dd><%= decidim.oauth_authorization_url(host: @oauth_application.owner.host, client_id: @oauth_application.uid, redirect_uri: @oauth_application.redirect_uri, response_type: "code") %></dd>
|
25
|
-
</dl>
|
26
|
-
</div>
|
27
|
-
</div>
|