backlog 0.7.2 → 0.7.3

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,15 @@
1
+ == 0.7.3 2007-08-17
2
+
3
+ * Fixed bug in estimate creation
4
+ * Added cruisecontrol.rb config file
5
+ * Fixed mailing of password
6
+ * Fixed find_by for class table inheritance subclasses
7
+ * Fixed date limits for new periods
8
+ * Fixed display of position in period edit view
9
+ * Added link to current user in top of layout
10
+ * Added display of periods to user view
11
+ * Adjusted the legend in the burn down graphs
12
+
1
13
  == 0.7.2 2007-08-17
2
14
 
3
15
  * Fixed bugs in task reordering links
@@ -1,9 +1,10 @@
1
1
  class EstimatesController < ApplicationController
2
+ verify :method => :post, :redirect_to => ''
2
3
 
3
4
  def create
4
5
  if params[:id] && params[:estimate]
5
6
  @task = Task.find(params[:id])
6
- @task.estimate(params[:estimate][:todo], user)
7
+ @task.estimate(params[:estimate][:todo])
7
8
  redirect_to :controller => 'periods', :action => :show, :id => @task.period, :task_id => @task.id
8
9
  end
9
10
  end
@@ -167,6 +167,7 @@ class UserController < ApplicationController
167
167
  def generate_filled_in
168
168
  @user = User.find_by_id(params[:id]) || current_user || User.find_by_id(session[:user_id])
169
169
  @groups = Group.find(:all, :order => 'name')
170
+ @periods = @user.periods
170
171
  case request.method
171
172
  when :get
172
173
  render
data/app/models/period.rb CHANGED
@@ -182,11 +182,11 @@ class Period < ActiveRecord::Base
182
182
  observed_todo_data = get_todo_data(recorded_dates)
183
183
  actual_todo_data = get_todo_data(recorded_dates, true)
184
184
  g.data("#{l :todo} (#{l :obs})", observed_todo_data)
185
- g.data("#{l :calc}", actual_todo_data)
185
+ g.data("#{l :todo}", actual_todo_data)
186
186
  g.data(l(:done), get_work_data(recorded_dates)) if track_work?
187
187
  if previous_period = higher_item
188
- g.data("#{l :previous} #{l :obs}", previous_period.get_todo_data(previous_period.dates))
189
- g.data("#{l :calc}", previous_period.get_todo_data(previous_period.dates, true))
188
+ g.data("#{l :previous_abr} #{l :obs}", previous_period.get_todo_data(previous_period.dates))
189
+ g.data("#{l :previous_abr}", previous_period.get_todo_data(previous_period.dates, true))
190
190
  end
191
191
 
192
192
  if active?
@@ -10,7 +10,7 @@
10
10
  <% end %>
11
11
  | <%= link_to l(:backlogs), :controller => 'backlogs', :action => :list %>
12
12
  <!-- | <%= link_to l(:administration), :controller => 'administration', :action => :index %> -->
13
- <% if user? %>| <%=user.email%><% end %>
13
+ <% if user? %>| <%=link_to user.email, :controller => 'user', :action => :edit%><% end %>
14
14
  </div>
15
15
  <div id="header">
16
16
  <%= error_messages_for :backlog, :user, :group, :period, :task, :work, :estimate %>
@@ -14,15 +14,23 @@
14
14
  <% end %>
15
15
  </p>
16
16
 
17
- <%= hidden_field 'period', 'position' %>
18
17
  <% if @period.party %>
19
- <p><label for="period_position"><%=l :position%></label>:
20
- <%= @period.party.periods.last ? @period.party.periods.last.position + 1 : 1 %></p>
18
+ <p><label for="period_position"><%=l :position%></label>:
19
+ <% if @period.new_record? %>
20
+ <%= @period.party.periods.last ? @period.party.periods.last.position + 1 : 1 %></p>
21
+ <% else %>
22
+ <%= @period.position %></p>
23
+ <% end %>
21
24
  <% end %>
22
25
 
23
26
  <p><label for="period_start_on"><%=l :start_on%></label><br/>
