lato_spaces 3.1.19 → 3.1.21

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1c608c2cf98abab79ac0e05afc614b5f9bb31df5eac5109fd56d1d4d11c9648e
4
- data.tar.gz: bef0de44e68e1a9f74376500241ed0500976525ac3ccd5fcac0ada4609db4758
3
+ metadata.gz: be2bfe1d12ffd6a6776ed821ba3a87faa2ffa65f54172c6c6bd4c0f4b75369c6
4
+ data.tar.gz: 198d5f7525775d514fb1d32ab02d9eb0568d6dc0732bb2a8b96798a4db4aff2a
5
5
  SHA512:
6
- metadata.gz: f9e1a566aad5ac9ab22379d2dd01acdfa05c6fa4607937cf22c3c097d7762e7a1ed1659f801a282f12a03ac75eccd550421973d81a8c3498fa22a266468f8840
7
- data.tar.gz: e4b9e6b1a17072af5f77beae8e845fe7d82f78b153eb14aca19d094aa9e00ab014f53a682cbe5e22eb68c4a88da5558de99b2e715b416cffd95ac79cc0a4ce35
6
+ metadata.gz: 3980b1cb0f1061b1438c93e3ca4af49bc89da9d6cfb0d925a1bda773276434ede52a77ea16a9c0dc8b5c54893cc4d5824845ef923da7e5da1be791dd8ec118b1
7
+ data.tar.gz: 1d12290c939338e0ead2a475991e091166fb005dc6fdf70acce97ccff654de32ce6a4a0476d9fe084189e2bb8865d385a1633094ae3191a55120ba5811e658d3
data/README.md CHANGED
@@ -29,6 +29,20 @@ 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
+
39
+ Import Lato Spaces Js on **app/javascript/application.js** file:
40
+ ```js
41
+ import "lato_spaces/application";
42
+
43
+ // ....
44
+ ```
45
+
32
46
  ## Todo
33
47
 
34
48
  ### Manage models relations with spaces groups
@@ -54,7 +68,7 @@ end
54
68
  Clone repository, install dependencies, run migrations and start:
55
69
 
56
70
  ```shell
57
- $ git clone https://github.com/Lato-GAM/lato_spaces
71
+ $ git clone https://github.com/Lato-org/lato_spaces
58
72
  $ cd lato_spaces
59
73
  $ bundle
60
74
  $ rails db:migrate
@@ -1,4 +1,2 @@
1
1
  //= link_directory ../stylesheets/lato_spaces .css
2
-
3
- //= link_directory ../images/lato_spaces .jpg
4
2
  //= link_tree ../javascripts/lato_spaces .js
@@ -0,0 +1 @@
1
+ console.log("Lato Spaces JS loaded");
@@ -12,4 +12,4 @@
12
12
  }
13
13
  }
14
14
  }
15
- }
15
+ }
@@ -52,7 +52,7 @@ module LatoSpaces
52
52
  private
53
53
 
54
54
  def membership_params
55
- params.require(:membership).permit(:email)
55
+ params.require(:membership).permit(LatoSpaces.config.membership_params)
56
56
  end
57
57
 
58
58
  def find_group
@@ -0,0 +1,9 @@
1
+ module LatoSpacesMembershipApplication
2
+ extend ActiveSupport::Concern
3
+
4
+ included do
5
+ # Add here custom relations, scopes, ecc.
6
+ end
7
+
8
+ # Add here custom methods
9
+ end
@@ -1,5 +1,7 @@
1
1
  module LatoSpaces
2
2
  class Membership < ApplicationRecord
3
+ include LatoSpacesMembershipApplication
4
+
3
5
  attr_accessor :email
4
6
  attr_accessor :user_infos, :actions # lato index
5
7
 
@@ -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 %>
@@ -0,0 +1,7 @@
1
+ <%
2
+
3
+ form ||= nil
4
+
5
+ %>
6
+
7
+ <!-- Free for extra form content -->
@@ -0,0 +1 @@
1
+ pin "lato_spaces/application", to: "lato_spaces/application.js"
@@ -13,6 +13,9 @@ module LatoSpaces
13
13
  # Params of the group.
14
14
  attr_accessor :group_params
15
15
 
16
+ # Params of the membership.
17
+ attr_accessor :membership_params
18
+
16
19
  # Permit creation of groups for users.
17
20
  attr_accessor :permit_group_creation
18
21
 
@@ -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
@@ -1,5 +1,13 @@
1
1
  module LatoSpaces
2
2
  class Engine < ::Rails::Engine
3
3
  isolate_namespace LatoSpaces
4
+
5
+ initializer 'lato_spaces.importmap', before: 'importmap' do |app|
6
+ app.config.importmap.paths << root.join('config/importmap.rb')
7
+ end
8
+
9
+ initializer "lato_spaces.precompile" do |app|
10
+ app.config.assets.precompile << "lato_spaces_manifest.js"
11
+ end
4
12
  end
5
13
  end
@@ -1,3 +1,3 @@
1
1
  module LatoSpaces
2
- VERSION = "3.1.19"
2
+ VERSION = "3.1.21"
3
3
  end
@@ -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.19
4
+ version: 3.1.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregorio Galante
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-11-30 00:00:00.000000000 Z
11
+ date: 2025-04-03 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,8 @@ 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
81
+ - config/importmap.rb
79
82
  - config/locales/en.yml
80
83
  - config/locales/it.yml
81
84
  - config/routes.rb