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
- ODA5YmNlNTU0OGNmNTk3YmU2MDRiNDZjYjQ3ZGUyMmY1NmYxNmNhYg==
4
+ MmY2ZDcyZTUzMjFkNGM2MGYxZGM2NzFiMTlhM2RkMTUyZWM1ODg4OQ==
5
5
  data.tar.gz: !binary |-
6
- YWJlMWMwODE2NTRkYjRlYmI1YjkxODAwYmZhMjM0ZjBjM2IzYjllZQ==
6
+ YzcxODQ4ZGY1NjA3OTA1OGUxNDU1MWE0YTEzM2NmOTQ3ZGU5OGY1Yw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MzQyYmY5M2MyMDUwMDMwODhmYjkzZDM5MTVlNDM0ZDQwOWY3ZTkwMTNhMmVi
10
- OTFiNDU4ZmZkMTgyMzEwMTIyYzUwMDFkM2VjMzJjMjVhOTlmMzc4NTcxMGUy
11
- OTU5MDcwZGIyYjhhNDFhMDljMGIzNjdlNDNlYTMyZmY0MWE5ZGQ=
9
+ ZTU2OWRjM2I0NTYyM2FhNmUxNjVmYWUxNDQ4MTg0OWRkODA5NzU3MDQ3NjVh
10
+ Yjg2M2NhMjYyNmU1NmZkMDZjNGEwY2I5OGY0NzZkYmU4MmNiODA0YjhjOTNl
11
+ MWVkNGY1ZmZjZTJmOGQ4N2VkYTUwMjdhZWI0NmIyMTc1NGQ1YWI=
12
12
  data.tar.gz: !binary |-
13
- NDEyMDlkZDZiYzRiMjNhMjkzZWMxMDFmZDQ0Yjk4MTQzMGExMDlhODA3OTdl
14
- NWE0NmE4ZWUzYzFmZGNmOTY1OTUwMDBmMzUwYWQ1NDI0ODU3ZDBlMWJiNWNk
15
- ZDY3MTc1M2YwNDExZTcyNDEyYTliNDliYWVhNzg5ZjU4ZDA1ZWM=
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(:day_of_week, required: false) <<
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
- ['1.', '2.', '3.', '4.', 'Last'].reduce(''.html_safe) { | x, item |
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(weekday.capitalize), required: false
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| "&nbsp;".html_safe}, item_wrapper_tag: :td, checked: db.object.send(weekday))
50
50
  end
@@ -1,3 +1,3 @@
1
1
  module Schedulable
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: schedulable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rafael Nowrotek