24
- <% minimum_date = @period.higher_item ? @period.higher_item.end_on + 1 : Date.today %>
25
- <% maximum_date = @period.lower_item ? @period.lower_item.start_on - 1 : Date.today + 5*365 %>
27
+ <% if @period.party && @period.new_record? %>
28
+ <% minimum_date = @period.party.periods.last ? @period.party.periods.last.end_on + 1 : Date.today %>
29
+ <% maximum_date = Date.today + 5*365 %>
30
+ <% else %>
31
+ <% minimum_date = @period.higher_item ? @period.higher_item.end_on + 1 : Date.today %>
32
+ <% maximum_date = @period.lower_item ? @period.lower_item.start_on - 1 : Date.today + 5*365 %>
33
+ <% end %>
26
34
  <%= text_field 'period', 'start_on', :size => 10, :value => @period.start_on ? @period.start_on.strftime('%Y-%m-%d') : nil %>
27
35
  <button id="trigger1">...</button>
28
36
  <script type="text/javascript">//<![CDATA[
@@ -11,17 +11,16 @@
11
11
  <h4><%=l :password %></h4>
12
12
  </div>
13
13
 
14
- <%= start_form_tag_helper %>
15
- <%= render_partial 'password', :submit => true %>
16
- </form>
14
+ <%= start_form_tag_helper %>
15
+ <%= render_partial 'password', :submit => true %>
16
+ </form>
17
17
 
18
- <%= start_form_tag_helper %>
19
- <div class="user_delete">
20
- <%= hidden_field 'user', 'form', :value => 'delete' %>
21
- <%= submit_tag l(:delete) %>
22
- </div>
23
- </form>
24
- </div>
18
+ <%= start_form_tag_helper %>
19
+ <div class="user_delete">
20
+ <%= hidden_field 'user', 'form', :value => 'delete' %>
21
+ <%= submit_tag l(:delete) %>
22
+ </div>
23
+ </form>
25
24
  </div>
26
25
 
27
26
  <div id="lfeature">
@@ -29,15 +28,33 @@
29
28
  <h4><%=l :groups %></h4>
30
29
  </div>
31
30
 
32
- <table>
33
- <% for @group in @groups %>
34
- <tr>
35
- <td><%=link_to h(@group.name), :controller => 'groups', :action => :edit, :id => @group %></td>
36
- <td>
37
- <% form_for :group, @group, :url => {:controller => 'groups', :action => :set_member, :id => @group, :user_id => @user.id} do %>
38
- <%=check_box_tag :value, true, @group.users.include?(@user), :onchange => "form.submit()" %></td>
39
- <% end %>
40
- </tr>
41
- <% end %>
42
- </table>
31
+ <table>
32
+ <% for @group in @groups %>
33
+ <tr>
34
+ <td><%=link_to h(@group.name), :controller => 'groups', :action => :edit, :id => @group %></td>
35
+ <td>
36
+ <% form_for :group, @group, :url => {:controller => 'groups', :action => :set_member, :id => @group, :user_id => @user.id} do %>
37
+ <%=check_box_tag :value, true, @group.users.include?(@user), :onchange => "form.submit()" %>
38
+ <% end %>
39
+ </td>
40
+ </tr>
41
+ <% end %>
42
+ </table>
43
43
  </div>
44
+
45
+ <br clear="right"/>
46
+
47
+ <div id="rfeature">
48
+ <div class="btitle">
49
+ <h4><%=l :periods %></h4>
50
+ </div>
51
+
52
+ <table>
53
+ <% for @period in @periods %>
54
+ <tr>
55
+ <td><%=link_to h(@period.name), :controller => 'periods', :action => :show, :id => @period %></td>
56
+ </tr>
57
+ <% end %>
58
+ </table>
59
+ </div>
60
+
data/cruise_config.rb ADDED
@@ -0,0 +1,6 @@
1
+ Project.configure do |project|
2
+ project.email_notifier.emails = ['uwe@datek.no', 'uwe@kubosch.no', 'donv@crusaders.no']
3
+ project.email_notifier.from = 'cruisecontrol@datek.no'
4
+
5
+ project.build_command = 'RAILS_ENV=test rake'
6
+ end
data/lang/en.yaml CHANGED
@@ -55,9 +55,11 @@ next: Next
55
55
  no_pending_tasks: There are no pending tasks in this period.
56
56
  password: Password
57
57
  period: Period
58
+ periods: Periods
58
59
  position: Position
59
60
  postponed: Postponed
60
61
  previous: Previous
62
+ previous_abr: Prev.
61
63
  projection: Projection
62
64
  reopen: Reopen task
63
65
  resolution: Resolution
