effective_memberships 0.17.3 → 0.17.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/concerns/effective_memberships_owner.rb +7 -0
- data/app/models/concerns/effective_memberships_registrar.rb +1 -0
- data/app/models/effective/membership_history.rb +8 -0
- data/app/views/effective/membership_directory/_membership_directory.html.haml +1 -2
- data/app/views/effective/membership_directory/show.html.haml +1 -21
- data/lib/effective_memberships/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef70771a4a2a9d5a9664b76dda457120845bd43ead1b684af0d71a8560331cb6
|
4
|
+
data.tar.gz: 585c057a19577bf1f5e4c6abca5e62fe7d55131090dcaa3f0839573b4e3a7bb0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f0e3096d63739c7d5e9e4de4c82c5876e8f2b70bd9ce297c23aa71fc54a302d19c7c31c3ba9e64bd53469d1e7e7f44f4afb8bf0529125bc3d9da58b6092852c
|
7
|
+
data.tar.gz: d1b95965cc3993a43f94273802aa8f7199d5107508be1858217a28644ab0fa3df48c003bd47352eef38be325ab1713398de15b2871de1d72f44ec98b526bbb85
|
@@ -432,6 +432,13 @@ module EffectiveMembershipsOwner
|
|
432
432
|
history
|
433
433
|
end
|
434
434
|
|
435
|
+
def membership_category_start_on(category: :current)
|
436
|
+
category = membership&.categories&.first if category == :current
|
437
|
+
raise('expected a category') unless category.present?
|
438
|
+
|
439
|
+
membership_histories.find { |history| history.membership_category_ids.include?(category.id) }&.start_on || membership&.joined_on
|
440
|
+
end
|
441
|
+
|
435
442
|
def membership_history_on(date)
|
436
443
|
raise('expected a date') unless date.respond_to?(:strftime)
|
437
444
|
membership_histories.find { |history| (history.start_on..history.end_on).cover?(date) } # Ruby 2.6 supports endless ranges
|
@@ -69,5 +69,13 @@ module Effective
|
|
69
69
|
assign_attributes(statuses: statuses.map(&:to_s), status_ids: statuses.map(&:id))
|
70
70
|
end
|
71
71
|
|
72
|
+
def start_period
|
73
|
+
EffectiveMemberships.Registrar.period(date: start_on)
|
74
|
+
end
|
75
|
+
|
76
|
+
def end_period
|
77
|
+
EffectiveMemberships.Registrar.period(date: end_on)
|
78
|
+
end
|
79
|
+
|
72
80
|
end
|
73
81
|
end
|
@@ -10,8 +10,7 @@
|
|
10
10
|
.row.mt-4
|
11
11
|
- group.each do |membership|
|
12
12
|
.col-md
|
13
|
-
|
14
|
-
= render('effective/membership_directory/membership', membership: membership)
|
13
|
+
= render('effective/membership_directory/membership', membership: membership) if membership
|
15
14
|
|
16
15
|
%nav.d-flex.justify-content-center
|
17
16
|
= bootstrap_paginate(results, per_page: membership_directory.per_page)
|
@@ -1,26 +1,6 @@
|
|
1
1
|
= render 'layout' do
|
2
2
|
.effective-membership
|
3
|
-
|
4
|
-
%h6= @membership.owner
|
5
|
-
%p= @membership.categories.map(&:membership_directory_title).to_sentence
|
6
|
-
%p= @membership.statuses.map(&:membership_directory_title).to_sentence
|
7
|
-
%p= @membership.number
|
8
|
-
|
9
|
-
- if @membership.owner.respond_to?(:rich_text_body)
|
10
|
-
.mb-4= @membership.owner.rich_text_body.to_s
|
11
|
-
|
12
|
-
- if @membership.owner.try(:email).present?
|
13
|
-
%p= reveal_mail_to(@membership.owner.email)
|
14
|
-
|
15
|
-
- if (organizations = @membership.owner.try(:membership_organizations)).present?
|
16
|
-
.mb-4.membership-directory-organizations
|
17
|
-
- organizations.each do |organization|
|
18
|
-
%div= organization
|
19
|
-
|
20
|
-
- if (users = @membership.owner.try(:membership_users)).present?
|
21
|
-
.mb-4.membership-directory-users
|
22
|
-
- users.each do |user|
|
23
|
-
%div= user
|
3
|
+
= render('effective/membership_directory/membership', membership: @membership)
|
24
4
|
|
25
5
|
%hr
|
26
6
|
= link_to 'Return to Directory', effective_memberships.membership_directory_index_path, class: 'btn btn-primary'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_memberships
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.17.
|
4
|
+
version: 0.17.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-05-
|
11
|
+
date: 2023-05-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -574,7 +574,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
574
574
|
- !ruby/object:Gem::Version
|
575
575
|
version: '0'
|
576
576
|
requirements: []
|
577
|
-
rubygems_version: 3.
|
577
|
+
rubygems_version: 3.1.2
|
578
578
|
signing_key:
|
579
579
|
specification_version: 4
|
580
580
|
summary: Manage your professional association online. Membership categories, applications
|