Permalink
Browse files

Showing rows for projects and users with no entries.

  • Loading branch information...
1 parent 7b11617 commit 8c8cfc1da005dc90cd637767eb5bd03660593994 @bradbeattie bradbeattie committed Apr 24, 2009
Showing with 24 additions and 27 deletions.
  1. +24 −27 app/views/schedules/_calendar.html.erb
@@ -33,34 +33,31 @@
end
focus_objects.each do |focus_object|
- if !schedule_entries_by_focus[focus_object.id].nil?
- entries = schedule_entries_by_focus[focus_object.id]
- @user = focus_object if @focus == "users"
- @project = focus_object if @focus == "projects"
- schedule_entries_by_day = entries.group_by {|entry| entry.date}
- %>
- <tr>
- <th>
- <%= link_to @project, :controller => 'schedules', :action => 'index', :date => @date, :project_id => @project unless @project.nil? %>
- <%= link_to @user, :controller => 'schedules', :action => 'index', :date => @date, :user_id => @user unless @user.nil? %>
- </th>
- <% (calendar.startdt..calendar.enddt).each do |day| %>
- <td class="even<%= ' today' if Date.today == day %>">
- <ul>
- <% if !schedule_entries_by_day[day].nil? %>
- <% schedule_entries_by_day[day].sort.each do |entry| %>
- <%= render :partial => 'schedules/schedule_entry', :locals => {:entry => entry} %>
- <% end %>
+ entries = schedule_entries_by_focus[focus_object.id]
+ @user = focus_object if @focus == "users"
+ @project = focus_object if @focus == "projects"
+ schedule_entries_by_day = entries.group_by {|entry| entry.date} unless entries.nil? %>
+ <tr>
+ <th>
+ <%= link_to @project, :controller => 'schedules', :action => 'index', :date => @date, :project_id => @project unless @project.nil? %>
+ <%= link_to @user, :controller => 'schedules', :action => 'index', :date => @date, :user_id => @user unless @user.nil? %>
+ </th>
+ <% (calendar.startdt..calendar.enddt).each do |day| %>
+ <td class="even<%= ' today' if Date.today == day %>">
+ <ul>
+ <% if !schedule_entries_by_day.nil? && !schedule_entries_by_day[day].nil? %>
+ <% schedule_entries_by_day[day].sort.each do |entry| %>
+ <%= render :partial => 'schedules/schedule_entry', :locals => {:entry => entry} %>
<% end %>
- <% if @focus == "users" %>
- <% hours = @availabilities[day][focus_object.id] %>
- <%= render :partial => 'schedules/availability', :locals => {:user => @user, :hours => hours, :day => day } %>
- <% end unless @availabilities.nil? || @availabilities.empty? %>
- </ul>
- </td>
- <% end %>
- </tr>
- <% end %>
+ <% end %>
+ <% if @focus == "users" %>
+ <% hours = @availabilities[day][focus_object.id] %>
+ <%= render :partial => 'schedules/availability', :locals => {:user => @user, :hours => hours, :day => day } %>
+ <% end unless @availabilities.nil? || @availabilities.empty? %>
+ </ul>
+ </td>
+ <% end %>
+ </tr>
<% end %>
<% @project = nil %>
<% @user = nil %>

0 comments on commit 8c8cfc1

Please sign in to comment.