%-# Fedena #Copyright 2010 Foradian Technologies Private Limited # #This product includes software developed at #Project Fedena - http://www.projectfedena.org/ # #Licensed under the Apache License, Version 2.0 (the "License"); #you may not use this file except in compliance with the License. #You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # #Unless required by applicable law or agreed to in writing, #software distributed under the License is distributed on an #"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY #KIND, either express or implied. See the License for the #specific language governing permissions and limitations #under the License. -%>
| <%= t('name') %> | <% current_day = @local_tzone_time.to_date %> <% if @config.config_value=='Daily' %> <% @dates.each do |date| %> <% if current_day.strftime("%a %d %y") == date.strftime("%a %d %y") %><%= I18n.l(date,:format=>"%a") %> <%= date.strftime("%d") %> |
<% else %>
<%= I18n.l(date,:format=>"%a") %> <%= date.strftime("%d") %> |
<% end %>
<% end %>
<% else %>
<% @dates_key.each do |date| %>
<% unless @dates[date].nil? %>
<% @dates[date].each do |v| %>
<% if current_day.strftime("%a %d %y") == date.strftime("%a %d %y") %>
<%= I18n.l(date,:format=>"%a") %> <%= date.strftime("%d") %> |
<% else %>
<%= I18n.l(date,:format=>"%a") %> <%= date.strftime("%d") %> |
<% end %>
<% end %>
<% end %>
<% end %>
<% end %>
|
<%= student.first_name %>
<%= student.full_name %>
|
<% if @config.config_value=='Daily' %>
<% @dates.each do |date| %>
<% @absent = Attendance.find_by_student_id_and_month_date(student.id, date) %>
<% if current_day.strftime("%a %d %y") == date.strftime("%a %d %y") %>
<% else %> |
<% end %>
<% unless @absent.nil? %>
<%= link_to_remote('X', {:url => edit_attendance_path(@absent), :method => 'get'}, :class =>'absent') %>
<% else %>
<%= link_to_remote( 'O',
{:url => {:controller =>'attendances', :action => 'new', :month_date=> date, :student_id =>student.id}}, :class=>'present' ) %>
<% end %>
<%= I18n.l(date,:format=>"%a %d") %>
<%= student.full_name %>
|
<% end %>
<% else %>
<% @dates_key.each do |date| %>
<% unless @dates[date].nil? %>
<% @dates[date].each do |v| %>
<% @absent = SubjectLeave.find_by_student_id_and_subject_id_and_month_date_and_class_timing_id(student.id, v.subject_id, date, v.class_timing_id) %>
<% if current_day.strftime("%a %d %y") == date.strftime("%a %d %y") %>
-timing-<%= v.class_timing_id %>" class="td-mark active"> <% else %> | -timing-<%= v.class_timing_id %>" class="td-mark">
<% end %>
<% unless @absent.nil? %>
<%= link_to_remote('X', {:url => edit_attendance_path(@absent), :method => 'get'}, :class =>'absent') %>
<% else %>
<%= link_to_remote( 'O',
{:url => {:controller =>'attendances', :action => 'new', :id=> date.id, :id2 =>student.id, :timetable_entry=>v,:month_date=>date}}, :class=>'present' ) %>
<% end %>
<%#* %>
<%#*%>
<%#= I18n.l(date.month_date,:format=>"%a %d") %>
<%#* %>
%>
<%#= student.full_name %>
<%#* %>
<%#*%>
<%#* |
<% end %>
<% end %>
<% end %>
<% end %>