data/lang/no.yaml CHANGED
@@ -55,9 +55,11 @@ next: Neste
55
55
  no_pending_tasks: Det er ingen ventende oppgaver i denne perioden.
56
56
  password: Passord
57
57
  period: Periode
58
+ periods: Perioder
58
59
  position: Posisjon
59
60
  postponed: Utsatt
60
61
  previous: Forrige
62
+ previous_abr: Forrige
61
63
  projection: Projeksjon
62
64
  reopen: Gjenåpne
63
65
  resolution: Avslutningsmåte
@@ -108,7 +108,16 @@ class ActiveRecord::Base
108
108
  # then filter by sub_attributes
109
109
  method_missing_super(method_symbol, parameters)
110
110
  else
111
- #{proxy_class_name}.method_missing(method_symbol, parameters)
111
+ result = #{proxy_class_name}.method_missing(method_symbol, parameters)
112
+ if result
113
+ if result.is_a? Array
114
+ result.map {|entry| entry.base}
115
+ else
116
+ result = result.base
117
+ end
118
+ else
119
+ result
120
+ end
112
121
  end
113
122
  else
114
123
  method_missing_super(method_symbol, parameters)
@@ -1,7 +1,6 @@
1
1
  require File.dirname(__FILE__) + '/../test_helper'
2
2
  require 'estimates_controller'
3
3
 
4
- # Re-raise errors caught by the controller.
5
4
  class EstimatesController; def rescue_action(e) raise e end; end
6
5
 
7
6
  class EstimatesControllerTest < Test::Unit::TestCase
@@ -9,10 +8,34 @@ class EstimatesControllerTest < Test::Unit::TestCase
9
8
  @controller = EstimatesController.new
10
9
  @request = ActionController::TestRequest.new
11
10
  @response = ActionController::TestResponse.new
11
+
12
+ @request.session[:user_id] = 1000001
13
+ end
14
+
15
+ def test_create
16
+ count_before = Estimate.count
17
+ post :create,
18
+ "action"=>"create",
19
+ "id"=>"1",
20
+ "estimate"=>{"todo"=>"0"}
21
+
22
+ assert_response :redirect
23
+ assert_redirected_to :controller => 'periods', :action => :show, :id => 1, :task_id => 1
24
+
25
+ assert_equal count_before +1 , Estimate.count
12
26
  end
27
+
28
+ def test_create_get_is_redirected_to_root
29
+ count_before = Estimate.count
30
+ get :create,
31
+ "action"=>"create",
32
+ "id"=>"1",
33
+ "estimate"=>{"todo"=>"0"}
34
+
35
+ assert_response :redirect
36
+ assert_redirected_to :controller => 'backlogs', :action => :index
13
37
 
14
- # Replace this with your real tests.
15
- def test_truth
16
- assert true
38
+ assert_equal count_before, Estimate.count
17
39
  end
40
+
18
41
  end
@@ -1,7 +1,6 @@
1
1
  require File.dirname(__FILE__) + '/../test_helper'
2
2
  require 'groups_controller'
3
3
 
4
- # Re-raise errors caught by the controller.
5
4
  class GroupsController; def rescue_action(e) raise e end; end
6
5
 
7
6
  class GroupsControllerTest < Test::Unit::TestCase
@@ -134,6 +134,11 @@ class UserTest < Test::Unit::TestCase
134
134
  # assert !u.save
135
135
  # end
136
136
 
137
+ def test_find_by
138
+ user = User.find_by_email('tesla@example.com')
139
+ assert_equal User, user.class
140
+ end
141
+
137
142
  private
138
143
 
139
144
  # TODO (uwe): This method should be removed
metadata CHANGED
@@ -3,7 +3,7 @@ rubygems_version: 0.9.4
3
3
  specification_version: 1
4
4
  name: backlog
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.7.2
6
+ version: 0.7.3
7
7
  date: 2007-08-17 00:00:00 +02:00
8
8
  summary: Application to aid collecting, processing, organizing, reviewing and doing tasks.
9
9
  require_paths:
@@ -227,7 +227,9 @@ files:
227
227
  - config/environments/datek_production.rb
228
228
  - LICENSE_LOCALIZATION
229
229
  - README.txt
230
+ - doc
230
231
  - Manifest.txt
232
+ - cruise_config.rb
231
233
  - vendor
232
234
  - vendor/plugins
233
235
  - vendor/plugins/activerecord_foreign_key_extensions