decidim-direct_verifications 1.0.2 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +24 -0
  3. data/app/commands/decidim/direct_verifications/verification/create_import.rb +5 -7
  4. data/app/controllers/concerns/decidim/direct_verifications/admin/needs_verification_snippets.rb +61 -0
  5. data/app/controllers/decidim/direct_verifications/verification/admin/application_controller.rb +15 -0
  6. data/app/controllers/decidim/direct_verifications/verification/admin/authorizations_controller.rb +1 -1
  7. data/app/controllers/decidim/direct_verifications/verification/admin/direct_verifications_controller.rb +1 -1
  8. data/app/controllers/decidim/direct_verifications/verification/admin/imports_controller.rb +1 -1
  9. data/app/controllers/decidim/direct_verifications/verification/admin/stats_controller.rb +2 -2
  10. data/app/controllers/decidim/direct_verifications/verification/admin/user_authorizations_controller.rb +64 -0
  11. data/app/jobs/decidim/direct_verifications/base_import_job.rb +6 -10
  12. data/app/packs/entrypoints/decidim_direct_verifications.js +4 -0
  13. data/app/packs/entrypoints/decidim_direct_verifications.scss +1 -0
  14. data/app/packs/entrypoints/decidim_direct_verifications_participants.js +1 -0
  15. data/app/packs/src/decidim/direct_verifications/admin/checkboxes.js +5 -0
  16. data/app/packs/src/decidim/direct_verifications/admin/participants.js +88 -0
  17. data/app/{assets/stylesheets/decidim/direct_verifications → packs/stylesheets/decidim/direct_verifications/admin}/authorizations.scss +1 -1
  18. data/app/permissions/decidim/direct_verifications/admin/permissions.rb +19 -0
  19. data/app/views/decidim/direct_verifications/verification/admin/authorizations/index.html.erb +1 -1
  20. data/app/views/decidim/direct_verifications/verification/admin/direct_verifications/index.html.erb +1 -1
  21. data/app/views/decidim/direct_verifications/verification/admin/imports/new.html.erb +1 -1
  22. data/app/views/decidim/direct_verifications/verification/admin/stats/index.html.erb +3 -1
  23. data/app/views/decidim/direct_verifications/verification/admin/user_authorizations/show.html.erb +27 -0
  24. data/config/assets.rb +25 -0
  25. data/config/locales/ca.yml +17 -0
  26. data/config/locales/cs.yml +17 -0
  27. data/config/locales/en.yml +35 -17
  28. data/config/locales/es.yml +17 -0
  29. data/config/locales/fr.yml +17 -0
  30. data/lib/decidim/direct_verifications/verification/admin.rb +2 -0
  31. data/lib/decidim/direct_verifications/verification/admin_engine.rb +9 -5
  32. data/lib/decidim/direct_verifications/version.rb +3 -3
  33. data/lib/decidim/direct_verifications.rb +6 -0
  34. data/package.json +192 -0
  35. metadata +19 -11
  36. data/app/assets/config/direct_verifications_admin_manifest.css +0 -3
  37. data/app/assets/config/direct_verifications_admin_manifest.js +0 -1
  38. data/app/assets/javascripts/decidim/direct_verifications/verification/admin/direct_verifications_admin.js.es6 +0 -7
  39. data/app/uploaders/decidim/direct_verifications/csv_uploader.rb +0 -16
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 42d98e0b62840fec678713b3538cc6c6bc10c1a76e813e02e0ce6a848b65924e
4
- data.tar.gz: 811a6783064250e01d8bed38e68495a341774ce7a86c1927e65719263c465f6a
3
+ metadata.gz: 1514f9aa82192dacd5a606881dd726fdd2149d9fe8420f894a3204092a4c4abf
4
+ data.tar.gz: dd8208ff309e9b749e994462e503afb68a1b27c500247d321b2da16deaa16eed
5
5
  SHA512:
6
- metadata.gz: 96b417c297794fa7c6e8cef31d7627b0cfe961e10005a3f6eaa57a42f46830d408f021f850ff949daa1756884cb814985af6f0a789c566403faca55d80f4804b
7
- data.tar.gz: b0ca0ef2dc79844b1d3d1ff48284debe43c32d0f581fb33ef868d9a9707f46ff82dc30914670c1ce0a8ad9e7e5d27dde577bb05f2327df2f489a7336643af90b
6
+ metadata.gz: 35b46513a89adf693cfbfc1712b4ea002455a024fedc137e211a1dc59748d3f6289f0a7894b2203df843b7b321dbb8824e1cc4bd2cc094b08e4fd77f7e276212
7
+ data.tar.gz: af41ee36b280fb03a1827cb0157c9c5dd95013c1df5944b1098b0663bd864e1f6e2240c27c9c68020d6e2b11ac633973f3b2b899205468c1a17d4d5e04a2ec23
data/README.md CHANGED
@@ -55,6 +55,28 @@ Decidim::DirectVerifications.configure do |config|
55
55
  end
