effective_resources 2.25.9 → 2.25.11

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: c5e923e218d9738cf726a638f0d850c3b2b86e4177b040bc50b0a8a1665e4ba1
4
- data.tar.gz: 4d362460cea6561d38058ec8764e9e98c7e1b9a0899f49244de71a17a0e11942
3
+ metadata.gz: e7440ef830150c8ec4c369c08cb58cc5bb3415caab9db4faea965c3cb7e11e0c
4
+ data.tar.gz: bf4772a488fd33850bcc4c516ff9b46091a257d1ebbe2549a84dfc09b15f011f
5
5
  SHA512:
6
- metadata.gz: 2770956df98832a7d08471d6182643f3317daf85924d9797f0ac4e1863a26222bf9d4a16730e21a15d364a1fb04d0f88f26833ff198b201e1a2bc9a36bb7b881
7
- data.tar.gz: 979ca1c1afc1d8a2645072e3710b5d68436259082f16fb92e8d786953f5f027401fcb07e23afeeba97cc7b66af73d86803de412030341269298377d3224248d5
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
@@ -80,7 +80,7 @@ module Effective
80
80
  raise('expected an ActiveSupport::OrderedOptions') unless value.kind_of?(ActiveSupport::OrderedOptions)
81
81
  parse_ordered_options(value)
82
82
  when :date, :datetime
83
- date = Time.zone.parse(value) if value.to_s.include?('T')
83
+ date = Time.zone.parse(value) if value.kind_of?(String) && value.include?('T')
84
84
 
85
85
  date ||= if (digits = value.to_s.scan(/(\d+)/).flatten).present?
86
86
  if digits.first.length == 4 # 2017-01-10
@@ -27,7 +27,7 @@ module Effective
27
27
  return value unless value.include?(key) # missing translation
28
28
  end
29
29
 
30
- "Really #{human_action_name(action)} @resource?"
30
+ "Are you sure you want to #{human_action_name(action).downcase}?"
31
31
  end
32
32
 
33
33
  def human_name
@@ -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.9'.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.9
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-18 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