Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ gem 'pg', platform: :ruby
gem 'activerecord-jdbcpostgresql-adapter', platform: :jruby

gem 'jquery-rails'
gem "jquery-ui-rails"

gem 'rails', '~> 4.0.12'
gem 'sass-rails', '~> 4.0.5'
70 changes: 38 additions & 32 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -37,28 +37,32 @@ GEM
tzinfo (~> 0.3.37)
arel (4.0.2)
builder (3.1.4)
coffee-rails (4.1.0)
coffee-rails (4.1.1)
coffee-script (>= 2.2.0)
railties (>= 4.0.0, < 5.0)
railties (>= 4.0.0, < 5.1.x)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.9.1.1)
coffee-script-source (1.10.0)
diff-lcs (1.2.5)
erubis (2.7.0)
execjs (2.6.0)
execjs (2.7.0)
hike (1.2.3)
i18n (0.7.0)
ice_cube (0.13.0)
jquery-rails (3.1.2)
ice_cube (0.14.0)
jquery-rails (3.1.4)
railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0)
mail (2.6.3)
mime-types (>= 1.16, < 3)
mime-types (2.6.2)
jquery-ui-rails (5.0.5)
railties (>= 3.2.16)
mail (2.6.4)
mime-types (>= 1.16, < 4)
mime-types (3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
minitest (4.7.5)
multi_json (1.11.2)
pg (0.17.1)
multi_json (1.12.1)
pg (0.18.4)
rack (1.5.5)
rack-test (0.6.3)
rack (>= 1.0)
Expand All @@ -75,27 +79,28 @@ GEM
activesupport (= 4.0.13)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (10.4.2)
rspec (3.1.0)
rspec-core (~> 3.1.0)
rspec-expectations (~> 3.1.0)
rspec-mocks (~> 3.1.0)
rspec-core (3.1.7)
rspec-support (~> 3.1.0)
rspec-expectations (3.1.2)
rake (11.1.2)
rspec (3.4.0)
rspec-core (~> 3.4.0)
rspec-expectations (~> 3.4.0)
rspec-mocks (~> 3.4.0)
rspec-core (3.4.4)
rspec-support (~> 3.4.0)
rspec-expectations (3.4.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.1.0)
rspec-mocks (3.1.3)
rspec-support (~> 3.1.0)
rspec-rails (3.1.0)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec-core (~> 3.1.0)
rspec-expectations (~> 3.1.0)
rspec-mocks (~> 3.1.0)
rspec-support (~> 3.1.0)
rspec-support (3.1.2)
rspec-support (~> 3.4.0)
rspec-mocks (3.4.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.4.0)
rspec-rails (3.4.2)
actionpack (>= 3.0, < 4.3)
activesupport (>= 3.0, < 4.3)
railties (>= 3.0, < 4.3)
rspec-core (~> 3.4.0)
rspec-expectations (~> 3.4.0)
rspec-mocks (~> 3.4.0)
rspec-support (~> 3.4.0)
rspec-support (3.4.1)
sass (3.2.19)
sass-rails (4.0.5)
railties (>= 4.0.0, < 5.0)
Expand All @@ -114,7 +119,7 @@ GEM
thor (0.19.1)
thread_safe (0.3.5)
tilt (1.4.1)
tzinfo (0.3.44)
tzinfo (0.3.49)

PLATFORMS
ruby
Expand All @@ -123,6 +128,7 @@ DEPENDENCIES
activerecord-jdbcpostgresql-adapter
bundler (>= 1.3.5)
jquery-rails
jquery-ui-rails
pg
rails (~> 4.0.12)
rake (>= 0.9.6)
Expand Down
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ Use :allow_blank for a "not recurring" option:
f.select_recurring :current_existing_rule, nil, :allow_blank => true
```

Use :data attribute to position the recurring select dialog inline (after the select input):

```ruby
f.select_recurring :current_existing_rule, nil, { :allow_blank => true }, { data: { recurring_select_position: 'inline' } }
```

### Additional Helpers

Expand Down Expand Up @@ -130,7 +135,15 @@ $.fn.recurring_select.options = {
monthly: {
show_week: [true, true, true, true, false, false] //display week 1, 2 .... Last
}
until: true //require until date
indefinite_until: true //until be set to indefinite
datepicker: {
firstDay: 1, # 1 = monday, 0 = sunday
beforeShowDayFunction: ->
},
close_on_outside_click: true
}

```

## Testing and Development
Expand Down
12 changes: 11 additions & 1 deletion app/assets/javascripts/recurring_select.js.coffee
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//= require jquery-ui
//= require recurring_select_dialog
//= require_self

Expand Down Expand Up @@ -76,7 +77,14 @@ $.fn.recurring_select = (method) ->
$.fn.recurring_select.options = {
monthly: {
show_week: [true, true, true, true, false, false]
}
},
until: true,
indefinite_until: true,
datepicker: {
firstDay: 1, # 1 = monday, 0 = sunday
beforeShowDayFunction: ->
},
close_on_outside_click: true
}

$.fn.recurring_select.texts = {
Expand All @@ -97,6 +105,8 @@ $.fn.recurring_select.texts = {
day_of_week: "Day of week"
cancel: "Cancel"
ok: "OK"
until: "Until"
repeats_indefinitely: "Repeats indefinitely"
summary: "Summary"
first_day_of_week: 0
days_first_letter: ["S", "M", "T", "W", "T", "F", "S" ]
Expand Down
Loading