effective_memberships 0.4.5 → 0.4.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 940bfa04e965ae36e054add85ac673260b5fa11f2ff3939ec0f00a3732b6bba1
4
- data.tar.gz: c3d94b16860a507b64e75bc7b156e6ce96f79845e5561a25a52ae48c57f3951b
3
+ metadata.gz: 20a57ae6829f25668b31b12a6a67ca6b0fb648810a6efba12c516a30a969144f
4
+ data.tar.gz: 7b67ecef9d09b021e924b8f8e1a0eb33a741a8a10c8a8912c6aae5aff7fd8545
5
5
  SHA512:
6
- metadata.gz: 81ba80b0314968331c9bc85a2a021be327780daf44854379f52f4f9f64d8e6c0a3b816871129610b953d2b6d29f8eca22aa4699cc5fc5aceee3fbf86b72e87e2
7
- data.tar.gz: 7671e32ba29f5540b90bbd250e5f78503033af257702a01caccfb93064c5e8a111e95cff7212f64c7b0ef2d0d8872131b76cef7ee10a800700f157fd3e8258d1
6
+ metadata.gz: 14d942c1d353f5b439392fe6a5646efd1f5dbd2d74959c65a776394c339e3bbc6aaf794bbd7d352cb192416bd04ea7f97db21931ab88ff48c3f773f4c707322c
7
+ data.tar.gz: 5ac8508dd130358939656a248d568b8257c3f751dafb2a5d9b49e5cc4d036982750e8f33bcae7a9b5be9957eb0b9a9f3e28f942ece9dfb26b7ac83684d36b4f4
@@ -1,7 +1,12 @@
1
1
  module Admin
2
2
  class EffectiveOrganizationsDatatable < Effective::Datatable
3
- datatable do
3
+ filters do
4
+ scope :unarchived, label: 'All'
5
+ scope :members
6
+ scope :archived
7
+ end
4
8
 
9
+ datatable do
5
10
  col :updated_at, visible: false
6
11
  col :created_at, visible: false
7
12
 
@@ -11,16 +16,54 @@ module Admin
11
16
  col :category, search: categories
12
17
  end
13
18
 
14
- col :title
19
+ col(:to_s, label: 'Organization', sql_column: true, action: :edit)
20
+ .search do |collection, term|
21
+ collection.where(id: effective_resource.search_any(term))
22
+ end.sort do |collection, direction|
23
+ collection.order(title: direction)
24
+ end
25
+
26
+ col :title, visible: false
27
+
28
+ col 'membership.joined_on'
29
+ col 'membership.fees_paid_through_period', label: 'Fees Paid Through'
30
+ col 'membership.categories'
15
31
 
16
32
  col :representatives_count
17
33
  col :representatives
18
34
 
35
+ col :email, visible: false
36
+
37
+ col :address1, visible: false do |organization|
38
+ organization.billing_address&.address1
39
+ end
40
+ col :address2, visible: false do |organization|
41
+ organization.billing_address&.address2
42
+ end
43
+ col :city, visible: false do |organization|
44
+ organization.billing_address&.city
45
+ end
46
+ col :state_code, label: 'Prov', visible: false do |organization|
47
+ organization.billing_address&.state_code
48
+ end
49
+ col :postal_code, label: 'Postal', visible: false do |organization|
50
+ organization.billing_address&.postal_code
51
+ end
52
+ col :country_code, label: 'Country', visible: false do |organization|
53
+ organization.billing_address&.country_code
54
+ end
55
+
56
+ col :phone, visible: false
57
+ col :fax, visible: false
58
+ col :website, visible: false
59
+ col :category, visible: false
60
+ col :notes, visible: false
61
+
19
62
  actions_col
20
63
  end
21
64
 
22
65
  collection do
23
- EffectiveMemberships.Organization.deep.all
66
+ EffectiveMemberships.Organization.deep.left_joins(:membership).includes(membership: :membership_categories)
24
67
  end
25
68
 
26
69
  def categories
@@ -23,6 +23,7 @@ module EffectiveMembershipsOrganization
23
23
  effective_memberships_owner
24
24
 
25
25
  acts_as_addressable :billing # effective_addresses
26
+ acts_as_archived unless respond_to?(:acts_as_archived?)
26
27
  log_changes(except: [:representatives, :users]) if respond_to?(:log_changes)
27
28
 
28
29
  # rich_text_body
@@ -2,5 +2,3 @@
2
2
 
3
3
  - if categories.present?
4
4
  = f.select :category, categories, required: true
5
-
6
- = f.text_field :title
@@ -5,7 +5,7 @@
5
5
  - if organization.persisted?
6
6
  - if can?(:index, Effective::Membership)
7
7
  = tab 'Membership' do
8
- = render 'admin/registrar_actions/form', owner: organization
8
+ = render 'admin/memberships/form', owner: organization
9
9
 
10
10
  = tab 'Representatives' do
11
11
  = render_datatable(Admin::EffectiveRepresentativesDatatable.new(organization: organization), inline: true, namespace: :admin)
@@ -18,10 +18,6 @@
18
18
  = tab 'Fee Payments' do
19
19
  = render_inline_datatable(Admin::EffectiveFeePaymentsDatatable.new(organization: organization))
20
20
 
21
- - if can?(:index, Effective::MembershipHistory)
22
- = tab 'History' do
23
- = render_datatable(Admin::EffectiveMembershipHistoriesDatatable.new(owner: organization))
24
-
25
21
  - if can?(:index, Effective::Order)
26
22
  = tab 'Orders' do
27
23
  = render_datatable(Admin::EffectiveOrdersDatatable.new(user: organization))
@@ -3,9 +3,7 @@
3
3
  .col-sm-6
4
4
  %h2 Demographics
5
5
  = render 'admin/organizations/fields', f: f
6
-
7
- %h2 Billing Address
8
- = effective_address_fields(f, :billing)
6
+ = render 'organizations/fields_demographics', f: f
9
7
 
10
8
  .col-sm-6
11
9
  %h2 Membership
@@ -1,3 +1,3 @@
1
1
  module EffectiveMemberships
2
- VERSION = '0.4.5'
2
+ VERSION = '0.4.6'
3
3
  end
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.4.5
4
+ version: 0.4.6
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: 2022-03-30 00:00:00.000000000 Z
11
+ date: 2022-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails