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 +4 -4
- data/app/helpers/effective_resources_helper.rb +16 -1
- data/app/models/concerns/acts_as_slugged.rb +2 -0
- data/app/models/effective/attribute.rb +1 -1
- data/app/models/effective/resources/i18n.rb +1 -1
- data/app/views/effective/acts_as_email_notification/_fields.html.haml +2 -2
- data/app/views/effective/acts_as_published/_fields.html.haml +9 -0
- data/app/views/effective/acts_as_slugged/_fields.html.haml +3 -0
- data/lib/effective_resources/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e7440ef830150c8ec4c369c08cb58cc5bb3415caab9db4faea965c3cb7e11e0c
|
4
|
+
data.tar.gz: bf4772a488fd33850bcc4c516ff9b46091a257d1ebbe2549a84dfc09b15f011f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
@@ -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.
|
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
|
@@ -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}"}
|
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}"}
|
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>")
|
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.
|
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-
|
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
|