bookyt_projects 0.3.2 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile +1 -1
- data/Gemfile.lock +1 -1
- data/VERSION +1 -1
- data/app/controllers/activities_controller.rb +27 -0
- data/app/models/{task.rb → activity.rb} +5 -1
- data/app/models/project.rb +1 -1
- data/app/views/{tasks → activities}/_form.html.haml +1 -1
- data/app/views/{tasks → activities}/_resource_detail.html.haml +0 -0
- data/app/views/activities/show.html.haml +6 -0
- data/app/views/projects/_list.html.haml +2 -2
- data/app/views/projects/_resource_detail.html.haml +3 -3
- data/bookyt_projects.gemspec +10 -9
- data/config/locales/de.yml +2 -2
- data/config/routes.rb +2 -2
- data/lib/bookyt_projects/navigation.rb +3 -3
- metadata +12 -12
- data/app/controllers/tasks_controller.rb +0 -14
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.6.0
|
@@ -0,0 +1,27 @@
|
|
1
|
+
class ActivitiesController < AuthorizedController
|
2
|
+
belongs_to :project
|
3
|
+
|
4
|
+
def new
|
5
|
+
# Allow callers specifying defaults
|
6
|
+
@activity = Activity.new(params[:activity])
|
7
|
+
|
8
|
+
# Nested resources support
|
9
|
+
@activity.project_id ||= params[:project_id] if params[:project_id]
|
10
|
+
|
11
|
+
# Educated guessing of defaults
|
12
|
+
@activity.person = current_user.person if current_user
|
13
|
+
|
14
|
+
new!
|
15
|
+
end
|
16
|
+
|
17
|
+
def create
|
18
|
+
@activity = Activity.create(params[:activity])
|
19
|
+
@project = @activity.project
|
20
|
+
|
21
|
+
create! { project_path(@project) }
|
22
|
+
end
|
23
|
+
|
24
|
+
def index
|
25
|
+
redirect_to :projects
|
26
|
+
end
|
27
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
class
|
1
|
+
class Activity < ActiveRecord::Base
|
2
2
|
belongs_to :project
|
3
3
|
belongs_to :person
|
4
4
|
|
@@ -31,4 +31,8 @@ class Task < ActiveRecord::Base
|
|
31
31
|
|
32
32
|
minutes < 0 ? 1.day.to_i + minutes : minutes
|
33
33
|
end
|
34
|
+
|
35
|
+
def to_s
|
36
|
+
"#{duration} => #{person}"
|
37
|
+
end
|
34
38
|
end
|
data/app/models/project.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
= semantic_form_for @
|
1
|
+
= semantic_form_for @activity do |f| #when:date from:datetime to:datetime person_id:integer project_id:integer comment:string
|
2
2
|
= f.inputs do
|
3
3
|
= f.input :person
|
4
4
|
= f.input :project
|
File without changes
|
@@ -4,7 +4,7 @@
|
|
4
4
|
%tr
|
5
5
|
- @attributes.each do |field|
|
6
6
|
%th= t_attr field, collection.first.class
|
7
|
-
%th.new-task= t_title(:new,
|
7
|
+
%th.new-task= t_title(:new, Activity)
|
8
8
|
%th.action-links
|
9
9
|
|
10
10
|
- @attributes = @attributes - ['client_id', 'project_state_id']
|
@@ -15,7 +15,7 @@
|
|
15
15
|
%td= r.send(field) if r.respond_to?(field)
|
16
16
|
%td= r.client
|
17
17
|
%td= r.project_state
|
18
|
-
%td= link_to t_title(:new,
|
18
|
+
%td= link_to t_title(:new, Activity), new_project_activity_url(r)
|
19
19
|
%td.action-links
|
20
20
|
= list_link_for(:show, r)
|
21
21
|
= list_link_for(:edit, r)
|
@@ -15,11 +15,11 @@
|
|
15
15
|
%table.list
|
16
16
|
%tr
|
17
17
|
- [:person, :when, :duration].each do |attr|
|
18
|
-
%th= t_attr(attr,
|
19
|
-
- @project.
|
18
|
+
%th= t_attr(attr, Activity)
|
19
|
+
- @project.activities.each do |task|
|
20
20
|
%tr
|
21
21
|
%td= task.person
|
22
22
|
%td= task.when
|
23
23
|
%td= t('bookyt.projects.minutes', :duration => task.duration)
|
24
24
|
|
25
|
-
= link_to t_title(:new,
|
25
|
+
= link_to t_title(:new, Activity), new_project_activity_path(resource)
|
data/bookyt_projects.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{bookyt_projects}
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.6.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = [%q{Roman Simecek}]
|
12
|
-
s.date = %q{2011-
|
12
|
+
s.date = %q{2011-10-10}
|
13
13
|
s.description = %q{Rails engine for project management it's used to extend the functionallity of bookyt.}
|
14
14
|
s.email = %q{roman.simecek@cyt.ch}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -25,12 +25,15 @@ Gem::Specification.new do |s|
|
|
25
25
|
"Rakefile",
|
26
26
|
"VERSION",
|
27
27
|
"app/assets/stylesheets/bookyt_projects.sass",
|
28
|
+
"app/controllers/activities_controller.rb",
|
28
29
|
"app/controllers/project_states_controller.rb",
|
29
30
|
"app/controllers/projects_controller.rb",
|
30
|
-
"app/
|
31
|
+
"app/models/activity.rb",
|
31
32
|
"app/models/project.rb",
|
32
33
|
"app/models/project_state.rb",
|
33
|
-
"app/
|
34
|
+
"app/views/activities/_form.html.haml",
|
35
|
+
"app/views/activities/_resource_detail.html.haml",
|
36
|
+
"app/views/activities/show.html.haml",
|
34
37
|
"app/views/project_states/_form.html.haml",
|
35
38
|
"app/views/project_states/new.html.haml",
|
36
39
|
"app/views/projects/_form.html.haml",
|
@@ -38,8 +41,6 @@ Gem::Specification.new do |s|
|
|
38
41
|
"app/views/projects/_resource_detail.html.haml",
|
39
42
|
"app/views/projects/new.html.haml",
|
40
43
|
"app/views/projects/show.html.haml",
|
41
|
-
"app/views/tasks/_form.html.haml",
|
42
|
-
"app/views/tasks/_resource_detail.html.haml",
|
43
44
|
"bookyt_projects.gemspec",
|
44
45
|
"config/locales/de.yml",
|
45
46
|
"config/routes.rb",
|
@@ -59,20 +60,20 @@ Gem::Specification.new do |s|
|
|
59
60
|
s.specification_version = 3
|
60
61
|
|
61
62
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
62
|
-
s.add_runtime_dependency(%q<rails>, ["~> 3.1.0
|
63
|
+
s.add_runtime_dependency(%q<rails>, ["~> 3.1.0"])
|
63
64
|
s.add_development_dependency(%q<shoulda>, [">= 0"])
|
64
65
|
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
|
65
66
|
s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
|
66
67
|
s.add_development_dependency(%q<rcov>, [">= 0"])
|
67
68
|
else
|
68
|
-
s.add_dependency(%q<rails>, ["~> 3.1.0
|
69
|
+
s.add_dependency(%q<rails>, ["~> 3.1.0"])
|
69
70
|
s.add_dependency(%q<shoulda>, [">= 0"])
|
70
71
|
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
71
72
|
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
72
73
|
s.add_dependency(%q<rcov>, [">= 0"])
|
73
74
|
end
|
74
75
|
else
|
75
|
-
s.add_dependency(%q<rails>, ["~> 3.1.0
|
76
|
+
s.add_dependency(%q<rails>, ["~> 3.1.0"])
|
76
77
|
s.add_dependency(%q<shoulda>, [">= 0"])
|
77
78
|
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
78
79
|
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
data/config/locales/de.yml
CHANGED
@@ -3,7 +3,7 @@ de:
|
|
3
3
|
models:
|
4
4
|
project: Projekte
|
5
5
|
project_state: Projektstatus
|
6
|
-
|
6
|
+
activity: Arbeitsschritt
|
7
7
|
attributes:
|
8
8
|
project:
|
9
9
|
name: Bezeichnung
|
@@ -16,7 +16,7 @@ de:
|
|
16
16
|
client_id: Kunde
|
17
17
|
project_state:
|
18
18
|
name: Bezeichnung
|
19
|
-
|
19
|
+
activity:
|
20
20
|
person: Person
|
21
21
|
when: Datum
|
22
22
|
duration: Dauer
|
data/config/routes.rb
CHANGED
@@ -2,12 +2,12 @@ module BookytProjects
|
|
2
2
|
module Navigation
|
3
3
|
def setup_bookyt_projects(navigation)
|
4
4
|
navigation.item :projects, t_model(Project), projects_path, :if => Proc.new { user_signed_in? } do |projects|
|
5
|
-
projects.item :project_index, t_title(:index, Project), projects_path, :highlights_on => /\/(projects|
|
6
|
-
projects.item :capture_hours, t_title(:new,
|
5
|
+
projects.item :project_index, t_title(:index, Project), projects_path, :highlights_on => /\/(projects|activities)($|\/[0-9]*($|\/.*))/
|
6
|
+
projects.item :capture_hours, t_title(:new, Activity), new_activity_path
|
7
7
|
projects.item :new_project, t_title(:new, Project), new_project_path
|
8
8
|
projects.item :project_states, t_model(ProjectState), project_states_path, :highlights_on => /\/project_states($|\/([0-9]*|new)($|\/.*))/
|
9
9
|
end
|
10
|
-
navigation.item :capture_hours, t_title(:new,
|
10
|
+
navigation.item :capture_hours, t_title(:new, Activity), new_activity_path, :if => Proc.new { user_signed_in? }
|
11
11
|
end
|
12
12
|
end
|
13
13
|
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:
|
4
|
+
hash: 7
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 6
|
9
|
+
- 0
|
10
|
+
version: 0.6.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Roman Simecek
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-10-10 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
requirement: &id001 !ruby/object:Gem::Requirement
|
@@ -23,13 +23,12 @@ dependencies:
|
|
23
23
|
requirements:
|
24
24
|
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
hash:
|
26
|
+
hash: 3
|
27
27
|
segments:
|
28
28
|
- 3
|
29
29
|
- 1
|
30
30
|
- 0
|
31
|
-
|
32
|
-
version: 3.1.0.rc
|
31
|
+
version: 3.1.0
|
33
32
|
version_requirements: *id001
|
34
33
|
name: rails
|
35
34
|
prerelease: false
|
@@ -112,12 +111,15 @@ files:
|
|
112
111
|
- Rakefile
|
113
112
|
- VERSION
|
114
113
|
- app/assets/stylesheets/bookyt_projects.sass
|
114
|
+
- app/controllers/activities_controller.rb
|
115
115
|
- app/controllers/project_states_controller.rb
|
116
116
|
- app/controllers/projects_controller.rb
|
117
|
-
- app/
|
117
|
+
- app/models/activity.rb
|
118
118
|
- app/models/project.rb
|
119
119
|
- app/models/project_state.rb
|
120
|
-
- app/
|
120
|
+
- app/views/activities/_form.html.haml
|
121
|
+
- app/views/activities/_resource_detail.html.haml
|
122
|
+
- app/views/activities/show.html.haml
|
121
123
|
- app/views/project_states/_form.html.haml
|
122
124
|
- app/views/project_states/new.html.haml
|
123
125
|
- app/views/projects/_form.html.haml
|
@@ -125,8 +127,6 @@ files:
|
|
125
127
|
- app/views/projects/_resource_detail.html.haml
|
126
128
|
- app/views/projects/new.html.haml
|
127
129
|
- app/views/projects/show.html.haml
|
128
|
-
- app/views/tasks/_form.html.haml
|
129
|
-
- app/views/tasks/_resource_detail.html.haml
|
130
130
|
- bookyt_projects.gemspec
|
131
131
|
- config/locales/de.yml
|
132
132
|
- config/routes.rb
|
@@ -1,14 +0,0 @@
|
|
1
|
-
class TasksController < AuthorizedController
|
2
|
-
def new
|
3
|
-
# Allow callers specifying defaults
|
4
|
-
@task = Task.new(params[:task])
|
5
|
-
|
6
|
-
# Nested resources support
|
7
|
-
@task.project_id ||= params[:project_id] if params[:project_id]
|
8
|
-
|
9
|
-
# Educated guessing of defaults
|
10
|
-
@task.person = current_user.person if current_user
|
11
|
-
|
12
|
-
new!{ projects_url(@task.project) }
|
13
|
-
end
|
14
|
-
end
|