backlog 0.15.1 → 0.16.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. data/History.txt +16 -0
  2. data/app/controllers/backlogs_controller.rb +2 -2
  3. data/app/controllers/estimates_controller.rb +3 -4
  4. data/app/controllers/periods_controller.rb +14 -2
  5. data/app/controllers/tasks_controller.rb +6 -1
  6. data/app/controllers/user_controller.rb +10 -10
  7. data/app/helpers/application_helper.rb +3 -2
  8. data/app/helpers/user_helper.rb +4 -4
  9. data/app/views/layouts/_headers.rhtml +1 -0
  10. data/app/views/layouts/_notice.rhtml +1 -4
  11. data/app/views/periods/_show_active.rhtml +8 -6
  12. data/app/views/periods/show.rhtml +38 -0
  13. data/app/views/tasks/_backlog_header.rhtml +7 -7
  14. data/app/views/tasks/_completed.rhtml +3 -3
  15. data/app/views/tasks/_fields_header.rhtml +9 -9
  16. data/app/views/tasks/_form.rhtml +16 -6
  17. data/app/views/tasks/_task.rhtml +56 -60
  18. data/app/views/tasks/edit.rhtml +67 -1
  19. data/app/views/tasks/notes.rhtml +6 -2
  20. data/bin/backlog +63 -1
  21. data/db/migrate/025_add_simple_auditing_of_tasks.rb +11 -0
  22. data/db/schema.rb +5 -1
  23. data/lib/url_for_fix.rb +5 -5
  24. data/public/applets/bsf.jar +0 -0
  25. data/public/applets/jruby.jar +0 -0
  26. data/public/javascripts/ruby.js +46 -0
  27. data/test/functional/user_controller_test.rb +5 -5
  28. data/vendor/plugins/foreign_key_migrations/CHANGELOG +36 -0
  29. data/vendor/plugins/foreign_key_migrations/README +27 -0
  30. data/vendor/plugins/foreign_key_migrations/about.yml +5 -0
  31. data/vendor/plugins/foreign_key_migrations/init.rb +1 -2
  32. data/vendor/plugins/foreign_key_migrations/lib/foreign_key_migrations.rb +3 -0
  33. data/vendor/plugins/foreign_key_migrations/lib/red_hill_consulting/foreign_key_migrations/active_record/base.rb +22 -0
  34. data/vendor/plugins/foreign_key_migrations/lib/red_hill_consulting/foreign_key_migrations/active_record/connection_adapters/abstract_adapter.rb +22 -0
  35. data/vendor/plugins/foreign_key_migrations/lib/red_hill_consulting/foreign_key_migrations/active_record/connection_adapters/table_definition.rb +28 -0
  36. metadata +99 -80
  37. data/vendor/plugins/foreign_key_migrations/lib/red_hill_consulting/foreign_key_migrations.rb +0 -57
data/History.txt CHANGED
@@ -1,3 +1,19 @@
1
+ == 0.16.0 2007-12-26
2
+
3
+ === Features
4
+
5
+ * Added displaying of task id in task edit form.
6
+ * Added displaying of task id and description in task full screen view.
7
+ * Added more notice messages on small updates, for better responsiveness.
8
+ * Added display of total hours done to Show Task view.
9
+ * Added action buttons to Show Task view
10
+ * Improved control script to delete stale PID file at startup and give better status info.
11
+ * Simple auditing of tasks. Who created the task, and who updated it last.
12
+
13
+ === Fixes
14
+
15
+ * Fixed error in some URL generations that led to strange navigation.
16
+
1
17
  == 0.15.1 2007-11-29
2
18
 
3
19
  === Features
@@ -90,9 +90,9 @@ class BacklogsController < ApplicationController
90
90
  Float(params[:estimate][:todo])
91
91
  @task.estimate(params[:estimate][:todo])
92
92
  @period = @task.period
93
- @success, @message = true, 'Estimate updated'
93
+ @success, flash[:notice] = true, 'Estimate updated'
94
94
  rescue ArgumentError => e
95
- @success, @message = false, "Estimate was not numeric"
95
+ @success, flash[:notice] = false, "Estimate was not numeric"
96
96
  end
97
97
  if @task.finished?
98
98
  load_tasks(@task.period)
