backlog 0.17.3 → 0.17.4

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,11 +1,27 @@
1
- == 0.17.3 2008-01-09
1
+ == 0.17.4 2008-01-14
2
+
3
+ === Features
4
+
5
+ * Added date and time to top bar
6
+ * Simplified design of task lists.
7
+ * Changed title in Show Sprint view from "Backlog" to "Sprint"
8
+
9
+ === Fixes
10
+
11
+ * Fixed wrong "Home" link.
12
+ * Fixed exception when updating task estimate.
13
+ * Removed shake effect when starting work on a task.
14
+ * Various style sheet adjustments.
15
+ * Fixed moving tasks between sprints in backlog view.
16
+ * Fixed redirect after ending work directly after starting it.
17
+
18
+ == 0.17.3 2008-01-11
2
19
 
3
20
  === Fixes
4
21
 
5
22
  * Fixed wrong redirect at startup.
6
23
  * Fixed ugly listing of started tasks.
7
24
 
8
-
9
25
  == 0.17.2 2008-01-07
10
26
 
11
27
  === Fixes
@@ -109,9 +109,11 @@ class ApplicationController < ActionController::Base
109
109
  end
110
110
 
111
111
  def pop_detour
112
- detour = session[:detours].pop
112
+ detours = session[:detours]
113
+ return nil unless detours
114
+ detour = detours.pop
113
115
  logger.debug "popped detour: #{detour.inspect} #{session[:detours].size} more"
114
- if session[:detours].empty?
116
+ if detours.empty?
115
117
  session[:detours] = nil
116
118
  end
117
119
  detour
@@ -92,7 +92,7 @@ class BacklogsController < ApplicationController
92
92
  @task.estimate(params[:estimate][:todo])
93
93
  @period = @task.period
94
94
  @success, flash[:notice] = true, 'Estimate updated'
95
- rescue ArgumentError => e
95
+ rescue ArgumentError => e
96
96
  @success, flash[:notice] = false, "Estimate was not numeric"
97
97
  end
98
98
  if @task.finished?
@@ -161,15 +161,19 @@ class BacklogsController < ApplicationController
161
161
  def order
162
162
  params.keys.find {|k| k =~ /active_tasks_(.*)/}
163
163
  period_id = $1
164
- tasks = params["active_tasks_#{period_id}"].select {|id| not id.empty?}
165
- tasks.each_with_index do |id,idx|
166
- task = Task.find(id)
167
- task.insert_at(idx + 1)
168
- task.save!
164
+ if period_id
165
+ period = Period.find(period_id)
166
+ tasks = params["active_tasks_#{period_id}"].select {|id| not id.empty?}
167
+ tasks.each_with_index do |id,idx|
168
+ task = Task.find(id)
169
+ task = task.move_to_period(period) if task.period != period
170
+ task.insert_at(idx + 1)
171
+ task.save!
172
+ end
169
173
  end
170
174
  render :text => 'Updated sort order'
171
175
  end
172
-
176
+
173
177
  private
174
178
 
175
179
  def load_tasks(backlog)
@@ -177,7 +181,7 @@ class BacklogsController < ApplicationController
177
181
  planned_tasks = backlog.tasks.select {|t| t.period && t.finished_at.nil?}.sort_by {|t| [t.period.end_on, t.position]}
178
182
  @tasks = planned_tasks + unplanned_tasks
179
183
  @completed_tasks = backlog.tasks.select {|t| t.finished_at}.sort {|t1, t2| t2.finished_at <=> t1.finished_at}
180
-
184
+
181
185
  end
182
186
 
183
187
  end
@@ -7,7 +7,7 @@ class TasksController < ApplicationController
7
7
  def list_started
8
8
  @tasks = Task.find_started
9
9
  @selected_task = Task.find_by_id(params[:id])
10
- back_or_redirect_to(:controller => '', :action => '') if @tasks.empty?
10
+ back_or_redirect_to('/') if @tasks.empty?
11
11
  end
12
12
 
13
13
  def new
