effective_resources 2.25.10 → 2.25.11

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: 8e25889bc1a891db68c75ce05df4bf02110c9a03cd03d7a121b8cde7487f2d14
4
- data.tar.gz: 475f27329c8c866aa64b903fcbc23b92d5a39cdc8cd2dac71db473c194ef7dd0
3
+ metadata.gz: e7440ef830150c8ec4c369c08cb58cc5bb3415caab9db4faea965c3cb7e11e0c
4
+ data.tar.gz: bf4772a488fd33850bcc4c516ff9b46091a257d1ebbe2549a84dfc09b15f011f
5
5
  SHA512:
6
- metadata.gz: d206a7a34f2f7bb9850d77328085606719ac5c8f2f2f4cddbeff3c0d124957dc9f5d1efdf7dddc841d7795f8b63ae6b164f037e29f60c03159aea922a7cc2252
7
- data.tar.gz: a87a21a1eb27e79e550ec29b31a54fb889b0bf21c318b928dd10fdaa164a039b639fe3180e36fef86b98ed864870c2cd35066ff218820c38fb7d94cf14781d17
6
+ metadata.gz: fee2257076e00d82dbf4a09a012a8a6a8030555bcaf99686830870a75789ecea932c2d935191936c074515c0b94c0008c8a06e351559cf7696b7c04bc3bf8778
7
+ data.tar.gz: fb387e13667ba8ca83f0a6101e3fed16dbf2f484f03391edebec5c4786d38f1f3f73b071d72598292ed3c3e16313749606314e59155290832db74d44c604a0e9
@@ -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')
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.11'.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.11
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-01 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