@@ -4,21 +4,20 @@ class EstimatesController < ApplicationController
4
4
  verify :method => :post, :redirect_to => ''
5
5
 
6
6
  def create
7
- @success, @message = do_create
7
+ @success, flash[:notice] = do_create
8
8
 
9
9
  unless @success
10
- @task.errors.add :estimate, @message
10
+ @task.errors.add :estimate, flash[:notice]
11
11
  render :file => "public/500.html", :layout => true, :status => 500
12
12
  return
13
13
  end
14
14
 
15
- flash[:notice] = @message
16
15
  redirect_to :controller => 'periods', :action => :show, :id => @task.root_task.period, :task_id => @task.id
17
16
  end
18
17
 
19
18
  def create_ajax
20
19
  @task = Task.find_by_id(params[:id])
21
- @success, @message = do_create
20
+ @success, flash[:notice] = do_create
22
21
  if @task.finished?
23
22
  render :template => '/tasks/finish', :layout => false
24
23
  end
@@ -175,9 +175,9 @@ class PeriodsController < ApplicationController
175
175
  Float(params[:estimate][:todo])
176
176
  @task.estimate(params[:estimate][:todo])
177
177
  @period = @task.period
178
- @success, @message = true, 'Estimate updated'
178
+ @success, flash[:notice] = true, 'Estimate updated'
179
179
  rescue ArgumentError => e
180
- @success, @message = false, "Estimate was not numeric"
180
+ @success, flash[:notice] = false, "Estimate was not numeric"
181
181
  end
182
182
  if @task.finished?
183
183
  load_tasks(@task.period)
@@ -194,6 +194,18 @@ class PeriodsController < ApplicationController
194
194
  end
195
195
  end
196
196
 
197
+ # def order
198
+ # params.keys.find {|k| k =~ /active_tasks_(.*)/}
199
+ # period_id = $1
200
+ # tasks = params["active_tasks_#{period_id}"].select {|id| not id.empty?}
201
+ # tasks.each_with_index do |id,idx|
202
+ # task = Task.find(id)
203
+ # task.insert_at(idx + 1)
204
+ # task.save!
205
+ # end
206
+ # render :text => 'Updated sort order'
207
+ # end
208
+
197
209
  private
198
210
 
199
211
  def send_burn_down_chart(size)
@@ -127,7 +127,7 @@ class TasksController < ApplicationController
127
127
  render :action => 'edit'
128
128
  end
129
129
  end
130
-
130
+
131
131
  def update_task_estimate
132
132
  update
133
133
  end
@@ -194,6 +194,11 @@ class TasksController < ApplicationController
194
194
  redirect_to :controller => 'periods', :action => :show_no_layout, :id => task.period_id, :task => task.id
195
195
  end
196
196
 
197
+ # def order
198
+ # params[:list].each_with_index { |id,idx| Model.update(id, :position => idx) }
199
+ # render :text => 'Updated sort order'
200
+ # end
201
+
197
202
  def start_work
198
203
  @task = Task.find(params[:id])
199
204
  @task.start_work
@@ -8,7 +8,7 @@ class UserController < ApplicationController
8
8
  user = User.authenticate(params['user']['login'], params['user']['password'])
9
9
  if user
10
10
  self.current_user = user
11
- flash['notice'] = 'Login succeeded'
11
+ flash[:notice] = 'Login succeeded'
12
12
  if remember_me && remember_me == '1'
13
13
  user.generate_security_token
14
14
  cookies[:autologin] = {:value => user.id.to_s, :expires =>90.days.from_now}
@@ -17,7 +17,7 @@ class UserController < ApplicationController
17
17
  back_or_redirect_to :controller => 'backlogs', :action => :index
18
18
  else
19
19
  @login = params['user']['login']
20
- flash['message'] = 'Login failed'
20
+ flash[:notice] = 'Login failed'
21
21
  end
22
22
  end
23
23
 
@@ -33,13 +33,13 @@ class UserController < ApplicationController
33
33
  url = url_for(:action => 'welcome')
34
34
  url += "?user[id]=#{@user.id}&key=#{key}"
35
35
  UserNotify.deliver_signup(@user, params['user']['password'], url)