@@ -87,7 +87,7 @@ class TasksController < ApplicationController
87
87
  end
88
88
  end
89
89
 
90
- file = params[:task].delete(:file)
90
+ file = params[:task] && params[:task].delete(:file)
91
91
 
92
92
  if params[:task] && @task.update_attributes(params[:task])
93
93
  flash[:notice] = 'Task was successfully updated.'
@@ -202,6 +202,8 @@ class TasksController < ApplicationController
202
202
  def start_work
203
203
  @task = Task.find(params[:id])
204
204
  @task.start_work
205
+ detour = pop_detour
206
+ params.update(detour) if detour
205
207
  end
206
208
 
207
209
  def end_work
@@ -24,7 +24,7 @@ module BacklogsHelper
24
24
  page.insert_html :top, "completed_tasks", "<table id=\"completed_tasks_#{@task.period_id}\" class=\"input\" />"
25
25
  end
26
26
 
27
- page.insert_html :top, "completed_tasks_#{@task.period_id}", :partial => '/tasks/task', :locals => {:active => false, :hidden => true, :highlight_task => false}
27
+ page.insert_html :top, "completed_tasks_#{@task.period_id}", :partial => '/tasks/task', :locals => {:active => false, :hidden => true, :highlight_task => false, :show_backlog => false}
28
28
  page.visual_effect :appear, "task_#{@task.id}"
29
29
 
30
30
  page.insert_html :top, "completed_tasks_#{@task.period_id}", :partial => '/tasks/fields_header', :locals => {:backlog => @task.backlog, :active => false, :work_done => work_done}
@@ -52,7 +52,7 @@ module BacklogsHelper
52
52
 
53
53
  page.insert_html(:top, "active_tasks_#{@task.period_id}", render(:partial => "/tasks/task", :locals => { :task => @task, :i => 1, :active => true, :highlight_task => false, :update => :spotlight, :hidden => true }))
54
54
 
55
- fields_header = render(:partial => '/tasks/fields_header', :locals => { :backlog => @task.backlog, :active => true, :track_times => tasks_in_period.find {|t|t.period && t.period.active?} } )
55
+ fields_header = render(:partial => '/tasks/fields_header', :locals => { :backlog => @task.backlog, :active => true, :track_todo => @task.backlog.track_todo?, :track_done => @task.backlog.track_done?, :track_times => tasks_in_period.find {|t|t.period && t.period.active?} } )
56
56
  page.insert_html :top, "active_tasks_#{@task.period_id}", fields_header
57
57
  page.insert_html :top, "active_tasks_#{@task.period_id}", render(:partial => "/tasks/period_header", :locals => {:period => @task.period})
58
58
 
data/app/models/task.rb CHANGED
@@ -144,7 +144,7 @@ class Task < ActiveRecord::Base
144
144
  def move_to_period(new_period)
145
145
  raise "Period missing" unless new_period
146
146
  raise "Cannot move finished tasks" unless active?
147
- return if new_period == period
147
+ return self if new_period == period
148
148
 
149
149
  self.remove_from_list
150
150
  self.position = nil
@@ -162,6 +162,7 @@ class Task < ActiveRecord::Base
162
162
  existing_task.description = self.description
163
163
  existing_task.save!
164
164
  existing_task.estimate(old_todo)
165
+ return existing_task
165
166
  else
166
167
  new_task = Task.new
167
168
  new_task.previous_task_id = ancestor_id
@@ -172,9 +173,8 @@ class Task < ActiveRecord::Base
172
173
  new_task.position = nil
173
174
  new_task.save!
174
175
  new_task.insert_at 1
175
- # new_task.position = 1
176
- # new_task.save!
177
176
  new_task.estimate(old_todo)
177
+ return new_task
178
178
  end
179
179
  else
180
180
  self.period_id = new_period.id
@@ -183,6 +183,7 @@ class Task < ActiveRecord::Base
183
183
  self.position = 1
184
184
  self.move_to_bottom
185
185
  self.save!
186
+ return self
186
187
  end
187
188
  end
188
189
 
