effective_resources 2.25.10 → 2.25.12

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: 8e25889bc1a891db68c75ce05df4bf02110c9a03cd03d7a121b8cde7487f2d14
4
- data.tar.gz: 475f27329c8c866aa64b903fcbc23b92d5a39cdc8cd2dac71db473c194ef7dd0
3
+ metadata.gz: 7189c9b0628e5f84b362ccfc62a80e26bf349fb0477dcdaef239f1eabbd3b3f4
4
+ data.tar.gz: 8a4a392131be33cd557d9d752698125b735610685bbb10c9035102d8c7cd624a
5
5
  SHA512:
6
- metadata.gz: d206a7a34f2f7bb9850d77328085606719ac5c8f2f2f4cddbeff3c0d124957dc9f5d1efdf7dddc841d7795f8b63ae6b164f037e29f60c03159aea922a7cc2252
7
- data.tar.gz: a87a21a1eb27e79e550ec29b31a54fb889b0bf21c318b928dd10fdaa164a039b639fe3180e36fef86b98ed864870c2cd35066ff218820c38fb7d94cf14781d17
6
+ metadata.gz: 58b7e2293d65db01e5683cc9505e0bca06d97be8cf32c9d48246882a747ff35d4c3c4b920150264e5ee98ea8353e4c5710d6dc6607505b372be005d374fcd8ed
7
+ data.tar.gz: 1f1ce662f557191eb973733ae430ba5a5563bc740d4bb8b8041b25bdfeceea559ee05b37d256b89f0828f9ac79d59dfd232201eb8979c08bf2d324a650513466
@@ -56,7 +56,7 @@ module Effective
56
56
 
57
57
  messages << e.message if messages.blank? && e && e.respond_to?(:message)
58
58
 
59
- messages.to_sentence.presence
59
+ messages.uniq.to_sentence.presence
60
60
  end
61
61
 
62
62
  def action_verb(action)
@@ -278,7 +278,7 @@ module EffectiveResourcesHelper
278
278
  raise("expected a title for step #{step}") unless title.present?
279
279
 
280
280
  link = if edit_effective_wizard? && resource.is_a?(controller.resource_klass) && resource.can_visit_step?(step)
281
- link_to('Edit', wizard_path(step), title: "Edit #{title}")
281
+ link_to('Edit', wizard_path(step), title: "Edit #{title}", class: 'btn btn-secondary mb-2')
282
282
  end
283
283
 
284
284
  content_tag(:div, class: 'card mb-4') do
@@ -327,4 +327,19 @@ module EffectiveResourcesHelper
327
327
  EffectiveResources.masked_email(resource)
328
328
  end
329
329
 
330
+ def acts_as_published_fields(form)
331
+ raise('expected an acts_as_published form object') unless form.object.class.try(:acts_as_published?)
332
+ render('effective/acts_as_published/fields', form: form)
333
+ end
334
+
335
+ def acts_as_slugged_fields(form, url: nil)
336
+ raise('expected an acts_as_slugged form object') unless form.object.class.try(:acts_as_slugged?)
337
+
338
+ current_url = if url.present?
339
+ 'Currently accessible via ' + link_to(url.gsub(form.object.slug, '<strong>' + form.object.slug + '</strong>').html_safe, url, target: :_blank)
340
+ end
341
+
342
+ render('effective/acts_as_slugged/fields', form: form, current_url: current_url)
343
+ end
344
+
330
345
  end
@@ -26,6 +26,8 @@ module ActsAsSlugged
26
26
  end
27
27
 
28
28
  module ClassMethods
29
+ def acts_as_slugged?; true; end
30
+
29
31
  def relation
30
32
  super.tap { |relation| relation.extend(FinderMethods) }
31
33
  end
@@ -12,7 +12,7 @@
12
12
  .col-md-10
13
13
  = form.select :from, mailer_froms_collection(), label: 'From', value: email_from
14
14
  .col-md-2.my-4
15
- %a{href: "#acts-as-email-notification-collapse-#{uid}", 'data-toggle': 'collapse', role: 'button', 'aria-expanded': expanded, 'aria-controls': "acts-as-email-notification-collapse-#{uid}"} more...
15
+ %a{href: "#acts-as-email-notification-collapse-#{uid}", 'data-toggle': 'collapse', role: 'button', 'aria-expanded': expanded, 'aria-controls': "acts-as-email-notification-collapse-#{uid}"} Add CC or BCC
16
16
 
17
17
  .collapse{id: "acts-as-email-notification-collapse-#{uid}", class: ('show' if expanded)}
18
18
  = form.text_field :cc, label: 'CC', value: email_cc
@@ -30,7 +30,7 @@
30
30
  .col-md-10
31
31
  = form.select :from, mailer_froms_collection(), label: 'From'
32
32
  .col-md-2.my-4
33
- %a{href: "#acts-as-email-notification-collapse-#{uid}", 'data-toggle': 'collapse', role: 'button', 'aria-expanded': expanded, 'aria-controls': "acts-as-email-notification-collapse-#{uid}"} more...
33
+ %a{href: "#acts-as-email-notification-collapse-#{uid}", 'data-toggle': 'collapse', role: 'button', 'aria-expanded': expanded, 'aria-controls': "acts-as-email-notification-collapse-#{uid}"} Add CC or BCC
34
34
 
35
35
  .collapse{id: "acts-as-email-notification-collapse-#{uid}", class: ('show' if expanded)}
36
36
  = form.text_field :cc, label: 'CC'
@@ -0,0 +1,9 @@
1
+ -# acts_as_published
2
+ = form.hide_if(:save_as_draft, true) do
3
+ .row
4
+ .col-md-6
5
+ = form.datetime_field :published_start_at, label: 'Published start', hint: 'Will appear on the website after this date and time. Leave blank to publish immediately.'
6
+ .col-md-6
7
+ = form.datetime_field :published_end_at, label: 'Published end', hint: 'Will not appear on the website after this date and time. Leave blank for no end date.', date_linked: false
8
+
9
+ = form.check_box :save_as_draft, label: "Save as a draft. It will not appear on the website and can only be accessed by admin users."
@@ -0,0 +1,3 @@
1
+ - if form.object.persisted? || form.object.errors.include?(:slug)
2
+ - hint = "The slug controls the internet address for this item. Be careful, changing the slug will break links that other websites may have to the old address."
3
+ = form.text_field :slug, hint: [hint, current_url].compact.join("<br>")
@@ -1,3 +1,3 @@
1
1
  module EffectiveResources
2
- VERSION = '2.25.10'.freeze
2
+ VERSION = '2.25.12'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_resources
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.25.10
4
+ version: 2.25.12
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: 2024-07-29 00:00:00.000000000 Z
11
+ date: 2024-08-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -259,6 +259,8 @@ files:
259
259
  - app/views/application/update.js.erb
260
260
  - app/views/effective/acts_as_email_form/_fields.html.haml
261
261
  - app/views/effective/acts_as_email_notification/_fields.html.haml
262
+ - app/views/effective/acts_as_published/_fields.html.haml
263
+ - app/views/effective/acts_as_slugged/_fields.html.haml
262
264
  - app/views/effective/acts_as_wizard/_wizard_step.html.haml
263
265
  - app/views/effective/resource/_actions.html.haml
264
266
  - app/views/effective/resource/_actions_dropleft.html.haml