36
- flash['notice'] = 'Signup successful! Please check your registered email account to verify your account registration and continue with the login.'
36
+ flash[:notice] = 'Signup successful! Please check your registered email account to verify your account registration and continue with the login.'
37
37
  redirect_to :action => 'login'
38
38
  end
39
39
  end
40
40
  rescue Exception => ex
41
41
  report_exception ex
42
- flash['message'] = 'Error creating account: confirmation email not sent'
42
+ flash[:notice] = 'Error creating account: confirmation email not sent'
43
43
  end
44
44
  end
45
45
 
@@ -58,7 +58,7 @@ class UserController < ApplicationController
58
58
  @user.save!
59
59
  rescue Exception => ex
60
60
  report_exception ex
61
- flash.now['message'] = 'Your password could not be changed at this time. Please retry.'
61
+ flash.now[:notice] = 'Your password could not be changed at this time. Please retry.'
62
62
  render and return
63
63
  end
64
64
  begin
@@ -71,7 +71,7 @@ class UserController < ApplicationController
71
71
 
72
72
  def forgot_password
73
73
  if authenticated_user?
74
- flash['message'] = 'You are currently logged in. You may change your password now.'
74
+ flash[:notice] = 'You are currently logged in. You may change your password now.'
75
75
  redirect_to :action => 'change_password'
76
76
  return
77
77
  end
@@ -79,9 +79,9 @@ class UserController < ApplicationController
79
79
  return if generate_blank_form
80
80
 
81
81
  if params['user']['email'].empty?
82
- flash.now['message'] = 'Please enter a valid email address.'
82
+ flash.now[:notice] = 'Please enter a valid email address.'
83
83
  elsif (user = User.find_by_email(params['user']['email'])).nil?
84
- flash.now['message'] = "We could not find a user with the email address #{CGI.escapeHTML(params['user']['email'])}"
84
+ flash.now[:notice] = "We could not find a user with the email address #{CGI.escapeHTML(params['user']['email'])}"
85
85
  else
86
86
  begin
87
87
  User.transaction do
@@ -98,7 +98,7 @@ class UserController < ApplicationController
98
98
  end
99
99
  rescue Exception => ex
100
100
  report_exception ex
101
- flash.now['message'] = "Your password could not be emailed to #{CGI.escapeHTML(params['user']['email'])}"
101
+ flash.now[:notice] = "Your password could not be emailed to #{CGI.escapeHTML(params['user']['email'])}"
102
102
  end
103
103
  end
104
104
  end
@@ -134,7 +134,7 @@ class UserController < ApplicationController
134
134
  @user.update_attribute( :deleted, true )
135
135
  logout
136
136
  rescue Exception => ex
137
- flash.now['message'] = "Error: #{@ex}."
137
+ flash.now[:notice] = "Error: #{@ex}."
138
138
  redirect_back_or_default :action => 'welcome'
139
139
  end
140
140
  end
@@ -86,9 +86,10 @@ module ApplicationHelper
86
86
  end
87
87
 
88
88
  def display_notice(page)
89
- if @message
90
- page.replace_html :notice, @message
89
+ if flash[:notice]
90
+ page.replace_html :notice, flash[:notice]
91
91
  page.visual_effect(:appear, :notice)
92
+ flash.discard
92
93
  else
93
94
  page.visual_effect(:fade, :notice)
94
95
  end
@@ -15,12 +15,12 @@ module UserHelper
15
15
  opts = DEFAULT_HEAD_OPTIONS.dup
16
16
  opts.update(options.symbolize_keys)
17
17
  s = "<h3>#{label}</h3>"
18
- if flash['notice'] and not opts[:notice].nil? and opts[:notice]
19
- notice = "<div><p>#{flash['notice']}</p></div>"
18
+ if flash[:notice] and not opts[:notice].nil? and opts[:notice]
19
+ notice = "<div><p>#{flash[:notice]}</p></div>"
20
20
  s = s + notice
21
21
  end
22
- if flash['message'] and not opts[:message].nil? and opts[:message]
23
- message = "<div id=\"ErrorExplanation\"><p>#{flash['message']}</p></div>"
22
+ if flash[:notice] and not opts[:message].nil? and opts[:message]
23
+ message = "<div id=\"ErrorExplanation\"><p>#{flash[:notice]}</p></div>"
24
24
  s = s + message