56
56
  ```
57
57
 
58
+ ### Direct managements of user's authorizations
59
+
60
+ This plugin also provides a place for admins to see and manage (if configured) existing verifications for any user.
61
+ Admins can go to the "Participants" admin page and see a new management button, when clicked it shows a modal window with all the authorizations that this user has granted as well as the missing ones. If Direct Verfication is configured to manage that verification (through the `manage_workflows` config var) it can be granted or revoke just by clicking a button.
62
+
63
+ ![Participants mods](examples/participants.png)
64
+
65
+ ![Participants modal management](examples/authorization-modal.png)
66
+
67
+ This behavior can be disabled by disabling in a initializer the config var `participants_modal`.
68
+
69
+ **`config/initializers/decidim_verifications.rb`:**
70
+
71
+ ```ruby
72
+ # frozen_string_literal: true
73
+
74
+ Decidim::DirectVerifications.configure do |config|
75
+ # Disable participants direct verifications management
76
+ config.participants_modal = false
77
+ end
78
+ ```
79
+
58
80
  ## Installation
59
81
 
60
82
  Add this line to your application's Gemfile:
@@ -73,6 +95,8 @@ Depending on your Decidim version, you might want to specify the version to ensu
73
95
 
74
96
  | Direct Verifications version | Compatible Decidim versions |
75
97
  |---|---|
98
+ | 1.2 | >= 0.25.x |
99
+ | 1.1 | >= 0.25.x |
76
100
  | 1.0 | >= 0.23.x |
77
101
  | 0.22.x | 0.22.x |
78
102
 
@@ -15,7 +15,6 @@ module Decidim
15
15
  def call
16
16
  return broadcast(:invalid) unless form.valid?
17
17
 
18
- save_or_upload_file!
19
18
  case action
20
19
  when :register
21
20
  register_users_async(remove_file: true)
@@ -36,20 +35,19 @@ module Decidim
36
35
  attr_reader :form, :file, :organization, :user, :action
37
36
 
38
37
  def register_users_async(options = {})
39
- RegisterUsersJob.perform_later(secure_name, organization, user, form.authorization_handler, options)
38
+ RegisterUsersJob.perform_later(blob.id, organization, user, form.authorization_handler, options)
40
39
  end
41
40
 
42
41
  def revoke_users_async(options = {})
43
- RevokeUsersJob.perform_later(secure_name, organization, user, form.authorization_handler, options)
42
+ RevokeUsersJob.perform_later(blob.id, organization, user, form.authorization_handler, options)
44
43
  end
45
44
 
46
45
  def authorize_users_async(options = {})
47
- AuthorizeUsersJob.perform_later(secure_name, organization, user, form.authorization_handler, options)
46
+ AuthorizeUsersJob.perform_later(blob.id, organization, user, form.authorization_handler, options)
48
47
  end
49
48
 
50
- def save_or_upload_file!
51
- file.instance_variable_set(:@original_filename, secure_name)
52
- CsvUploader.new(organization).store!(file)
49
+ def blob
50
+ @blob ||= ActiveStorage::Blob.create_and_upload!(io: file, filename: secure_name)
53
51
  end
54
52
 
55
53
  def secure_name
@@ -0,0 +1,61 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "active_support/concern"
4
+
5
+ module Decidim
6
+ module DirectVerifications
7
+ module Admin
8
+ module NeedsVerificationSnippets
9
+ extend ActiveSupport::Concern
10
+
11
+ included do
12
+ helper_method :snippets
13
+ end
14
+
15
+ def snippets
16
+ return @snippets if @snippets
17
+
18
+ @snippets = Decidim::Snippets.new
19
+ return @snippets if Decidim::DirectVerifications.participants_modal.blank?
20
+
21
+ @snippets.add(:direct_verifications, "<script>DirectVerificationsConfig = #{direct_verifications_config.to_json}</script>")
22
+ @snippets.add(:direct_verifications, ActionController::Base.helpers.javascript_pack_tag("decidim_direct_verifications_participants"))
23
+ @snippets.add(:head, @snippets.for(:direct_verifications))
24
+
25
+ @snippets
26
+ end
27
+
28
+ def direct_verifications_config
29
+ {
30
+ buttonTitle: I18n.t("decidim.direct_verifications.participants.modal.button_title", locale: detect_current_locale),
31
+ modalTitle: I18n.t("decidim.direct_verifications.participants.modal.modal_title", locale: detect_current_locale),
32
+ closeModalLabel: I18n.t("decidim.direct_verifications.participants.modal.close_modal_label", locale: detect_current_locale),
33
+ statsLabel: I18n.t("decidim.direct_verifications.verification.admin.index.stats", locale: detect_current_locale),
34
+ userVerificationsPath: Decidim::DirectVerifications::Verification::AdminEngine.routes.url_helpers.user_authorization_path("-ID-"),
35
+ statsPath: Decidim::DirectVerifications::Verification::AdminEngine.routes.url_helpers.stats_path,
36
+ verifications: direct_verifications_verifications
37
+ }
38
+ end
39
+
40
+ def direct_verifications_verifications
41
+ @direct_verifications_verifications ||= Decidim::Authorization.where(name: current_organization.available_authorizations)
42
+ .where.not(granted_at: nil)
43
+ .where(decidim_user_id: filtered_collection).map do |auth|
44
+ {
45
+ id: auth.id,
46
+ userId: auth.decidim_user_id,
47
+ name: auth.name,
48
+ title: I18n.t("decidim.authorization_handlers.#{auth.name}.name", locale: detect_current_locale, default: auth.name),
49
+ createdAt: auth.created_at,
50
+ updatedAt: auth.updated_at
51
+ }
52
+ end
53
+ end
54
+
55
+ def detect_current_locale
56
+ params[:locale] || session[:user_locale] || locale
57
+ end
58
+ end
59
+ end
60
+ end
61
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module DirectVerifications
5
+ module Verification
6
+ module Admin
7
+ class ApplicationController < Decidim::Admin::ApplicationController
8
+ def permission_class_chain
9
+ [::Decidim::DirectVerifications::Admin::Permissions] + super
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -4,7 +4,7 @@ module Decidim
4
4
  module DirectVerifications
5
5
  module Verification
6
6
  module Admin
7
- class AuthorizationsController < Decidim::Admin::ApplicationController
7
+ class AuthorizationsController < ApplicationController
8
8
  layout "decidim/admin/users"
9
9
 
10
10
  def index
@@ -4,7 +4,7 @@ module Decidim
4
4
  module DirectVerifications
5
5
  module Verification
6
6
  module Admin
7
- class DirectVerificationsController < Decidim::Admin::ApplicationController
7
+ class DirectVerificationsController < ApplicationController
8
8
  include NeedsPermission
9
9
  helper_method :workflows, :current_authorization_handler
10
10
 
@@ -4,7 +4,7 @@ module Decidim
4
4
  module DirectVerifications
5
5
  module Verification
6
6
  module Admin
7
- class ImportsController < Decidim::Admin::ApplicationController
7
+ class ImportsController < ApplicationController
8
8
  layout "decidim/admin/users"
9
9
  helper_method :workflows, :current_authorization_handler
10
10
 
@@ -4,10 +4,10 @@ module Decidim
4
4
  module DirectVerifications
5
5
  module Verification
6
6
  module Admin
7
- class StatsController < Decidim::Admin::ApplicationController
7
+ class StatsController < ApplicationController
8
8
  include NeedsPermission
9
9
 
10
- layout "decidim/admin/users"
10
+ layout -> { request.xhr? ? false : "decidim/admin/users" }
11
11
 
12
12
  def index
13
13
  enforce_permission_to :index, :authorization
@@ -0,0 +1,64 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module DirectVerifications
5
+ module Verification
6
+ module Admin
7
+ class UserAuthorizationsController < ApplicationController
8
+ include NeedsPermission
9
+ layout false
10
+
11
+ helper_method :user, :authorizations, :authorization_for, :managed?
12
+
13
+ def show
14
+ enforce_permission_to :index, :authorization
15
+ end
16
+
17
+ def update
18
+ enforce_permission_to :create, :direct_authorization, name: params[:name]
19
+ handler = OpenStruct.new(handler_name: params[:name], user: user, unique_id: nil, metadata: {})
20
+ if Decidim::Authorization.create_or_update_from(handler)
21
+ flash[:notice] = t(".success", name: auth_name)
22
+ else
23
+ flash[:alert] = t(".error", name: auth_name)
24
+ end
25
+ redirect_to decidim_admin.officializations_path
26
+ end
27
+
28
+ def destroy
29
+ enforce_permission_to :destroy, :direct_authorization, name: params[:name]
30
+ begin
31
+ authorization_for(params[:name]).destroy!
32
+ flash[:notice] = t(".success", name: auth_name)
33
+ rescue StandardError => e
34
+ flash[:alert] = t(".error", name: auth_name, error: e.message)
35
+ end
36
+ redirect_to decidim_admin.officializations_path
37
+ end
38
+
39
+ private
40
+
41
+ def user
42
+ @user ||= Decidim::User.find_by(id: params[:id])
43
+ end
44
+
45
+ def authorizations
46
+ @authorizations ||= Decidim::Authorization.where(decidim_user_id: user.id)
47
+ end
48
+
49
+ def authorization_for(name)
50
+ authorizations.find_by(name: name)
51
+ end
52
+
53
+ def managed?(name)
54
+ Decidim::DirectVerifications.manage_workflows.include? name
55
+ end
56
+
57
+ def auth_name
58
+ t("decidim.authorization_handlers.#{params[:name]}.name", default: params[:name])
59
+ end
60
+ end
61
+ end
62
+ end
63
+ end
64
+ end
@@ -10,8 +10,8 @@ module Decidim
10
10
  class BaseImportJob < ApplicationJob
11
11
  queue_as :default
12
12
 
13
- def perform(filename, organization, current_user, authorization_handler, options = {})
14
- @filename = filename
13
+ def perform(blob_id, organization, current_user, authorization_handler, options = {})
14
+ @blob = ActiveStorage::Blob.find(blob_id)
15
15
  @organization = organization
16
16
  @current_user = current_user
17
17
  @authorization_handler = authorization_handler
@@ -20,7 +20,7 @@ module Decidim
20
20
  @emails = Parsers::MetadataParser.new(userslist).to_h
21
21
  @instrumenter = Instrumenter.new(current_user)
22
22
 
23
- Rails.logger.info "BaseImportJob: Processing file #{filename}"
23
+ Rails.logger.info "BaseImportJob: Processing file #{@blob.filename}"
24
24
  process_users
25
25
  send_email_notification
26
26
  rescue StandardError => e
@@ -31,14 +31,10 @@ module Decidim
31
31
 
32
32
  private
33
33
 
34
- attr_reader :uploader, :filename, :emails, :organization, :current_user, :instrumenter, :authorization_handler
34
+ attr_reader :blob, :emails, :organization, :current_user, :instrumenter, :authorization_handler
35
35
 
36
36
  def userslist
37
- return @userslist if @userslist
38
-
39
- @uploader = CsvUploader.new(organization)
40
- @uploader.retrieve_from_store!(filename)
41
- @userslist = @uploader.file.read.force_encoding("UTF-8")
37
+ @userslist ||= blob.download.force_encoding("UTF-8")
42
38
  end
43
39
 
44
40
  def send_email_notification
@@ -51,7 +47,7 @@ module Decidim
51
47
  end
52
48
 
53
49
  def remove_file!
54
- uploader.remove!
50
+ blob.purge
55
51
  end
56
52
  end
57
53
  end
@@ -0,0 +1,4 @@
1
+ import "src/decidim/direct_verifications/admin/checkboxes.js"
2
+
3
+ // CSS
4
+ import "entrypoints/decidim_direct_verifications.scss";
@@ -0,0 +1 @@
1
+ @import "stylesheets/decidim/direct_verifications/admin/authorizations";
@@ -0,0 +1 @@
1
+ import "src/decidim/direct_verifications/admin/participants.js"
@@ -0,0 +1,5 @@
1
+ $(() => {
2
+ $('[type="checkbox"]#register').change(function () {
3
+ $(this).closest("label").find(".callout").toggleClass("hide", !$(this).prop("checked"))
4
+ })
5
+ })
@@ -0,0 +1,88 @@
1
+ class VerificationUI {
2
+ constructor($table, config) {
3
+ this.$table = $table;
4
+ this.svgPath = $table.find("use[href]:first").attr("href").split("#")[0];
5
+ this.icon = "icon-key";
6
+ this.config = config;
7
+ this.$table.on("click", ".show-verifications-modal", (e) => this.toggleModal(e));
8
+ this.addModal();
9
+ }
10
+
11
+ addModal() {
12
+ this.$modal = $(`<div class="reveal" id="show-verifications-modal" data-reveal>
13
+ <div class="reveal__header">
14
+ <h3 class="reveal__title">${this.config.modalTitle}</h3>
15
+ <button class="close-button" data-close aria-label="${this.config.closeModalLabel}"
16
+ type="button">
17
+ <span aria-hidden="true">&times;</span>
18
+ </button>
19
+ </div>
20
+
21
+ <div class="row">
22
+ <div class="columns medium-4 medium-centered modal-body">
23
+ </div>
24
+ </div>
25
+ </div>`);
26
+ this.$table.after(this.$modal);
27
+ this.$title = $("#user-groups .card-title:first");
28
+ this.$modalBody = this.$modal.find(".modal-body");
29
+ this.reveal = new Foundation.Reveal(this.$modal);
30
+ }
31
+
32
+ drawButtons() {
33
+ this.$table.find("tbody tr").each((idx, tr) => {
34
+ const $lastTd = $(tr).find("td:last");
35
+
36
+ $lastTd.prepend(`<a class="action-icon action-icon action-icon show-verifications-modal" title="${this.config.buttonTitle}" href="#open-show-verifications-modal"><span class="has-tip ${this.getTrStatus(tr)}"><svg aria-label="${this.config.buttonTitle}" role="img" class="icon--ban icon">
37
+ <title>${this.config.buttonTitle}</title>
38
+ <use href="${this.svgPath}#${this.icon}"></use>
39
+ </svg></span></a>`);
40
+ });
41
+ }
42
+
43
+ addStatsTitle() {
44
+ // Add upper link to verification stats
45
+ const $a = $(`<a class="button tiny button--title" href="${this.config.statsPath}">${this.config.statsLabel}</a>`);
46
+ $a.on("click", (e) => {
47
+ e.preventDefault();
48
+ this.loadUrl($a.attr("href"), true);
49
+ });
50
+ this.$title.append($a);
51
+ }
52
+
53
+ getTrStatus(tr) {
54
+ return this.getUserVerifications($(tr).data("user-id")).length
55
+ ? "alert"
56
+ : "";
57
+ }
58
+
59
+ getVerification(id) {
60
+ return this.config.verifications.find((auth) => auth.id == id);
61
+ }
62
+
63
+ getUserVerifications(userId) {
64
+ return this.config.verifications.filter((auth) => auth.userId == userId);
65
+ }
66
+
67
+ toggleModal(e) {
68
+ const userId = $(e.target).closest("tr").data("user-id");
69
+ this.loadUrl(this.config.userVerificationsPath.replace("-ID-", userId));
70
+ }
71
+
72
+ loadUrl(url, large = false) {
73
+ this.$modal.removeClass("large");
74
+ if (large) {
75
+ this.$modal.addClass("large");
76
+ }
77
+ this.$modalBody.html('<span class="loading-spinner"></span>');
78
+ this.$modalBody.load(url);
79
+ this.$modal.foundation("toggle");
80
+ }
81
+ }
82
+
83
+ $(() => {
84
+ const ui = new VerificationUI($("#user-groups table.table-list"), DirectVerificationsConfig);
85
+ // Draw the icon buttons for checking verification statuses
86
+ ui.drawButtons();
87
+ ui.addStatsTitle();
88
+ });
@@ -1,4 +1,4 @@
1
- @import "decidim/admin/utils/settings";
1
+ @import "stylesheets/decidim/admin/utils/settings";
2
2
 
3
3
  $code-color: $black;
4
4
  $code-font-family: $font-family-monospace;
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module DirectVerifications
5
+ module Admin
6
+ class Permissions < Decidim::DefaultPermissions
7
+ def permissions
8
+ return permission_action if permission_action.scope != :admin
9
+ return permission_action unless user
10
+ return permission_action unless user.admin?
11
+
12
+ toggle_allow(Decidim::DirectVerifications.manage_workflows.map(&:to_s).include?(context.fetch(:name).to_s)) if permission_action.subject == :direct_authorization
13
+
14
+ permission_action
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -1,4 +1,4 @@
1
- <%= stylesheet_link_tag "decidim/direct_verifications/authorizations" %>
1
+ <%= stylesheet_pack_tag "decidim_direct_verifications" %>
2
2
 
3
3
  <div class="card">
4
4
  <div class="card-divider">
@@ -42,4 +42,4 @@
42
42
  </div>
43
43
  </div>
44
44
 
45
- <%= javascript_include_tag "decidim/direct_verifications/verification/admin/direct_verifications_admin" %>
45
+ <%= javascript_pack_tag "decidim_direct_verifications" %>
@@ -47,4 +47,4 @@
47
47
  </div>
48
48
  </div>
49
49
 
50
- <%= javascript_include_tag "decidim/direct_verifications/verification/admin/direct_verifications_admin" %>
50
+ <%= javascript_pack_tag "decidim_direct_verifications" %>
@@ -2,7 +2,9 @@
2
2
  <div class="card-divider">
3
3
  <h2 class="card-title">
4
4
  <%= t("admin.index.stats", scope: "decidim.direct_verifications.verification") %>
5
- <%= link_to t("admin.index.title", scope: "decidim.direct_verifications.verification"), direct_verifications_path, class: "button tiny button--title" %>
5
+ <% unless request.xhr? %>
6
+ <%= link_to t("admin.index.title", scope: "decidim.direct_verifications.verification"), direct_verifications_path, class: "button tiny button--title" %>
7
+ <% end %>
6
8
  </h2>
7
9
  </div>
8
10
  <div class="card-section">
@@ -0,0 +1,27 @@
1
+ <strong><%= user.name %>:</strong>
2
+ <table class="table-list">
3
+ <tbody>
4
+ <% current_organization.available_authorizations.each do |name| %>
5
+ <% authorization = authorization_for(name) %>
6
+ <tr>
7
+ <td><%= I18n.t("decidim.authorization_handlers.#{name}.name", default: name) %></td>
8
+ <td>
9
+ <% if authorization&.granted? %>
10
+ <span class="label success"><%= t ".granted" %></span>
11
+ <% else %>
12
+ <span class="label alert"><%= t ".not_granted" %></span>
13
+ <% end %>
14
+ </td>
15
+ <td class="table-list__actions">
16
+ <% if managed?(name) %>
17
+ <% if authorization&.granted? %>
18
+ <%= icon_link_to "circle-x", user_authorization_path(user, name: name), t(".revoke"), method: :delete, role: "img", aria_label: t(".revoke") %>
19
+ <% else %>
20
+ <%= icon_link_to "circle-check", user_authorization_path(user, name: name), t(".grant"), method: :patch, role: "img", aria_label: t(".grant") %>
21
+ <% end %>
22
+ <% end %>
23
+ </td>
24
+ </tr>
25
+ <% end %>
26
+ </tbody>
27
+ </table>
data/config/assets.rb ADDED
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is located at `config/assets.rb` of your module.
4
+
5
+ # Define the base path of your module. Please note that `Rails.root` may not be
6
+ # used because we are not inside the Rails environment when this file is loaded.
7
+ base_path = File.expand_path("..", __dir__)
8
+
9
+ # Register an additional load path for webpack. All the assets within these
10
+ # directories will be available for inclusion within the Decidim assets. For
11
+ # example, if you have `app/packs/src/decidim/foo.js`, you can include that file
12
+ # in your JavaScript entrypoints (or other JavaScript files within Decidim)
13
+ # using `import "src/decidim/foo"` after you have registered the additional path
14
+ # as follows.
15
+ Decidim::Webpacker.register_path("#{base_path}/app/packs")
16
+
17
+ # Register the entrypoints for your module. These entrypoints can be included
18
+ # within your application using `javascript_pack_tag` and if you include any
19
+ # SCSS files within the entrypoints, they become available for inclusion using
20
+ # `stylesheet_pack_tag`.
21
+ Decidim::Webpacker.register_entrypoints(
22
+ decidim_direct_verifications: "#{base_path}/app/packs/entrypoints/decidim_direct_verifications.js",
23
+ decidim_direct_verifications_participants: "#{base_path}/app/packs/entrypoints/decidim_direct_verifications_participants.js",
24
+ decidim_direct_verifications_css: "#{base_path}/app/packs/entrypoints/decidim_direct_verifications.scss"
25
+ )
@@ -18,6 +18,11 @@ ca:
18
18
  explanation: Verificació manual per part de les administradores de l'organització
19
19
  name: Verificació directa
20
20
  direct_verifications:
21
+ participants:
22
+ modal:
23
+ button_title: Veure autoritzacions
24
+ modal_close_button: Tanca
25
+ modal_title: Autoritzacions disponibles
21
26
  verification:
22
27
  admin:
23
28
  authorizations:
@@ -70,6 +75,18 @@ ca:
70
75
  global: "- Qualsevol mètode de verificació -"
71
76
  registered: Registrades
72
77
  unconfirmed: No confirmades
78
+ user_authorizations:
79
+ destroy:
80
+ error: Error al esborrar l'autorització %{name} (%{message})
81
+ success: La verificació %{name} ha estat eliminada correctament
82
+ show:
83
+ grant: Autoritza la usuària fent servir aquest mètode
84
+ granted: Concedida
85
+ not_granted: No concedida
86
+ revoke: Revoca l'autorització
87
+ update:
88
+ error: No s'ha pogut autoritzar la usuària usant el mètode %{name}
89
+ success: Usuària autoritzada correctament amb %{name}
73
90
  authorizations:
74
91
  new:
75
92
  no_action: Aquest mètode requereix que una administradora us verifiqui
@@ -18,6 +18,11 @@ cs:
18
18
  explanation: Ruční ověření správcem organizace
19
19
  name: Přímé ověření
20
20
  direct_verifications:
21
+ participants:
22
+ modal:
23
+ button_title: See authorizations
24
+ modal_close_button: Close
25
+ modal_title: Available authorizations
21
26
  verification:
22
27
  admin:
23
28
  authorizations:
@@ -70,6 +75,18 @@ cs:
70
75
  global: "- Jakákoli metoda ověřování -"
71
76
  registered: Registrován
72
77
  unconfirmed: Nepotvrzeno
78
+ user_authorizations:
79
+ destroy:
80
+ error: Error while trying to delete the authorization %{name} (%{message})
81
+ success: Authorization %{name} deleted successfully
82
+ show:
83
+ grant: Authorize user with this method
84
+ granted: Granted
85
+ not_granted: Not granted
86
+ revoke: Revoke the authorization
87
+ update:
88
+ error: Error while trying to authorize the user using %{name}
89
+ success: User authorized successfully using %{name}
73
90
  authorizations:
74
91
  new:
75
92
  no_action: Tato metoda vyžaduje administrátora, který vás ověřuje
@@ -19,6 +19,11 @@ en:
19
19
  explanation: Manual verification by the administrators of the organization
20
20
  name: Direct verification
21
21
  direct_verifications:
22
+ participants:
23
+ modal:
24
+ button_title: See authorizations
25
+ modal_close_button: Close
26
+ modal_title: Available authorizations
22
27
  verification:
23
28
  admin:
24
29
  authorizations:
@@ -31,37 +36,37 @@ en:
31
36
  user_name: Participant name
32
37
  direct_verifications:
33
38
  create:
34
- authorized: "%{authorized} participants have been successfully verified using
35
- [%{handler}] (%{count} detected, %{errors} errors)"
39
+ authorized: "%{authorized} participants have been successfully verified
40
+ using [%{handler}] (%{count} detected, %{errors} errors)"
36
41
  info: "%{count} participants detected, of which %{registered} are registered,
37
42
  %{authorized} authorized using [%{handler}] (%{unconfirmed} unconfirmed)"
38
43
  missing_header: Please, provide a header row
39
- registered: "%{registered} participants have been successfully registered (%{count}
40
- detected, %{errors} errors) "
41
- revoked: Verification from %{revoked} participants have been revoked using
42
- [%{handler}] (%{count} detected, %{errors} errors)
44
+ registered: "%{registered} participants have been successfully registered
45
+ (%{count} detected, %{errors} errors) "
46
+ revoked: Verification from %{revoked} participants have been revoked
47
+ using [%{handler}] (%{count} detected, %{errors} errors)
43
48
  gdpr_disclaimer: Do this under your responsibility. Remember that you
44
- need to have explicit consent from your participants in order to register them.
45
- Otherwise you will be infringing the GDPR regulation in EU countries.
49
+ need to have explicit consent from your participants in order to register
50
+ them. Otherwise you will be infringing the GDPR regulation in EU countries.
46
51
  imports:
47
52
  create:
48
53
  error: There was an error importing the file
49
54
  success: File successfully uploaded. We'll email you when all participants
50
55
  are imported.
51
56
  mailer:
52
- authorized: "%{successful} participants have been successfully verified using
53
- [%{handler}] (%{count} detected, %{errors} errors)"
57
+ authorized: "%{successful} participants have been successfully verified
58
+ using [%{handler}] (%{count} detected, %{errors} errors)"
54
59
  info: "%{count} participants detected, of which %{registered} are registered,
55
60
  %{authorized} authorized using [%{handler}] (%{unconfirmed} unconfirmed)"
56
- registered: "%{successful} participants have been successfully registered (%{count}
57
- detected, %{errors} errors) "
58
- revoked: Verification from %{successful} participants have been revoked using
59
- [%{handler}] (%{count} detected, %{errors} errors)
61
+ registered: "%{successful} participants have been successfully registered
62
+ (%{count} detected, %{errors} errors) "
63
+ revoked: Verification from %{successful} participants have been revoked
64
+ using [%{handler}] (%{count} detected, %{errors} errors)
60
65
  subject: File import results
61
66
  new:
62
67
  file: CSV file with participants data
63
- info: Import a CSV file with a participant entry per line copying the format
64
- from the example below
68
+ info: Import a CSV file with a participant entry per line copying the
69
+ format from the example below
65
70
  submit: Upload file
66
71
  index:
67
72
  authorizations: Authorized participants
@@ -74,7 +79,8 @@ en:
74
79
  info_html: You can <a href=%{link}>import a CSV</a> or enter the emails
75
80
  here, one per line. If the emails are preceded by a text, it will be
76
81
  interpreted as the participant's name.
77
- register: Register participants in the platform (if they exist they will be ignored)
82
+ register: Register participants in the platform (if they exist they will
83
+ be ignored)
78
84
  revoke: Revoke authorization from participants
79
85
  submit: Send and process the list
80
86
  textarea: Emails list
@@ -85,6 +91,18 @@ en:
85
91
  global: "- Any verification method -"
86
92
  registered: Registered
87
93
  unconfirmed: Unconfirmed
94
+ user_authorizations:
95
+ destroy:
96
+ error: Error while trying to delete the authorization %{name} (%{message})
97
+ success: Authorization %{name} deleted successfully
98
+ show:
99
+ grant: Authorize user with this method
100
+ granted: Granted
101
+ not_granted: Not granted
102
+ revoke: Revoke the authorization
103
+ update:
104
+ error: Error while trying to authorize the user using %{name}
105
+ success: User authorized successfully using %{name}
88
106
  authorizations:
89
107
  new:
90
108
  no_action: This method requires an administrator that verifies you
@@ -18,6 +18,11 @@ es:
18
18
  explanation: Verificación manual por parte de las administradoras de la organización
19
19
  name: Verificación directa
20
20
  direct_verifications:
21
+ participants:
22
+ modal:
23
+ button_title: Ver autorizaciones
24
+ modal_close_button: Cerrar
25
+ modal_title: Autorizaciones disponibles
21
26
  verification:
22
27
  admin:
23
28
  authorizations:
@@ -70,6 +75,18 @@ es:
70
75
  global: "- Cualquier método de verificación -"
71
76
  registered: Registradas
72
77
  unconfirmed: Sin confirmar
78
+ user_authorizations:
79
+ destroy:
80
+ error: Error al intentar eliminar la autorización %{name} (%{message})
81
+ success: Autorización %{name} eliminada correctamente
82
+ show:
83
+ grant: Autorizar usuaria con este método
84
+ granted: Concedida
85
+ not_granted: No concedida
86
+ revoke: Revocar autorización
87
+ update:
88
+ error: Error al intentar autorizar la usuaria usando %{name}
89
+ success: Usuaria autorizada con éxito usando %{name}
73
90
  authorizations:
74
91
  new:
75
92
  no_action: Este método requiere que una administradora os verifique
@@ -18,6 +18,11 @@ fr:
18
18
  explanation: Vérification manuelle par les administrateurs de l'organisation
19
19
  name: Vérification directe
20
20
  direct_verifications:
21
+ participants:
22
+ modal:
23
+ button_title: See authorizations
24
+ modal_close_button: Close
25
+ modal_title: Available authorizations
21
26
  verification:
22
27
  admin:
23
28
  authorizations:
@@ -70,6 +75,18 @@ fr:
70
75
  global: "- N'importe quelle méthode de vérification -"
71
76
  registered: Inscrits
72
77
  unconfirmed: Non confirmé
78
+ user_authorizations:
79
+ destroy:
80
+ error: Error while trying to delete the authorization %{name} (%{message})
81
+ success: Authorization %{name} deleted successfully
82
+ show:
83
+ grant: Authorize user with this method
84
+ granted: Granted
85
+ not_granted: Not granted
86
+ revoke: Revoke the authorization
87
+ update:
88
+ error: Error while trying to authorize the user using %{name}
89
+ success: User authorized successfully using %{name}
73
90
  authorizations:
74
91
  new:
75
92
  no_action: Cette méthode nécessite un administrateur qui vous vérifie
@@ -2,6 +2,8 @@
2
2
 
3
3
  module Decidim
4
4
  module DirectVerifications
5
+ module Admin
6
+ end
5
7
  module Verification
6
8
  # This module contains all the domain logic associated to Decidim's DirectVerifications
7
9
  # component admin panel.
@@ -12,15 +12,19 @@ module Decidim
12
12
  resources :stats, only: [:index]
13
13
  resources :authorizations, only: [:index, :destroy]
14
14
  resources :imports, only: [:new, :create]
15
+ resources :user_authorizations, only: [:show, :update, :destroy]
15
16
 
16
17
  root to: "direct_verifications#index"
17
18
  end
18
19
 
19
- initializer "decidim_direct_verifications.admin_assets" do |app|
20
- app.config.assets.precompile += %w(
21
- direct_verifications_admin_manifest.js
22
- direct_verifications_admin_manifest.css
23
- )
20
+ config.after_initialize do
21
+ if Decidim::DirectVerifications.participants_modal.present?
22
+ Decidim::Admin::OfficializationsController.include(Decidim::DirectVerifications::Admin::NeedsVerificationSnippets)
23
+ end
24
+ end
25
+
26
+ initializer "direct_verifications.webpacker.assets_path" do
27
+ Decidim.register_assets_path File.expand_path("app/packs", root)
24
28
  end
25
29
  end
26
30
  end
@@ -3,8 +3,8 @@
3
3
  module Decidim
4
4
  # This holds the decidim-direct_verifications version.
5
5
  module DirectVerifications
6
- VERSION = "1.0.2"
7
- DECIDIM_VERSION = "0.24.3"
8
- MIN_DECIDIM_VERSION = ">= 0.23.0"
6
+ VERSION = "1.2.1"
7
+ DECIDIM_VERSION = "0.26.1"
8
+ MIN_DECIDIM_VERSION = ">= 0.25.0"
9
9
  end
10
10
  end
@@ -28,6 +28,12 @@ module Decidim
28
28
  :name_parser
29
29
  end
30
30
 
31
+ # add a button to the participants list to be able to handle verifications from there
32
+ # Manageable Verifications need to be registered in :manage_workflows
33
+ config_accessor :participants_modal do
34
+ true
35
+ end
36
+
31
37
  def self.find_parser_class(manifest)
32
38
  "Decidim::DirectVerifications::Parsers::#{manifest.to_s.camelize}".safe_constantize || Decidim::DirectVerifications::Parsers::NameParser
33
39
  end
data/package.json ADDED
@@ -0,0 +1,192 @@
1
+ {
2
+ "name": "decidim-verifications-direct_verifications",
3
+ "version": "1.1.0",
4
+ "description": "A tool for Decidim that allows to track time spent by volunteers doing any arbitrary task",
5
+ "scripts": {
6
+ "lint": "eslint -c .eslintrc.json --ext .js app/packs/",
7
+ "lint-fix": "eslint -c .eslintrc.json --ext .js app/packs/ --fix",
8
+ "stylelint": "stylelint **/*.scss",
9
+ "stylelint-fix": "stylelint **/*.scss --fix"
10
+ },
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/Platoniq/decidim-verifications-direct_verifications.git"
14
+ },
15
+ "keywords": [
16
+ "decidim"
17
+ ],
18
+ "author": "ivan@platoniq.net",
19
+ "license": "AGPL-3.0-or-later",
20
+ "bugs": {
21
+ "url": "https://github.com/Platoniq/decidim-verifications-direct_verifications/issues"
22
+ },
23
+ "homepage": "https://github.com/Platoniq/decidim-verifications-direct_verifications#readme",
24
+ "stylelint": {
25
+ "rules": {
26
+ "at-rule-empty-line-before": [
27
+ "always",
28
+ {
29
+ "except": [
30
+ "blockless-after-same-name-blockless",
31
+ "first-nested"
32
+ ],
33
+ "ignore": [
34
+ "after-comment"
35
+ ],
36
+ "ignoreAtRules": [
37
+ "else"
38
+ ]
39
+ }
40
+ ],
41
+ "at-rule-name-case": "lower",
42
+ "at-rule-semicolon-newline-after": "always",
43
+ "block-closing-brace-empty-line-before": "never",
44
+ "block-closing-brace-newline-after": "always",
45
+ "block-closing-brace-newline-before": "always-multi-line",
46
+ "block-closing-brace-space-before": "always-single-line",
47
+ "block-no-empty": true,
48
+ "block-opening-brace-newline-after": "always-multi-line",
49
+ "block-opening-brace-space-after": "always-single-line",
50
+ "block-opening-brace-space-before": "always",
51
+ "color-hex-case": "lower",
52
+ "color-hex-length": "short",
53
+ "color-no-invalid-hex": true,
54
+ "comment-empty-line-before": [
55
+ "always",
56
+ {
57
+ "except": [
58
+ "first-nested"
59
+ ],
60
+ "ignore": [
61
+ "stylelint-commands"
62
+ ]
63
+ }
64
+ ],
65
+ "comment-no-empty": true,
66
+ "comment-whitespace-inside": "always",
67
+ "custom-property-empty-line-before": [
68
+ "always",
69
+ {
70
+ "except": [
71
+ "after-custom-property",
72
+ "first-nested"
73
+ ],
74
+ "ignore": [
75
+ "after-comment",
76
+ "inside-single-line-block"
77
+ ]
78
+ }
79
+ ],
80
+ "declaration-bang-space-after": "never",
81
+ "declaration-bang-space-before": "always",
82
+ "declaration-block-no-duplicate-properties": [
83
+ true,
84
+ {
85
+ "ignore": [
86
+ "consecutive-duplicates-with-different-values"
87
+ ]
88
+ }
89
+ ],
90
+ "declaration-block-no-redundant-longhand-properties": true,
91
+ "declaration-block-no-shorthand-property-overrides": true,
92
+ "declaration-block-semicolon-newline-after": "always-multi-line",
93
+ "declaration-block-semicolon-space-after": "always-single-line",
94
+ "declaration-block-semicolon-space-before": "never",
95
+ "declaration-block-single-line-max-declarations": 1,
96
+ "declaration-block-trailing-semicolon": "always",
97
+ "declaration-colon-newline-after": "always-multi-line",
98
+ "declaration-colon-space-after": "always-single-line",
99
+ "declaration-colon-space-before": "never",
100
+ "declaration-empty-line-before": [
101
+ "always",
102
+ {
103
+ "except": [
104
+ "after-declaration",
105
+ "first-nested"
106
+ ],
107
+ "ignore": [
108
+ "after-comment",
109
+ "inside-single-line-block"
110
+ ]
111
+ }
112
+ ],
113
+ "function-calc-no-unspaced-operator": true,
114
+ "function-comma-newline-after": "always-multi-line",
115
+ "function-comma-space-after": "always-single-line",
116
+ "function-comma-space-before": "never",
117
+ "function-linear-gradient-no-nonstandard-direction": true,
118
+ "function-max-empty-lines": 0,
119
+ "function-name-case": "lower",
120
+ "function-parentheses-newline-inside": "always-multi-line",
121
+ "function-parentheses-space-inside": "never-single-line",
122
+ "function-whitespace-after": "always",
123
+ "indentation": 2,
124
+ "keyframe-declaration-no-important": true,
125
+ "length-zero-no-unit": true,
126
+ "max-empty-lines": 1,
127
+ "media-feature-colon-space-after": "always",
128
+ "media-feature-colon-space-before": "never",
129
+ "media-feature-name-case": "lower",
130
+ "media-feature-name-no-unknown": true,
131
+ "media-feature-parentheses-space-inside": "never",
132
+ "media-feature-range-operator-space-after": "always",
133
+ "media-feature-range-operator-space-before": "always",
134
+ "media-query-list-comma-newline-after": "always-multi-line",
135
+ "media-query-list-comma-space-after": "always-single-line",
136
+ "media-query-list-comma-space-before": "never",
137
+ "no-empty-source": true,
138
+ "no-eol-whitespace": true,
139
+ "no-extra-semicolons": true,
140
+ "no-invalid-double-slash-comments": true,
141
+ "no-missing-end-of-source-newline": true,
142
+ "number-leading-zero": "never",
143
+ "number-no-trailing-zeros": true,
144
+ "property-case": "lower",
145
+ "property-no-unknown": true,
146
+ "rule-empty-line-before": [
147
+ "always-multi-line",
148
+ {
149
+ "except": [
150
+ "first-nested"
151
+ ],
152
+ "ignore": [
153
+ "after-comment"
154
+ ]
155
+ }
156
+ ],
157
+ "selector-attribute-brackets-space-inside": "never",
158
+ "selector-attribute-operator-space-after": "never",
159
+ "selector-attribute-operator-space-before": "never",
160
+ "selector-combinator-space-after": "always",
161
+ "selector-combinator-space-before": "always",
162
+ "selector-descendant-combinator-no-non-space": true,
163
+ "selector-list-comma-newline-after": "always",
164
+ "selector-list-comma-space-before": "never",
165
+ "selector-max-empty-lines": 0,
166
+ "selector-pseudo-class-case": "lower",
167
+ "selector-pseudo-class-no-unknown": true,
168
+ "selector-pseudo-class-parentheses-space-inside": "never",
169
+ "selector-pseudo-element-case": "lower",
170
+ "selector-pseudo-element-colon-notation": "double",
171
+ "selector-pseudo-element-no-unknown": true,
172
+ "selector-type-case": "lower",
173
+ "selector-type-no-unknown": true,
174
+ "shorthand-property-no-redundant-values": true,
175
+ "string-no-newline": true,
176
+ "unit-case": "lower",
177
+ "unit-no-unknown": true,
178
+ "value-list-comma-newline-after": "always-multi-line",
179
+ "value-list-comma-space-after": "always-single-line",
180
+ "value-list-comma-space-before": "never",
181
+ "value-list-max-empty-lines": 0
182
+ }
183
+ },
184
+ "devDependencies": {
185
+ "eslint": "^7.32.0",
186
+ "eslint": "^7.25.0",
187
+ "eslint-config-prettier": "^8.2.0",
188
+ "eslint-config-standard": "^11.0.0",
189
+ "eslint-plugin-import": "^2.22.0",
190
+ "stylelint": "13.11.0"
191
+ }
192
+ }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decidim-direct_verifications
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Vergés
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-04 00:00:00.000000000 Z
11
+ date: 2022-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: decidim-admin
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.23.0
19
+ version: 0.25.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 0.23.0
26
+ version: 0.25.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: decidim-core
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 0.23.0
33
+ version: 0.25.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 0.23.0
40
+ version: 0.25.0
41
41
  description: Provides a verification method that also registers users directly in
42
42
  the platform. Can be used to mass verificate user with other verification handlers
43
43
  email:
@@ -49,17 +49,16 @@ files:
49
49
  - LICENSE-AGPLv3.txt
50
50
  - README.md
51
51
  - Rakefile
52
- - app/assets/config/direct_verifications_admin_manifest.css
53
- - app/assets/config/direct_verifications_admin_manifest.js
54
- - app/assets/javascripts/decidim/direct_verifications/verification/admin/direct_verifications_admin.js.es6
55
- - app/assets/stylesheets/decidim/direct_verifications/authorizations.scss
56
52
  - app/commands/decidim/direct_verifications/verification/confirm_user_authorization.rb
57
53
  - app/commands/decidim/direct_verifications/verification/create_import.rb
58
54
  - app/commands/decidim/direct_verifications/verification/destroy_user_authorization.rb
55
+ - app/controllers/concerns/decidim/direct_verifications/admin/needs_verification_snippets.rb
56
+ - app/controllers/decidim/direct_verifications/verification/admin/application_controller.rb
59
57
  - app/controllers/decidim/direct_verifications/verification/admin/authorizations_controller.rb
60
58
  - app/controllers/decidim/direct_verifications/verification/admin/direct_verifications_controller.rb
61
59
  - app/controllers/decidim/direct_verifications/verification/admin/imports_controller.rb
62
60
  - app/controllers/decidim/direct_verifications/verification/admin/stats_controller.rb
61
+ - app/controllers/decidim/direct_verifications/verification/admin/user_authorizations_controller.rb
63
62
  - app/controllers/decidim/direct_verifications/verification/authorizations_controller.rb
64
63
  - app/forms/decidim/direct_verifications/registration_form.rb
65
64
  - app/forms/decidim/direct_verifications/verification/create_import_form.rb
@@ -70,15 +69,23 @@ files:
70
69
  - app/jobs/decidim/direct_verifications/revoke_users_job.rb
71
70
  - app/mailers/decidim/direct_verifications/import_mailer.rb
72
71
  - app/mailers/decidim/direct_verifications/stats.rb
73
- - app/uploaders/decidim/direct_verifications/csv_uploader.rb
72
+ - app/packs/entrypoints/decidim_direct_verifications.js
73
+ - app/packs/entrypoints/decidim_direct_verifications.scss
74
+ - app/packs/entrypoints/decidim_direct_verifications_participants.js
75
+ - app/packs/src/decidim/direct_verifications/admin/checkboxes.js
76
+ - app/packs/src/decidim/direct_verifications/admin/participants.js
77
+ - app/packs/stylesheets/decidim/direct_verifications/admin/authorizations.scss
78
+ - app/permissions/decidim/direct_verifications/admin/permissions.rb
74
79
  - app/views/decidim/direct_verifications/import_mailer/finished_processing.html.erb
75
80
  - app/views/decidim/direct_verifications/import_mailer/finished_processing.text.erb
76
81
  - app/views/decidim/direct_verifications/verification/admin/authorizations/index.html.erb
77
82
  - app/views/decidim/direct_verifications/verification/admin/direct_verifications/index.html.erb
78
83
  - app/views/decidim/direct_verifications/verification/admin/imports/new.html.erb
79
84
  - app/views/decidim/direct_verifications/verification/admin/stats/index.html.erb
85
+ - app/views/decidim/direct_verifications/verification/admin/user_authorizations/show.html.erb
80
86
  - app/views/devise/mailer/direct_invite.html.erb
81
87
  - app/views/devise/mailer/direct_invite.text.erb
88
+ - config/assets.rb
82
89
  - config/initializers/mail_previews.rb
83
90
  - config/locales/ca.yml
84
91
  - config/locales/cs.yml
@@ -104,6 +111,7 @@ files:
104
111
  - lib/decidim/direct_verifications/verification/engine.rb
105
112
  - lib/decidim/direct_verifications/verification/workflow.rb
106
113
  - lib/decidim/direct_verifications/version.rb
114
+ - package.json
107
115
  homepage: https://github.com/Platoniq/decidim-verifications-direct_verifications
108
116
  licenses:
109
117
  - AGPL-3.0
@@ -1,3 +0,0 @@
1
- /*
2
- *= link decidim/direct_verifications/authorizations.css
3
- */
@@ -1 +0,0 @@
1
- //= link decidim/direct_verifications/verification/admin/direct_verifications_admin.js
@@ -1,7 +0,0 @@
1
- // = require_self
2
-
3
- $(() => {
4
- $('[type="checkbox"]#register').change(function () {
5
- $(this).closest('label').find('.callout').toggleClass('hide', !$(this).prop('checked'))
6
- })
7
- })
@@ -1,16 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Decidim
4
- module DirectVerifications
5
- class CsvUploader < ApplicationUploader
6
- # Override the directory where uploaded files will be stored.
7
- def store_dir
8
- default_path = "uploads/direct-verifications/"
9
-
10
- return File.join(Decidim.base_uploads_path, default_path) if Decidim.base_uploads_path.present?
11
-
12
- default_path
13
- end
14
- end
15
- end
16
- end