From 6003770813a356b5e08bffe3f5c55611bc62077b Mon Sep 17 00:00:00 2001 From: echarp Date: Sun, 29 Dec 2013 16:17:33 +0100 Subject: [PATCH] =?UTF-8?q?Utilisation=20d'un=20fork=20de=20simple=5Fcalen?= =?UTF-8?q?dar,=20qui=20g=C3=A8re=20des=20=C3=A9v=C3=A9nements=20sur=20plu?= =?UTF-8?q?sieurs=20jours?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile | 2 +- Gemfile.lock | 13 +++++++++---- app/assets/stylesheets/events.css.sass | 2 ++ app/controllers/events_controller.rb | 4 +--- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/Gemfile b/Gemfile index 142f0800..96adedd1 100644 --- a/Gemfile +++ b/Gemfile @@ -51,7 +51,7 @@ gem 'jquery-turbolinks' gem 'font-awesome-rails' gem 'compass-rails', "~> 2.0.alpha.0" gem 'has_scope' -gem 'simple_calendar' +gem 'simple_calendar', github: 'echarp/simple_calendar' group :development do gem 'guard-livereload' diff --git a/Gemfile.lock b/Gemfile.lock index 53fd0e37..a240bff6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,13 @@ +GIT + remote: git://github.com/echarp/simple_calendar.git + revision: 415838f60847068bc29459f5a275c04d4db05ee9 + specs: + simple_calendar (0.1.9) + rails (>= 3.0) + GIT remote: git://github.com/gregbell/active_admin.git - revision: 10105176ff64013e0db6d5464cfed4049edf052b + revision: 5e4fe269a32e491d8454ed586a5321a6cfc088cd specs: activeadmin (1.0.0.pre) arbre (~> 1.0) @@ -196,8 +203,6 @@ GEM sdoc (0.3.20) json (>= 1.1.3) rdoc (~> 3.10) - simple_calendar (0.1.9) - rails (>= 3.0) slop (3.4.7) sprockets (2.10.1) hike (~> 1.2) @@ -247,6 +252,6 @@ DEPENDENCIES rails-i18n sass-rails sdoc - simple_calendar + simple_calendar! turbolinks uglifier diff --git a/app/assets/stylesheets/events.css.sass b/app/assets/stylesheets/events.css.sass index 4919543d..b314a495 100644 --- a/app/assets/stylesheets/events.css.sass +++ b/app/assets/stylesheets/events.css.sass @@ -56,6 +56,7 @@ table.calendar padding-left: 15px list-style-type: circle li + color: #444 padding: 0 margin-bottom: 5px @@ -64,6 +65,7 @@ table.calendar line-height: 1.1em strong:after content: ':' + margin-right: -1px a:link, a:visited color: #666 font-weight: normal diff --git a/app/controllers/events_controller.rb b/app/controllers/events_controller.rb index 3a4f88fb..a2fe0778 100644 --- a/app/controllers/events_controller.rb +++ b/app/controllers/events_controller.rb @@ -1,12 +1,10 @@ class EventsController < InheritedResources::Base - has_scope :region - def index params[:year] ||= Date.today.year params[:month] ||= Date.today.month @events = Event.month(params[:year], params[:month]) - if (params[:region]) + if (params[:region] && params[:region].present?) @events = @events.region(params[:region]) end end