@@ -6,18 +6,22 @@
6
6
  <div id="active_tasks"<%=' style="display: none;"' unless @tasks and not @tasks.empty? %>>
7
7
  <%#=render :partial => '/tasks/backlog_header', :locals => {:backlog => @backlog, :track_times => @tasks.find {|t|t.period && t.period.active?}} %>
8
8
  <%i = 0 %>
9
- <%for period in @tasks.map {|t| t.period}.uniq %>
9
+ <% periods = @tasks.map {|t| t.period}.uniq %>
10
+ <% period_ids = periods.map {|period| "active_tasks_#{period ? period.id : ''}"} %>
11
+ <%for period in periods %>
10
12
  <% tasks_in_period = @tasks.select {|t| t.period_id == (period && period.id)} %>
11
13
  <% work_done = !tasks_in_period.find{|t| t.total_done > 0}.nil? %>
14
+ <%=render :partial => '/tasks/period_header', :locals => {:period => period} if @backlog.enable_periods %>
15
+ <%=render :partial => '/tasks/fields_header', :locals => {:backlog => @backlog, :active => true, :track_times => tasks_in_period.find {|t|t.period && t.period.active?}, :work_done => work_done} %>
12
16
  <ul id="active_tasks_<%=period ? period.id : '' %>" class="task_list">
13
- <%=render :partial => '/tasks/period_header', :locals => {:period => period} if @backlog.enable_periods %>
14
- <%=render :partial => '/tasks/fields_header', :locals => {:backlog => @backlog, :active => true, :track_times => tasks_in_period.find {|t|t.period && t.period.active?}, :work_done => work_done} %>
15
17
  <%for @task in tasks_in_period %>
16
- <%=render :partial => '/tasks/task/', :locals => {:task => @task, :i => i += 1, :active => true, :highlight_task => false, :update => :maincontent, :hidden => false} %>
18
+ <%=render :partial => '/tasks/task/', :locals => {:task => @task, :i => i += 1, :active => true, :highlight_task => false, :update => :maincontent, :show_backlog => false, :hidden => false} %>
17
19
  <%end %>
18
20
  </ul>
19
- <%=sortable_element "active_tasks_#{period ? period.id : ''}", :url => { :action => :order }, :constraint => false %>
20
- <%end %>
21
+ <% end %>
22
+ <%for period in periods %>
23
+ <%=sortable_element "active_tasks_#{period ? period.id : ''}", :url => { :action => :order }, :containment => period_ids, :constraint => false %>
24
+ <% end %>
21
25
  </div>
22
26
  <p id="no_tasks_message"<%=' style="display: none;"' if @tasks and not @tasks.empty? %>>
23
27
  <%=l :no_pending_tasks_in_backlog %>
@@ -1,7 +1,8 @@
1
1
  <div id="navbar">
2
2
  <span style="float: left"><%=link_to "#{l :backlog} #{APP::VERSION}", 'http://rubyforge.org/projects/backlog'%></span>
3
3
  <span style="float: left"><form action="<%=url_for :controller => 'search', :action => :results%>"><%=text_field_tag :q, @search || l(:search), :onfocus => "if (value == '#{l(:search)}') value='' "%><%=submit_tag :search, :style => 'display: none'%></form></span>
4
- <%= link_to l(:home), url_for(:controller => 'backlogs') %>
4
+ <span style="float: left; margin-left: 5px; font-weight: bold"><%=Time.new.strftime('%Y-%m-%d %H:%M')%></span>
5
+ <%= link_to l(:home), url_for('/') %>
5
6
 
6
7
  <% if user? %>
7
8
  | <%= link_to l(:backlogs), :controller => 'backlogs', :action => :list %>
