bookyt_projects 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.2.1
@@ -1,2 +1,10 @@
1
- class TasksController < AuthorizedController
1
+ class TasksController < AuthorizedController
2
+
3
+ def new
4
+ @task = Task.new(:project_id => params[:project_id]) if params[:project_id]
5
+ @task.person = current_user.person if current_user
6
+
7
+ new!{ projects_url(@task.project) }
8
+ end
9
+
2
10
  end
@@ -1,4 +1,5 @@
1
1
  class Project < ActiveRecord::Base
2
2
  belongs_to :client, :class_name => 'Person'
3
3
  belongs_to :project_state
4
+ has_many :tasks
4
5
  end
data/app/models/task.rb CHANGED
@@ -1,4 +1,8 @@
1
1
  class Task < ActiveRecord::Base
2
2
  belongs_to :project
3
3
  belongs_to :person
4
+
5
+ def duration
6
+ "2h"
7
+ end
4
8
  end
@@ -4,6 +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, Task)
7
8
  %th.action-links
8
9
 
9
10
  - @attributes = @attributes - ['client_id', 'project_state_id']
@@ -14,6 +15,8 @@
14
15
  %td= r.send(field) if r.respond_to?(field)
15
16
  %td= r.client
16
17
  %td= r.project_state
18
+ %td= link_to t_title(:new, Task), new_project_task_url(r)
17
19
  %td.action-links
20
+ = list_link_for(:show, r)
18
21
  = list_link_for(:edit, r)
19
22
  = list_link_for(:delete, r)
@@ -0,0 +1,25 @@
1
+ %table{:class => "#{collection.first.class.to_s.downcase} detail"}
2
+ - resource.attributes.each_pair do |attr, value|
3
+ - next if ['id', 'created_at', 'updated_at', 'client_id', 'project_state_id'].include?(attr)
4
+ %tr
5
+ %td= attr.titleize
6
+ %td= value
7
+ %tr
8
+ %td= t_model(ProjectState)
9
+ %td= @project.project_state
10
+ %tr
11
+ %td= t_model(Company)
12
+ %td= @project.client
13
+
14
+
15
+ %table.list
16
+ %tr
17
+ - [:person, :when, :duration].each do |attr|
18
+ %th= t_attr(attr, Task)
19
+ - @project.tasks.each do |task|
20
+ %tr
21
+ %td= task.person
22
+ %td= task.when
23
+ %td= task.duration
24
+
25
+ = link_to t_title(:new, Task), new_project_task_path(resource)
@@ -0,0 +1,5 @@
1
+ = contextual_links
2
+
3
+ %h1= t_title
4
+
5
+ = render "resource_detail"
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{bookyt_projects}
8
- s.version = "0.2.0"
8
+ s.version = "0.2.1"
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}]
@@ -35,7 +35,9 @@ Gem::Specification.new do |s|
35
35
  "app/views/project_states/new.html.haml",
36
36
  "app/views/projects/_form.html.haml",
37
37
  "app/views/projects/_list.html.haml",
38
+ "app/views/projects/_resource_detail.html.haml",
38
39
  "app/views/projects/new.html.haml",
40
+ "app/views/projects/show.html.haml",
39
41
  "app/views/tasks/_form.html.haml",
40
42
  "bookyt_projects.gemspec",
41
43
  "config/locales/de.yml",
@@ -16,3 +16,7 @@ de:
16
16
  client_id: Kunde
17
17
  project_state:
18
18
  name: Bezeichnung
19
+ task:
20
+ person: Person
21
+ when: Datum
22
+ duration: Dauer
data/config/routes.rb CHANGED
@@ -1,5 +1,7 @@
1
1
  Rails.application.routes.draw do
2
- resources :projects
2
+ resources :projects do
3
+ resources :tasks
4
+ end
3
5
  resources :project_states
4
6
  resources :tasks
5
7
  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: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 0
10
- version: 0.2.0
9
+ - 1
10
+ version: 0.2.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Roman Simecek
@@ -122,7 +122,9 @@ files:
122
122
  - app/views/project_states/new.html.haml
123
123
  - app/views/projects/_form.html.haml
124
124
  - app/views/projects/_list.html.haml
125
+ - app/views/projects/_resource_detail.html.haml
125
126
  - app/views/projects/new.html.haml
127
+ - app/views/projects/show.html.haml
126
128
  - app/views/tasks/_form.html.haml
127
129
  - bookyt_projects.gemspec
128
130
  - config/locales/de.yml