lato_spaces 3.1.20 → 3.1.22
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 +7 -0
- data/app/controllers/lato_spaces/memberships_controller.rb +1 -1
- data/app/models/concerns/lato_spaces/associable_required.rb +10 -4
- data/app/models/concerns/lato_spaces_membership_application.rb +9 -0
- data/app/models/lato_spaces/membership.rb +2 -0
- data/app/views/lato_spaces/memberships/_form.html.erb +3 -1
- data/app/views/layouts/lato_spaces/_membership-form-extra_content.html.erb +7 -0
- data/lib/lato_spaces/config.rb +6 -2
- data/lib/lato_spaces/version.rb +1 -1
- data/lib/tasks/lato_spaces_tasks.rake +7 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8be2ba859fb4758a001f626ba2faab4b254dc65fdd39e31110a12f01f33cff80
|
4
|
+
data.tar.gz: f45a5f7a94806d23ea6a7557be9f57ee6d0423a3805fb4aa7bd8287c26c07b57
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '01259f92ebb9457bdac1ad09df4164d2862f430461e5ec88b6662d18fba8cb9ddb12d9944650f433f44fb008495acce978ecb63392b4ee4881abc4cebca07e39'
|
7
|
+
data.tar.gz: 90de698d6fd4af00d2d787f033e26d022d459eaf03eb43ee97fc16cf9563cf77957d0e5495ca64bb0030c8db3951f82bba6740b6d8396b9a50ad2f367923efeb
|
data/README.md
CHANGED
@@ -29,6 +29,13 @@ Rails.application.routes.draw do
|
|
29
29
|
end
|
30
30
|
```
|
31
31
|
|
32
|
+
Import Lato Scss on **app/assets/stylesheets/application.scss** file:
|
33
|
+
```scss
|
34
|
+
@import 'lato_spaces/application';
|
35
|
+
|
36
|
+
// ....
|
37
|
+
```
|
38
|
+
|
32
39
|
Import Lato Spaces Js on **app/javascript/application.js** file:
|
33
40
|
```js
|
34
41
|
import "lato_spaces/application";
|
@@ -12,16 +12,22 @@ module LatoSpaces::AssociableRequired
|
|
12
12
|
# Hooks
|
13
13
|
##
|
14
14
|
|
15
|
-
|
16
|
-
lato_spaces_associations.create
|
15
|
+
after_create_commit do
|
16
|
+
unless lato_spaces_associations.create(lato_spaces_group_id: lato_spaces_group_id)
|
17
|
+
Rails.logger.error "Failed to create LatoSpaces association for #{self.class.name} with ID #{id} and group ID #{lato_spaces_group_id}"
|
18
|
+
end
|
17
19
|
end
|
18
20
|
|
19
21
|
# External hooks
|
20
22
|
##
|
21
23
|
|
22
24
|
# listen LatoSpaces::Association destroy event to destroy item
|
23
|
-
LatoSpaces::Association.
|
24
|
-
association.item
|
25
|
+
LatoSpaces::Association.after_destroy_commit do |association|
|
26
|
+
if association.item
|
27
|
+
unless association.item.destroy
|
28
|
+
Rails.logger.error "Failed to destroy #{association.item.class.name} with ID #{association.item_id} after LatoSpaces association destruction"
|
29
|
+
end
|
30
|
+
end
|
25
31
|
end
|
26
32
|
end
|
27
33
|
end
|
@@ -8,8 +8,10 @@
|
|
8
8
|
<%= lato_form_item_input_email form, :email, required: true %>
|
9
9
|
</div>
|
10
10
|
|
11
|
+
<%= render 'layouts/lato_spaces/membership-form-extra_content', form: form %>
|
12
|
+
|
11
13
|
<div class="d-flex justify-content-end">
|
12
14
|
<%= lato_form_submit form, I18n.t('lato_spaces.cta_confirm'), class: %w[btn-success] %>
|
13
15
|
</div>
|
14
16
|
<% end %>
|
15
|
-
<% end %>
|
17
|
+
<% end %>
|
data/lib/lato_spaces/config.rb
CHANGED
@@ -13,10 +13,13 @@ module LatoSpaces
|
|
13
13
|
# Params of the group.
|
14
14
|
attr_accessor :group_params
|
15
15
|
|
16
|
-
#
|
16
|
+
# Params of the membership.
|
17
|
+
attr_accessor :membership_params
|
18
|
+
|
19
|
+
# Permit creation of groups for users (not admins).
|
17
20
|
attr_accessor :permit_group_creation
|
18
21
|
|
19
|
-
# Permit management of groups for users.
|
22
|
+
# Permit management of groups for users (not admins).
|
20
23
|
attr_accessor :permit_group_management
|
21
24
|
|
22
25
|
# Permit users to choose a preferred group.
|
@@ -26,6 +29,7 @@ module LatoSpaces
|
|
26
29
|
@setgroup_redirect_path = nil
|
27
30
|
@group_icon = 'bi bi-people-fill'
|
28
31
|
@group_params = %i[name]
|
32
|
+
@membership_params = %i[email]
|
29
33
|
@permit_group_creation = false
|
30
34
|
@permit_group_management = false
|
31
35
|
@permit_group_preferred = false
|
data/lib/lato_spaces/version.rb
CHANGED
@@ -26,6 +26,13 @@ namespace :lato_spaces do
|
|
26
26
|
|
27
27
|
FileUtils.copy(src_file_path, dest_file_path) unless File.exist? dest_file_path
|
28
28
|
end
|
29
|
+
|
30
|
+
# Copy "lato_spaces_membership_application.rb" model concern from gem to main application
|
31
|
+
##
|
32
|
+
|
33
|
+
gem_concern_path = LatoSpaces::Engine.root.join('app', 'models', 'concerns', 'lato_spaces_membership_application.rb').to_s
|
34
|
+
app_concern_path = Rails.root.join('app', 'models', 'concerns', 'lato_spaces_membership_application.rb').to_s
|
35
|
+
FileUtils.copy(gem_concern_path, app_concern_path) unless File.exist? app_concern_path
|
29
36
|
end
|
30
37
|
end
|
31
38
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lato_spaces
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.22
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gregorio Galante
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-08-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -63,6 +63,7 @@ files:
|
|
63
63
|
- app/models/concerns/lato_spaces/associable.rb
|
64
64
|
- app/models/concerns/lato_spaces/associable_required.rb
|
65
65
|
- app/models/concerns/lato_spaces/associable_unique.rb
|
66
|
+
- app/models/concerns/lato_spaces_membership_application.rb
|
66
67
|
- app/models/lato_spaces/association.rb
|
67
68
|
- app/models/lato_spaces/group.rb
|
68
69
|
- app/models/lato_spaces/membership.rb
|
@@ -76,6 +77,7 @@ files:
|
|
76
77
|
- app/views/lato_spaces/memberships/create.html.erb
|
77
78
|
- app/views/layouts/lato_spaces/_group-form-extra_content.html.erb
|
78
79
|
- app/views/layouts/lato_spaces/_group-informations_content.html.erb
|
80
|
+
- app/views/layouts/lato_spaces/_membership-form-extra_content.html.erb
|
79
81
|
- config/importmap.rb
|
80
82
|
- config/locales/en.yml
|
81
83
|
- config/locales/it.yml
|