@@ -33,22 +33,15 @@ function handleEvent(field, event, id) {
33
33
 
34
34
 
35
35
  <div id="active_tasks"<%=' style="display: none;"' unless @tasks and not @tasks.empty?%>>
36
- <% current_backlog = nil -%>
37
- <% for task in @tasks -%>
38
- <% if task.backlog != current_backlog -%>
39
- <%=sortable_element "active_tasks_#{current_backlog.id}", :url => { :action => :order } if current_backlog%>
40
- <%='</ul>' if current_backlog%>
41
- <% current_backlog = task.backlog %>
42
- <ul id="active_tasks_<%=current_backlog.id%>" class="task_list">
43
- <%= '<li><span>&nbsp;</span></li>' if false && current_backlog %>
44
- <%=render :partial => '/tasks/backlog_header', :locals => { :backlog => task.backlog, :track_times => current_backlog.track_done? && @tasks.find {|t|t.period && t.period.active?} } %>
45
- <%=render :partial => '/tasks/fields_header', :locals => { :backlog => task.backlog, :active => true, :track_times => @tasks.find {|t|t.period && t.period.active?}, :work_done => @tasks.find {|t|t.backlog_id == current_backlog.id && t.total_done > 0} } %>
46
- <% end -%>
47
- <%=render :partial => '/tasks/task', :locals => { :task => task, :i => i, :active => true, :highlight_task => task == @selected_task, :update => :spotlight, :hidden => false } %>
48
- <% i += 1 %>
49
- <% end -%>
50
- <%=sortable_element "active_tasks_#{current_backlog.id}", :url => { :action => :order }, :constraint => false if current_backlog%>
51
- <%='</ul>' if current_backlog%>
36
+ <%=render :partial => '/tasks/fields_header', :locals => { :backlog => nil, :active => true, :track_todo => @tasks.find {|t|t.period && t.period.active?}, :track_times => @tasks.find {|t|t.period && t.period.active?}, :track_done => @tasks.find {|t|t.period && t.period.active? }, :work_done => @tasks.find {|t| t.total_done > 0} } %>
37
+ <ul id="active_tasks_<%=@period.id%>" class="task_list">
38
+ <% for task in @tasks -%>
39
+ <%=render :partial => '/tasks/task', :locals => { :task => task, :i => i, :active => true, :highlight_task => task == @selected_task, :update => :spotlight, :show_backlog => true, :hidden => false } %>
40
+ <%#=render :partial => '/tasks/backlog_header', :locals => { :backlog => task.backlog, :track_times => task.backlog.track_done? && @tasks.find {|t|t.period && t.period.active?} } %>
41
+ <% i += 1 %>
42
+ <% end -%>
43
+ </ul>
44
+ <%=sortable_element "active_tasks_#{@period.id}", :url => { :action => :order }, :constraint => false%>
52
45
  </div>
53
46
 
54
47
  <p id="no_tasks_message"<%=' style="display: none;"' if @tasks and not @tasks.empty?%>><%=l :no_pending_tasks%></p>
@@ -1,3 +1,6 @@
1
+ <%@application_title = l :period %>
2
+ <%@page_title = @period.name %>
3
+
1
4
  <% i = 1 %>
2
5
 
3
6
  <div id="spotlight">
@@ -1,17 +1,17 @@
1
1
  <% @backlog = backlog %>
2
2
 
3
- <li valign="top">
3
+ <div valign="top">
4
4
  <div>
5
- <span style="float: left">
6
- <%=image_detour_to('add.png', l(:new_task), :controller => 'tasks', :action => :new, :task => {:backlog_id => @backlog.id, :period_id => @period && @period.id})%>
7
- </span>
8
- <span colspan="4" style="float: left; vertical-align: middle">
9
- <h5>
10
- <%=detour_to(h(backlog.name), :controller => 'backlogs', :action => :show, :id => @backlog) %>
11
- <%=image_detour_to('clipboard.png', l(:edit), :controller => 'backlogs', :action => :edit, :id => @backlog.id)%>
12
- </h5>
13
- </span>
14
- <span style="float: left" width="*"/>
5
+ <span style="float: left">
6
+ <%=image_detour_to('add.png', l(:new_task), :controller => 'tasks', :action => :new, :task => {:backlog_id => @backlog.id, :period_id => @period && @period.id})%>
7
+ </span>
8
+ <span colspan="4" style="float: left; vertical-align: middle">
9
+ <h5>
10
+ <%=detour_to(h(backlog.name), :controller => 'backlogs', :action => :show, :id => @backlog) %>
11
+ <%=image_detour_to('clipboard.png', l(:edit), :controller => 'backlogs', :action => :edit, :id => @backlog.id)%>
12
+ </h5>
13
+ </span>
14
+ <span style="float: left" width="*"/>
15
15
  </div>
16
16
  <br clear="all" />
17
- </li>
17
+ </div>
@@ -1,15 +1,13 @@
1
- <li>
2
1
  <div style="font-weight: bold">
3
- <div style="float: left" />
2
+ <div style="float: left"></div>
4
3
  <div class="task_id"><%=active ? 'ID' : l(:resolution_abr)%></div>
5
4
  <div class="task_description"><%=l :task %></div>
6
5
  <div style="float: right">
7
- <div class="task_start"><%=l :start if active && backlog.track_times? %></div>
6
+ <div class="task_start"><%=l :start if active && track_times %></div>
8
7
  <div class="task_end_work">&nbsp;</div>
9
- <div class="task_done"><%=l :done if (active && backlog.track_done?) || work_done %></div>
10
- <div class="task_todo"><%=l :todo if active && backlog.track_todo? %></div>
8
+ <div class="task_done"><%=l :done if (active && track_done) || work_done %></div>
9
+ <div class="task_todo"><%=l :todo if active && track_todo %></div>
11
10
  <div class="task_buttons"></div>
12
11
  </div>
13
12
  </div>
14
13
  <br clear="all"/>
15
- </li>
@@ -1 +1 @@
1
- <li><span><%=period ? link_to(h(period.name), :controller => 'periods', :action => :show, :id => period) : l(:unplanned_tasks)%></span></li>
1
+ <div><span><%=period ? link_to(h(period.name), :controller => 'periods', :action => :show, :id => period) : l(:unplanned_tasks)%></span></div>
@@ -17,6 +17,10 @@
17
17
  </div>
18
18
  <div id="task_<%=@task.id%>_description" class="task_description">
19
19
  <%=h(@task.description) %>
20
+ <% if show_backlog %>
21
+ <br/>
22
+ <%=l :backlog%>: <%=detour_to(h(@task.backlog.name), :controller => 'backlogs', :action => :show, :id => @task.backlog) %>
23
+ <% end %>
20
24
  </div>
21
25
 
22
26
 
@@ -31,7 +35,7 @@
31
35
  :class => :task_time, :maxlength => 5 %>
32
36
  <% end %>
33
37
  <% elsif @task.track_times? && (@task.period_id.nil? || @task.period.active?) %>
34
- <%=image_link_to_remote 'hammer.png', l(:start_work), {:controller => 'tasks', :action => :start_work, :id => @task.id}, nil, true %>
38
+ <%=image_link_to_remote 'hammer.png', l(:start_work), with_detour({:controller => 'tasks', :action => :start_work, :id => @task.id}), nil, true %>
35
39
  <% end -%>
36
40
  <% end -%>
37
41
  </div>
@@ -65,7 +69,7 @@
65
69
  <% if active && @task.loggable? -%>
66
70
  <% if @task.track_todo? -%>
67
71
  <% if @task.period.nil? || @task.period.active_or_future? -%>
68
- <% form_for(:estimate, :url => {:action => :update_task_estimate, :id => @task}) do |f| -%>
72
+ <% remote_form_for(:estimate, :url => {:action => :update_task_estimate, :id => @task}) do |f| -%>
69
73
  <%=f.text_field :todo, :tabindex => i+2, :id => "task_#{@task.id}_todo", :value => @task.todo, :class => :task_hours, :maxlength => 4 %>
70
74
  <% end -%>
71
75
  <% else -%>
@@ -36,21 +36,13 @@ function handleEvent(field, event, id) {
36
36
  </script>
37
37
 
38
38
  <% if @tasks %>
39
+ <%=render :partial => '/tasks/fields_header', :locals => {:backlog => nil, :active => true, :track_times => @tasks.find {|t|t.period && t.period.active?}} %>
39
40
  <ul class="task_list">
40
41
  <% i = 0 %>
41
42
  <% current_backlog = nil %>
42
43
  <% current_period = nil %>
43
44
  <% for task in @tasks %>
44
- <% if task.backlog != current_backlog %>
45
- <%= render :partial => '/tasks/backlog_header', :locals => {:backlog => task.backlog, :track_times => @tasks.find {|t|t.period && t.period.active?}} %>
46
- <% current_backlog = task.backlog %>
47
- <% end %>
48
- <% if task.period != current_period %>
49
- <%=render :partial => '/tasks/period_header', :locals => {:period => task.period} %>
50
- <%=render :partial => '/tasks/fields_header', :locals => {:backlog => task.root_task.backlog, :active => true, :track_times => @tasks.find {|t|t.period && t.period.active?}} %>
51
- <% current_period = task.period %>
52
- <% end %>
53
- <%=render :partial => 'task', :locals => { :task => task, :i => i, :active => true, :highlight_task => (task == @selected_task), :update => :spotlight, :hidden => false } %>
45
+ <%=render :partial => 'task', :locals => { :task => task, :i => i, :active => true, :highlight_task => (task == @selected_task), :update => :spotlight, :show_backlog => true, :hidden => false } %>
54
46
  <% i += 1 %>
55
47
  <% end %>
56
48
 
@@ -1,2 +1 @@
1
1
  page.replace "task_#{@task.id}", :partial => '/tasks/task', :locals => { :task => @task, :i => 1, :active => true, :highlight_task => false, :update => :spotlight, :hidden => false }
2
- page.visual_effect :shake, "task_#{@task.id}"
@@ -1,8 +1,8 @@
1
1
  textarea {font-family:Arial, Helvetica, sans-serif; font-size:10.8pt;}
2
2
 
3
3
  .task_description { width: 300px; }
4
- .task_hours { width: 32px; }
5
- .task_time { width: 40px }
4
+ .task_hours { width: 2.5em; text-align: right}
5
+ .task_time { width: 3em; text-align: right; }
6
6
  .image-submit {height: 22px; border: 0; margin-bottom: 1px; padding: 0; vertical-align: bottom; float: none;}
7
7
  table.input {border-collapse: collapse}
8
8
  table.input td {vertical-align: top; margin: 0; border: 0; padding: 0 1px;}
@@ -13,15 +13,15 @@ table.input td {vertical-align: top; margin: 0; border: 0; padding: 0 1px;}
13
13
  #maincontent div.btitle img.image-submit {float: right;}
14
14
  #maincontent div.btitle h4 {margin-top: 6px;}
15
15
  .highlight {background: yellow;}
16
- .task_list {width: 95%; text-align: left; list-style-type: none; padding-left: 0}
16
+ .task_list {width: 100%; text-align: left; list-style-type: none; padding-left: 0}
17
17
  .task_list li {margin-left: 0}
18
18
  .tasks {cursor: move}
19
19
  .task_id {float: left; padding-left: 2px; width: 3em; text-align: center}
20
20
  .task_description {float: left; padding: 1px; width: auto}
21
- .task_start {float: left; width: 4em; text-align: center}
21
+ .task_start {float: left; width: 5em; text-align: center}
22
22
  .task_end_work {float: left; width: 2em}
23
- .task_done {float: left; width: 3em}
24
- .task_todo {float: left; width: 3em; padding: 1px}
23
+ .task_done {float: left; width: 3.6em; text-align: right; padding: 1px}
24
+ .task_todo {float: left; width: 4.3em; padding: 1px; text-align: center;}
25
25
  .task_buttons {float: left; width: 5em}
26
26
  .dragable-hover {background: yellow; border: 1px solid black;}
27
27
  .dropzone-hover {background: yellow; border: 1px solid black;}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: backlog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.3
4
+ version: 0.17.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Uwe Kubosch
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-01-11 00:00:00 +01:00
12
+ date: 2008-01-14 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency