Browse Source

Utilisation d'un fork de simple_calendar, qui gère des événements sur plusieurs jours

recurrent
echarp 8 years ago
parent
commit
6003770813
  1. 2
      Gemfile
  2. 13
      Gemfile.lock
  3. 2
      app/assets/stylesheets/events.css.sass
  4. 4
      app/controllers/events_controller.rb

2
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'

13
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

2
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

4
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

Loading…
Cancel
Save