<commit_before>
<%=define_grid @time_report_grid, hide_submit_button: true, hide_reset_button: true, hide_csv_button: false do |e|

  #e.column name: l(:field_user_id), html: {style: 'text-align: center'}, 
  #:attribute => 'user_id',#model:'User',
  #detach_with_id: 'user_filter'   do |t|
  #t.user.name unless t.user.nil? 
  ##t.user.grou
  #end
  e.column name: l(:field_user_id), html: {style: 'text-align: center'}, 
    :attribute => 'user_id',
    detach_with_id: 'user_filter' ,
    custom_filter: User.active.collect{|u|[u.name, u.id]}  do |t|
    t.user.name unless t.user.nil? 
    end

  e.column name: l(:field_check_in_time), html: {style: 'text-align: center' }, 
    :attribute => 'check_in_time'  , 
    detach_with_id: 'check_in_time_filter' 

  e.column name: l(:field_check_out_time), html: {style: 'text-align: center'}, 
    :attribute => 'check_out_time', 
    detach_with_id: 'check_out_time_filter'

  e.column name: 'Time Checked', html: {style: 'text-align: center'}   do |t|
    unless t.time_spent.nil?
      time_spent_date = Time.new(Time.now.year) + t.time_spent
      time_spent_date.strftime("%H:%M:%S") 
    end
  end
  
  e.column name: 'Time Logged', html: {style: 'text-align: center'}   do |t|
  @time_spent_today = TimeEntry.where(['user_id = ? and created_on between ? and ?', t.user_id,t.check_in_time,t.check_out_time]).sum(:hours)
   logger.debug("\nMOO: #{t.inspect}\n")
   logger.debug("\nMOO: #{@time_spent_today}\n")
    unless t.time_spent.nil?
      #time_spent_date = Time.new(Time.now.year) +  @time_spent_today * 60 * 60
      @time_spent_today.round(2)
      #time_spent_date.strftime("%H:%M:%S") 
    end
  end

end %><commit_msg>more fixes<commit_after>
<%=define_grid @time_report_grid, hide_submit_button: true, hide_reset_button: true, hide_csv_button: false do |e|

  #e.column name: l(:field_user_id), html: {style: 'text-align: center'}, 
  #:attribute => 'user_id',#model:'User',
  #detach_with_id: 'user_filter'   do |t|
  #t.user.name unless t.user.nil? 
  ##t.user.grou
  #end
  e.column name: l(:field_user_id), html: {style: 'text-align: center'}, 
    :attribute => 'user_id',
    detach_with_id: 'user_filter' ,
    custom_filter: User.active.collect{|u|[u.name, u.id]}  do |t|
    t.user.name unless t.user.nil? 
    end

  e.column name: l(:field_check_in_time), html: {style: 'text-align: center' }, 
    :attribute => 'check_in_time'  , 
    detach_with_id: 'check_in_time_filter' 

  e.column name: l(:field_check_out_time), html: {style: 'text-align: center'}, 
    :attribute => 'check_out_time', 
    detach_with_id: 'check_out_time_filter'

  e.column name: 'Time Checked', html: {style: 'text-align: center'}   do |t|
    unless t.time_spent.nil?
      time_spent_date = Time.new(Time.now.year) + t.time_spent
      time_spent_date.strftime("%H:%M:%S") 
    end
  end
  
  e.column name: 'Time Logged', html: {style: 'text-align: center'}   do |t|

  if params["time_checks_grid"].nil?
    @time_spent_today = TimeEntry.where(['user_id = ? and date(created_on) = date(CURDATE())', t.user_id]).sum(:hours)
  else
    @time_spent_today = TimeEntry.where(['user_id = ? and created_on between ? and ?', t.user_id,t.check_in_time,t.check_out_time]).sum(:hours)
  end




  @time_spent_today = TimeEntry.where(['user_id = ? and created_on between ? and ?', t.user_id,t.check_in_time,t.check_out_time]).sum(:hours)
   logger.debug("\nMOO: #{params.inspect}\n")
   logger.debug("\nMOO: #{@time_spent_today}\n")
    unless t.time_spent.nil?
      #time_spent_date = Time.new(Time.now.year) +  @time_spent_today * 60 * 60
      @time_spent_today.round(2)
      #time_spent_date.strftime("%H:%M:%S") 
    end
  end

end %>
{'fraction_non_alphanumeric': 0.16657638136511377, 'fraction_numerical': 0.0027085590465872156, 'mean_word_length': 4.072802197802198, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4115701', 'n_tokens_mistral': 1512, 'n_tokens_neox': 1437, 'n_words': 262}