25
25
  end
26
26
  if not opts[:error].nil? and opts[:error]
@@ -20,3 +20,4 @@
20
20
  <%= javascript_include_tag "effects" %>
21
21
  <%= javascript_include_tag "controls" %>
22
22
  <%= javascript_include_tag "dragdrop" %>
23
+ <%= javascript_include_tag "ruby" %>
@@ -1,9 +1,6 @@
1
1
  <div id="notice">
2
- <% if flash[:notice] || flash['notice'] || flash[:message] || flash['message'] %>
2
+ <% if flash[:notice] %>
3
3
  <%=flash[:notice]%>
4
- <%=flash['notice']%>
5
- <%=flash[:message]%>
6
- <%=flash['message']%>
7
4
  <%=javascript_tag update_page {|page|
8
5
  page.show 'notice'
9
6
  } %>
@@ -36,17 +36,19 @@ function handleEvent(field, event, id) {
36
36
  <% current_backlog = nil -%>
37
37
  <% for task in @tasks -%>
38
38
  <% if task.backlog != current_backlog -%>
39
- <%='</table>' if current_backlog%>
39
+ <%=sortable_element "active_tasks_#{current_backlog.id}", :url => { :action => :order } if current_backlog%>
40
+ <%='</ul>' if current_backlog%>
40
41
  <% current_backlog = task.backlog %>
41
- <table class="input" style="width: 100%;">
42
- <%= '<tr><td>&nbsp;</td></tr>' if false && current_backlog %>
42
+ <ul id="active_tasks_<%=current_backlog.id%>" class="input" style="width: 95%; list-style-type: none">
43
+ <%= '<li><span>&nbsp;</span></li>' if false && current_backlog %>
43
44
  <%=render :partial => '/tasks/backlog_header', :locals => { :backlog => task.backlog, :track_times => current_backlog.track_done? && @tasks.find {|t|t.period && t.period.active?} } %>
44
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} } %>
45
46
  <% end -%>
46
47
  <%=render :partial => '/tasks/task', :locals => { :task => task, :i => i, :active => true, :highlight_task => task == @selected_task, :update => :spotlight, :hidden => false } %>
47
48
  <% i += 1 %>
48
49
  <% end -%>
49
- <%='</table>' if current_backlog%>
50
+ <%=sortable_element "active_tasks_#{current_backlog.id}", :url => { :action => :order } if current_backlog%>
51
+ <%='</ul>' if current_backlog%>
50
52
  </div>
51
53
 
52
54
  <p id="no_tasks_message"<%=' style="display: none;"' if @tasks and not @tasks.empty?%>><%=l :no_pending_tasks%></p>
