Revision 1297:0a574315af3e .svn/pristine/2e

View differences:

.svn/pristine/2e/2e6c87fbf008e52f19138f6c4bd2e546325437b5.svn-base
1
<% if issues && issues.any? %>
2
<%= form_tag({}) do %>
3
  <table class="list issues">
4
    <thead><tr>
5
    <th>#</th>
6
    <th><%=l(:field_project)%></th>
7
    <th><%=l(:field_tracker)%></th>
8
    <th><%=l(:field_subject)%></th>
9
    </tr></thead>
10
    <tbody>
11
    <% for issue in issues %>
12
    <tr id="issue-<%= h(issue.id) %>" class="hascontextmenu <%= cycle('odd', 'even') %> <%= issue.css_classes %>">
13
      <td class="id">
14
        <%= check_box_tag("ids[]", issue.id, false, :style => 'display:none;', :id => nil) %>
15
        <%= link_to(h(issue.id), :controller => 'issues', :action => 'show', :id => issue) %>
16
      </td>
17
      <td class="project"><%= link_to_project(issue.project) %></td>
18
      <td class="tracker"><%=h issue.tracker %></td>
19
      <td class="subject">
20
        <%= link_to h(truncate(issue.subject, :length => 60)), :controller => 'issues', :action => 'show', :id => issue %> (<%=h issue.status %>)
21
      </td>
22
    </tr>
23
    <% end %>
24
    </tbody>
25
  </table>
26
<% end %>
27
<% else %>
28
  <p class="nodata"><%= l(:label_no_data) %></p>
29
<% end %>
.svn/pristine/2e/2e761f17a6eb6248759d869c76abad698e943338.svn-base
1
# Redmine - project management software
2
# Copyright (C) 2006-2012  Jean-Philippe Lang
3
#
4
# This program is free software; you can redistribute it and/or
5
# modify it under the terms of the GNU General Public License
6
# as published by the Free Software Foundation; either version 2
7
# of the License, or (at your option) any later version.
8
#
9
# This program is distributed in the hope that it will be useful,
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
# GNU General Public License for more details.
13
#
14
# You should have received a copy of the GNU General Public License
15
# along with this program; if not, write to the Free Software
16
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17

  
18
require File.expand_path('../../test_helper', __FILE__)
19

  
20
class GanttsControllerTest < ActionController::TestCase
21
  fixtures :projects, :trackers, :issue_statuses, :issues,
22
           :enumerations, :users, :issue_categories,
23
           :projects_trackers,
24
           :roles,
25
           :member_roles,
26
           :members,
27
           :enabled_modules,
28
           :workflows,
29
           :versions
30

  
31
    def test_gantt_should_work
32
      i2 = Issue.find(2)
33
      i2.update_attribute(:due_date, 1.month.from_now)
34
      get :show, :project_id => 1
35
      assert_response :success
36
      assert_template 'gantts/show'
37
      assert_not_nil assigns(:gantt)
38
      # Issue with start and due dates
39
      i = Issue.find(1)
40
      assert_not_nil i.due_date
41
      assert_select "div a.issue", /##{i.id}/
42
      # Issue with on a targeted version should not be in the events but loaded in the html
43
      i = Issue.find(2)
44
      assert_select "div a.issue", /##{i.id}/
45
    end
46

  
47
    def test_gantt_should_work_without_issue_due_dates
48
      Issue.update_all("due_date = NULL")
49
      get :show, :project_id => 1
50
      assert_response :success
51
      assert_template 'gantts/show'
52
      assert_not_nil assigns(:gantt)
53
    end
54

  
55
    def test_gantt_should_work_without_issue_and_version_due_dates
56
      Issue.update_all("due_date = NULL")
57
      Version.update_all("effective_date = NULL")
58
      get :show, :project_id => 1
59
      assert_response :success
60
      assert_template 'gantts/show'
61
      assert_not_nil assigns(:gantt)
62
    end
63

  
64
    def test_gantt_should_work_cross_project
65
      get :show
66
      assert_response :success
67
      assert_template 'gantts/show'
68
      assert_not_nil assigns(:gantt)
69
      assert_not_nil assigns(:gantt).query
70
      assert_nil assigns(:gantt).project
71
    end
72

  
73
    def test_gantt_should_not_disclose_private_projects
74
      get :show
75
      assert_response :success
76
      assert_template 'gantts/show'
77
      assert_tag 'a', :content => /eCookbook/
78
      # Root private project
79
      assert_no_tag 'a', {:content => /OnlineStore/}
80
      # Private children of a public project
81
      assert_no_tag 'a', :content => /Private child of eCookbook/
82
    end
83

  
84
    def test_gantt_should_export_to_pdf
85
      get :show, :project_id => 1, :format => 'pdf'
86
      assert_response :success
87
      assert_equal 'application/pdf', @response.content_type
88
      assert @response.body.starts_with?('%PDF')
89
      assert_not_nil assigns(:gantt)
90
    end
91

  
92
    def test_gantt_should_export_to_pdf_cross_project
93
      get :show, :format => 'pdf'
94
      assert_response :success
95
      assert_equal 'application/pdf', @response.content_type
96
      assert @response.body.starts_with?('%PDF')
97
      assert_not_nil assigns(:gantt)
98
    end
99

  
100
    if Object.const_defined?(:Magick)
101
      def test_gantt_should_export_to_png
102
        get :show, :project_id => 1, :format => 'png'
103
        assert_response :success
104
        assert_equal 'image/png', @response.content_type
105
      end
106
    end
107
end
.svn/pristine/2e/2e7cd667f7708d524c177cdc1b5c822705ec53e1.svn-base
1
require 'awesome_nested_set/awesome_nested_set'
2
ActiveRecord::Base.send :extend, CollectiveIdea::Acts::NestedSet
3

  
4
if defined?(ActionView)
5
  require 'awesome_nested_set/helper'
6
  ActionView::Base.send :include, CollectiveIdea::Acts::NestedSet::Helper
7
end

Also available in: Unified diff