effective_mailchimp 0.1.0 → 0.1.2

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: fc851b003ffad568b1b32a435b75022875e3c12be043f4a298d929927142aab1
4
- data.tar.gz: 7560d0e76bef241e59c40ca93b2c607b45b4e4757ccbe2d8b64f575b0e9eb9c8
3
+ metadata.gz: b07992dd0456401263f6d8ee6d82ad6189cda9fe191e7952ed8e90f5bad9ec79
4
+ data.tar.gz: 6fc4ba4b3abba5ee85670a721e4681aaee3e4ece6140a0b8873891f1eb367a4f
5
5
  SHA512:
6
- metadata.gz: 787fbc005508da120aaac6103c21c5ff31b107ae80c311b7ad0eed91765fc85ff5a2c4537fdf22e41d8d78e95d6de5cade9e1bd76570165d63e217ac8909696c
7
- data.tar.gz: 2dd3834383a2352a093928e95fd77423734c214d5061377ccf9fc2b1b4e51ce18e5e82e0af6e1acca928a576efdc8215cc9b8bb814af1a1a5cb63cd7393340d5
6
+ metadata.gz: 8f58bb4d3431787e4211ae6a132d71ed205feffebe46e2b7a1702b0179ebd43ac773f303744c5af196000ce3a1d1445ac9216adda8f2925496284cb1dccd4a2d
7
+ data.tar.gz: 7d27cd2a229e062657eb868bca61f122bd7c17fde66d0dd6e56f547436bb1ea8b993df34cb485531a7cbd47d049135fb497655a4a613a6fe2194b51554ff3837
data/README.md CHANGED
@@ -49,7 +49,6 @@ effective_mailchimp_user
49
49
 
50
50
  and
51
51
 
52
- ```
53
52
  Add a link to the admin menu:
54
53
 
55
54
  ```haml
@@ -66,6 +65,7 @@ To add the fields to your existing users form
66
65
  = f.text_field :last_name
67
66
  = mailchimp_user_fields(f)
68
67
  = f.submit
68
+ ```
69
69
 
70
70
  ## Configuring Mailchimp Account
71
71
 
@@ -3,6 +3,6 @@
3
3
  = f.static_field :web_id
4
4
  = f.static_field :name
5
5
 
6
- = f.check_box :can_subscribe, label: 'Yes, display this list to users and allow them to subscribe'
6
+ = f.check_box :can_subscribe, label: "Yes, display users and allow them to subscribe"
7
7
 
8
8
  = effective_submit(f)
@@ -4,22 +4,26 @@
4
4
  %p.text-muted
5
5
  Please visit
6
6
  = link_to 'All ' + ets(Effective::MailchimpList), effective_mailchimp.admin_mailchimp_lists_path, target: '_blank'
7
- to configure which lists are displayed.
7
+ to configure which are displayed.
8
8
 
9
9
  %p
10
10
  %strong Subscribed
11
11
 
12
12
  = effective_form_with model: [:admin, user] do |f|
13
13
  = f.hidden_field :id
14
+
14
15
  = mailchimp_user_fields(f)
15
16
 
16
17
  %p.text-muted
17
18
  %small
18
19
  last synced with
19
20
  = link_to 'Mailchimp', EffectiveMailchimp.api.admin_url
20
- = time_ago_in_words(user.mailchimp_last_synced_at)
21
- ago.
22
- = link_to 'sync now', effective_mailchimp.mailchimp_sync_user_admin_mailchimp_path(f.object), 'data-method': :post
21
+ - if user.mailchimp_last_synced_at.present?
22
+ = time_ago_in_words(user.mailchimp_last_synced_at)
23
+ ago.
24
+ - else
25
+ never.
23
26
 
27
+ = link_to 'sync now', effective_mailchimp.mailchimp_sync_user_admin_mailchimp_path(f.object), 'data-method': :post
24
28
 
25
29
  = f.submit
@@ -1,3 +1,3 @@
1
1
  module EffectiveMailchimp
2
- VERSION = '0.1.0'.freeze
2
+ VERSION = '0.1.2'.freeze
3
3
  end
@@ -19,6 +19,10 @@ module EffectiveMailchimp
19
19
  Effective::MailchimpApi.new(api_key: api_key, server: server)
20
20
  end
21
21
 
22
+ def self.api_present?
23
+ api_key.present? && server.present?
24
+ end
25
+
22
26
  def self.permitted_params
23
27
  [ :mailchimp_user_form_action, mailchimp_list_members_attributes: [:id, :subscribed] ]
24
28
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_mailchimp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
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-02-28 00:00:00.000000000 Z
11
+ date: 2023-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails