schedulable 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MmY2ZDcyZTUzMjFkNGM2MGYxZGM2NzFiMTlhM2RkMTUyZWM1ODg4OQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YzcxODQ4ZGY1NjA3OTA1OGUxNDU1MWE0YTEzM2NmOTQ3ZGU5OGY1Yw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZTU2OWRjM2I0NTYyM2FhNmUxNjVmYWUxNDQ4MTg0OWRkODA5NzU3MDQ3NjVh
|
10
|
+
Yjg2M2NhMjYyNmU1NmZkMDZjNGEwY2I5OGY0NzZkYmU4MmNiODA0YjhjOTNl
|
11
|
+
MWVkNGY1ZmZjZTJmOGQ4N2VkYTUwMjdhZWI0NmIyMTc1NGQ1YWI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ODIzOWVlYzY4ZGEyN2FkMWIyZDM2NmVhZTYzYjQ1NjBkM2I0MzQ5NDRhNWI0
|
14
|
+
ODA4NGFmMzRkY2U4MjEwYWZmMjI0NjcwNWQ0NjY1MmMwMGZkZjE1ZjUxOTFm
|
15
|
+
Mzc5OTNlNjE5YmQ5ODQwZDQ5NWE5MTIzM2RiMDk0NDU5ODY1ZTc=
|
@@ -15,14 +15,14 @@ class ScheduleInput < SimpleForm::Inputs::Base
|
|
15
15
|
|
16
16
|
b.template.content_tag("div", {id: b.object_name.to_s.gsub(/\]\[|[^-a-zA-Z0-9:.]/,"_").sub(/_$/,"")}) do
|
17
17
|
|
18
|
-
b.input(:rule, collection: ['singular', 'daily', 'weekly', 'monthly'], label_method: lambda { |i| i.capitalize }, label: false) <<
|
18
|
+
b.input(:rule, collection: ['singular', 'daily', 'weekly', 'monthly'], label_method: lambda { |i| I18n.t("schedulable.rules.#{i}") || i.capitalize }, label: false) <<
|
19
19
|
|
20
20
|
template.content_tag("div", {data: {group: 'singular'}}) do
|
21
21
|
b.input :date
|
22
22
|
end <<
|
23
23
|
|
24
24
|
template.content_tag("div", {data: {group: 'weekly'}}) do
|
25
|
-
b.input :days, collection: Time::DAYS_INTO_WEEK.invert.values, label_method: lambda { |v| v.capitalize }, as: :check_boxes
|
25
|
+
b.input :days, collection: Time::DAYS_INTO_WEEK.invert.values, label_method: lambda { |v| I18n.t("date.day_names")[Time::DAYS_INTO_WEEK[v]] || v.capitalize }, as: :check_boxes
|
26
26
|
end <<
|
27
27
|
|
28
28
|
template.content_tag("div", {data: {group: 'monthly'}}) do
|
@@ -30,21 +30,21 @@ class ScheduleInput < SimpleForm::Inputs::Base
|
|
30
30
|
|
31
31
|
template.content_tag("div", class: 'form-group') do
|
32
32
|
|
33
|
-
db.label(
|
33
|
+
db.label(I18n.t("activerecord.attributes.schedule.day_of_week"), required: false) <<
|
34
34
|
|
35
35
|
template.content_tag("table", style: 'min-width: 280px') do
|
36
36
|
template.content_tag("tr") do
|
37
37
|
template.content_tag("td") <<
|
38
|
-
['
|
38
|
+
['1st', '2nd', '3rd', '4th', 'last'].reduce(''.html_safe) { | x, item |
|
39
39
|
x << template.content_tag("td") do
|
40
|
-
db.label(item, required: false)
|
40
|
+
db.label(I18n.t("schedulable.monthly_week_names.#{item}") || item, required: false)
|
41
41
|
end
|
42
42
|
}
|
43
43
|
end <<
|
44
44
|
Time::DAYS_INTO_WEEK.invert.values.reduce(''.html_safe) { | x, weekday |
|
45
45
|
x << template.content_tag("tr") do
|
46
46
|
template.content_tag("td") do
|
47
|
-
db.label t(
|
47
|
+
db.label I18n.t("date.day_names")[Time::DAYS_INTO_WEEK[weekday]] || weekday, required: false
|
48
48
|
end <<
|
49
49
|
db.collection_check_boxes(weekday.to_sym, [1, 2, 3, 4, -1], lambda { |i| i} , lambda { |i| " ".html_safe}, item_wrapper_tag: :td, checked: db.object.send(weekday))
|
50
50
|
end
|
data/lib/schedulable/version.rb
CHANGED