bookyt_projects 0.19.8 → 0.19.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,8 @@
1
1
  class TimesheetsController < ApplicationController
2
2
  def index
3
3
  @employee = Employee.find(params[:employee_id])
4
+ WorkDay.create_or_update_upto(@employee, Date.today.end_of_month)
5
+ range = Date.today.beginning_of_month..Date.today.end_of_month
6
+ @work_days = @employee.work_days.where(:date => range)
4
7
  end
5
8
  end
@@ -1 +1,9 @@
1
- = render 'timesheets/show'
1
+ - WorkDay.create_or_update_upto(@employee, Date.today.end_of_month)
2
+
3
+ .row
4
+ .span8
5
+ - range = Date.parse('2012-01-01')..Date.parse('2012-01-31')
6
+ = render 'timesheets/show', :work_days => @employee.work_days.where(:date => range)
7
+ .span8
8
+ - range = Date.today.beginning_of_month..Date.today.end_of_month
9
+ = render 'timesheets/show', :work_days => @employee.work_days.where(:date => range)
@@ -1,3 +1,5 @@
1
+ %h3= "%s - %s" % [work_days.first.date, work_days.last.date]
2
+
1
3
  %table.condensed-table.span8
2
4
  %tr
3
5
  %th= t_attr :date, Activity
@@ -5,17 +7,15 @@
5
7
  %th.right= t_attr :overtime, Activity
6
8
  %th.right= t_attr :overall_overtime, Activity
7
9
 
8
- - WorkDay.create_or_update_upto(@employee, Date.today.end_of_month)
9
- - range = Date.today.beginning_of_month..Date.today.end_of_month
10
- - @employee.work_days.where(:date => range).each do |day|
10
+ - work_days.each do |day|
11
11
  - tr_params = {:class => work_day_classes(day)}
12
12
  - tr_params.merge!(:rel => 'popover', 'data-content' => h(render 'timesheets/activities_popover', :activities => day.activities), 'data-original-title' => 'Aktivitäten', 'data-html' => 'true') unless day.activities.empty?
13
13
  %tr{tr_params}
14
14
  %td
15
15
  - if day.activities.empty?
16
- = link_to l(day.date, :format => '%a, %d.%m.%Y'), new_activity_path(:activity => {:person_id => @employee.id, :date => day.date.to_s(:db)}), 'data-href-container' => 'tr'
16
+ = link_to l(day.date, :format => '%a, %d.%m.%Y'), new_activity_path(:activity => {:person_id => day.person_id, :date => day.date.to_s(:db)}), 'data-href-container' => 'tr'
17
17
  - else
18
- = link_to l(day.date, :format => '%a, %d.%m.%Y'), person_activities_path(@employee, :by_date => day.date.to_s(:db)), 'data-href-container' => 'tr'
18
+ = link_to l(day.date, :format => '%a, %d.%m.%Y'), person_activities_path(day.person, :by_date => day.date.to_s(:db)), 'data-href-container' => 'tr'
19
19
  %td.right
20
20
  %span.strong= "%0.2f" % day.hours_worked
21
21
  = "(%0.2f)" % day.hours_due
@@ -4,4 +4,4 @@
4
4
  .page-header
5
5
  %h1= t_title
6
6
 
7
- = render 'show'
7
+ = render 'show', :work_days => @work_days
@@ -1,3 +1,3 @@
1
1
  module BookytPos
2
- VERSION = '0.19.8'
2
+ VERSION = '0.19.9'
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bookyt_projects
3
3
  version: !ruby/object:Gem::Version
4
- hash: 67
4
+ hash: 65
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 19
9
- - 8
10
- version: 0.19.8
9
+ - 9
10
+ version: 0.19.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - Roman Simecek (CyT)
@@ -181,7 +181,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
181
181
  requirements: []
182
182
 
183
183
  rubyforge_project:
184
- rubygems_version: 1.8.10
184
+ rubygems_version: 1.8.15
185
185
  signing_key:
186
186
  specification_version: 3
187
187
  summary: Project management plugin for bookyt