##// END OF EJS Templates
Added a quick search form in page header. Search functionality moved to a dedicated controller....
Jean-Philippe Lang -
r486:ebe10fa6452d
parent child
Show More
@@ -0,0 +1,75
1 # redMine - project management software
2 # Copyright (C) 2006 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 class SearchController < ApplicationController
19 layout 'base'
20
21 def index
22 @question = params[:q] || ""
23 @question.strip!
24 @all_words = params[:all_words] || (params[:submit] ? false : true)
25 @scope = params[:scope] || (params[:submit] ? [] : %w(projects issues changesets news documents wiki) )
26
27 # quick jump to an issue
28 if @scope.include?('issues') && @question.match(/^#?(\d+)$/) && Issue.find_by_id($1, :include => :project, :conditions => Project.visible_by(logged_in_user))
29 redirect_to :controller => "issues", :action => "show", :id => $1
30 return
31 end
32
33 if params[:id]
34 find_project
35 return unless check_project_privacy
36 end
37
38 # tokens must be at least 3 character long
39 @tokens = @question.split.uniq.select {|w| w.length > 2 }
40
41 if !@tokens.empty?
42 # no more than 5 tokens to search for
43 @tokens.slice! 5..-1 if @tokens.size > 5
44 # strings used in sql like statement
45 like_tokens = @tokens.collect {|w| "%#{w.downcase}%"}
46 operator = @all_words ? " AND " : " OR "
47 limit = 10
48 @results = []
49 if @project
50 @results += @project.issues.find(:all, :limit => limit, :include => :author, :conditions => [ (["(LOWER(subject) like ? OR LOWER(description) like ?)"] * like_tokens.size).join(operator), * (like_tokens * 2).sort] ) if @scope.include? 'issues'
51 @results += @project.news.find(:all, :limit => limit, :conditions => [ (["(LOWER(title) like ? OR LOWER(description) like ?)"] * like_tokens.size).join(operator), * (like_tokens * 2).sort], :include => :author ) if @scope.include? 'news'
52 @results += @project.documents.find(:all, :limit => limit, :conditions => [ (["(LOWER(title) like ? OR LOWER(description) like ?)"] * like_tokens.size).join(operator), * (like_tokens * 2).sort] ) if @scope.include? 'documents'
53 @results += @project.wiki.pages.find(:all, :limit => limit, :include => :content, :conditions => [ (["(LOWER(title) like ? OR LOWER(text) like ?)"] * like_tokens.size).join(operator), * (like_tokens * 2).sort] ) if @project.wiki && @scope.include?('wiki')
54 @results += @project.repository.changesets.find(:all, :limit => limit, :conditions => [ (["(LOWER(comments) like ?)"] * like_tokens.size).join(operator), * (like_tokens).sort] ) if @project.repository && @scope.include?('changesets')
55 else
56 Project.with_scope(:find => {:conditions => Project.visible_by(logged_in_user)}) do
57 @results += Project.find(:all, :limit => limit, :conditions => [ (["(LOWER(name) like ? OR LOWER(description) like ?)"] * like_tokens.size).join(operator), * (like_tokens * 2).sort] ) if @scope.include? 'projects'
58 end
59 # if only one project is found, user is redirected to its overview
60 redirect_to :controller => 'projects', :action => 'show', :id => @results.first and return if @results.size == 1
61 end
62 @question = @tokens.join(" ")
63 else
64 @question = ""
65 end
66 end
67
68 private
69 def find_project
70 @project = Project.find(params[:id])
71 @html_title = @project.name
72 rescue ActiveRecord::RecordNotFound
73 render_404
74 end
75 end
@@ -0,0 +1,28
1 # redMine - project management software
2 # Copyright (C) 2006-2007 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 module SearchHelper
19 def highlight_tokens(text, tokens)
20 return text unless tokens && !tokens.empty?
21 regexp = Regexp.new "(#{tokens.join('|')})", Regexp::IGNORECASE
22 result = ''
23 text.split(regexp).each_with_index do |words, i|
24 result << (i.even? ? (words.length > 100 ? "#{words[0..44]} ... #{words[-45..-1]}" : words) : content_tag('span', words, :class => 'highlight'))
25 end
26 result
27 end
28 end
@@ -0,0 +1,48
1 require File.dirname(__FILE__) + '/../test_helper'
2 require 'search_controller'
3
4 # Re-raise errors caught by the controller.
5 class SearchController; def rescue_action(e) raise e end; end
6
7 class SearchControllerTest < Test::Unit::TestCase
8 fixtures :projects, :issues
9
10 def setup
11 @controller = SearchController.new
12 @request = ActionController::TestRequest.new
13 @response = ActionController::TestResponse.new
14 end
15
16 def test_search_for_projects
17 get :index
18 assert_response :success
19 assert_template 'index'
20
21 get :index, :q => "cook"
22 assert_response :success
23 assert_template 'index'
24 assert assigns(:results).include?(Project.find(1))
25 end
26
27 def test_search_in_project
28 get :index, :id => 1
29 assert_response :success
30 assert_template 'index'
31 assert_not_nil assigns(:project)
32
33 get :index, :id => 1, :q => "can", :scope => ["issues", "news", "documents"]
34 assert_response :success
35 assert_template 'index'
36 end
37
38 def test_quick_jump_to_issue
39 # issue of a public project
40 get :index, :q => "3"
41 assert_redirected_to 'issues/show/3'
42
43 # issue of a private project
44 get :index, :q => "4"
45 assert_response :success
46 assert_template 'index'
47 end
48 end
@@ -1,691 +1,665
1 # redMine - project management software
1 # redMine - project management software
2 # Copyright (C) 2006-2007 Jean-Philippe Lang
2 # Copyright (C) 2006-2007 Jean-Philippe Lang
3 #
3 #
4 # This program is free software; you can redistribute it and/or
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
7 # of the License, or (at your option) any later version.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU General Public License
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
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.
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
17
18 require 'csv'
18 require 'csv'
19
19
20 class ProjectsController < ApplicationController
20 class ProjectsController < ApplicationController
21 layout 'base'
21 layout 'base'
22 before_filter :find_project, :authorize, :except => [ :index, :list, :add ]
22 before_filter :find_project, :authorize, :except => [ :index, :list, :add ]
23 before_filter :require_admin, :only => [ :add, :destroy ]
23 before_filter :require_admin, :only => [ :add, :destroy ]
24
24
25 helper :sort
25 helper :sort
26 include SortHelper
26 include SortHelper
27 helper :custom_fields
27 helper :custom_fields
28 include CustomFieldsHelper
28 include CustomFieldsHelper
29 helper :ifpdf
29 helper :ifpdf
30 include IfpdfHelper
30 include IfpdfHelper
31 helper IssuesHelper
31 helper IssuesHelper
32 helper :queries
32 helper :queries
33 include QueriesHelper
33 include QueriesHelper
34
34
35 def index
35 def index
36 list
36 list
37 render :action => 'list' unless request.xhr?
37 render :action => 'list' unless request.xhr?
38 end
38 end
39
39
40 # Lists public projects
40 # Lists public projects
41 def list
41 def list
42 sort_init "#{Project.table_name}.name", "asc"
42 sort_init "#{Project.table_name}.name", "asc"
43 sort_update
43 sort_update
44 @project_count = Project.count(:all, :conditions => Project.visible_by(logged_in_user))
44 @project_count = Project.count(:all, :conditions => Project.visible_by(logged_in_user))
45 @project_pages = Paginator.new self, @project_count,
45 @project_pages = Paginator.new self, @project_count,
46 15,
46 15,
47 params['page']
47 params['page']
48 @projects = Project.find :all, :order => sort_clause,
48 @projects = Project.find :all, :order => sort_clause,
49 :conditions => Project.visible_by(logged_in_user),
49 :conditions => Project.visible_by(logged_in_user),
50 :include => :parent,
50 :include => :parent,
51 :limit => @project_pages.items_per_page,
51 :limit => @project_pages.items_per_page,
52 :offset => @project_pages.current.offset
52 :offset => @project_pages.current.offset
53
53
54 render :action => "list", :layout => false if request.xhr?
54 render :action => "list", :layout => false if request.xhr?
55 end
55 end
56
56
57 # Add a new project
57 # Add a new project
58 def add
58 def add
59 @custom_fields = IssueCustomField.find(:all)
59 @custom_fields = IssueCustomField.find(:all)
60 @root_projects = Project.find(:all, :conditions => "parent_id is null")
60 @root_projects = Project.find(:all, :conditions => "parent_id is null")
61 @project = Project.new(params[:project])
61 @project = Project.new(params[:project])
62 if request.get?
62 if request.get?
63 @custom_values = ProjectCustomField.find(:all).collect { |x| CustomValue.new(:custom_field => x, :customized => @project) }
63 @custom_values = ProjectCustomField.find(:all).collect { |x| CustomValue.new(:custom_field => x, :customized => @project) }
64 else
64 else
65 @project.custom_fields = CustomField.find(params[:custom_field_ids]) if params[:custom_field_ids]
65 @project.custom_fields = CustomField.find(params[:custom_field_ids]) if params[:custom_field_ids]
66 @custom_values = ProjectCustomField.find(:all).collect { |x| CustomValue.new(:custom_field => x, :customized => @project, :value => params["custom_fields"][x.id.to_s]) }
66 @custom_values = ProjectCustomField.find(:all).collect { |x| CustomValue.new(:custom_field => x, :customized => @project, :value => params["custom_fields"][x.id.to_s]) }
67 @project.custom_values = @custom_values
67 @project.custom_values = @custom_values
68 if params[:repository_enabled] && params[:repository_enabled] == "1"
68 if params[:repository_enabled] && params[:repository_enabled] == "1"
69 @project.repository = Repository.new
69 @project.repository = Repository.new
70 @project.repository.attributes = params[:repository]
70 @project.repository.attributes = params[:repository]
71 end
71 end
72 if "1" == params[:wiki_enabled]
72 if "1" == params[:wiki_enabled]
73 @project.wiki = Wiki.new
73 @project.wiki = Wiki.new
74 @project.wiki.attributes = params[:wiki]
74 @project.wiki.attributes = params[:wiki]
75 end
75 end
76 if @project.save
76 if @project.save
77 flash[:notice] = l(:notice_successful_create)
77 flash[:notice] = l(:notice_successful_create)
78 redirect_to :controller => 'admin', :action => 'projects'
78 redirect_to :controller => 'admin', :action => 'projects'
79 end
79 end
80 end
80 end
81 end
81 end
82
82
83 # Show @project
83 # Show @project
84 def show
84 def show
85 @custom_values = @project.custom_values.find(:all, :include => :custom_field)
85 @custom_values = @project.custom_values.find(:all, :include => :custom_field)
86 @members_by_role = @project.members.find(:all, :include => [:user, :role], :order => 'position').group_by {|m| m.role}
86 @members_by_role = @project.members.find(:all, :include => [:user, :role], :order => 'position').group_by {|m| m.role}
87 @subprojects = @project.children if @project.children.size > 0
87 @subprojects = @project.children if @project.children.size > 0
88 @news = @project.news.find(:all, :limit => 5, :include => [ :author, :project ], :order => "#{News.table_name}.created_on DESC")
88 @news = @project.news.find(:all, :limit => 5, :include => [ :author, :project ], :order => "#{News.table_name}.created_on DESC")
89 @trackers = Tracker.find(:all, :order => 'position')
89 @trackers = Tracker.find(:all, :order => 'position')
90 @open_issues_by_tracker = Issue.count(:group => :tracker, :joins => "INNER JOIN #{IssueStatus.table_name} ON #{IssueStatus.table_name}.id = #{Issue.table_name}.status_id", :conditions => ["project_id=? and #{IssueStatus.table_name}.is_closed=?", @project.id, false])
90 @open_issues_by_tracker = Issue.count(:group => :tracker, :joins => "INNER JOIN #{IssueStatus.table_name} ON #{IssueStatus.table_name}.id = #{Issue.table_name}.status_id", :conditions => ["project_id=? and #{IssueStatus.table_name}.is_closed=?", @project.id, false])
91 @total_issues_by_tracker = Issue.count(:group => :tracker, :conditions => ["project_id=?", @project.id])
91 @total_issues_by_tracker = Issue.count(:group => :tracker, :conditions => ["project_id=?", @project.id])
92 end
92 end
93
93
94 def settings
94 def settings
95 @root_projects = Project::find(:all, :conditions => ["parent_id is null and id <> ?", @project.id])
95 @root_projects = Project::find(:all, :conditions => ["parent_id is null and id <> ?", @project.id])
96 @custom_fields = IssueCustomField.find(:all)
96 @custom_fields = IssueCustomField.find(:all)
97 @issue_category ||= IssueCategory.new
97 @issue_category ||= IssueCategory.new
98 @member ||= @project.members.new
98 @member ||= @project.members.new
99 @roles = Role.find(:all, :order => 'position')
99 @roles = Role.find(:all, :order => 'position')
100 @users = User.find_active(:all) - @project.users
100 @users = User.find_active(:all) - @project.users
101 @custom_values ||= ProjectCustomField.find(:all).collect { |x| @project.custom_values.find_by_custom_field_id(x.id) || CustomValue.new(:custom_field => x) }
101 @custom_values ||= ProjectCustomField.find(:all).collect { |x| @project.custom_values.find_by_custom_field_id(x.id) || CustomValue.new(:custom_field => x) }
102 end
102 end
103
103
104 # Edit @project
104 # Edit @project
105 def edit
105 def edit
106 if request.post?
106 if request.post?
107 @project.custom_fields = IssueCustomField.find(params[:custom_field_ids]) if params[:custom_field_ids]
107 @project.custom_fields = IssueCustomField.find(params[:custom_field_ids]) if params[:custom_field_ids]
108 if params[:custom_fields]
108 if params[:custom_fields]
109 @custom_values = ProjectCustomField.find(:all).collect { |x| CustomValue.new(:custom_field => x, :customized => @project, :value => params["custom_fields"][x.id.to_s]) }
109 @custom_values = ProjectCustomField.find(:all).collect { |x| CustomValue.new(:custom_field => x, :customized => @project, :value => params["custom_fields"][x.id.to_s]) }
110 @project.custom_values = @custom_values
110 @project.custom_values = @custom_values
111 end
111 end
112 if params[:repository_enabled]
112 if params[:repository_enabled]
113 case params[:repository_enabled]
113 case params[:repository_enabled]
114 when "0"
114 when "0"
115 @project.repository = nil
115 @project.repository = nil
116 when "1"
116 when "1"
117 @project.repository ||= Repository.new
117 @project.repository ||= Repository.new
118 @project.repository.update_attributes params[:repository]
118 @project.repository.update_attributes params[:repository]
119 end
119 end
120 end
120 end
121 if params[:wiki_enabled]
121 if params[:wiki_enabled]
122 case params[:wiki_enabled]
122 case params[:wiki_enabled]
123 when "0"
123 when "0"
124 @project.wiki.destroy if @project.wiki
124 @project.wiki.destroy if @project.wiki
125 when "1"
125 when "1"
126 @project.wiki ||= Wiki.new
126 @project.wiki ||= Wiki.new
127 @project.wiki.update_attributes params[:wiki]
127 @project.wiki.update_attributes params[:wiki]
128 end
128 end
129 end
129 end
130 @project.attributes = params[:project]
130 @project.attributes = params[:project]
131 if @project.save
131 if @project.save
132 flash[:notice] = l(:notice_successful_update)
132 flash[:notice] = l(:notice_successful_update)
133 redirect_to :action => 'settings', :id => @project
133 redirect_to :action => 'settings', :id => @project
134 else
134 else
135 settings
135 settings
136 render :action => 'settings'
136 render :action => 'settings'
137 end
137 end
138 end
138 end
139 end
139 end
140
140
141 # Delete @project
141 # Delete @project
142 def destroy
142 def destroy
143 if request.post? and params[:confirm]
143 if request.post? and params[:confirm]
144 @project.destroy
144 @project.destroy
145 redirect_to :controller => 'admin', :action => 'projects'
145 redirect_to :controller => 'admin', :action => 'projects'
146 end
146 end
147 end
147 end
148
148
149 # Add a new issue category to @project
149 # Add a new issue category to @project
150 def add_issue_category
150 def add_issue_category
151 if request.post?
151 if request.post?
152 @issue_category = @project.issue_categories.build(params[:issue_category])
152 @issue_category = @project.issue_categories.build(params[:issue_category])
153 if @issue_category.save
153 if @issue_category.save
154 flash[:notice] = l(:notice_successful_create)
154 flash[:notice] = l(:notice_successful_create)
155 redirect_to :action => 'settings', :tab => 'categories', :id => @project
155 redirect_to :action => 'settings', :tab => 'categories', :id => @project
156 else
156 else
157 settings
157 settings
158 render :action => 'settings'
158 render :action => 'settings'
159 end
159 end
160 end
160 end
161 end
161 end
162
162
163 # Add a new version to @project
163 # Add a new version to @project
164 def add_version
164 def add_version
165 @version = @project.versions.build(params[:version])
165 @version = @project.versions.build(params[:version])
166 if request.post? and @version.save
166 if request.post? and @version.save
167 flash[:notice] = l(:notice_successful_create)
167 flash[:notice] = l(:notice_successful_create)
168 redirect_to :action => 'settings', :tab => 'versions', :id => @project
168 redirect_to :action => 'settings', :tab => 'versions', :id => @project
169 end
169 end
170 end
170 end
171
171
172 # Add a new member to @project
172 # Add a new member to @project
173 def add_member
173 def add_member
174 @member = @project.members.build(params[:member])
174 @member = @project.members.build(params[:member])
175 if request.post?
175 if request.post?
176 if @member.save
176 if @member.save
177 flash[:notice] = l(:notice_successful_create)
177 flash[:notice] = l(:notice_successful_create)
178 redirect_to :action => 'settings', :tab => 'members', :id => @project
178 redirect_to :action => 'settings', :tab => 'members', :id => @project
179 else
179 else
180 settings
180 settings
181 render :action => 'settings'
181 render :action => 'settings'
182 end
182 end
183 end
183 end
184 end
184 end
185
185
186 # Show members list of @project
186 # Show members list of @project
187 def list_members
187 def list_members
188 @members = @project.members.find(:all)
188 @members = @project.members.find(:all)
189 end
189 end
190
190
191 # Add a new document to @project
191 # Add a new document to @project
192 def add_document
192 def add_document
193 @categories = Enumeration::get_values('DCAT')
193 @categories = Enumeration::get_values('DCAT')
194 @document = @project.documents.build(params[:document])
194 @document = @project.documents.build(params[:document])
195 if request.post? and @document.save
195 if request.post? and @document.save
196 # Save the attachments
196 # Save the attachments
197 params[:attachments].each { |a|
197 params[:attachments].each { |a|
198 Attachment.create(:container => @document, :file => a, :author => logged_in_user) unless a.size == 0
198 Attachment.create(:container => @document, :file => a, :author => logged_in_user) unless a.size == 0
199 } if params[:attachments] and params[:attachments].is_a? Array
199 } if params[:attachments] and params[:attachments].is_a? Array
200 flash[:notice] = l(:notice_successful_create)
200 flash[:notice] = l(:notice_successful_create)
201 Mailer.deliver_document_add(@document) if Permission.find_by_controller_and_action(params[:controller], params[:action]).mail_enabled?
201 Mailer.deliver_document_add(@document) if Permission.find_by_controller_and_action(params[:controller], params[:action]).mail_enabled?
202 redirect_to :action => 'list_documents', :id => @project
202 redirect_to :action => 'list_documents', :id => @project
203 end
203 end
204 end
204 end
205
205
206 # Show documents list of @project
206 # Show documents list of @project
207 def list_documents
207 def list_documents
208 @documents = @project.documents.find :all, :include => :category
208 @documents = @project.documents.find :all, :include => :category
209 end
209 end
210
210
211 # Add a new issue to @project
211 # Add a new issue to @project
212 def add_issue
212 def add_issue
213 @tracker = Tracker.find(params[:tracker_id])
213 @tracker = Tracker.find(params[:tracker_id])
214 @priorities = Enumeration::get_values('IPRI')
214 @priorities = Enumeration::get_values('IPRI')
215
215
216 default_status = IssueStatus.default
216 default_status = IssueStatus.default
217 @issue = Issue.new(:project => @project, :tracker => @tracker)
217 @issue = Issue.new(:project => @project, :tracker => @tracker)
218 @issue.status = default_status
218 @issue.status = default_status
219 @allowed_statuses = ([default_status] + default_status.find_new_statuses_allowed_to(logged_in_user.role_for_project(@project), @issue.tracker))if logged_in_user
219 @allowed_statuses = ([default_status] + default_status.find_new_statuses_allowed_to(logged_in_user.role_for_project(@project), @issue.tracker))if logged_in_user
220 if request.get?
220 if request.get?
221 @issue.start_date = Date.today
221 @issue.start_date = Date.today
222 @custom_values = @project.custom_fields_for_issues(@tracker).collect { |x| CustomValue.new(:custom_field => x, :customized => @issue) }
222 @custom_values = @project.custom_fields_for_issues(@tracker).collect { |x| CustomValue.new(:custom_field => x, :customized => @issue) }
223 else
223 else
224 @issue.attributes = params[:issue]
224 @issue.attributes = params[:issue]
225
225
226 requested_status = IssueStatus.find_by_id(params[:issue][:status_id])
226 requested_status = IssueStatus.find_by_id(params[:issue][:status_id])
227 @issue.status = (@allowed_statuses.include? requested_status) ? requested_status : default_status
227 @issue.status = (@allowed_statuses.include? requested_status) ? requested_status : default_status
228
228
229 @issue.author_id = self.logged_in_user.id if self.logged_in_user
229 @issue.author_id = self.logged_in_user.id if self.logged_in_user
230 # Multiple file upload
230 # Multiple file upload
231 @attachments = []
231 @attachments = []
232 params[:attachments].each { |a|
232 params[:attachments].each { |a|
233 @attachments << Attachment.new(:container => @issue, :file => a, :author => logged_in_user) unless a.size == 0
233 @attachments << Attachment.new(:container => @issue, :file => a, :author => logged_in_user) unless a.size == 0
234 } if params[:attachments] and params[:attachments].is_a? Array
234 } if params[:attachments] and params[:attachments].is_a? Array
235 @custom_values = @project.custom_fields_for_issues(@tracker).collect { |x| CustomValue.new(:custom_field => x, :customized => @issue, :value => params["custom_fields"][x.id.to_s]) }
235 @custom_values = @project.custom_fields_for_issues(@tracker).collect { |x| CustomValue.new(:custom_field => x, :customized => @issue, :value => params["custom_fields"][x.id.to_s]) }
236 @issue.custom_values = @custom_values
236 @issue.custom_values = @custom_values
237 if @issue.save
237 if @issue.save
238 @attachments.each(&:save)
238 @attachments.each(&:save)
239 flash[:notice] = l(:notice_successful_create)
239 flash[:notice] = l(:notice_successful_create)
240 Mailer.deliver_issue_add(@issue) if Permission.find_by_controller_and_action(params[:controller], params[:action]).mail_enabled?
240 Mailer.deliver_issue_add(@issue) if Permission.find_by_controller_and_action(params[:controller], params[:action]).mail_enabled?
241 redirect_to :action => 'list_issues', :id => @project
241 redirect_to :action => 'list_issues', :id => @project
242 end
242 end
243 end
243 end
244 end
244 end
245
245
246 # Show filtered/sorted issues list of @project
246 # Show filtered/sorted issues list of @project
247 def list_issues
247 def list_issues
248 sort_init "#{Issue.table_name}.id", "desc"
248 sort_init "#{Issue.table_name}.id", "desc"
249 sort_update
249 sort_update
250
250
251 retrieve_query
251 retrieve_query
252
252
253 @results_per_page_options = [ 15, 25, 50, 100 ]
253 @results_per_page_options = [ 15, 25, 50, 100 ]
254 if params[:per_page] and @results_per_page_options.include? params[:per_page].to_i
254 if params[:per_page] and @results_per_page_options.include? params[:per_page].to_i
255 @results_per_page = params[:per_page].to_i
255 @results_per_page = params[:per_page].to_i
256 session[:results_per_page] = @results_per_page
256 session[:results_per_page] = @results_per_page
257 else
257 else
258 @results_per_page = session[:results_per_page] || 25
258 @results_per_page = session[:results_per_page] || 25
259 end
259 end
260
260
261 if @query.valid?
261 if @query.valid?
262 @issue_count = Issue.count(:include => [:status, :project, :custom_values], :conditions => @query.statement)
262 @issue_count = Issue.count(:include => [:status, :project, :custom_values], :conditions => @query.statement)
263 @issue_pages = Paginator.new self, @issue_count, @results_per_page, params['page']
263 @issue_pages = Paginator.new self, @issue_count, @results_per_page, params['page']
264 @issues = Issue.find :all, :order => sort_clause,
264 @issues = Issue.find :all, :order => sort_clause,
265 :include => [ :assigned_to, :status, :tracker, :project, :priority, :custom_values ],
265 :include => [ :assigned_to, :status, :tracker, :project, :priority, :custom_values ],
266 :conditions => @query.statement,
266 :conditions => @query.statement,
267 :limit => @issue_pages.items_per_page,
267 :limit => @issue_pages.items_per_page,
268 :offset => @issue_pages.current.offset
268 :offset => @issue_pages.current.offset
269 end
269 end
270 @trackers = Tracker.find :all, :order => 'position'
270 @trackers = Tracker.find :all, :order => 'position'
271 render :layout => false if request.xhr?
271 render :layout => false if request.xhr?
272 end
272 end
273
273
274 # Export filtered/sorted issues list to CSV
274 # Export filtered/sorted issues list to CSV
275 def export_issues_csv
275 def export_issues_csv
276 sort_init "#{Issue.table_name}.id", "desc"
276 sort_init "#{Issue.table_name}.id", "desc"
277 sort_update
277 sort_update
278
278
279 retrieve_query
279 retrieve_query
280 render :action => 'list_issues' and return unless @query.valid?
280 render :action => 'list_issues' and return unless @query.valid?
281
281
282 @issues = Issue.find :all, :order => sort_clause,
282 @issues = Issue.find :all, :order => sort_clause,
283 :include => [ :assigned_to, :author, :status, :tracker, :priority, {:custom_values => :custom_field} ],
283 :include => [ :assigned_to, :author, :status, :tracker, :priority, {:custom_values => :custom_field} ],
284 :conditions => @query.statement,
284 :conditions => @query.statement,
285 :limit => Setting.issues_export_limit
285 :limit => Setting.issues_export_limit
286
286
287 ic = Iconv.new(l(:general_csv_encoding), 'UTF-8')
287 ic = Iconv.new(l(:general_csv_encoding), 'UTF-8')
288 export = StringIO.new
288 export = StringIO.new
289 CSV::Writer.generate(export, l(:general_csv_separator)) do |csv|
289 CSV::Writer.generate(export, l(:general_csv_separator)) do |csv|
290 # csv header fields
290 # csv header fields
291 headers = [ "#", l(:field_status),
291 headers = [ "#", l(:field_status),
292 l(:field_tracker),
292 l(:field_tracker),
293 l(:field_priority),
293 l(:field_priority),
294 l(:field_subject),
294 l(:field_subject),
295 l(:field_assigned_to),
295 l(:field_assigned_to),
296 l(:field_author),
296 l(:field_author),
297 l(:field_start_date),
297 l(:field_start_date),
298 l(:field_due_date),
298 l(:field_due_date),
299 l(:field_done_ratio),
299 l(:field_done_ratio),
300 l(:field_created_on),
300 l(:field_created_on),
301 l(:field_updated_on)
301 l(:field_updated_on)
302 ]
302 ]
303 for custom_field in @project.all_custom_fields
303 for custom_field in @project.all_custom_fields
304 headers << custom_field.name
304 headers << custom_field.name
305 end
305 end
306 csv << headers.collect {|c| ic.iconv(c) }
306 csv << headers.collect {|c| ic.iconv(c) }
307 # csv lines
307 # csv lines
308 @issues.each do |issue|
308 @issues.each do |issue|
309 fields = [issue.id, issue.status.name,
309 fields = [issue.id, issue.status.name,
310 issue.tracker.name,
310 issue.tracker.name,
311 issue.priority.name,
311 issue.priority.name,
312 issue.subject,
312 issue.subject,
313 (issue.assigned_to ? issue.assigned_to.name : ""),
313 (issue.assigned_to ? issue.assigned_to.name : ""),
314 issue.author.name,
314 issue.author.name,
315 issue.start_date ? l_date(issue.start_date) : nil,
315 issue.start_date ? l_date(issue.start_date) : nil,
316 issue.due_date ? l_date(issue.due_date) : nil,
316 issue.due_date ? l_date(issue.due_date) : nil,
317 issue.done_ratio,
317 issue.done_ratio,
318 l_datetime(issue.created_on),
318 l_datetime(issue.created_on),
319 l_datetime(issue.updated_on)
319 l_datetime(issue.updated_on)
320 ]
320 ]
321 for custom_field in @project.all_custom_fields
321 for custom_field in @project.all_custom_fields
322 fields << (show_value issue.custom_value_for(custom_field))
322 fields << (show_value issue.custom_value_for(custom_field))
323 end
323 end
324 csv << fields.collect {|c| ic.iconv(c.to_s) }
324 csv << fields.collect {|c| ic.iconv(c.to_s) }
325 end
325 end
326 end
326 end
327 export.rewind
327 export.rewind
328 send_data(export.read, :type => 'text/csv; header=present', :filename => 'export.csv')
328 send_data(export.read, :type => 'text/csv; header=present', :filename => 'export.csv')
329 end
329 end
330
330
331 # Export filtered/sorted issues to PDF
331 # Export filtered/sorted issues to PDF
332 def export_issues_pdf
332 def export_issues_pdf
333 sort_init "#{Issue.table_name}.id", "desc"
333 sort_init "#{Issue.table_name}.id", "desc"
334 sort_update
334 sort_update
335
335
336 retrieve_query
336 retrieve_query
337 render :action => 'list_issues' and return unless @query.valid?
337 render :action => 'list_issues' and return unless @query.valid?
338
338
339 @issues = Issue.find :all, :order => sort_clause,
339 @issues = Issue.find :all, :order => sort_clause,
340 :include => [ :author, :status, :tracker, :priority, :custom_values ],
340 :include => [ :author, :status, :tracker, :priority, :custom_values ],
341 :conditions => @query.statement,
341 :conditions => @query.statement,
342 :limit => Setting.issues_export_limit
342 :limit => Setting.issues_export_limit
343
343
344 @options_for_rfpdf ||= {}
344 @options_for_rfpdf ||= {}
345 @options_for_rfpdf[:file_name] = "export.pdf"
345 @options_for_rfpdf[:file_name] = "export.pdf"
346 render :layout => false
346 render :layout => false
347 end
347 end
348
348
349 def move_issues
349 def move_issues
350 @issues = @project.issues.find(params[:issue_ids]) if params[:issue_ids]
350 @issues = @project.issues.find(params[:issue_ids]) if params[:issue_ids]
351 redirect_to :action => 'list_issues', :id => @project and return unless @issues
351 redirect_to :action => 'list_issues', :id => @project and return unless @issues
352 @projects = []
352 @projects = []
353 # find projects to which the user is allowed to move the issue
353 # find projects to which the user is allowed to move the issue
354 @logged_in_user.memberships.each {|m| @projects << m.project if Permission.allowed_to_role("projects/move_issues", m.role)}
354 @logged_in_user.memberships.each {|m| @projects << m.project if Permission.allowed_to_role("projects/move_issues", m.role)}
355 # issue can be moved to any tracker
355 # issue can be moved to any tracker
356 @trackers = Tracker.find(:all)
356 @trackers = Tracker.find(:all)
357 if request.post? and params[:new_project_id] and params[:new_tracker_id]
357 if request.post? and params[:new_project_id] and params[:new_tracker_id]
358 new_project = Project.find(params[:new_project_id])
358 new_project = Project.find(params[:new_project_id])
359 new_tracker = Tracker.find(params[:new_tracker_id])
359 new_tracker = Tracker.find(params[:new_tracker_id])
360 @issues.each { |i|
360 @issues.each { |i|
361 # project dependent properties
361 # project dependent properties
362 unless i.project_id == new_project.id
362 unless i.project_id == new_project.id
363 i.category = nil
363 i.category = nil
364 i.fixed_version = nil
364 i.fixed_version = nil
365 end
365 end
366 # move the issue
366 # move the issue
367 i.project = new_project
367 i.project = new_project
368 i.tracker = new_tracker
368 i.tracker = new_tracker
369 i.save
369 i.save
370 }
370 }
371 flash[:notice] = l(:notice_successful_update)
371 flash[:notice] = l(:notice_successful_update)
372 redirect_to :action => 'list_issues', :id => @project
372 redirect_to :action => 'list_issues', :id => @project
373 end
373 end
374 end
374 end
375
375
376 def add_query
376 def add_query
377 @query = Query.new(params[:query])
377 @query = Query.new(params[:query])
378 @query.project = @project
378 @query.project = @project
379 @query.user = logged_in_user
379 @query.user = logged_in_user
380
380
381 params[:fields].each do |field|
381 params[:fields].each do |field|
382 @query.add_filter(field, params[:operators][field], params[:values][field])
382 @query.add_filter(field, params[:operators][field], params[:values][field])
383 end if params[:fields]
383 end if params[:fields]
384
384
385 if request.post? and @query.save
385 if request.post? and @query.save
386 flash[:notice] = l(:notice_successful_create)
386 flash[:notice] = l(:notice_successful_create)
387 redirect_to :controller => 'reports', :action => 'issue_report', :id => @project
387 redirect_to :controller => 'reports', :action => 'issue_report', :id => @project
388 end
388 end
389 render :layout => false if request.xhr?
389 render :layout => false if request.xhr?
390 end
390 end
391
391
392 # Add a news to @project
392 # Add a news to @project
393 def add_news
393 def add_news
394 @news = News.new(:project => @project)
394 @news = News.new(:project => @project)
395 if request.post?
395 if request.post?
396 @news.attributes = params[:news]
396 @news.attributes = params[:news]
397 @news.author_id = self.logged_in_user.id if self.logged_in_user
397 @news.author_id = self.logged_in_user.id if self.logged_in_user
398 if @news.save
398 if @news.save
399 flash[:notice] = l(:notice_successful_create)
399 flash[:notice] = l(:notice_successful_create)
400 redirect_to :action => 'list_news', :id => @project
400 redirect_to :action => 'list_news', :id => @project
401 end
401 end
402 end
402 end
403 end
403 end
404
404
405 # Show news list of @project
405 # Show news list of @project
406 def list_news
406 def list_news
407 @news_pages, @news = paginate :news, :per_page => 10, :conditions => ["project_id=?", @project.id], :include => :author, :order => "#{News.table_name}.created_on DESC"
407 @news_pages, @news = paginate :news, :per_page => 10, :conditions => ["project_id=?", @project.id], :include => :author, :order => "#{News.table_name}.created_on DESC"
408 render :action => "list_news", :layout => false if request.xhr?
408 render :action => "list_news", :layout => false if request.xhr?
409 end
409 end
410
410
411 def add_file
411 def add_file
412 if request.post?
412 if request.post?
413 @version = @project.versions.find_by_id(params[:version_id])
413 @version = @project.versions.find_by_id(params[:version_id])
414 # Save the attachments
414 # Save the attachments
415 @attachments = []
415 @attachments = []
416 params[:attachments].each { |file|
416 params[:attachments].each { |file|
417 next unless file.size > 0
417 next unless file.size > 0
418 a = Attachment.create(:container => @version, :file => file, :author => logged_in_user)
418 a = Attachment.create(:container => @version, :file => file, :author => logged_in_user)
419 @attachments << a unless a.new_record?
419 @attachments << a unless a.new_record?
420 } if params[:attachments] and params[:attachments].is_a? Array
420 } if params[:attachments] and params[:attachments].is_a? Array
421 Mailer.deliver_attachments_add(@attachments) if !@attachments.empty? and Permission.find_by_controller_and_action(params[:controller], params[:action]).mail_enabled?
421 Mailer.deliver_attachments_add(@attachments) if !@attachments.empty? and Permission.find_by_controller_and_action(params[:controller], params[:action]).mail_enabled?
422 redirect_to :controller => 'projects', :action => 'list_files', :id => @project
422 redirect_to :controller => 'projects', :action => 'list_files', :id => @project
423 end
423 end
424 @versions = @project.versions
424 @versions = @project.versions
425 end
425 end
426
426
427 def list_files
427 def list_files
428 @versions = @project.versions
428 @versions = @project.versions
429 end
429 end
430
430
431 # Show changelog for @project
431 # Show changelog for @project
432 def changelog
432 def changelog
433 @trackers = Tracker.find(:all, :conditions => ["is_in_chlog=?", true], :order => 'position')
433 @trackers = Tracker.find(:all, :conditions => ["is_in_chlog=?", true], :order => 'position')
434 retrieve_selected_tracker_ids(@trackers)
434 retrieve_selected_tracker_ids(@trackers)
435
435
436 @fixed_issues = @project.issues.find(:all,
436 @fixed_issues = @project.issues.find(:all,
437 :include => [ :fixed_version, :status, :tracker ],
437 :include => [ :fixed_version, :status, :tracker ],
438 :conditions => [ "#{IssueStatus.table_name}.is_closed=? and #{Issue.table_name}.tracker_id in (#{@selected_tracker_ids.join(',')}) and #{Issue.table_name}.fixed_version_id is not null", true],
438 :conditions => [ "#{IssueStatus.table_name}.is_closed=? and #{Issue.table_name}.tracker_id in (#{@selected_tracker_ids.join(',')}) and #{Issue.table_name}.fixed_version_id is not null", true],
439 :order => "#{Version.table_name}.effective_date DESC, #{Issue.table_name}.id DESC"
439 :order => "#{Version.table_name}.effective_date DESC, #{Issue.table_name}.id DESC"
440 ) unless @selected_tracker_ids.empty?
440 ) unless @selected_tracker_ids.empty?
441 @fixed_issues ||= []
441 @fixed_issues ||= []
442 end
442 end
443
443
444 def roadmap
444 def roadmap
445 @trackers = Tracker.find(:all, :conditions => ["is_in_roadmap=?", true], :order => 'position')
445 @trackers = Tracker.find(:all, :conditions => ["is_in_roadmap=?", true], :order => 'position')
446 retrieve_selected_tracker_ids(@trackers)
446 retrieve_selected_tracker_ids(@trackers)
447
447
448 @versions = @project.versions.find(:all,
448 @versions = @project.versions.find(:all,
449 :conditions => [ "#{Version.table_name}.effective_date>?", Date.today],
449 :conditions => [ "#{Version.table_name}.effective_date>?", Date.today],
450 :order => "#{Version.table_name}.effective_date ASC"
450 :order => "#{Version.table_name}.effective_date ASC"
451 )
451 )
452 end
452 end
453
453
454 def activity
454 def activity
455 if params[:year] and params[:year].to_i > 1900
455 if params[:year] and params[:year].to_i > 1900
456 @year = params[:year].to_i
456 @year = params[:year].to_i
457 if params[:month] and params[:month].to_i > 0 and params[:month].to_i < 13
457 if params[:month] and params[:month].to_i > 0 and params[:month].to_i < 13
458 @month = params[:month].to_i
458 @month = params[:month].to_i
459 end
459 end
460 end
460 end
461 @year ||= Date.today.year
461 @year ||= Date.today.year
462 @month ||= Date.today.month
462 @month ||= Date.today.month
463
463
464 @date_from = Date.civil(@year, @month, 1)
464 @date_from = Date.civil(@year, @month, 1)
465 @date_to = (@date_from >> 1)-1
465 @date_to = (@date_from >> 1)-1
466
466
467 @events_by_day = {}
467 @events_by_day = {}
468
468
469 unless params[:show_issues] == "0"
469 unless params[:show_issues] == "0"
470 @project.issues.find(:all, :include => [:author], :conditions => ["#{Issue.table_name}.created_on>=? and #{Issue.table_name}.created_on<=?", @date_from, @date_to] ).each { |i|
470 @project.issues.find(:all, :include => [:author], :conditions => ["#{Issue.table_name}.created_on>=? and #{Issue.table_name}.created_on<=?", @date_from, @date_to] ).each { |i|
471 @events_by_day[i.created_on.to_date] ||= []
471 @events_by_day[i.created_on.to_date] ||= []
472 @events_by_day[i.created_on.to_date] << i
472 @events_by_day[i.created_on.to_date] << i
473 }
473 }
474 @show_issues = 1
474 @show_issues = 1
475 end
475 end
476
476
477 unless params[:show_news] == "0"
477 unless params[:show_news] == "0"
478 @project.news.find(:all, :conditions => ["#{News.table_name}.created_on>=? and #{News.table_name}.created_on<=?", @date_from, @date_to], :include => :author ).each { |i|
478 @project.news.find(:all, :conditions => ["#{News.table_name}.created_on>=? and #{News.table_name}.created_on<=?", @date_from, @date_to], :include => :author ).each { |i|
479 @events_by_day[i.created_on.to_date] ||= []
479 @events_by_day[i.created_on.to_date] ||= []
480 @events_by_day[i.created_on.to_date] << i
480 @events_by_day[i.created_on.to_date] << i
481 }
481 }
482 @show_news = 1
482 @show_news = 1
483 end
483 end
484
484
485 unless params[:show_files] == "0"
485 unless params[:show_files] == "0"
486 Attachment.find(:all, :select => "#{Attachment.table_name}.*", :joins => "LEFT JOIN #{Version.table_name} ON #{Version.table_name}.id = #{Attachment.table_name}.container_id", :conditions => ["#{Attachment.table_name}.container_type='Version' and #{Version.table_name}.project_id=? and #{Attachment.table_name}.created_on>=? and #{Attachment.table_name}.created_on<=?", @project.id, @date_from, @date_to], :include => :author ).each { |i|
486 Attachment.find(:all, :select => "#{Attachment.table_name}.*", :joins => "LEFT JOIN #{Version.table_name} ON #{Version.table_name}.id = #{Attachment.table_name}.container_id", :conditions => ["#{Attachment.table_name}.container_type='Version' and #{Version.table_name}.project_id=? and #{Attachment.table_name}.created_on>=? and #{Attachment.table_name}.created_on<=?", @project.id, @date_from, @date_to], :include => :author ).each { |i|
487 @events_by_day[i.created_on.to_date] ||= []
487 @events_by_day[i.created_on.to_date] ||= []
488 @events_by_day[i.created_on.to_date] << i
488 @events_by_day[i.created_on.to_date] << i
489 }
489 }
490 @show_files = 1
490 @show_files = 1
491 end
491 end
492
492
493 unless params[:show_documents] == "0"
493 unless params[:show_documents] == "0"
494 @project.documents.find(:all, :conditions => ["#{Document.table_name}.created_on>=? and #{Document.table_name}.created_on<=?", @date_from, @date_to] ).each { |i|
494 @project.documents.find(:all, :conditions => ["#{Document.table_name}.created_on>=? and #{Document.table_name}.created_on<=?", @date_from, @date_to] ).each { |i|
495 @events_by_day[i.created_on.to_date] ||= []
495 @events_by_day[i.created_on.to_date] ||= []
496 @events_by_day[i.created_on.to_date] << i
496 @events_by_day[i.created_on.to_date] << i
497 }
497 }
498 Attachment.find(:all, :select => "attachments.*", :joins => "LEFT JOIN #{Document.table_name} ON #{Document.table_name}.id = #{Attachment.table_name}.container_id", :conditions => ["#{Attachment.table_name}.container_type='Document' and #{Document.table_name}.project_id=? and #{Attachment.table_name}.created_on>=? and #{Attachment.table_name}.created_on<=?", @project.id, @date_from, @date_to], :include => :author ).each { |i|
498 Attachment.find(:all, :select => "attachments.*", :joins => "LEFT JOIN #{Document.table_name} ON #{Document.table_name}.id = #{Attachment.table_name}.container_id", :conditions => ["#{Attachment.table_name}.container_type='Document' and #{Document.table_name}.project_id=? and #{Attachment.table_name}.created_on>=? and #{Attachment.table_name}.created_on<=?", @project.id, @date_from, @date_to], :include => :author ).each { |i|
499 @events_by_day[i.created_on.to_date] ||= []
499 @events_by_day[i.created_on.to_date] ||= []
500 @events_by_day[i.created_on.to_date] << i
500 @events_by_day[i.created_on.to_date] << i
501 }
501 }
502 @show_documents = 1
502 @show_documents = 1
503 end
503 end
504
504
505 unless params[:show_wiki_edits] == "0"
505 unless params[:show_wiki_edits] == "0"
506 select = "#{WikiContent.versioned_table_name}.updated_on, #{WikiContent.versioned_table_name}.comments, " +
506 select = "#{WikiContent.versioned_table_name}.updated_on, #{WikiContent.versioned_table_name}.comments, " +
507 "#{WikiContent.versioned_table_name}.#{WikiContent.version_column}, #{WikiPage.table_name}.title"
507 "#{WikiContent.versioned_table_name}.#{WikiContent.version_column}, #{WikiPage.table_name}.title"
508 joins = "LEFT JOIN #{WikiPage.table_name} ON #{WikiPage.table_name}.id = #{WikiContent.versioned_table_name}.page_id " +
508 joins = "LEFT JOIN #{WikiPage.table_name} ON #{WikiPage.table_name}.id = #{WikiContent.versioned_table_name}.page_id " +
509 "LEFT JOIN #{Wiki.table_name} ON #{Wiki.table_name}.id = #{WikiPage.table_name}.wiki_id "
509 "LEFT JOIN #{Wiki.table_name} ON #{Wiki.table_name}.id = #{WikiPage.table_name}.wiki_id "
510 conditions = ["#{Wiki.table_name}.project_id = ? AND #{WikiContent.versioned_table_name}.updated_on BETWEEN ? AND ?",
510 conditions = ["#{Wiki.table_name}.project_id = ? AND #{WikiContent.versioned_table_name}.updated_on BETWEEN ? AND ?",
511 @project.id, @date_from, @date_to]
511 @project.id, @date_from, @date_to]
512
512
513 WikiContent.versioned_class.find(:all, :select => select, :joins => joins, :conditions => conditions).each { |i|
513 WikiContent.versioned_class.find(:all, :select => select, :joins => joins, :conditions => conditions).each { |i|
514 # We provide this alias so all events can be treated in the same manner
514 # We provide this alias so all events can be treated in the same manner
515 def i.created_on
515 def i.created_on
516 self.updated_on
516 self.updated_on
517 end
517 end
518
518
519 @events_by_day[i.created_on.to_date] ||= []
519 @events_by_day[i.created_on.to_date] ||= []
520 @events_by_day[i.created_on.to_date] << i
520 @events_by_day[i.created_on.to_date] << i
521 }
521 }
522 @show_wiki_edits = 1
522 @show_wiki_edits = 1
523 end
523 end
524
524
525 unless @project.repository.nil? || params[:show_changesets] == "0"
525 unless @project.repository.nil? || params[:show_changesets] == "0"
526 @project.repository.changesets.find(:all, :conditions => ["#{Changeset.table_name}.committed_on BETWEEN ? AND ?", @date_from, @date_to]).each { |i|
526 @project.repository.changesets.find(:all, :conditions => ["#{Changeset.table_name}.committed_on BETWEEN ? AND ?", @date_from, @date_to]).each { |i|
527 def i.created_on
527 def i.created_on
528 self.committed_on
528 self.committed_on
529 end
529 end
530 @events_by_day[i.created_on.to_date] ||= []
530 @events_by_day[i.created_on.to_date] ||= []
531 @events_by_day[i.created_on.to_date] << i
531 @events_by_day[i.created_on.to_date] << i
532 }
532 }
533 @show_changesets = 1
533 @show_changesets = 1
534 end
534 end
535
535
536 render :layout => false if request.xhr?
536 render :layout => false if request.xhr?
537 end
537 end
538
538
539 def calendar
539 def calendar
540 @trackers = Tracker.find(:all, :order => 'position')
540 @trackers = Tracker.find(:all, :order => 'position')
541 retrieve_selected_tracker_ids(@trackers)
541 retrieve_selected_tracker_ids(@trackers)
542
542
543 if params[:year] and params[:year].to_i > 1900
543 if params[:year] and params[:year].to_i > 1900
544 @year = params[:year].to_i
544 @year = params[:year].to_i
545 if params[:month] and params[:month].to_i > 0 and params[:month].to_i < 13
545 if params[:month] and params[:month].to_i > 0 and params[:month].to_i < 13
546 @month = params[:month].to_i
546 @month = params[:month].to_i
547 end
547 end
548 end
548 end
549 @year ||= Date.today.year
549 @year ||= Date.today.year
550 @month ||= Date.today.month
550 @month ||= Date.today.month
551
551
552 @date_from = Date.civil(@year, @month, 1)
552 @date_from = Date.civil(@year, @month, 1)
553 @date_to = (@date_from >> 1)-1
553 @date_to = (@date_from >> 1)-1
554 # start on monday
554 # start on monday
555 @date_from = @date_from - (@date_from.cwday-1)
555 @date_from = @date_from - (@date_from.cwday-1)
556 # finish on sunday
556 # finish on sunday
557 @date_to = @date_to + (7-@date_to.cwday)
557 @date_to = @date_to + (7-@date_to.cwday)
558
558
559 @events = []
559 @events = []
560 @project.issues_with_subprojects(params[:with_subprojects]) do
560 @project.issues_with_subprojects(params[:with_subprojects]) do
561 @events += Issue.find(:all,
561 @events += Issue.find(:all,
562 :include => [:tracker, :status, :assigned_to, :priority, :project],
562 :include => [:tracker, :status, :assigned_to, :priority, :project],
563 :conditions => ["((start_date>=? and start_date<=?) or (due_date>=? and due_date<=?)) and #{Issue.table_name}.tracker_id in (#{@selected_tracker_ids.join(',')})", @date_from, @date_to, @date_from, @date_to]
563 :conditions => ["((start_date>=? and start_date<=?) or (due_date>=? and due_date<=?)) and #{Issue.table_name}.tracker_id in (#{@selected_tracker_ids.join(',')})", @date_from, @date_to, @date_from, @date_to]
564 ) unless @selected_tracker_ids.empty?
564 ) unless @selected_tracker_ids.empty?
565 end
565 end
566 @events += @project.versions.find(:all, :conditions => ["effective_date BETWEEN ? AND ?", @date_from, @date_to])
566 @events += @project.versions.find(:all, :conditions => ["effective_date BETWEEN ? AND ?", @date_from, @date_to])
567
567
568 @ending_events_by_days = @events.group_by {|event| event.due_date}
568 @ending_events_by_days = @events.group_by {|event| event.due_date}
569 @starting_events_by_days = @events.group_by {|event| event.start_date}
569 @starting_events_by_days = @events.group_by {|event| event.start_date}
570
570
571 render :layout => false if request.xhr?
571 render :layout => false if request.xhr?
572 end
572 end
573
573
574 def gantt
574 def gantt
575 @trackers = Tracker.find(:all, :order => 'position')
575 @trackers = Tracker.find(:all, :order => 'position')
576 retrieve_selected_tracker_ids(@trackers)
576 retrieve_selected_tracker_ids(@trackers)
577
577
578 if params[:year] and params[:year].to_i >0
578 if params[:year] and params[:year].to_i >0
579 @year_from = params[:year].to_i
579 @year_from = params[:year].to_i
580 if params[:month] and params[:month].to_i >=1 and params[:month].to_i <= 12
580 if params[:month] and params[:month].to_i >=1 and params[:month].to_i <= 12
581 @month_from = params[:month].to_i
581 @month_from = params[:month].to_i
582 else
582 else
583 @month_from = 1
583 @month_from = 1
584 end
584 end
585 else
585 else
586 @month_from ||= (Date.today << 1).month
586 @month_from ||= (Date.today << 1).month
587 @year_from ||= (Date.today << 1).year
587 @year_from ||= (Date.today << 1).year
588 end
588 end
589
589
590 @zoom = (params[:zoom].to_i > 0 and params[:zoom].to_i < 5) ? params[:zoom].to_i : 2
590 @zoom = (params[:zoom].to_i > 0 and params[:zoom].to_i < 5) ? params[:zoom].to_i : 2
591 @months = (params[:months].to_i > 0 and params[:months].to_i < 25) ? params[:months].to_i : 6
591 @months = (params[:months].to_i > 0 and params[:months].to_i < 25) ? params[:months].to_i : 6
592
592
593 @date_from = Date.civil(@year_from, @month_from, 1)
593 @date_from = Date.civil(@year_from, @month_from, 1)
594 @date_to = (@date_from >> @months) - 1
594 @date_to = (@date_from >> @months) - 1
595
595
596 @events = []
596 @events = []
597 @project.issues_with_subprojects(params[:with_subprojects]) do
597 @project.issues_with_subprojects(params[:with_subprojects]) do
598 @events += Issue.find(:all,
598 @events += Issue.find(:all,
599 :order => "start_date, due_date",
599 :order => "start_date, due_date",
600 :include => [:tracker, :status, :assigned_to, :priority, :project],
600 :include => [:tracker, :status, :assigned_to, :priority, :project],
601 :conditions => ["(((start_date>=? and start_date<=?) or (due_date>=? and due_date<=?) or (start_date<? and due_date>?)) and start_date is not null and due_date is not null and #{Issue.table_name}.tracker_id in (#{@selected_tracker_ids.join(',')}))", @date_from, @date_to, @date_from, @date_to, @date_from, @date_to]
601 :conditions => ["(((start_date>=? and start_date<=?) or (due_date>=? and due_date<=?) or (start_date<? and due_date>?)) and start_date is not null and due_date is not null and #{Issue.table_name}.tracker_id in (#{@selected_tracker_ids.join(',')}))", @date_from, @date_to, @date_from, @date_to, @date_from, @date_to]
602 ) unless @selected_tracker_ids.empty?
602 ) unless @selected_tracker_ids.empty?
603 end
603 end
604 @events += @project.versions.find(:all, :conditions => ["effective_date BETWEEN ? AND ?", @date_from, @date_to])
604 @events += @project.versions.find(:all, :conditions => ["effective_date BETWEEN ? AND ?", @date_from, @date_to])
605 @events.sort! {|x,y| x.start_date <=> y.start_date }
605 @events.sort! {|x,y| x.start_date <=> y.start_date }
606
606
607 if params[:output]=='pdf'
607 if params[:output]=='pdf'
608 @options_for_rfpdf ||= {}
608 @options_for_rfpdf ||= {}
609 @options_for_rfpdf[:file_name] = "gantt.pdf"
609 @options_for_rfpdf[:file_name] = "gantt.pdf"
610 render :template => "projects/gantt.rfpdf", :layout => false
610 render :template => "projects/gantt.rfpdf", :layout => false
611 else
611 else
612 render :template => "projects/gantt.rhtml"
612 render :template => "projects/gantt.rhtml"
613 end
613 end
614 end
614 end
615
615
616 def search
617 @question = params[:q] || ""
618 @question.strip!
619 @all_words = params[:all_words] || (params[:submit] ? false : true)
620 @scope = params[:scope] || (params[:submit] ? [] : %w(issues changesets news documents wiki) )
621 # tokens must be at least 3 character long
622 @tokens = @question.split.uniq.select {|w| w.length > 2 }
623 if !@tokens.empty?
624 # no more than 5 tokens to search for
625 @tokens.slice! 5..-1 if @tokens.size > 5
626 # strings used in sql like statement
627 like_tokens = @tokens.collect {|w| "%#{w.downcase}%"}
628 operator = @all_words ? " AND " : " OR "
629 limit = 10
630 @results = []
631 @results += @project.issues.find(:all, :limit => limit, :include => :author, :conditions => [ (["(LOWER(subject) like ? OR LOWER(description) like ?)"] * like_tokens.size).join(operator), * (like_tokens * 2).sort] ) if @scope.include? 'issues'
632 @results += @project.news.find(:all, :limit => limit, :conditions => [ (["(LOWER(title) like ? OR LOWER(description) like ?)"] * like_tokens.size).join(operator), * (like_tokens * 2).sort], :include => :author ) if @scope.include? 'news'
633 @results += @project.documents.find(:all, :limit => limit, :conditions => [ (["(LOWER(title) like ? OR LOWER(description) like ?)"] * like_tokens.size).join(operator), * (like_tokens * 2).sort] ) if @scope.include? 'documents'
634 @results += @project.wiki.pages.find(:all, :limit => limit, :include => :content, :conditions => [ (["(LOWER(title) like ? OR LOWER(text) like ?)"] * like_tokens.size).join(operator), * (like_tokens * 2).sort] ) if @project.wiki && @scope.include?('wiki')
635 @results += @project.repository.changesets.find(:all, :limit => limit, :conditions => [ (["(LOWER(comments) like ?)"] * like_tokens.size).join(operator), * (like_tokens).sort] ) if @project.repository && @scope.include?('changesets')
636 @question = @tokens.join(" ")
637 else
638 @question = ""
639 end
640 end
641
642 def feeds
616 def feeds
643 @queries = @project.queries.find :all, :conditions => ["is_public=? or user_id=?", true, (logged_in_user ? logged_in_user.id : 0)]
617 @queries = @project.queries.find :all, :conditions => ["is_public=? or user_id=?", true, (logged_in_user ? logged_in_user.id : 0)]
644 @key = logged_in_user.get_or_create_rss_key.value if logged_in_user
618 @key = logged_in_user.get_or_create_rss_key.value if logged_in_user
645 end
619 end
646
620
647 private
621 private
648 # Find project of id params[:id]
622 # Find project of id params[:id]
649 # if not found, redirect to project list
623 # if not found, redirect to project list
650 # Used as a before_filter
624 # Used as a before_filter
651 def find_project
625 def find_project
652 @project = Project.find(params[:id])
626 @project = Project.find(params[:id])
653 @html_title = @project.name
627 @html_title = @project.name
654 rescue ActiveRecord::RecordNotFound
628 rescue ActiveRecord::RecordNotFound
655 render_404
629 render_404
656 end
630 end
657
631
658 def retrieve_selected_tracker_ids(selectable_trackers)
632 def retrieve_selected_tracker_ids(selectable_trackers)
659 if ids = params[:tracker_ids]
633 if ids = params[:tracker_ids]
660 @selected_tracker_ids = (ids.is_a? Array) ? ids.collect { |id| id.to_i.to_s } : ids.split('/').collect { |id| id.to_i.to_s }
634 @selected_tracker_ids = (ids.is_a? Array) ? ids.collect { |id| id.to_i.to_s } : ids.split('/').collect { |id| id.to_i.to_s }
661 else
635 else
662 @selected_tracker_ids = selectable_trackers.collect {|t| t.id.to_s }
636 @selected_tracker_ids = selectable_trackers.collect {|t| t.id.to_s }
663 end
637 end
664 end
638 end
665
639
666 # Retrieve query from session or build a new query
640 # Retrieve query from session or build a new query
667 def retrieve_query
641 def retrieve_query
668 if params[:query_id]
642 if params[:query_id]
669 @query = @project.queries.find(params[:query_id])
643 @query = @project.queries.find(params[:query_id])
670 session[:query] = @query
644 session[:query] = @query
671 else
645 else
672 if params[:set_filter] or !session[:query] or session[:query].project_id != @project.id
646 if params[:set_filter] or !session[:query] or session[:query].project_id != @project.id
673 # Give it a name, required to be valid
647 # Give it a name, required to be valid
674 @query = Query.new(:name => "_")
648 @query = Query.new(:name => "_")
675 @query.project = @project
649 @query.project = @project
676 if params[:fields] and params[:fields].is_a? Array
650 if params[:fields] and params[:fields].is_a? Array
677 params[:fields].each do |field|
651 params[:fields].each do |field|
678 @query.add_filter(field, params[:operators][field], params[:values][field])
652 @query.add_filter(field, params[:operators][field], params[:values][field])
679 end
653 end
680 else
654 else
681 @query.available_filters.keys.each do |field|
655 @query.available_filters.keys.each do |field|
682 @query.add_short_filter(field, params[field]) if params[field]
656 @query.add_short_filter(field, params[field]) if params[field]
683 end
657 end
684 end
658 end
685 session[:query] = @query
659 session[:query] = @query
686 else
660 else
687 @query = session[:query]
661 @query = session[:query]
688 end
662 end
689 end
663 end
690 end
664 end
691 end
665 end
@@ -1,29 +1,19
1 # redMine - project management software
1 # redMine - project management software
2 # Copyright (C) 2006 Jean-Philippe Lang
2 # Copyright (C) 2006 Jean-Philippe Lang
3 #
3 #
4 # This program is free software; you can redistribute it and/or
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
7 # of the License, or (at your option) any later version.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU General Public License
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
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.
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
17
18 module ProjectsHelper
18 module ProjectsHelper
19
20 def highlight_tokens(text, tokens)
21 return text unless tokens && !tokens.empty?
22 regexp = Regexp.new "(#{tokens.join('|')})", Regexp::IGNORECASE
23 result = ''
24 text.split(regexp).each_with_index do |words, i|
25 result << (i.even? ? (words.length > 100 ? "#{words[0..44]} ... #{words[-45..-1]}" : words) : content_tag('span', words, :class => 'highlight'))
26 end
27 result
28 end
29 end
19 end
@@ -1,134 +1,144
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
2 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
3 <head>
3 <head>
4 <title><%= Setting.app_title + (@html_title ? ": #{@html_title}" : "") %></title>
4 <title><%= Setting.app_title + (@html_title ? ": #{@html_title}" : "") %></title>
5 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
5 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
6 <meta name="description" content="redMine" />
6 <meta name="description" content="redMine" />
7 <meta name="keywords" content="issue,bug,tracker" />
7 <meta name="keywords" content="issue,bug,tracker" />
8 <!--[if IE]>
8 <!--[if IE]>
9 <style type="text/css">
9 <style type="text/css">
10 body {behavior: url(<%= stylesheet_path "csshover.htc" %>);}
10 body {behavior: url(<%= stylesheet_path "csshover.htc" %>);}
11 </style>
11 </style>
12 <![endif]-->
12 <![endif]-->
13 <%= stylesheet_link_tag "application" %>
13 <%= stylesheet_link_tag "application" %>
14 <%= stylesheet_link_tag "print", :media => "print" %>
14 <%= stylesheet_link_tag "print", :media => "print" %>
15 <%= javascript_include_tag :defaults %>
15 <%= javascript_include_tag :defaults %>
16 <%= javascript_include_tag 'menu' %>
16 <%= javascript_include_tag 'menu' %>
17 <%= stylesheet_link_tag 'jstoolbar' %>
17 <%= stylesheet_link_tag 'jstoolbar' %>
18 <!-- page specific tags --><%= yield :header_tags %>
18 <!-- page specific tags --><%= yield :header_tags %>
19 </head>
19 </head>
20
20
21 <body>
21 <body>
22 <div id="container" >
22 <div id="container" >
23
23
24 <div id="header">
24 <div id="header">
25 <div style="float: left;">
25 <div style="float: left;">
26 <h1><%= Setting.app_title %></h1>
26 <h1><%= Setting.app_title %></h1>
27 <h2><%= Setting.app_subtitle %></h2>
27 <h2><%= Setting.app_subtitle %></h2>
28 </div>
28 </div>
29 <div style="float: right; padding-right: 1em; padding-top: 0.2em;">
29 <div style="float: right; padding-right: 1em; padding-top: 0.2em;">
30 <% if loggedin? %><small><%=l(:label_logged_as)%> <b><%= @logged_in_user.login %></b></small><% end %>
30 <% if loggedin? %><small><%=l(:label_logged_as)%> <strong><%= @logged_in_user.login %></strong> -</small><% end %>
31 <small><%= toggle_link 'Search', 'quick-search-form', :focus => 'quick-search-input' %></small>
32 <% form_tag({:controller => 'search', :action => 'index', :id => @project}, :method => :get, :id => 'quick-search-form', :style => "display:none;" ) do %>
33 <%= text_field_tag 'q', @question, :size => 15, :class => 'small', :id => 'quick-search-input' %>
34 <% end %>
35 </div>
31 </div>
36 </div>
32 </div>
33
37
34 <div id="navigation">
38 <div id="navigation">
35 <ul>
39 <ul>
36 <li><%= link_to l(:label_home), { :controller => 'welcome' }, :class => "icon icon-home" %></li>
40 <li><%= link_to l(:label_home), { :controller => 'welcome' }, :class => "icon icon-home" %></li>
37 <li><%= link_to l(:label_my_page), { :controller => 'my', :action => 'page'}, :class => "icon icon-mypage" %></li>
41 <li><%= link_to l(:label_my_page), { :controller => 'my', :action => 'page'}, :class => "icon icon-mypage" %></li>
38 <li><%= link_to l(:label_project_plural), { :controller => 'projects' }, :class => "icon icon-projects" %></li>
42 <li><%= link_to l(:label_project_plural), { :controller => 'projects' }, :class => "icon icon-projects" %></li>
39
43
40 <% unless @project.nil? || @project.id.nil? %>
44 <% unless @project.nil? || @project.id.nil? %>
41 <li class="submenu"><%= link_to @project.name, { :controller => 'projects', :action => 'show', :id => @project }, :class => "icon icon-projects", :onmouseover => "buttonMouseover(event, 'menuProject');" %></li>
45 <li class="submenu"><%= link_to @project.name, { :controller => 'projects', :action => 'show', :id => @project }, :class => "icon icon-projects", :onmouseover => "buttonMouseover(event, 'menuProject');" %></li>
42 <% end %>
46 <% end %>
43
47
44 <% if loggedin? %>
48 <% if loggedin? %>
45 <li><%= link_to l(:label_my_account), { :controller => 'my', :action => 'account' }, :class => "icon icon-user" %></li>
49 <li><%= link_to l(:label_my_account), { :controller => 'my', :action => 'account' }, :class => "icon icon-user" %></li>
46 <% end %>
50 <% end %>
47
51
48 <% if admin_loggedin? %>
52 <% if admin_loggedin? %>
49 <li class="submenu"><%= link_to l(:label_administration), { :controller => 'admin' }, :class => "icon icon-admin", :onmouseover => "buttonMouseover(event, 'menuAdmin');" %></li>
53 <li class="submenu"><%= link_to l(:label_administration), { :controller => 'admin' }, :class => "icon icon-admin", :onmouseover => "buttonMouseover(event, 'menuAdmin');" %></li>
50 <% end %>
54 <% end %>
51
55
52 <li class="right"><%= link_to l(:label_help), { :controller => 'help', :ctrl => params[:controller], :page => params[:action] }, :onclick => "window.open(this.href); return false;", :class => "icon icon-help" %></li>
56 <li class="right"><%= link_to l(:label_help), { :controller => 'help', :ctrl => params[:controller], :page => params[:action] }, :onclick => "window.open(this.href); return false;", :class => "icon icon-help" %></li>
53
57
54 <% if loggedin? %>
58 <% if loggedin? %>
55 <li class="right"><%= link_to l(:label_logout), { :controller => 'account', :action => 'logout' }, :class => "icon icon-user" %></li>
59 <li class="right"><%= link_to l(:label_logout), { :controller => 'account', :action => 'logout' }, :class => "icon icon-user" %></li>
56 <% else %>
60 <% else %>
57 <li class="right"><%= link_to l(:label_login), { :controller => 'account', :action => 'login' }, :class => "icon icon-user" %></li>
61 <li class="right"><%= link_to l(:label_login), { :controller => 'account', :action => 'login' }, :class => "icon icon-user" %></li>
58 <% end %>
62 <% end %>
63
64 <% unless @project.nil? || @project.id.nil? %>
65 <li class="right" style="padding-right:0.8em;">
66 </li>
67 <% end %>
68
59 </ul>
69 </ul>
60 </div>
70 </div>
61
71
62 <% if admin_loggedin? %>
72 <% if admin_loggedin? %>
63 <%= render :partial => 'admin/menu' %>
73 <%= render :partial => 'admin/menu' %>
64 <% end %>
74 <% end %>
65
75
66 <% unless @project.nil? || @project.id.nil? %>
76 <% unless @project.nil? || @project.id.nil? %>
67 <div id="menuProject" class="menu" onmouseover="menuMouseover(event)">
77 <div id="menuProject" class="menu" onmouseover="menuMouseover(event)">
68 <%= link_to l(:label_calendar), {:controller => 'projects', :action => 'calendar', :id => @project }, :class => "menuItem" %>
78 <%= link_to l(:label_calendar), {:controller => 'projects', :action => 'calendar', :id => @project }, :class => "menuItem" %>
69 <%= link_to l(:label_gantt), {:controller => 'projects', :action => 'gantt', :id => @project }, :class => "menuItem" %>
79 <%= link_to l(:label_gantt), {:controller => 'projects', :action => 'gantt', :id => @project }, :class => "menuItem" %>
70 <%= link_to l(:label_issue_plural), {:controller => 'projects', :action => 'list_issues', :id => @project, :set_filter => 1 }, :class => "menuItem" %>
80 <%= link_to l(:label_issue_plural), {:controller => 'projects', :action => 'list_issues', :id => @project, :set_filter => 1 }, :class => "menuItem" %>
71 <%= link_to l(:label_report_plural), {:controller => 'reports', :action => 'issue_report', :id => @project }, :class => "menuItem" %>
81 <%= link_to l(:label_report_plural), {:controller => 'reports', :action => 'issue_report', :id => @project }, :class => "menuItem" %>
72 <%= link_to l(:label_activity), {:controller => 'projects', :action => 'activity', :id => @project }, :class => "menuItem" %>
82 <%= link_to l(:label_activity), {:controller => 'projects', :action => 'activity', :id => @project }, :class => "menuItem" %>
73 <%= link_to l(:label_news_plural), {:controller => 'projects', :action => 'list_news', :id => @project }, :class => "menuItem" %>
83 <%= link_to l(:label_news_plural), {:controller => 'projects', :action => 'list_news', :id => @project }, :class => "menuItem" %>
74 <%= link_to l(:label_change_log), {:controller => 'projects', :action => 'changelog', :id => @project }, :class => "menuItem" %>
84 <%= link_to l(:label_change_log), {:controller => 'projects', :action => 'changelog', :id => @project }, :class => "menuItem" %>
75 <%= link_to l(:label_roadmap), {:controller => 'projects', :action => 'roadmap', :id => @project }, :class => "menuItem" %>
85 <%= link_to l(:label_roadmap), {:controller => 'projects', :action => 'roadmap', :id => @project }, :class => "menuItem" %>
76 <%= link_to l(:label_document_plural), {:controller => 'projects', :action => 'list_documents', :id => @project }, :class => "menuItem" %>
86 <%= link_to l(:label_document_plural), {:controller => 'projects', :action => 'list_documents', :id => @project }, :class => "menuItem" %>
77 <%= link_to l(:label_wiki), {:controller => 'wiki', :id => @project, :page => nil }, :class => "menuItem" if @project.wiki and !@project.wiki.new_record? %>
87 <%= link_to l(:label_wiki), {:controller => 'wiki', :id => @project, :page => nil }, :class => "menuItem" if @project.wiki and !@project.wiki.new_record? %>
78 <%= link_to l(:label_attachment_plural), {:controller => 'projects', :action => 'list_files', :id => @project }, :class => "menuItem" %>
88 <%= link_to l(:label_attachment_plural), {:controller => 'projects', :action => 'list_files', :id => @project }, :class => "menuItem" %>
79 <%= link_to l(:label_search), {:controller => 'projects', :action => 'search', :id => @project }, :class => "menuItem" %>
89 <%= link_to l(:label_search), {:controller => 'search', :action => 'index', :id => @project }, :class => "menuItem" %>
80 <%= link_to l(:label_repository), {:controller => 'repositories', :action => 'show', :id => @project}, :class => "menuItem" if @project.repository and !@project.repository.new_record? %>
90 <%= link_to l(:label_repository), {:controller => 'repositories', :action => 'show', :id => @project}, :class => "menuItem" if @project.repository and !@project.repository.new_record? %>
81 <%= link_to_if_authorized l(:label_settings), {:controller => 'projects', :action => 'settings', :id => @project }, :class => "menuItem" %>
91 <%= link_to_if_authorized l(:label_settings), {:controller => 'projects', :action => 'settings', :id => @project }, :class => "menuItem" %>
82 </div>
92 </div>
83 <% end %>
93 <% end %>
84
94
85
95
86 <div id="subcontent">
96 <div id="subcontent">
87
97
88 <% unless @project.nil? || @project.id.nil? %>
98 <% unless @project.nil? || @project.id.nil? %>
89 <h2><%= @project.name %></h2>
99 <h2><%= @project.name %></h2>
90 <ul class="menublock">
100 <ul class="menublock">
91 <li><%= link_to l(:label_overview), :controller => 'projects', :action => 'show', :id => @project %></li>
101 <li><%= link_to l(:label_overview), :controller => 'projects', :action => 'show', :id => @project %></li>
92 <li><%= link_to l(:label_calendar), :controller => 'projects', :action => 'calendar', :id => @project %></li>
102 <li><%= link_to l(:label_calendar), :controller => 'projects', :action => 'calendar', :id => @project %></li>
93 <li><%= link_to l(:label_gantt), :controller => 'projects', :action => 'gantt', :id => @project %></li>
103 <li><%= link_to l(:label_gantt), :controller => 'projects', :action => 'gantt', :id => @project %></li>
94 <li><%= link_to l(:label_issue_plural), :controller => 'projects', :action => 'list_issues', :id => @project, :set_filter => 1 %></li>
104 <li><%= link_to l(:label_issue_plural), :controller => 'projects', :action => 'list_issues', :id => @project, :set_filter => 1 %></li>
95 <li><%= link_to l(:label_report_plural), :controller => 'reports', :action => 'issue_report', :id => @project %></li>
105 <li><%= link_to l(:label_report_plural), :controller => 'reports', :action => 'issue_report', :id => @project %></li>
96 <li><%= link_to l(:label_activity), :controller => 'projects', :action => 'activity', :id => @project %></li>
106 <li><%= link_to l(:label_activity), :controller => 'projects', :action => 'activity', :id => @project %></li>
97 <li><%= link_to l(:label_news_plural), :controller => 'projects', :action => 'list_news', :id => @project %></li>
107 <li><%= link_to l(:label_news_plural), :controller => 'projects', :action => 'list_news', :id => @project %></li>
98 <li><%= link_to l(:label_change_log), :controller => 'projects', :action => 'changelog', :id => @project %></li>
108 <li><%= link_to l(:label_change_log), :controller => 'projects', :action => 'changelog', :id => @project %></li>
99 <li><%= link_to l(:label_roadmap), :controller => 'projects', :action => 'roadmap', :id => @project %></li>
109 <li><%= link_to l(:label_roadmap), :controller => 'projects', :action => 'roadmap', :id => @project %></li>
100 <li><%= link_to l(:label_document_plural), :controller => 'projects', :action => 'list_documents', :id => @project %></li>
110 <li><%= link_to l(:label_document_plural), :controller => 'projects', :action => 'list_documents', :id => @project %></li>
101 <%= content_tag("li", link_to(l(:label_wiki), :controller => 'wiki', :id => @project, :page => nil)) if @project.wiki and !@project.wiki.new_record? %>
111 <%= content_tag("li", link_to(l(:label_wiki), :controller => 'wiki', :id => @project, :page => nil)) if @project.wiki and !@project.wiki.new_record? %>
102 <li><%= link_to l(:label_attachment_plural), :controller => 'projects', :action => 'list_files', :id => @project %></li>
112 <li><%= link_to l(:label_attachment_plural), :controller => 'projects', :action => 'list_files', :id => @project %></li>
103 <li><%= link_to l(:label_search), :controller => 'projects', :action => 'search', :id => @project %></li>
113 <li><%= link_to l(:label_search), :controller => 'search', :action => 'index', :id => @project %></li>
104 <%= content_tag("li", link_to(l(:label_repository), :controller => 'repositories', :action => 'show', :id => @project)) if @project.repository and !@project.repository.new_record? %>
114 <%= content_tag("li", link_to(l(:label_repository), :controller => 'repositories', :action => 'show', :id => @project)) if @project.repository and !@project.repository.new_record? %>
105 <li><%= link_to_if_authorized l(:label_settings), :controller => 'projects', :action => 'settings', :id => @project %></li>
115 <li><%= link_to_if_authorized l(:label_settings), :controller => 'projects', :action => 'settings', :id => @project %></li>
106 </ul>
116 </ul>
107 <% end %>
117 <% end %>
108
118
109 <% if loggedin? and @logged_in_user.memberships.length > 0 %>
119 <% if loggedin? and @logged_in_user.memberships.length > 0 %>
110 <h2><%=l(:label_my_projects) %></h2>
120 <h2><%=l(:label_my_projects) %></h2>
111 <ul class="menublock">
121 <ul class="menublock">
112 <% for membership in @logged_in_user.memberships %>
122 <% for membership in @logged_in_user.memberships %>
113 <li><%= link_to membership.project.name, :controller => 'projects', :action => 'show', :id => membership.project %></li>
123 <li><%= link_to membership.project.name, :controller => 'projects', :action => 'show', :id => membership.project %></li>
114 <% end %>
124 <% end %>
115 </ul>
125 </ul>
116 <% end %>
126 <% end %>
117 </div>
127 </div>
118
128
119 <div id="content">
129 <div id="content">
120 <% if flash[:notice] %><p style="color: green"><%= flash[:notice] %></p><% end %>
130 <% if flash[:notice] %><p style="color: green"><%= flash[:notice] %></p><% end %>
121 <%= yield %>
131 <%= yield %>
122 </div>
132 </div>
123
133
124 <div id="ajax-indicator" style="display:none;">
134 <div id="ajax-indicator" style="display:none;">
125 <span><%= l(:label_loading) %></span>
135 <span><%= l(:label_loading) %></span>
126 </div>
136 </div>
127
137
128 <div id="footer">
138 <div id="footer">
129 <p><a href="http://redmine.rubyforge.org/">redMine</a> <small><%= Redmine::VERSION %> &copy 2006-2007 Jean-Philippe Lang</small></p>
139 <p><a href="http://redmine.rubyforge.org/">redMine</a> <small><%= Redmine::VERSION %> &copy 2006-2007 Jean-Philippe Lang</small></p>
130 </div>
140 </div>
131
141
132 </div>
142 </div>
133 </body>
143 </body>
134 </html> No newline at end of file
144 </html>
@@ -1,50 +1,58
1 <h2><%= l(:label_search) %></h2>
1 <h2><%= l(:label_search) %></h2>
2
2
3 <div class="box">
3 <div class="box">
4 <% form_tag({:action => 'search', :id => @project}, :method => :get) do %>
4 <% form_tag({}, :method => :get) do %>
5 <p><%= text_field_tag 'q', @question, :size => 30 %>
5 <p><%= text_field_tag 'q', @question, :size => 30 %>
6 <%= check_box_tag 'scope[]', 'issues', (@scope.include? 'issues') %> <label><%= l(:label_issue_plural) %></label>
6
7 <% if @project.repository %>
7 <% if @project %>
8 <%= check_box_tag 'scope[]', 'changesets', (@scope.include? 'changesets') %> <label><%= l(:label_revision_plural) %></label>
8 <%= check_box_tag 'scope[]', 'issues', (@scope.include? 'issues') %> <label><%= l(:label_issue_plural) %></label>
9 <% end %>
9 <% if @project.repository %>
10 <%= check_box_tag 'scope[]', 'news', (@scope.include? 'news') %> <label><%= l(:label_news_plural) %></label>
10 <%= check_box_tag 'scope[]', 'changesets', (@scope.include? 'changesets') %> <label><%= l(:label_revision_plural) %></label>
11 <%= check_box_tag 'scope[]', 'documents', (@scope.include? 'documents') %> <label><%= l(:label_document_plural) %></label>
11 <% end %>
12 <% if @project.wiki %>
12 <%= check_box_tag 'scope[]', 'news', (@scope.include? 'news') %> <label><%= l(:label_news_plural) %></label>
13 <%= check_box_tag 'scope[]', 'wiki', (@scope.include? 'wiki') %> <label><%= l(:label_wiki) %></label>
13 <%= check_box_tag 'scope[]', 'documents', (@scope.include? 'documents') %> <label><%= l(:label_document_plural) %></label>
14 <% end %>
14 <% if @project.wiki %>
15 <br />
15 <%= check_box_tag 'scope[]', 'wiki', (@scope.include? 'wiki') %> <label><%= l(:label_wiki) %></label>
16 <%= check_box_tag 'all_words', 1, @all_words %> <%= l(:label_all_words) %></p>
16 <% end %>
17 <%= submit_tag l(:button_submit), :name => 'submit' %>
17 <% else %>
18 <% end %>
18 <%= check_box_tag 'scope[]', 'projects', (@scope.include? 'projects') %> <label><%= l(:label_project_plural) %></label>
19 </div>
19 <% end %>
20
20 <br />
21 <% if @results %>
21 <%= check_box_tag 'all_words', 1, @all_words %> <%= l(:label_all_words) %></p>
22 <h3><%= lwr(:label_result, @results.length) %></h3>
22 <%= submit_tag l(:button_submit), :name => 'submit' %>
23 <ul>
23 <% end %>
24 <% @results.each do |e| %>
24 </div>
25 <li><p>
25
26 <% if e.is_a? Issue %>
26 <% if @results %>
27 <%= link_to_issue e %>: <%= highlight_tokens(h(e.subject), @tokens) %><br />
27 <h3><%= lwr(:label_result, @results.length) %></h3>
28 <%= highlight_tokens(e.description, @tokens) %><br />
28 <ul>
29 <i><%= e.author.name %>, <%= format_time(e.created_on) %></i>
29 <% @results.each do |e| %>
30 <% elsif e.is_a? News %>
30 <li><p>
31 <%=l(:label_news)%>: <%= link_to highlight_tokens(h(e.title), @tokens), :controller => 'news', :action => 'show', :id => e %><br />
31 <% if e.is_a? Project %>
32 <%= highlight_tokens(e.description, @tokens) %><br />
32 <%= link_to highlight_tokens(h(e.name), @tokens), :controller => 'projects', :action => 'show', :id => e %><br />
33 <i><%= e.author.name %>, <%= format_time(e.created_on) %></i>
33 <%= highlight_tokens(e.description, @tokens) %>
34 <% elsif e.is_a? Document %>
34 <% elsif e.is_a? Issue %>
35 <%=l(:label_document)%>: <%= link_to highlight_tokens(h(e.title), @tokens), :controller => 'documents', :action => 'show', :id => e %><br />
35 <%= link_to_issue e %>: <%= highlight_tokens(h(e.subject), @tokens) %><br />
36 <%= highlight_tokens(e.description, @tokens) %><br />
36 <%= highlight_tokens(e.description, @tokens) %><br />
37 <i><%= format_time(e.created_on) %></i>
37 <i><%= e.author.name %>, <%= format_time(e.created_on) %></i>
38 <% elsif e.is_a? WikiPage %>
38 <% elsif e.is_a? News %>
39 <%=l(:label_wiki)%>: <%= link_to highlight_tokens(h(e.pretty_title), @tokens), :controller => 'wiki', :action => 'index', :id => @project, :page => e.title %><br />
39 <%=l(:label_news)%>: <%= link_to highlight_tokens(h(e.title), @tokens), :controller => 'news', :action => 'show', :id => e %><br />
40 <%= highlight_tokens(e.content.text, @tokens) %><br />
40 <%= highlight_tokens(e.description, @tokens) %><br />
41 <i><%= e.content.author ? e.content.author.name : "Anonymous" %>, <%= format_time(e.content.updated_on) %></i>
41 <i><%= e.author.name %>, <%= format_time(e.created_on) %></i>
42 <% elsif e.is_a? Changeset %>
42 <% elsif e.is_a? Document %>
43 <%=l(:label_revision)%> <%= link_to h(e.revision), :controller => 'repositories', :action => 'revision', :id => @project, :rev => e.revision %><br />
43 <%=l(:label_document)%>: <%= link_to highlight_tokens(h(e.title), @tokens), :controller => 'documents', :action => 'show', :id => e %><br />
44 <%= highlight_tokens(e.comments, @tokens) %><br />
44 <%= highlight_tokens(e.description, @tokens) %><br />
45 <em><%= e.committer.blank? ? e.committer : "Anonymous" %>, <%= format_time(e.committed_on) %></em>
45 <i><%= format_time(e.created_on) %></i>
46 <% end %>
46 <% elsif e.is_a? WikiPage %>
47 </p></li>
47 <%=l(:label_wiki)%>: <%= link_to highlight_tokens(h(e.pretty_title), @tokens), :controller => 'wiki', :action => 'index', :id => @project, :page => e.title %><br />
48 <% end %>
48 <%= highlight_tokens(e.content.text, @tokens) %><br />
49 </ul>
49 <i><%= e.content.author ? e.content.author.name : "Anonymous" %>, <%= format_time(e.content.updated_on) %></i>
50 <% elsif e.is_a? Changeset %>
51 <%=l(:label_revision)%> <%= link_to h(e.revision), :controller => 'repositories', :action => 'revision', :id => @project, :rev => e.revision %><br />
52 <%= highlight_tokens(e.comments, @tokens) %><br />
53 <em><%= e.committer.blank? ? e.committer : "Anonymous" %>, <%= format_time(e.committed_on) %></em>
54 <% end %>
55 </p></li>
56 <% end %>
57 </ul>
50 <% end %> No newline at end of file
58 <% end %>
@@ -1,665 +1,667
1 /* andreas08 - an open source xhtml/css website layout by Andreas Viklund - http://andreasviklund.com . Free to use in any way and for any purpose as long as the proper credits are given to the original designer. Version: 1.0, November 28, 2005 */
1 /* andreas08 - an open source xhtml/css website layout by Andreas Viklund - http://andreasviklund.com . Free to use in any way and for any purpose as long as the proper credits are given to the original designer. Version: 1.0, November 28, 2005 */
2 /* Edited by Jean-Philippe Lang *>
2 /* Edited by Jean-Philippe Lang *>
3 /**************** Body and tag styles ****************/
3 /**************** Body and tag styles ****************/
4
4
5 #header * {margin:0; padding:0;}
5 #header * {margin:0; padding:0;}
6 p, ul, ol, li {margin:0; padding:0;}
6 p, ul, ol, li {margin:0; padding:0;}
7
7
8 body{
8 body{
9 font:76% Verdana,Tahoma,Arial,sans-serif;
9 font:76% Verdana,Tahoma,Arial,sans-serif;
10 line-height:1.4em;
10 line-height:1.4em;
11 text-align:center;
11 text-align:center;
12 color:#303030;
12 color:#303030;
13 background:#e8eaec;
13 background:#e8eaec;
14 margin:0;
14 margin:0;
15 }
15 }
16
16
17 a{color:#467aa7;font-weight:bold;text-decoration:none;background-color:inherit;}
17 a{color:#467aa7;font-weight:bold;text-decoration:none;background-color:inherit;}
18 a:hover{color:#2a5a8a; text-decoration:none; background-color:inherit;}
18 a:hover{color:#2a5a8a; text-decoration:none; background-color:inherit;}
19 a img{border:none;}
19 a img{border:none;}
20
20
21 p{margin:0 0 1em 0;}
21 p{margin:0 0 1em 0;}
22 p form{margin-top:0; margin-bottom:20px;}
22 p form{margin-top:0; margin-bottom:20px;}
23
23
24 img.left,img.center,img.right{padding:4px; border:1px solid #a0a0a0;}
24 img.left,img.center,img.right{padding:4px; border:1px solid #a0a0a0;}
25 img.left{float:left; margin:0 12px 5px 0;}
25 img.left{float:left; margin:0 12px 5px 0;}
26 img.center{display:block; margin:0 auto 5px auto;}
26 img.center{display:block; margin:0 auto 5px auto;}
27 img.right{float:right; margin:0 0 5px 12px;}
27 img.right{float:right; margin:0 0 5px 12px;}
28
28
29 /**************** Header and navigation styles ****************/
29 /**************** Header and navigation styles ****************/
30
30
31 #container{
31 #container{
32 width:100%;
32 width:100%;
33 min-width: 800px;
33 min-width: 800px;
34 margin:0;
34 margin:0;
35 padding:0;
35 padding:0;
36 text-align:left;
36 text-align:left;
37 background:#ffffff;
37 background:#ffffff;
38 color:#303030;
38 color:#303030;
39 }
39 }
40
40
41 #header{
41 #header{
42 height:4.5em;
42 height:4.5em;
43 margin:0;
43 margin:0;
44 background:#467aa7;
44 background:#467aa7;
45 color:#ffffff;
45 color:#ffffff;
46 margin-bottom:1px;
46 margin-bottom:1px;
47 }
47 }
48
48
49 #header h1{
49 #header h1{
50 padding:10px 0 0 20px;
50 padding:10px 0 0 20px;
51 font-size:2em;
51 font-size:2em;
52 background-color:inherit;
52 background-color:inherit;
53 color:#fff;
53 color:#fff;
54 letter-spacing:-1px;
54 letter-spacing:-1px;
55 font-weight:bold;
55 font-weight:bold;
56 font-family: Trebuchet MS,Georgia,"Times New Roman",serif;
56 font-family: Trebuchet MS,Georgia,"Times New Roman",serif;
57 }
57 }
58
58
59 #header h2{
59 #header h2{
60 margin:3px 0 0 40px;
60 margin:3px 0 0 40px;
61 font-size:1.5em;
61 font-size:1.5em;
62 background-color:inherit;
62 background-color:inherit;
63 color:#f0f2f4;
63 color:#f0f2f4;
64 letter-spacing:-1px;
64 letter-spacing:-1px;
65 font-weight:normal;
65 font-weight:normal;
66 font-family: Trebuchet MS,Georgia,"Times New Roman",serif;
66 font-family: Trebuchet MS,Georgia,"Times New Roman",serif;
67 }
67 }
68
68
69 #header a {color:#fff;}
70
69 #navigation{
71 #navigation{
70 height:2.2em;
72 height:2.2em;
71 line-height:2.2em;
73 line-height:2.2em;
72 margin:0;
74 margin:0;
73 background:#578bb8;
75 background:#578bb8;
74 color:#ffffff;
76 color:#ffffff;
75 }
77 }
76
78
77 #navigation li{
79 #navigation li{
78 float:left;
80 float:left;
79 list-style-type:none;
81 list-style-type:none;
80 border-right:1px solid #ffffff;
82 border-right:1px solid #ffffff;
81 white-space:nowrap;
83 white-space:nowrap;
82 }
84 }
83
85
84 #navigation li.right {
86 #navigation li.right {
85 float:right;
87 float:right;
86 list-style-type:none;
88 list-style-type:none;
87 border-right:0;
89 border-right:0;
88 border-left:1px solid #ffffff;
90 border-left:1px solid #ffffff;
89 white-space:nowrap;
91 white-space:nowrap;
90 }
92 }
91
93
92 #navigation li a{
94 #navigation li a{
93 display:block;
95 display:block;
94 padding:0px 10px 0px 22px;
96 padding:0px 10px 0px 22px;
95 font-size:0.8em;
97 font-size:0.8em;
96 font-weight:normal;
98 font-weight:normal;
97 text-decoration:none;
99 text-decoration:none;
98 background-color:inherit;
100 background-color:inherit;
99 color: #ffffff;
101 color: #ffffff;
100 }
102 }
101
103
102 #navigation li.submenu {background:url(../images/arrow_down.png) 96% 80% no-repeat;}
104 #navigation li.submenu {background:url(../images/arrow_down.png) 96% 80% no-repeat;}
103 #navigation li.submenu a {padding:0px 16px 0px 22px;}
105 #navigation li.submenu a {padding:0px 16px 0px 22px;}
104 * html #navigation a {width:1%;}
106 * html #navigation a {width:1%;}
105
107
106 #navigation .selected,#navigation a:hover{
108 #navigation .selected,#navigation a:hover{
107 color:#ffffff;
109 color:#ffffff;
108 text-decoration:none;
110 text-decoration:none;
109 background-color: #80b0da;
111 background-color: #80b0da;
110 }
112 }
111
113
112 /**************** Icons *******************/
114 /**************** Icons *******************/
113 .icon {
115 .icon {
114 background-position: 0% 40%;
116 background-position: 0% 40%;
115 background-repeat: no-repeat;
117 background-repeat: no-repeat;
116 padding-left: 20px;
118 padding-left: 20px;
117 padding-top: 2px;
119 padding-top: 2px;
118 padding-bottom: 3px;
120 padding-bottom: 3px;
119 vertical-align: middle;
121 vertical-align: middle;
120 }
122 }
121
123
122 #navigation .icon {
124 #navigation .icon {
123 background-position: 4px 50%;
125 background-position: 4px 50%;
124 }
126 }
125
127
126 .icon22 {
128 .icon22 {
127 background-position: 0% 40%;
129 background-position: 0% 40%;
128 background-repeat: no-repeat;
130 background-repeat: no-repeat;
129 padding-left: 26px;
131 padding-left: 26px;
130 line-height: 22px;
132 line-height: 22px;
131 vertical-align: middle;
133 vertical-align: middle;
132 }
134 }
133
135
134 .icon-add { background-image: url(../images/add.png); }
136 .icon-add { background-image: url(../images/add.png); }
135 .icon-edit { background-image: url(../images/edit.png); }
137 .icon-edit { background-image: url(../images/edit.png); }
136 .icon-del { background-image: url(../images/delete.png); }
138 .icon-del { background-image: url(../images/delete.png); }
137 .icon-move { background-image: url(../images/move.png); }
139 .icon-move { background-image: url(../images/move.png); }
138 .icon-save { background-image: url(../images/save.png); }
140 .icon-save { background-image: url(../images/save.png); }
139 .icon-cancel { background-image: url(../images/cancel.png); }
141 .icon-cancel { background-image: url(../images/cancel.png); }
140 .icon-pdf { background-image: url(../images/pdf.png); }
142 .icon-pdf { background-image: url(../images/pdf.png); }
141 .icon-csv { background-image: url(../images/csv.png); }
143 .icon-csv { background-image: url(../images/csv.png); }
142 .icon-html { background-image: url(../images/html.png); }
144 .icon-html { background-image: url(../images/html.png); }
143 .icon-txt { background-image: url(../images/txt.png); }
145 .icon-txt { background-image: url(../images/txt.png); }
144 .icon-file { background-image: url(../images/file.png); }
146 .icon-file { background-image: url(../images/file.png); }
145 .icon-folder { background-image: url(../images/folder.png); }
147 .icon-folder { background-image: url(../images/folder.png); }
146 .icon-package { background-image: url(../images/package.png); }
148 .icon-package { background-image: url(../images/package.png); }
147 .icon-home { background-image: url(../images/home.png); }
149 .icon-home { background-image: url(../images/home.png); }
148 .icon-user { background-image: url(../images/user.png); }
150 .icon-user { background-image: url(../images/user.png); }
149 .icon-mypage { background-image: url(../images/user_page.png); }
151 .icon-mypage { background-image: url(../images/user_page.png); }
150 .icon-admin { background-image: url(../images/admin.png); }
152 .icon-admin { background-image: url(../images/admin.png); }
151 .icon-projects { background-image: url(../images/projects.png); }
153 .icon-projects { background-image: url(../images/projects.png); }
152 .icon-logout { background-image: url(../images/logout.png); }
154 .icon-logout { background-image: url(../images/logout.png); }
153 .icon-help { background-image: url(../images/help.png); }
155 .icon-help { background-image: url(../images/help.png); }
154 .icon-attachment { background-image: url(../images/attachment.png); }
156 .icon-attachment { background-image: url(../images/attachment.png); }
155 .icon-index { background-image: url(../images/index.png); }
157 .icon-index { background-image: url(../images/index.png); }
156 .icon-history { background-image: url(../images/history.png); }
158 .icon-history { background-image: url(../images/history.png); }
157 .icon-feed { background-image: url(../images/feed.png); }
159 .icon-feed { background-image: url(../images/feed.png); }
158 .icon-time { background-image: url(../images/time.png); }
160 .icon-time { background-image: url(../images/time.png); }
159 .icon-stats { background-image: url(../images/stats.png); }
161 .icon-stats { background-image: url(../images/stats.png); }
160 .icon-warning { background-image: url(../images/warning.png); }
162 .icon-warning { background-image: url(../images/warning.png); }
161 .icon-fav { background-image: url(../images/fav.png); }
163 .icon-fav { background-image: url(../images/fav.png); }
162 .icon-fav-off { background-image: url(../images/fav_off.png); }
164 .icon-fav-off { background-image: url(../images/fav_off.png); }
163
165
164 .icon22-projects { background-image: url(../images/22x22/projects.png); }
166 .icon22-projects { background-image: url(../images/22x22/projects.png); }
165 .icon22-users { background-image: url(../images/22x22/users.png); }
167 .icon22-users { background-image: url(../images/22x22/users.png); }
166 .icon22-tracker { background-image: url(../images/22x22/tracker.png); }
168 .icon22-tracker { background-image: url(../images/22x22/tracker.png); }
167 .icon22-role { background-image: url(../images/22x22/role.png); }
169 .icon22-role { background-image: url(../images/22x22/role.png); }
168 .icon22-workflow { background-image: url(../images/22x22/workflow.png); }
170 .icon22-workflow { background-image: url(../images/22x22/workflow.png); }
169 .icon22-options { background-image: url(../images/22x22/options.png); }
171 .icon22-options { background-image: url(../images/22x22/options.png); }
170 .icon22-notifications { background-image: url(../images/22x22/notifications.png); }
172 .icon22-notifications { background-image: url(../images/22x22/notifications.png); }
171 .icon22-authent { background-image: url(../images/22x22/authent.png); }
173 .icon22-authent { background-image: url(../images/22x22/authent.png); }
172 .icon22-info { background-image: url(../images/22x22/info.png); }
174 .icon22-info { background-image: url(../images/22x22/info.png); }
173 .icon22-comment { background-image: url(../images/22x22/comment.png); }
175 .icon22-comment { background-image: url(../images/22x22/comment.png); }
174 .icon22-package { background-image: url(../images/22x22/package.png); }
176 .icon22-package { background-image: url(../images/22x22/package.png); }
175 .icon22-settings { background-image: url(../images/22x22/settings.png); }
177 .icon22-settings { background-image: url(../images/22x22/settings.png); }
176
178
177 /**************** Content styles ****************/
179 /**************** Content styles ****************/
178
180
179 html>body #content {
181 html>body #content {
180 height: auto;
182 height: auto;
181 min-height: 500px;
183 min-height: 500px;
182 }
184 }
183
185
184 #content{
186 #content{
185 width: auto;
187 width: auto;
186 height:500px;
188 height:500px;
187 font-size:0.9em;
189 font-size:0.9em;
188 padding:20px 10px 10px 20px;
190 padding:20px 10px 10px 20px;
189 margin-left: 120px;
191 margin-left: 120px;
190 border-left: 1px dashed #c0c0c0;
192 border-left: 1px dashed #c0c0c0;
191
193
192 }
194 }
193
195
194 #content h2, #content div.wiki h1 {
196 #content h2, #content div.wiki h1 {
195 display:block;
197 display:block;
196 margin:0 0 16px 0;
198 margin:0 0 16px 0;
197 font-size:1.7em;
199 font-size:1.7em;
198 font-weight:normal;
200 font-weight:normal;
199 letter-spacing:-1px;
201 letter-spacing:-1px;
200 color:#606060;
202 color:#606060;
201 background-color:inherit;
203 background-color:inherit;
202 font-family: Trebuchet MS,Georgia,"Times New Roman",serif;
204 font-family: Trebuchet MS,Georgia,"Times New Roman",serif;
203 }
205 }
204
206
205 #content h2 a{font-weight:normal;}
207 #content h2 a{font-weight:normal;}
206 #content h3{margin:0 0 12px 0; font-size:1.4em;color:#707070;font-family: Trebuchet MS,Georgia,"Times New Roman",serif;}
208 #content h3{margin:0 0 12px 0; font-size:1.4em;color:#707070;font-family: Trebuchet MS,Georgia,"Times New Roman",serif;}
207 #content h4{font-size: 1em; margin-bottom: 12px; margin-top: 20px; font-weight: normal; border-bottom: dotted 1px #c0c0c0;}
209 #content h4{font-size: 1em; margin-bottom: 12px; margin-top: 20px; font-weight: normal; border-bottom: dotted 1px #c0c0c0;}
208 #content a:hover,#subcontent a:hover{text-decoration:underline;}
210 #content a:hover,#subcontent a:hover{text-decoration:underline;}
209 #content ul,#content ol{margin:0 5px 16px 35px;}
211 #content ul,#content ol{margin:0 5px 16px 35px;}
210 #content dl{margin:0 5px 10px 25px;}
212 #content dl{margin:0 5px 10px 25px;}
211 #content dt{font-weight:bold; margin-bottom:5px;}
213 #content dt{font-weight:bold; margin-bottom:5px;}
212 #content dd{margin:0 0 10px 15px;}
214 #content dd{margin:0 0 10px 15px;}
213
215
214 #content .tabs{height: 2.6em;}
216 #content .tabs{height: 2.6em;}
215 #content .tabs ul{margin:0;}
217 #content .tabs ul{margin:0;}
216 #content .tabs ul li{
218 #content .tabs ul li{
217 float:left;
219 float:left;
218 list-style-type:none;
220 list-style-type:none;
219 white-space:nowrap;
221 white-space:nowrap;
220 margin-right:8px;
222 margin-right:8px;
221 background:#fff;
223 background:#fff;
222 }
224 }
223 #content .tabs ul li a{
225 #content .tabs ul li a{
224 display:block;
226 display:block;
225 font-size: 0.9em;
227 font-size: 0.9em;
226 text-decoration:none;
228 text-decoration:none;
227 line-height:1em;
229 line-height:1em;
228 padding:4px;
230 padding:4px;
229 border: 1px solid #c0c0c0;
231 border: 1px solid #c0c0c0;
230 }
232 }
231
233
232 #content .tabs ul li a.selected, #content .tabs ul li a:hover{
234 #content .tabs ul li a.selected, #content .tabs ul li a:hover{
233 background-color: #80b0da;
235 background-color: #80b0da;
234 border: 1px solid #80b0da;
236 border: 1px solid #80b0da;
235 color: #fff;
237 color: #fff;
236 text-decoration:none;
238 text-decoration:none;
237 }
239 }
238
240
239 /***********************************************/
241 /***********************************************/
240
242
241 form {display: inline;}
243 form {display: inline;}
242 blockquote {padding-left: 6px; border-left: 2px solid #ccc;}
244 blockquote {padding-left: 6px; border-left: 2px solid #ccc;}
243 input, select {vertical-align: middle; margin-bottom: 4px;}
245 input, select {vertical-align: middle; margin-bottom: 4px;}
244
246
245 input.button-small {font-size: 0.8em;}
247 input.button-small {font-size: 0.8em;}
246 textarea.wiki-edit { width: 99.5%; }
248 textarea.wiki-edit { width: 99.5%; }
247 .select-small {font-size: 0.8em;}
249 .select-small {font-size: 0.8em;}
248 label {font-weight: bold; font-size: 1em; color: #505050;}
250 label {font-weight: bold; font-size: 1em; color: #505050;}
249 fieldset {border:1px solid #c0c0c0; padding: 6px;}
251 fieldset {border:1px solid #c0c0c0; padding: 6px;}
250 legend {color: #505050;}
252 legend {color: #505050;}
251 .required {color: #bb0000;}
253 .required {color: #bb0000;}
252 .odd {background-color:#f6f7f8;}
254 .odd {background-color:#f6f7f8;}
253 .even {background-color: #fff;}
255 .even {background-color: #fff;}
254 hr { border:0; border-top: dotted 1px #fff; border-bottom: dotted 1px #c0c0c0; }
256 hr { border:0; border-top: dotted 1px #fff; border-bottom: dotted 1px #c0c0c0; }
255 table p {margin:0; padding:0;}
257 table p {margin:0; padding:0;}
256
258
257 .highlight { background-color: #FCFD8D;}
259 .highlight { background-color: #FCFD8D;}
258
260
259 div.square {
261 div.square {
260 border: 1px solid #999;
262 border: 1px solid #999;
261 float: left;
263 float: left;
262 margin: .4em .5em 0 0;
264 margin: .4em .5em 0 0;
263 overflow: hidden;
265 overflow: hidden;
264 width: .6em; height: .6em;
266 width: .6em; height: .6em;
265 }
267 }
266
268
267 ul.documents {
269 ul.documents {
268 list-style-type: none;
270 list-style-type: none;
269 padding: 0;
271 padding: 0;
270 margin: 0;
272 margin: 0;
271 }
273 }
272
274
273 ul.documents li {
275 ul.documents li {
274 background-image: url(../images/32x32/file.png);
276 background-image: url(../images/32x32/file.png);
275 background-repeat: no-repeat;
277 background-repeat: no-repeat;
276 background-position: 0 1px;
278 background-position: 0 1px;
277 padding-left: 36px;
279 padding-left: 36px;
278 margin-bottom: 10px;
280 margin-bottom: 10px;
279 margin-left: -37px;
281 margin-left: -37px;
280 }
282 }
281
283
282 /********** Table used to display lists of things ***********/
284 /********** Table used to display lists of things ***********/
283
285
284 table.list {
286 table.list {
285 width:100%;
287 width:100%;
286 border-collapse: collapse;
288 border-collapse: collapse;
287 border: 1px dotted #d0d0d0;
289 border: 1px dotted #d0d0d0;
288 margin-bottom: 6px;
290 margin-bottom: 6px;
289 }
291 }
290
292
291 table.with-cells td {
293 table.with-cells td {
292 border: 1px solid #d7d7d7;
294 border: 1px solid #d7d7d7;
293 }
295 }
294
296
295 table.list td {
297 table.list td {
296 padding:2px;
298 padding:2px;
297 }
299 }
298
300
299 table.list thead th {
301 table.list thead th {
300 text-align: center;
302 text-align: center;
301 background: #eee;
303 background: #eee;
302 border: 1px solid #d7d7d7;
304 border: 1px solid #d7d7d7;
303 color: #777;
305 color: #777;
304 }
306 }
305
307
306 table.list tbody th {
308 table.list tbody th {
307 font-weight: bold;
309 font-weight: bold;
308 background: #eed;
310 background: #eed;
309 border: 1px solid #d7d7d7;
311 border: 1px solid #d7d7d7;
310 color: #777;
312 color: #777;
311 }
313 }
312
314
313 /********** Validation error messages *************/
315 /********** Validation error messages *************/
314 #errorExplanation {
316 #errorExplanation {
315 width: 400px;
317 width: 400px;
316 border: 0;
318 border: 0;
317 padding: 7px;
319 padding: 7px;
318 padding-bottom: 3px;
320 padding-bottom: 3px;
319 margin-bottom: 0px;
321 margin-bottom: 0px;
320 }
322 }
321
323
322 #errorExplanation h2 {
324 #errorExplanation h2 {
323 text-align: left;
325 text-align: left;
324 font-weight: bold;
326 font-weight: bold;
325 padding: 5px 5px 10px 26px;
327 padding: 5px 5px 10px 26px;
326 font-size: 1em;
328 font-size: 1em;
327 margin: -7px;
329 margin: -7px;
328 background: url(../images/alert.png) no-repeat 6px 6px;
330 background: url(../images/alert.png) no-repeat 6px 6px;
329 }
331 }
330
332
331 #errorExplanation p {
333 #errorExplanation p {
332 color: #333;
334 color: #333;
333 margin-bottom: 0;
335 margin-bottom: 0;
334 padding: 5px;
336 padding: 5px;
335 }
337 }
336
338
337 #errorExplanation ul li {
339 #errorExplanation ul li {
338 font-size: 1em;
340 font-size: 1em;
339 list-style: none;
341 list-style: none;
340 margin-left: -16px;
342 margin-left: -16px;
341 }
343 }
342
344
343 /*========== Drop down menu ==============*/
345 /*========== Drop down menu ==============*/
344 div.menu {
346 div.menu {
345 background-color: #FFFFFF;
347 background-color: #FFFFFF;
346 border-style: solid;
348 border-style: solid;
347 border-width: 1px;
349 border-width: 1px;
348 border-color: #7F9DB9;
350 border-color: #7F9DB9;
349 position: absolute;
351 position: absolute;
350 top: 0px;
352 top: 0px;
351 left: 0px;
353 left: 0px;
352 padding: 0;
354 padding: 0;
353 visibility: hidden;
355 visibility: hidden;
354 z-index: 101;
356 z-index: 101;
355 }
357 }
356
358
357 div.menu a.menuItem {
359 div.menu a.menuItem {
358 font-size: 10px;
360 font-size: 10px;
359 font-weight: normal;
361 font-weight: normal;
360 line-height: 2em;
362 line-height: 2em;
361 color: #000000;
363 color: #000000;
362 background-color: #FFFFFF;
364 background-color: #FFFFFF;
363 cursor: default;
365 cursor: default;
364 display: block;
366 display: block;
365 padding: 0 1em;
367 padding: 0 1em;
366 margin: 0;
368 margin: 0;
367 border: 0;
369 border: 0;
368 text-decoration: none;
370 text-decoration: none;
369 white-space: nowrap;
371 white-space: nowrap;
370 }
372 }
371
373
372 div.menu a.menuItem:hover, div.menu a.menuItemHighlight {
374 div.menu a.menuItem:hover, div.menu a.menuItemHighlight {
373 background-color: #80b0da;
375 background-color: #80b0da;
374 color: #ffffff;
376 color: #ffffff;
375 }
377 }
376
378
377 div.menu a.menuItem span.menuItemText {}
379 div.menu a.menuItem span.menuItemText {}
378
380
379 div.menu a.menuItem span.menuItemArrow {
381 div.menu a.menuItem span.menuItemArrow {
380 margin-right: -.75em;
382 margin-right: -.75em;
381 }
383 }
382
384
383 /**************** Sidebar styles ****************/
385 /**************** Sidebar styles ****************/
384
386
385 #subcontent{
387 #subcontent{
386 position: absolute;
388 position: absolute;
387 left: 0px;
389 left: 0px;
388 width:95px;
390 width:95px;
389 padding:20px 20px 10px 5px;
391 padding:20px 20px 10px 5px;
390 overflow: hidden;
392 overflow: hidden;
391 }
393 }
392
394
393 #subcontent h2{
395 #subcontent h2{
394 display:block;
396 display:block;
395 margin:0 0 5px 0;
397 margin:0 0 5px 0;
396 font-size:1.0em;
398 font-size:1.0em;
397 font-weight:bold;
399 font-weight:bold;
398 text-align:left;
400 text-align:left;
399 color:#606060;
401 color:#606060;
400 background-color:inherit;
402 background-color:inherit;
401 font-family: Trebuchet MS,Georgia,"Times New Roman",serif;
403 font-family: Trebuchet MS,Georgia,"Times New Roman",serif;
402 }
404 }
403
405
404 #subcontent p{margin:0 0 16px 0; font-size:0.9em;}
406 #subcontent p{margin:0 0 16px 0; font-size:0.9em;}
405
407
406 /**************** Menublock styles ****************/
408 /**************** Menublock styles ****************/
407
409
408 .menublock{margin:0 0 20px 8px; font-size:0.8em;}
410 .menublock{margin:0 0 20px 8px; font-size:0.8em;}
409 .menublock li{list-style:none; display:block; padding:1px; margin-bottom:0px;}
411 .menublock li{list-style:none; display:block; padding:1px; margin-bottom:0px;}
410 .menublock li a{font-weight:bold; text-decoration:none;}
412 .menublock li a{font-weight:bold; text-decoration:none;}
411 .menublock li a:hover{text-decoration:none;}
413 .menublock li a:hover{text-decoration:none;}
412 .menublock li ul{margin:0; font-size:1em; font-weight:normal;}
414 .menublock li ul{margin:0; font-size:1em; font-weight:normal;}
413 .menublock li ul li{margin-bottom:0;}
415 .menublock li ul li{margin-bottom:0;}
414 .menublock li ul a{font-weight:normal;}
416 .menublock li ul a{font-weight:normal;}
415
417
416 /**************** Footer styles ****************/
418 /**************** Footer styles ****************/
417
419
418 #footer{
420 #footer{
419 clear:both;
421 clear:both;
420 padding:5px 0;
422 padding:5px 0;
421 margin:0;
423 margin:0;
422 font-size:0.9em;
424 font-size:0.9em;
423 color:#f0f0f0;
425 color:#f0f0f0;
424 background:#467aa7;
426 background:#467aa7;
425 }
427 }
426
428
427 #footer p{padding:0; margin:0; text-align:center;}
429 #footer p{padding:0; margin:0; text-align:center;}
428 #footer a{color:#f0f0f0; background-color:inherit; font-weight:bold;}
430 #footer a{color:#f0f0f0; background-color:inherit; font-weight:bold;}
429 #footer a:hover{color:#ffffff; background-color:inherit; text-decoration: underline;}
431 #footer a:hover{color:#ffffff; background-color:inherit; text-decoration: underline;}
430
432
431 /**************** Misc classes and styles ****************/
433 /**************** Misc classes and styles ****************/
432
434
433 .splitcontentleft{float:left; width:49%;}
435 .splitcontentleft{float:left; width:49%;}
434 .splitcontentright{float:right; width:49%;}
436 .splitcontentright{float:right; width:49%;}
435 .clear{clear:both;}
437 .clear{clear:both;}
436 .small{font-size:0.8em;line-height:1.4em;padding:0 0 0 0;}
438 .small{font-size:0.8em;line-height:1.4em;padding:0 0 0 0;}
437 .hide{display:none;}
439 .hide{display:none;}
438 .textcenter{text-align:center;}
440 .textcenter{text-align:center;}
439 .textright{text-align:right;}
441 .textright{text-align:right;}
440 .important{color:#f02025; background-color:inherit; font-weight:bold;}
442 .important{color:#f02025; background-color:inherit; font-weight:bold;}
441
443
442 .box{
444 .box{
443 margin:0 0 20px 0;
445 margin:0 0 20px 0;
444 padding:10px;
446 padding:10px;
445 border:1px solid #c0c0c0;
447 border:1px solid #c0c0c0;
446 background-color:#fafbfc;
448 background-color:#fafbfc;
447 color:#505050;
449 color:#505050;
448 line-height:1.5em;
450 line-height:1.5em;
449 }
451 }
450
452
451 a.close-icon {
453 a.close-icon {
452 display:block;
454 display:block;
453 margin-top:3px;
455 margin-top:3px;
454 overflow:hidden;
456 overflow:hidden;
455 width:12px;
457 width:12px;
456 height:12px;
458 height:12px;
457 background-repeat: no-repeat;
459 background-repeat: no-repeat;
458 cursor:pointer;
460 cursor:pointer;
459 background-image:url('../images/close.png');
461 background-image:url('../images/close.png');
460 }
462 }
461
463
462 a.close-icon:hover {
464 a.close-icon:hover {
463 background-image:url('../images/close_hl.png');
465 background-image:url('../images/close_hl.png');
464 }
466 }
465
467
466 .rightbox{
468 .rightbox{
467 background: #fafbfc;
469 background: #fafbfc;
468 border: 1px solid #c0c0c0;
470 border: 1px solid #c0c0c0;
469 float: right;
471 float: right;
470 padding: 8px;
472 padding: 8px;
471 position: relative;
473 position: relative;
472 margin: 0 5px 5px;
474 margin: 0 5px 5px;
473 }
475 }
474
476
475 .overlay{
477 .overlay{
476 position: absolute;
478 position: absolute;
477 margin-left:0;
479 margin-left:0;
478 z-index: 50;
480 z-index: 50;
479 }
481 }
480
482
481 .layout-active {
483 .layout-active {
482 background: #ECF3E1;
484 background: #ECF3E1;
483 }
485 }
484
486
485 .block-receiver {
487 .block-receiver {
486 border:1px dashed #c0c0c0;
488 border:1px dashed #c0c0c0;
487 margin-bottom: 20px;
489 margin-bottom: 20px;
488 padding: 15px 0 15px 0;
490 padding: 15px 0 15px 0;
489 }
491 }
490
492
491 .mypage-box {
493 .mypage-box {
492 margin:0 0 20px 0;
494 margin:0 0 20px 0;
493 color:#505050;
495 color:#505050;
494 line-height:1.5em;
496 line-height:1.5em;
495 }
497 }
496
498
497 .handle {
499 .handle {
498 cursor: move;
500 cursor: move;
499 }
501 }
500
502
501 .login {
503 .login {
502 width: 50%;
504 width: 50%;
503 text-align: left;
505 text-align: left;
504 }
506 }
505
507
506 img.calendar-trigger {
508 img.calendar-trigger {
507 cursor: pointer;
509 cursor: pointer;
508 vertical-align: middle;
510 vertical-align: middle;
509 margin-left: 4px;
511 margin-left: 4px;
510 }
512 }
511
513
512 #history p {
514 #history p {
513 margin-left: 34px;
515 margin-left: 34px;
514 }
516 }
515
517
516 .progress {
518 .progress {
517 border: 1px solid #D7D7D7;
519 border: 1px solid #D7D7D7;
518 border-collapse: collapse;
520 border-collapse: collapse;
519 border-spacing: 0pt;
521 border-spacing: 0pt;
520 empty-cells: show;
522 empty-cells: show;
521 padding: 3px;
523 padding: 3px;
522 width: 40em;
524 width: 40em;
523 text-align: center;
525 text-align: center;
524 }
526 }
525
527
526 .progress td { height: 1em; }
528 .progress td { height: 1em; }
527 .progress .closed { background: #BAE0BA none repeat scroll 0%; }
529 .progress .closed { background: #BAE0BA none repeat scroll 0%; }
528 .progress .open { background: #FFF none repeat scroll 0%; }
530 .progress .open { background: #FFF none repeat scroll 0%; }
529
531
530 /***** Contextual links div *****/
532 /***** Contextual links div *****/
531 .contextual {
533 .contextual {
532 float: right;
534 float: right;
533 font-size: 0.8em;
535 font-size: 0.8em;
534 line-height: 16px;
536 line-height: 16px;
535 padding: 2px;
537 padding: 2px;
536 }
538 }
537
539
538 .contextual select, .contextual input {
540 .contextual select, .contextual input {
539 font-size: 1em;
541 font-size: 1em;
540 }
542 }
541
543
542 /***** Gantt chart *****/
544 /***** Gantt chart *****/
543 .gantt_hdr {
545 .gantt_hdr {
544 position:absolute;
546 position:absolute;
545 top:0;
547 top:0;
546 height:16px;
548 height:16px;
547 border-top: 1px solid #c0c0c0;
549 border-top: 1px solid #c0c0c0;
548 border-bottom: 1px solid #c0c0c0;
550 border-bottom: 1px solid #c0c0c0;
549 border-right: 1px solid #c0c0c0;
551 border-right: 1px solid #c0c0c0;
550 text-align: center;
552 text-align: center;
551 overflow: hidden;
553 overflow: hidden;
552 }
554 }
553
555
554 .task {
556 .task {
555 position: absolute;
557 position: absolute;
556 height:8px;
558 height:8px;
557 font-size:0.8em;
559 font-size:0.8em;
558 color:#888;
560 color:#888;
559 padding:0;
561 padding:0;
560 margin:0;
562 margin:0;
561 line-height:0.8em;
563 line-height:0.8em;
562 }
564 }
563
565
564 .task_late { background:#f66 url(../images/task_late.png); border: 1px solid #f66; }
566 .task_late { background:#f66 url(../images/task_late.png); border: 1px solid #f66; }
565 .task_done { background:#66f url(../images/task_done.png); border: 1px solid #66f; }
567 .task_done { background:#66f url(../images/task_done.png); border: 1px solid #66f; }
566 .task_todo { background:#aaa url(../images/task_todo.png); border: 1px solid #aaa; }
568 .task_todo { background:#aaa url(../images/task_todo.png); border: 1px solid #aaa; }
567 .milestone { background-image:url(../images/milestone.png); background-repeat: no-repeat; border: 0; }
569 .milestone { background-image:url(../images/milestone.png); background-repeat: no-repeat; border: 0; }
568
570
569 /***** Tooltips ******/
571 /***** Tooltips ******/
570 .tooltip{position:relative;z-index:24;}
572 .tooltip{position:relative;z-index:24;}
571 .tooltip:hover{z-index:25;color:#000;}
573 .tooltip:hover{z-index:25;color:#000;}
572 .tooltip span.tip{display: none; text-align:left;}
574 .tooltip span.tip{display: none; text-align:left;}
573
575
574 div.tooltip:hover span.tip{
576 div.tooltip:hover span.tip{
575 display:block;
577 display:block;
576 position:absolute;
578 position:absolute;
577 top:12px; left:24px; width:270px;
579 top:12px; left:24px; width:270px;
578 border:1px solid #555;
580 border:1px solid #555;
579 background-color:#fff;
581 background-color:#fff;
580 padding: 4px;
582 padding: 4px;
581 font-size: 0.8em;
583 font-size: 0.8em;
582 color:#505050;
584 color:#505050;
583 }
585 }
584
586
585 /***** CSS FORM ******/
587 /***** CSS FORM ******/
586 .tabular p{
588 .tabular p{
587 margin: 0;
589 margin: 0;
588 padding: 5px 0 8px 0;
590 padding: 5px 0 8px 0;
589 padding-left: 180px; /*width of left column containing the label elements*/
591 padding-left: 180px; /*width of left column containing the label elements*/
590 height: 1%;
592 height: 1%;
591 }
593 }
592
594
593 .tabular label{
595 .tabular label{
594 font-weight: bold;
596 font-weight: bold;
595 float: left;
597 float: left;
596 margin-left: -180px; /*width of left column*/
598 margin-left: -180px; /*width of left column*/
597 width: 175px; /*width of labels. Should be smaller than left column to create some right
599 width: 175px; /*width of labels. Should be smaller than left column to create some right
598 margin*/
600 margin*/
599 }
601 }
600
602
601 .error {
603 .error {
602 color: #cc0000;
604 color: #cc0000;
603 }
605 }
604
606
605 #settings .tabular p{ padding-left: 300px; }
607 #settings .tabular p{ padding-left: 300px; }
606 #settings .tabular label{ margin-left: -300px; width: 295px; }
608 #settings .tabular label{ margin-left: -300px; width: 295px; }
607
609
608 /*.threepxfix class below:
610 /*.threepxfix class below:
609 Targets IE6- ONLY. Adds 3 pixel indent for multi-line form contents.
611 Targets IE6- ONLY. Adds 3 pixel indent for multi-line form contents.
610 to account for 3 pixel bug: http://www.positioniseverything.net/explorer/threepxtest.html
612 to account for 3 pixel bug: http://www.positioniseverything.net/explorer/threepxtest.html
611 */
613 */
612
614
613 * html .threepxfix{
615 * html .threepxfix{
614 margin-left: 3px;
616 margin-left: 3px;
615 }
617 }
616
618
617 /***** Wiki sections ****/
619 /***** Wiki sections ****/
618 #content div.wiki { font-size: 110%}
620 #content div.wiki { font-size: 110%}
619
621
620 #content div.wiki h2, div.wiki h3 { font-family: Trebuchet MS,Georgia,"Times New Roman",serif; color:#606060; }
622 #content div.wiki h2, div.wiki h3 { font-family: Trebuchet MS,Georgia,"Times New Roman",serif; color:#606060; }
621 #content div.wiki h2 { font-size: 1.4em;}
623 #content div.wiki h2 { font-size: 1.4em;}
622 #content div.wiki h3 { font-size: 1.2em;}
624 #content div.wiki h3 { font-size: 1.2em;}
623
625
624 div.wiki table {
626 div.wiki table {
625 border: 1px solid #505050;
627 border: 1px solid #505050;
626 border-collapse: collapse;
628 border-collapse: collapse;
627 }
629 }
628
630
629 div.wiki table, div.wiki td {
631 div.wiki table, div.wiki td {
630 border: 1px solid #bbb;
632 border: 1px solid #bbb;
631 padding: 4px;
633 padding: 4px;
632 }
634 }
633
635
634 div.wiki code {
636 div.wiki code {
635 font-size: 1.2em;
637 font-size: 1.2em;
636 }
638 }
637
639
638 #preview .preview { background: #fafbfc url(../images/draft.png); }
640 #preview .preview { background: #fafbfc url(../images/draft.png); }
639
641
640 #ajax-indicator {
642 #ajax-indicator {
641 position: absolute; /* fixed not supported by IE */
643 position: absolute; /* fixed not supported by IE */
642 background-color:#eee;
644 background-color:#eee;
643 border: 1px solid #bbb;
645 border: 1px solid #bbb;
644 top:35%;
646 top:35%;
645 left:40%;
647 left:40%;
646 width:20%;
648 width:20%;
647 font-weight:bold;
649 font-weight:bold;
648 text-align:center;
650 text-align:center;
649 padding:0.6em;
651 padding:0.6em;
650 z-index:100;
652 z-index:100;
651 filter:alpha(opacity=50);
653 filter:alpha(opacity=50);
652 -moz-opacity:0.5;
654 -moz-opacity:0.5;
653 opacity: 0.5;
655 opacity: 0.5;
654 -khtml-opacity: 0.5;
656 -khtml-opacity: 0.5;
655 }
657 }
656
658
657 html>body #ajax-indicator { position: fixed; }
659 html>body #ajax-indicator { position: fixed; }
658
660
659 #ajax-indicator span {
661 #ajax-indicator span {
660 background-position: 0% 40%;
662 background-position: 0% 40%;
661 background-repeat: no-repeat;
663 background-repeat: no-repeat;
662 background-image: url(../images/loading.gif);
664 background-image: url(../images/loading.gif);
663 padding-left: 26px;
665 padding-left: 26px;
664 vertical-align: bottom;
666 vertical-align: bottom;
665 }
667 }
@@ -1,138 +1,128
1 # redMine - project management software
1 # redMine - project management software
2 # Copyright (C) 2006 Jean-Philippe Lang
2 # Copyright (C) 2006 Jean-Philippe Lang
3 #
3 #
4 # This program is free software; you can redistribute it and/or
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
7 # of the License, or (at your option) any later version.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU General Public License
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
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.
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
17
18 require File.dirname(__FILE__) + '/../test_helper'
18 require File.dirname(__FILE__) + '/../test_helper'
19 require 'projects_controller'
19 require 'projects_controller'
20
20
21 # Re-raise errors caught by the controller.
21 # Re-raise errors caught by the controller.
22 class ProjectsController; def rescue_action(e) raise e end; end
22 class ProjectsController; def rescue_action(e) raise e end; end
23
23
24 class ProjectsControllerTest < Test::Unit::TestCase
24 class ProjectsControllerTest < Test::Unit::TestCase
25 fixtures :projects, :permissions
25 fixtures :projects, :permissions
26
26
27 def setup
27 def setup
28 @controller = ProjectsController.new
28 @controller = ProjectsController.new
29 @request = ActionController::TestRequest.new
29 @request = ActionController::TestRequest.new
30 @response = ActionController::TestResponse.new
30 @response = ActionController::TestResponse.new
31 end
31 end
32
32
33 def test_index
33 def test_index
34 get :index
34 get :index
35 assert_response :success
35 assert_response :success
36 assert_template 'list'
36 assert_template 'list'
37 end
37 end
38
38
39 def test_list
39 def test_list
40 get :list
40 get :list
41 assert_response :success
41 assert_response :success
42 assert_template 'list'
42 assert_template 'list'
43 assert_not_nil assigns(:projects)
43 assert_not_nil assigns(:projects)
44 end
44 end
45
45
46 def test_show
46 def test_show
47 get :show, :id => 1
47 get :show, :id => 1
48 assert_response :success
48 assert_response :success
49 assert_template 'show'
49 assert_template 'show'
50 assert_not_nil assigns(:project)
50 assert_not_nil assigns(:project)
51 end
51 end
52
52
53 def test_list_members
53 def test_list_members
54 get :list_members, :id => 1
54 get :list_members, :id => 1
55 assert_response :success
55 assert_response :success
56 assert_template 'list_members'
56 assert_template 'list_members'
57 assert_not_nil assigns(:members)
57 assert_not_nil assigns(:members)
58 end
58 end
59
59
60 def test_list_documents
60 def test_list_documents
61 get :list_documents, :id => 1
61 get :list_documents, :id => 1
62 assert_response :success
62 assert_response :success
63 assert_template 'list_documents'
63 assert_template 'list_documents'
64 assert_not_nil assigns(:documents)
64 assert_not_nil assigns(:documents)
65 end
65 end
66
66
67 def test_list_issues
67 def test_list_issues
68 get :list_issues, :id => 1
68 get :list_issues, :id => 1
69 assert_response :success
69 assert_response :success
70 assert_template 'list_issues'
70 assert_template 'list_issues'
71 assert_not_nil assigns(:issues)
71 assert_not_nil assigns(:issues)
72 end
72 end
73
73
74 def test_list_issues_with_filter
74 def test_list_issues_with_filter
75 get :list_issues, :id => 1, :set_filter => 1
75 get :list_issues, :id => 1, :set_filter => 1
76 assert_response :success
76 assert_response :success
77 assert_template 'list_issues'
77 assert_template 'list_issues'
78 assert_not_nil assigns(:issues)
78 assert_not_nil assigns(:issues)
79 end
79 end
80
80
81 def test_list_issues_reset_filter
81 def test_list_issues_reset_filter
82 post :list_issues, :id => 1
82 post :list_issues, :id => 1
83 assert_response :success
83 assert_response :success
84 assert_template 'list_issues'
84 assert_template 'list_issues'
85 assert_not_nil assigns(:issues)
85 assert_not_nil assigns(:issues)
86 end
86 end
87
87
88 def test_export_issues_csv
88 def test_export_issues_csv
89 get :export_issues_csv, :id => 1
89 get :export_issues_csv, :id => 1
90 assert_response :success
90 assert_response :success
91 assert_not_nil assigns(:issues)
91 assert_not_nil assigns(:issues)
92 end
92 end
93
93
94 def test_list_news
94 def test_list_news
95 get :list_news, :id => 1
95 get :list_news, :id => 1
96 assert_response :success
96 assert_response :success
97 assert_template 'list_news'
97 assert_template 'list_news'
98 assert_not_nil assigns(:news)
98 assert_not_nil assigns(:news)
99 end
99 end
100
100
101 def test_list_files
101 def test_list_files
102 get :list_files, :id => 1
102 get :list_files, :id => 1
103 assert_response :success
103 assert_response :success
104 assert_template 'list_files'
104 assert_template 'list_files'
105 assert_not_nil assigns(:versions)
105 assert_not_nil assigns(:versions)
106 end
106 end
107
107
108 def test_changelog
108 def test_changelog
109 get :changelog, :id => 1
109 get :changelog, :id => 1
110 assert_response :success
110 assert_response :success
111 assert_template 'changelog'
111 assert_template 'changelog'
112 assert_not_nil assigns(:fixed_issues)
112 assert_not_nil assigns(:fixed_issues)
113 end
113 end
114
114
115 def test_roadmap
115 def test_roadmap
116 get :roadmap, :id => 1
116 get :roadmap, :id => 1
117 assert_response :success
117 assert_response :success
118 assert_template 'roadmap'
118 assert_template 'roadmap'
119 assert_not_nil assigns(:versions)
119 assert_not_nil assigns(:versions)
120 end
120 end
121
121
122 def test_activity
122 def test_activity
123 get :activity, :id => 1
123 get :activity, :id => 1
124 assert_response :success
124 assert_response :success
125 assert_template 'activity'
125 assert_template 'activity'
126 assert_not_nil assigns(:events_by_day)
126 assert_not_nil assigns(:events_by_day)
127 end
127 end
128
129 def test_search
130 get :search, :id => 1
131 assert_response :success
132 assert_template 'search'
133
134 get :search, :id => 1, :token => "can", :scope => ["issues", "news", "documents"]
135 assert_response :success
136 assert_template 'search'
137 end
138 end
128 end
General Comments 0
You need to be logged in to leave comments. Login now