diff options
| author | hukl <contact@smyck.org> | 2009-09-10 13:29:14 +0200 |
|---|---|---|
| committer | hukl <contact@smyck.org> | 2009-09-10 13:29:14 +0200 |
| commit | 8194cd82d7cb70c5b81bec8ee7a82b542c2570e9 (patch) | |
| tree | 19c8feba1043492ca191dfd04d58cd513d74fe06 /app/helpers | |
| parent | cc401c9bf20995bc4e02ba835847a7578e727d0c (diff) | |
show the next event if none are found for the next 14 days. Closes #19
Diffstat (limited to 'app/helpers')
| -rw-r--r-- | app/helpers/content_helper.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/helpers/content_helper.rb b/app/helpers/content_helper.rb index 5a288ed..c85fcf5 100644 --- a/app/helpers/content_helper.rb +++ b/app/helpers/content_helper.rb | |||
| @@ -10,6 +10,11 @@ module ContentHelper | |||
| 10 | 10 | ||
| 11 | def calendar | 11 | def calendar |
| 12 | occurrences = Occurrence.find_in_range(Time.now, (Time.now+14.days)) | 12 | occurrences = Occurrence.find_in_range(Time.now, (Time.now+14.days)) |
| 13 | |||
| 14 | if occurrences.empty? | ||
| 15 | occurrences = Occurrence.find_next | ||
| 16 | end | ||
| 17 | |||
| 13 | render( | 18 | render( |
| 14 | :partial => 'content/front_page_calendar', | 19 | :partial => 'content/front_page_calendar', |
| 15 | :locals => {:occurrences => occurrences} | 20 | :locals => {:occurrences => occurrences} |