@@ -56,7 +58,7 @@ function handleEvent(field, event, id) {
56
58
 
57
59
  <script type="text/JavaScript">
58
60
  <% if @selected_task && @selected_task.active?%>
59
- document.getElementById('task_<%=@selected_task.id%>_description').focus();
60
- //document.getElementById('task_<%=@selected_task.id%>_description').select();
61
+ document.getElementById('task_<%=@selected_task.id%>').focus();
62
+ //document.getElementById('task_<%=@selected_task.id%>').select();
61
63
  <% end %>
62
64
  </script>
@@ -13,3 +13,41 @@
13
13
 
14
14
  <%=render :partial => '/tasks/completed', :locals => {:i => i} %>
15
15
  </div>
16
+
17
+ <script type="text/javascript">
18
+ //alert(Ruby.eval(Ruby.code()));
19
+ </script>
20
+
21
+ <script type="text/x-ruby">
22
+ begin
23
+ require 'java'
24
+ JSObject = netscape.javascript.JSObject
25
+ s = "ho"
26
+ rescue Exception => e
27
+ s = e
28
+ end
29
+ s
30
+ #win = JSObject.getWindow(this)
31
+ #doc = win.getMember("document")
32
+ #loc = doc.getMember("location")
33
+
34
+ #s = loc.getMember("href")
35
+ #win.call("f", null)
36
+ </script>
37
+
38
+ <script type="text/javascript">
39
+ function showRuby() {
40
+ alert(Ruby.code());
41
+ }
42
+
43
+ function echoRuby(ruby) {
44
+ alert(Ruby.eval(ruby));
45
+ }
46
+
47
+ window.onload = function() {
48
+ Ruby.init(function(result) {
49
+ alert(result);
50
+ });
51
+ }
52
+
53
+ </script>
@@ -1,14 +1,14 @@
1
1
  <% @backlog = backlog %>
2
2
 
3
- <tr valign="top">
4
- <td>
3
+ <li valign="top">
4
+ <span>
5
5
  <%=image_detour_to('add.png', l(:new_task), :controller => 'tasks', :action => :new, :task => {:backlog_id => @backlog.id, :period_id => @period && @period.id})%>
6
- </td>
7
- <td colspan="4" style="vertical-align: middle">
6
+ </span>
7
+ <span colspan="4" style="vertical-align: middle">
8
8
  <h5>
9
9
  <%=detour_to(h(backlog.name), :controller => 'backlogs', :action => :show, :id => @backlog) %>
10
10
  <%=image_detour_to('clipboard.png', l(:edit), :controller => 'backlogs', :action => :edit, :id => @backlog.id)%>
11
11
  </h5>
12
- </td>
13
- <td width="*"/>
14
- </tr>
12
+ </span>
13
+ <span width="*"/>
14
+ </li>
@@ -1,6 +1,6 @@
1
- <div id="completed_tasks">
1
+ <div id="completed_tasks" style="margin: 0px; border: 0px; padding: 0px">
2
2
  <% @completed_tasks.map {|t| t.period}.uniq.each do |period| %>
3
- <table id="completed_tasks_<%=period ? period.id : ''%>" class="input">
3
+ <ul id="completed_tasks_<%=period ? period.id : ''%>" class="input" style="width: 100%; list-style-type: none; margin: 0px; border: 0px; padding: 0px">
4
4
  <% tasks_in_period = @completed_tasks.select {|t| t.period == period} %>
5
5
  <% work_done = !tasks_in_period.find{|t| t.total_done != 0}.nil? %>
6
6
  <%=render :partial => '/tasks/period_header', :locals => {:period => period} unless @completed_tasks.map(&:period).uniq.size == 1 %>
@@ -9,6 +9,6 @@
9
9
  <%=render :partial => '/tasks/task', :locals => { :task => task, :i => i, :active => false, :highlight_task => task == @selected_task, :hidden => false } %>
10
10
  <% i += 1 %>
11
11
  <% end %>
12
- </table>
12
+ </ul>
13
13
  <% end %>
14
14
  </div>
@@ -1,9 +1,9 @@
1
- <tr>
2
- <th/>
3
- <th align="center"><%=active ? '#' : l(:resolution_abr)%></th>
4
- <th><%=l :task %></th>
5
- <th><%=l :start if active && backlog.track_times? %></th>
6
- <th/>
7
- <th><%=l :done if (active && backlog.track_done?) || work_done %></th>
8
- <th width="*"><%=l :todo if active && backlog.track_todo? %></th>
9
- </tr>
1
+ <li>
2
+ <span/>
3
+ <span align="center"><%=active ? '#' : l(:resolution_abr)%></span>
4
+ <span><%=l :task %></span>
5
+ <span><%=l :start if active && backlog.track_times? %></span>
6
+ <span/>
7
+ <span><%=l :done if (active && backlog.track_done?) || work_done %></span>
8
+ <span width="*"><%=l :todo if active && backlog.track_todo? %></span>
9
+ </li>
@@ -29,12 +29,13 @@
29
29
 
30
30
  <% if @task.backlog %>
31
31
 
32
- <p><label for="task_description"><%=l :task%></label><br/>
32
+ <p><label for="task_description"><%=l :task%> #<%=@task.id%></label><br/>
33
33
  <% if @task.active? -%>
34
- <%=text_field 'task', 'description', :size => 64, :maxlength => 80 %></p>
34
+ <%=text_field 'task', 'description', :size => 64, :maxlength => 80 %>
35
35
  <% else -%>
36
36
  <%=@task.description -%>
37
37
  <% end -%>
38
+ </p>
38
39
 
39
40
  <% if @task.enable_customer? %>
40
41
  <p><label for="task_customer"><%=l :customer%></label><br/>
@@ -48,14 +49,23 @@
48
49
 
49
50
  <% if @task.track_todo? %>
50
51
  <% if @task.new_record? %>
51
- <p><label for="task_initial_estimate"><%=l :estimate%></label><br/>
52
- <%= text_field 'task', 'initial_estimate', :size => 4 %></p>
52
+ <p><label for="task_initial_estimate"><%=l :estimate%></label><br/>
53
+ <%= text_field 'task', 'initial_estimate', :size => 4 %>
54
+ </p>
53
55
  <% else %>
54
- <p><label for="estimate_todo"><%=l :estimate%></label><br/>
55
- <%= text_field 'estimate', 'todo', :size => 4, :value => @task.todo %></p>
56
+ <p style="float: left"><label for="estimate_todo"><%=l :estimate%></label><br/>
57
+ <%=text_field 'estimate', 'todo', :size => 4, :value => @task.todo %>
58
+ </p>
56
59
  <% end %>
57
60
  <% end %>
58
61
 
62
+ <% if @task.total_done != 0 -%>
63
+ <p style="float: left"><%=l :done%></label><br/>
64
+ <%=t @task.total_done%>
65
+ </p>
66
+ <% end %>
67
+ <br clear="all" />
68
+
59
69
  <p><label for="task_notes"><%=l :notes%></label><br/>
60
70
  <%=text_area 'task', 'notes', :cols => '72', :rows => 16 %>
61
71
  <%=if @task.notes and not @task.notes.empty? then image_link_to 'view_fullscreen.png', l(:view_fullscreen), :controller => 'tasks', :action => :notes, :id => @task end%>
@@ -1,65 +1,70 @@
1
1
  <% @task = task %>
2
- <tr id="task_<%=@task.id%>" valign="top"<%=' class="highlight"' if highlight_task %><%=' style="display: none"' if hidden %>>
3
- <td width="1">
2
+ <li id="task_<%=@task.id%>" style="border: 0px; margin: 0px"<%=' class="tasks" onmouseover="this.style.border=\'1px solid black\'" onmouseout="this.style.border=\'1px solid transparent\'"' if active && (@task.period.nil? || @task.period.active_or_future?) && (not @task.work_started?) %><%=' class="highlight"' if highlight_task %><%=' style="display: none"' if hidden %>>
3
+ <div style="float: left" style="border: 0px">
4
4
  <% if @task.enable_subtasks? && active && (@task.period.nil? || @task.period.active_or_future?) %>
5
5
  <% form_tag({:controller => 'tasks', :action => :specify, :id => @task}) do %>
6
6
  <%= image_button_to('add.png', l(:specify), :controller => 'tasks', :action => :specify, :id => @task.id)%>
7
7
  <% end %>
8
8
  <% end %>
9
- </td>
10
- <td align="left" valign="top" width="1" nowrap="true">
11
- <%= ("&nbsp;" * @task.depth * 4) if @task.depth > 0 %>
12
- <%=@task.position if @task.position || @task.depth == 0 %>
13
- <%= resolution_image(@task.resolution) if @task.finished_at %>
14
- <%= "-" if @task.children.size > 0 %>
15
- </td>
16
- <td>
17
- <div id="task_<%=@task.id%>_description"<%=' class="tasks" onmouseover="this.style.border=\'1px solid black\'" onmouseout="this.style.border=\'1px solid transparent\'"' if active && (@task.period.nil? || @task.period.active_or_future?) && (not @task.work_started?) %>>
18
- <%=detour_to h(@task.description_with_id), :controller => 'tasks', :action => :edit, :id => @task.id if @task.position || @task.depth == 0 %>
19
- </div>
20
- </td>
21
- <td align="right" nowrap="true" width="1">
9
+ </div>
10
+ <div style="float: left" style="border: 0px">
11
+ <%=("&nbsp;" * @task.depth * 4) if @task.depth > 0 %>
12
+ <%=resolution_image(@task.resolution) if @task.finished_at %>
13
+ <%="-" if @task.children.size > 0 %>
14
+ </div>
15
+ <div id="task_<%=@task.id%>_id" style="float: left; padding: 2px">
16
+ <%=@task.id %>
17
+ </div>
18
+ <div id="task_<%=@task.id%>_description" style="float: left">
19
+ <%=detour_to h(@task.description), :controller => 'tasks', :action => :edit, :id => @task.id, :style => 'border: 0px; margin: 0px; padding: 0px' if @task.position || @task.depth == 0 %>
20
+ </div>
21
+
22
+
23
+
24
+ <div style="float: right" style="border: 1px solid black">
25
+ <div style="float: left" style="border: 1px solid black">
22
26
  <% if active && @task.loggable? -%>
23
- <% remote_form_for(:work, :url => {:controller => 'works', :action => 'update_time', :id => @task.started_work}) do |f| %>
24
- <%=submit_tag('checkmark', :value => l(:save), :style => 'display: none')%>
25
27
  <% if @task.work_started? -%>
26
- <%=f.text_field 'started_at_time', :id => "work_#{@task.started_work.id}_started_at_time", :tabindex => i+1, :value => @task.started_work.started_at.strftime('%H:%M'),
27
- :class => :task_time, :maxlength => 5 %>
28
+ <% remote_form_for(:work, :url => {:controller => 'works', :action => 'update_time', :id => @task.started_work}) do |f| %>
29
+ <%=submit_tag('checkmark', :value => l(:save), :style => 'display: none')%>
30
+ <%=f.text_field 'started_at_time', :id => "work_#{@task.started_work.id}_started_at_time", :tabindex => i+1, :value => @task.started_work.started_at.strftime('%H:%M'),
31
+ :class => :task_time, :maxlength => 5 %>
32
+ <% end %>
28
33
  <% elsif @task.track_times? && (@task.period_id.nil? || @task.period.active?) %>
29
34
  <%=image_link_to_remote 'hammer.png', l(:start_work), {:controller => 'tasks', :action => :start_work, :id => @task.id}, nil, true %>
30
35
  <% end -%>
31
- <% end %>
32
36
  <% end -%>
33
- </td>
34
- <td align="right" nowrap="true" width="1">
37
+ </div>
38
+ <div style="float: left" style="border: 1px solid black">
35
39
  <% if active && @task.loggable? && @task.work_started? -%>
36
40
  <% form_tag({:controller => 'works', :action => 'update', :id => @task.started_work}) do %>
37
41
  <%= image_detour_to('ernes_stop.png', l(:end_work), {:controller => 'tasks', :action => :end_work, :id => @task.id}, nil, true) %>
38
42
  <% end -%>
39
43
  <% end -%>
40
- </td>
41
- <td align="<%=active && @task.loggable? && @task.track_done? ? 'left' : 'right'%>" nowrap="true" width="1">
44
+ </div>
45
+ <div style="float: left" style="border: 1px solid black" align="<%=active && @task.loggable? && @task.track_done? ? 'left' : 'right'%>">
42
46
  <% if @task.track_done? || @task.total_done != 0 %>
43
47
  <% if @task.loggable? || @task.finished_at -%>
44
- <% form_tag({:controller => 'works', :action => (@task.work_started? ? :edit : :create), :id => @task.started_work}) do %>
45
- <%=hidden_field('work', 'task_id', :value => @task.id)%>
46
- <%=submit_tag('checkmark', :value => l(:save), :style => 'display: none')%>
47
48
  <% unless !@task.track_done? || @task.track_times? || @task.work_started? || @task.finished_at -%>
48
- <%=text_field 'work', 'hours', :tabindex => i+1, :id => "#{@task.id}_done",
49
- :class => :task_hours, :maxlength => 4,
50
- :ondblclick => "form.elements[1].style.display = 'inline';this.style.display = 'none'" -%>
49
+ <% form_tag({:controller => 'works', :action => (@task.work_started? ? :edit : :create), :id => @task.started_work}) do %>
50
+ <%=hidden_field('work', 'task_id', :value => @task.id)%>
51
+ <%=submit_tag('checkmark', :value => l(:save), :style => 'display: none')%>
52
+ <%=text_field 'work', 'hours', :tabindex => i+1, :id => "#{@task.id}_done",
53
+ :class => :task_hours, :maxlength => 4,
54
+ :ondblclick => "form.elements[1].style.display = 'inline';this.style.display = 'none'" -%>
55
+ <% end -%>
51
56
  <% end -%>
52
57
  <%=t @task.total_done if @task.total_done != 0%>
53
- <% end -%>
54
58
  <% end -%>
55
59
  <% end -%>
56
- </td>
57
- <td nowrap="true" width="1">
60
+ </div>
61
+ <div style="float: left" style="border: 1px solid black">
58
62
  <% if active && @task.loggable? -%>
59
- <% remote_form_for(:estimate, :url => {:action => :update_task_estimate, :id => @task}) do |f| -%>
60
63
  <% if @task.track_todo? -%>
61
64
  <% if @task.period.nil? || @task.period.active_or_future? -%>
62
- <%=f.text_field :todo, :tabindex => i+2, :id => "task_#{@task.id}_todo", :value => @task.todo, :class => :task_hours, :maxlength => 4 %>
65
+ <% form_for(:estimate, :url => {:action => :update_task_estimate, :id => @task}) do |f| -%>
66
+ <%=f.text_field :todo, :tabindex => i+2, :id => "task_#{@task.id}_todo", :value => @task.todo, :class => :task_hours, :maxlength => 4 %>
67
+ <% end -%>
63
68
  <% else -%>
64
69
  <%=@task.todo %>
65
70
  <% end -%>
@@ -67,36 +72,27 @@
67
72
  <% if (not @task.track_times?) && !@task.work_started? && (@task.period.nil? || @task.period.active?) %>
68
73
  <%=image_link_to_remote('checkmark.png', l(:complete), {:action => :finish_task, :id => @task}, nil, true)%>
69
74
  <% end -%>
70
- <% end -%>
71
75
  <% end -%>
72
- </td>
73
- <td align="right" nowrap="true">
74
- <% form_tag({:controller => 'tasks', :action => 'update', :id => @task}) do %>
75
- <% if @task.active? %>
76
- <% if @task.loggable? %>
77
- <% unless @task.work_started? %>
76
+ </div>
77
+ <div style="float: left" align="right" style="border: 1px solid black">
78
+ <% if @task.active? -%>
79
+ <% if @task.loggable? -%>
80
+ <% unless @task.work_started? -%>
81
+ <%# form_tag({:controller => 'tasks', :action => 'update', :id => @task}) do -%>
78
82
  <%=image_link_to_remote('arrow_right.png', l(:move_to_next_period), {:action => :move_task_to_next_period, :id => @task}, nil, true) if @task.backlog.enable_periods? || @task.period_id%>
79
83
  <%=image_link_to_remote('ernes_stop.png', l(:abort), {:action => :abort_task, :id => @task}, nil, true)%>
80
- <% end %>
81
- <% end %>
82
- <% elsif (@task.period.nil? || (not @task.period.passed?)) && @task.leaf? %>
84
+ <%# end -%>
85
+ <% end -%>
86
+ <% end -%>
87
+ <% elsif (@task.period.nil? || (not @task.period.passed?)) && @task.leaf? -%>
88
+ <% form_tag({:controller => 'tasks', :action => 'update', :id => @task}) do -%>
83
89
  <%=image_link_to_remote('eraser.png', l(:reopen), {:action => :reopen_task, :id => @task}, nil, true) %>
84
- <% end -%>
85
90
  <% end -%>
86
- </td>
87
- </tr>
88
-
89
- <% if active && (@task.period.nil? || @task.period.active_or_future?) %>
90
- <%=draggable_element "task_#{@task.id}_description" %>
91
- <%=drop_receiving_element "task_#{@task.id}_description",
92
- :update => update,
93
- :url => with_detour({:controller => 'tasks', :action => "move_to", :target_id => @task.id, :layout => false}),
94
- :accept => "tasks",
95
- :loading => "",
96
- :complete => "",
97
- :hoverclass => 'dropzone-hover'
98
- %>
99
- <% end %>
91
+ <% end -%>
92
+ </div>
93
+ </div>
94
+ <br clear="all" />
95
+ </li>
100
96
 
101
97
  <% for subtask in task.children %>
102
98
  <%=render :partial => '/tasks/task', :locals => { :task => subtask, :i => i, :active => active, :highlight_task => subtask == @selected_task, :update => update } if (active && subtask.active?) || (!active && subtask.completed?) %>