public
Description: El Dorado is a full-stack community web application written in Ruby/Rails.
Homepage: http://almosteffortless.com/eldorado/
Clone URL: git://github.com/trevorturk/el-dorado.git
fixing bug with mini calendar, but it still only shows one event per day

git-svn-id: http://eldorado.googlecode.com/svn/trunk@498 
9c008b19-a030-0410-9975-d76d301b4276
trevorturk (author)
Tue Oct 23 20:51:24 -0700 2007
commit  b3d104b63cbb94938d530a6e0635af327033eab8
tree    c0cb8c54e8ea925e5410fdcdd4f445e5f2cc39e2
parent  60db7f65b2befcfc063ad9b0c618e2b8e66c6216
...
7
8
9
10
 
11
12
 
13
14
15
...
7
8
9
 
10
11
 
12
13
14
15
0
@@ -7,9 +7,9 @@ class EventsController < ApplicationController
0
   def index
0
     @date = Time.parse("#{params[:date]} || TzTime.now")
0
     if logged_in?
0
- @events = Event.paginate(:page => params[:page], :order => 'updated_at desc')
0
+ @events = Event.find(:all, :conditions => ['created_at between ? and ?', @date.strftime("%Y-%m") + '-01', @date.next_month.strftime("%Y-%m") + '-01'])
0
     else
0
- @events = Event.paginate(:page => params[:page], :order => 'updated_at desc', :conditions => ["private = ?", false])
0
+ @events = Event.find(:all, :conditions => ['created_at between ? and ? and private = ?', @date.strftime("%Y-%m") + '-01', @date.next_month.strftime("%Y-%m") + '-01', false])
0
     end
0
   end
0
 
...
4
5
6
7
 
8
9
10
...
4
5
6
 
7
8
9
10
0
@@ -4,7 +4,7 @@ class HomeController < ApplicationController
0
     if logged_in?
0
       @date = Time.parse("#{params[:date]} || TzTime.now")
0
       @topics = Topic.find(:all, :limit => 30, :include => [:user, :forum, :last_poster], :order => 'topics.last_post_at desc')
0
- @events = Event.find(:all, :limit => 30, :order => 'updated_at desc')
0
+ @events = Event.paginate(:page => params[:page], :conditions => ['created_at between ? and ?', @date.strftime("%Y-%m") + '-01', @date.next_month.strftime("%Y-%m") + '-01'])
0
       @uploads = Upload.find(:all, :limit => 5, :include => :user, :order => 'uploads.updated_at desc')
0
       @headers = Header.find(:all, :limit => 3, :include => :user, :order => 'headers.created_at desc')
0
       @users = User.find(:all, :limit => 3, :order => 'profile_updated_at desc')
...
5
6
7
8
 
9
10
11
...
15
16
17
18
 
19
20
...
5
6
7
 
8
9
10
11
...
15
16
17
 
18
19
20
0
@@ -5,7 +5,7 @@ calendar({:year => @date.year, :month => @date.month}) do |d|
0
   cell_attrs[:class] += 'todayDay ' if (d.to_date == TzTime.now.to_date)
0
   @events.each do |e|
0
     if e.date.to_date == d
0
- cell_text = "#{ link_to d.mday, events_path, :id => 'cal-' + e.id.to_s }"
0
+ cell_text = "#{ link_to d.mday, events_path, :id => 'cal-' + d.to_date.to_s }"
0
       cell_attrs[:class] += 'specialDay '
0
     end
0
   end
0
@@ -15,6 +15,6 @@ end
0
 
0
 <script type="text/javascript">
0
 <% @events.each do |e| %>
0
- <%= "var my_tooltip = new Tooltip('#{'cal-' + e.id.to_s }', '#{e.title}')" %>
0
+ <%= "var my_tooltip = new Tooltip('#{'cal-' + e.date.to_date.to_s }', '#{e.title}')" %>
0
 <% end %>
0
 </script>
...
465
466
467
468
 
469
470
471
...
465
466
467
 
468
469
470
471
0
@@ -465,7 +465,7 @@ cite {
0
 }
0
 
0
 .home-right .specialDay {
0
- background: #d1d1d1;
0
+ background: #e1e1e1;
0
 }
0
 
0
 .home-right .specialDay a:link, .home-right .specialDay a:visited {

Comments

    No one has commented yet.