bookyt_projects 0.19.23 → 0.20.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,6 +3,8 @@ class ActivitiesController < AuthorizedController
3
3
  belongs_to :person, :optional => true
4
4
 
5
5
  has_scope :by_date
6
+ has_scope :by_period, :using => [:from, :to]
7
+ has_scope :by_project_id
6
8
 
7
9
  def new
8
10
  # Allow callers specifying defaults
@@ -7,6 +7,16 @@ class Activity < ActiveRecord::Base
7
7
 
8
8
  # Scopes
9
9
  scope :by_date, lambda {|value| where(:date => value)}
10
+ scope :by_period, lambda {|value|
11
+ if value.is_a? Array
12
+ where(:date => (value[0]..value[1]))
13
+ else
14
+ where(:date => value)
15
+ end
16
+ }
17
+ scope :by_project_id, lambda {|value|
18
+ where(:project_id => value) if value.present?
19
+ }
10
20
 
11
21
  # Sorting
12
22
  default_scope order("date DESC")
@@ -1,4 +1,5 @@
1
1
  %tr[activity]
2
- %td= activity.person
3
2
  %td= link_to activity.date, activity, {'data-href-container' => 'tr'}
3
+ %td= activity.person
4
+ %td= activity.project
4
5
  %td= t('bookyt.projects.hours', :duration => "%0.2f" % activity.duration)
@@ -1,7 +1,9 @@
1
1
  %table.table.table-striped.activities.collection
2
2
  %thead
3
3
  %tr
4
- - [:person, :date, :duration].each do |attr|
4
+ - [:date, :person, :project, :duration].each do |attr|
5
5
  %th= t_attr(attr, Activity)
6
6
  %tbody
7
7
  = render collection
8
+
9
+ = render 'sidebar'
@@ -0,0 +1,10 @@
1
+ - filter_name = :by_period
2
+ - content_for :sidebar do
3
+ - filters = month_periods
4
+ = boot_nav_filter(filter_name, [{:title => t('bookyt.all'), :value => nil}] + filters)
5
+
6
+
7
+ - filter_name = :by_project_id
8
+ - content_for :sidebar do
9
+ - filters = Project.all.collect{|project| {:title => project.to_s, :value => project.id} }
10
+ = boot_nav_filter(filter_name, [{:title => t('bookyt.all'), :value => nil}] + filters)
@@ -53,6 +53,8 @@ de:
53
53
  title: Zeit erfassen
54
54
  list:
55
55
  title: Aktivitäten
56
+ index:
57
+ title: Aktivitäten
56
58
  timesheet:
57
59
  title: Stundenrapport
58
60
 
@@ -5,6 +5,7 @@ module BookytProjects
5
5
  projects.item :project_index, t_title(:index, Project), projects_path, :highlights_on => /\/(projects|activities)($|\/[0-9]*($|\/.*))/
6
6
  projects.item :new_project, t_title(:new, Project), new_project_path
7
7
  projects.item :divider, "", :class => 'divider'
8
+ projects.item :activities, t_title(:index, Activity), activities_path
8
9
  projects.item :capture_hours, t('activities.new.title'), new_batch_activity_path
9
10
  end
10
11
  end
@@ -1,3 +1,3 @@
1
1
  module BookytPos
2
- VERSION = '0.19.23'
2
+ VERSION = '0.20.0'
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: 125
4
+ hash: 79
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 19
9
- - 23
10
- version: 0.19.23
8
+ - 20
9
+ - 0
10
+ version: 0.20.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Roman Simecek (CyT)
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2012-04-12 00:00:00 Z
19
+ date: 2012-04-15 00:00:00 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: rails
@@ -116,6 +116,7 @@ files:
116
116
  - app/views/activities/_activity.html.haml
117
117
  - app/views/activities/_form.html.haml
118
118
  - app/views/activities/_list.html.haml
119
+ - app/views/activities/_sidebar.html.haml
119
120
  - app/views/batch_activities/_form.html.haml
120
121
  - app/views/batch_activities/new.html.haml
121
122
  - app/views/people/_show_activities.html.haml
@@ -182,7 +183,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
182
183
  requirements: []
183
184
 
184
185
  rubyforge_project:
185
- rubygems_version: 1.8.10
186
+ rubygems_version: 1.8.15
186
187
  signing_key:
187
188
  specification_version: 3
188
189
  summary: Project management plugin for bookyt