##// END OF EJS Templates
Adds projects association on tracker form (#2578)....
Jean-Philippe Lang -
r2333:945ec8942a4c
parent child
Show More
@@ -0,0 +1,68
1 # Redmine - project management software
2 # Copyright (C) 2006-2009 Jean-Philippe Lang
3 #
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
18 require File.dirname(__FILE__) + '/../test_helper'
19 require 'trackers_controller'
20
21 # Re-raise errors caught by the controller.
22 class TrackersController; def rescue_action(e) raise e end; end
23
24 class TrackersControllerTest < Test::Unit::TestCase
25 fixtures :trackers, :projects, :projects_trackers, :users
26
27 def setup
28 @controller = TrackersController.new
29 @request = ActionController::TestRequest.new
30 @response = ActionController::TestResponse.new
31 User.current = nil
32 @request.session[:user_id] = 1 # admin
33 end
34
35 def test_get_edit
36 Tracker.find(1).project_ids = [1, 3]
37
38 get :edit, :id => 1
39 assert_response :success
40 assert_template 'edit'
41
42 assert_tag :input, :attributes => { :name => 'tracker[project_ids][]',
43 :value => '1',
44 :checked => 'checked' }
45
46 assert_tag :input, :attributes => { :name => 'tracker[project_ids][]',
47 :value => '2',
48 :checked => nil }
49
50 assert_tag :input, :attributes => { :name => 'tracker[project_ids][]',
51 :value => '',
52 :type => 'hidden'}
53 end
54
55 def test_post_edit
56 post :edit, :id => 1, :tracker => { :name => 'Renamed',
57 :project_ids => ['1', '2', ''] }
58 assert_redirected_to '/trackers/list'
59 assert_equal [1, 2], Tracker.find(1).project_ids.sort
60 end
61
62 def test_post_edit_without_projects
63 post :edit, :id => 1, :tracker => { :name => 'Renamed',
64 :project_ids => [''] }
65 assert_redirected_to '/trackers/list'
66 assert Tracker.find(1).project_ids.empty?
67 end
68 end
@@ -1,79 +1,83
1 1 # redMine - project management software
2 2 # Copyright (C) 2006 Jean-Philippe Lang
3 3 #
4 4 # This program is free software; you can redistribute it and/or
5 5 # modify it under the terms of the GNU General Public License
6 6 # as published by the Free Software Foundation; either version 2
7 7 # of the License, or (at your option) any later version.
8 8 #
9 9 # This program is distributed in the hope that it will be useful,
10 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 12 # GNU General Public License for more details.
13 13 #
14 14 # You should have received a copy of the GNU General Public License
15 15 # along with this program; if not, write to the Free Software
16 16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 17
18 18 class TrackersController < ApplicationController
19 19 before_filter :require_admin
20 20
21 21 def index
22 22 list
23 23 render :action => 'list' unless request.xhr?
24 24 end
25 25
26 26 # GETs should be safe (see http://www.w3.org/2001/tag/doc/whenToUseGet.html)
27 27 verify :method => :post, :only => [ :destroy, :move ], :redirect_to => { :action => :list }
28 28
29 29 def list
30 30 @tracker_pages, @trackers = paginate :trackers, :per_page => 10, :order => 'position'
31 31 render :action => "list", :layout => false if request.xhr?
32 32 end
33 33
34 34 def new
35 35 @tracker = Tracker.new(params[:tracker])
36 36 if request.post? and @tracker.save
37 37 # workflow copy
38 38 if !params[:copy_workflow_from].blank? && (copy_from = Tracker.find_by_id(params[:copy_workflow_from]))
39 39 @tracker.workflows.copy(copy_from)
40 40 end
41 41 flash[:notice] = l(:notice_successful_create)
42 42 redirect_to :action => 'list'
43 return
43 44 end
44 45 @trackers = Tracker.find :all, :order => 'position'
46 @projects = Project.find(:all)
45 47 end
46 48
47 49 def edit
48 50 @tracker = Tracker.find(params[:id])
49 51 if request.post? and @tracker.update_attributes(params[:tracker])
50 52 flash[:notice] = l(:notice_successful_update)
51 53 redirect_to :action => 'list'
54 return
52 55 end
56 @projects = Project.find(:all)
53 57 end
54 58
55 59 def move
56 60 @tracker = Tracker.find(params[:id])
57 61 case params[:position]
58 62 when 'highest'
59 63 @tracker.move_to_top
60 64 when 'higher'
61 65 @tracker.move_higher
62 66 when 'lower'
63 67 @tracker.move_lower
64 68 when 'lowest'
65 69 @tracker.move_to_bottom
66 70 end if params[:position]
67 71 redirect_to :action => 'list'
68 72 end
69 73
70 74 def destroy
71 75 @tracker = Tracker.find(params[:id])
72 76 unless @tracker.issues.empty?
73 77 flash[:error] = "This tracker contains issues and can\'t be deleted."
74 78 else
75 79 @tracker.destroy
76 80 end
77 81 redirect_to :action => 'list'
78 82 end
79 83 end
@@ -1,678 +1,702
1 1 # redMine - project management software
2 2 # Copyright (C) 2006-2007 Jean-Philippe Lang
3 3 #
4 4 # This program is free software; you can redistribute it and/or
5 5 # modify it under the terms of the GNU General Public License
6 6 # as published by the Free Software Foundation; either version 2
7 7 # of the License, or (at your option) any later version.
8 8 #
9 9 # This program is distributed in the hope that it will be useful,
10 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 12 # GNU General Public License for more details.
13 13 #
14 14 # You should have received a copy of the GNU General Public License
15 15 # along with this program; if not, write to the Free Software
16 16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 17
18 18 require 'coderay'
19 19 require 'coderay/helpers/file_type'
20 20 require 'forwardable'
21 21 require 'cgi'
22 22
23 23 module ApplicationHelper
24 24 include Redmine::WikiFormatting::Macros::Definitions
25 25 include GravatarHelper::PublicMethods
26 26
27 27 extend Forwardable
28 28 def_delegators :wiki_helper, :wikitoolbar_for, :heads_for_wiki_formatter
29 29
30 30 def current_role
31 31 @current_role ||= User.current.role_for_project(@project)
32 32 end
33 33
34 34 # Return true if user is authorized for controller/action, otherwise false
35 35 def authorize_for(controller, action)
36 36 User.current.allowed_to?({:controller => controller, :action => action}, @project)
37 37 end
38 38
39 39 # Display a link if user is authorized
40 40 def link_to_if_authorized(name, options = {}, html_options = nil, *parameters_for_method_reference)
41 41 link_to(name, options, html_options, *parameters_for_method_reference) if authorize_for(options[:controller] || params[:controller], options[:action])
42 42 end
43 43
44 44 # Display a link to remote if user is authorized
45 45 def link_to_remote_if_authorized(name, options = {}, html_options = nil)
46 46 url = options[:url] || {}
47 47 link_to_remote(name, options, html_options) if authorize_for(url[:controller] || params[:controller], url[:action])
48 48 end
49 49
50 50 # Display a link to user's account page
51 51 def link_to_user(user, options={})
52 52 (user && !user.anonymous?) ? link_to(user.name(options[:format]), :controller => 'account', :action => 'show', :id => user) : 'Anonymous'
53 53 end
54 54
55 55 def link_to_issue(issue, options={})
56 56 options[:class] ||= ''
57 57 options[:class] << ' issue'
58 58 options[:class] << ' closed' if issue.closed?
59 59 link_to "#{issue.tracker.name} ##{issue.id}", {:controller => "issues", :action => "show", :id => issue}, options
60 60 end
61 61
62 62 # Generates a link to an attachment.
63 63 # Options:
64 64 # * :text - Link text (default to attachment filename)
65 65 # * :download - Force download (default: false)
66 66 def link_to_attachment(attachment, options={})
67 67 text = options.delete(:text) || attachment.filename
68 68 action = options.delete(:download) ? 'download' : 'show'
69 69
70 70 link_to(h(text), {:controller => 'attachments', :action => action, :id => attachment, :filename => attachment.filename }, options)
71 71 end
72 72
73 73 def toggle_link(name, id, options={})
74 74 onclick = "Element.toggle('#{id}'); "
75 75 onclick << (options[:focus] ? "Form.Element.focus('#{options[:focus]}'); " : "this.blur(); ")
76 76 onclick << "return false;"
77 77 link_to(name, "#", :onclick => onclick)
78 78 end
79 79
80 80 def image_to_function(name, function, html_options = {})
81 81 html_options.symbolize_keys!
82 82 tag(:input, html_options.merge({
83 83 :type => "image", :src => image_path(name),
84 84 :onclick => (html_options[:onclick] ? "#{html_options[:onclick]}; " : "") + "#{function};"
85 85 }))
86 86 end
87 87
88 88 def prompt_to_remote(name, text, param, url, html_options = {})
89 89 html_options[:onclick] = "promptToRemote('#{text}', '#{param}', '#{url_for(url)}'); return false;"
90 90 link_to name, {}, html_options
91 91 end
92 92
93 93 def format_date(date)
94 94 return nil unless date
95 95 # "Setting.date_format.size < 2" is a temporary fix (content of date_format setting changed)
96 96 @date_format ||= (Setting.date_format.blank? || Setting.date_format.size < 2 ? l(:general_fmt_date) : Setting.date_format)
97 97 date.strftime(@date_format)
98 98 end
99 99
100 100 def format_time(time, include_date = true)
101 101 return nil unless time
102 102 time = time.to_time if time.is_a?(String)
103 103 zone = User.current.time_zone
104 104 local = zone ? time.in_time_zone(zone) : (time.utc? ? time.localtime : time)
105 105 @date_format ||= (Setting.date_format.blank? || Setting.date_format.size < 2 ? l(:general_fmt_date) : Setting.date_format)
106 106 @time_format ||= (Setting.time_format.blank? ? l(:general_fmt_time) : Setting.time_format)
107 107 include_date ? local.strftime("#{@date_format} #{@time_format}") : local.strftime(@time_format)
108 108 end
109 109
110 110 def format_activity_title(text)
111 111 h(truncate_single_line(text, 100))
112 112 end
113 113
114 114 def format_activity_day(date)
115 115 date == Date.today ? l(:label_today).titleize : format_date(date)
116 116 end
117 117
118 118 def format_activity_description(text)
119 119 h(truncate(text.to_s, 250).gsub(%r{<(pre|code)>.*$}m, '...'))
120 120 end
121 121
122 122 def distance_of_date_in_words(from_date, to_date = 0)
123 123 from_date = from_date.to_date if from_date.respond_to?(:to_date)
124 124 to_date = to_date.to_date if to_date.respond_to?(:to_date)
125 125 distance_in_days = (to_date - from_date).abs
126 126 lwr(:actionview_datehelper_time_in_words_day, distance_in_days)
127 127 end
128 128
129 129 def due_date_distance_in_words(date)
130 130 if date
131 131 l((date < Date.today ? :label_roadmap_overdue : :label_roadmap_due_in), distance_of_date_in_words(Date.today, date))
132 132 end
133 133 end
134 134
135 135 def render_page_hierarchy(pages, node=nil)
136 136 content = ''
137 137 if pages[node]
138 138 content << "<ul class=\"pages-hierarchy\">\n"
139 139 pages[node].each do |page|
140 140 content << "<li>"
141 141 content << link_to(h(page.pretty_title), {:controller => 'wiki', :action => 'index', :id => page.project, :page => page.title},
142 142 :title => (page.respond_to?(:updated_on) ? l(:label_updated_time, distance_of_time_in_words(Time.now, page.updated_on)) : nil))
143 143 content << "\n" + render_page_hierarchy(pages, page.id) if pages[page.id]
144 144 content << "</li>\n"
145 145 end
146 146 content << "</ul>\n"
147 147 end
148 148 content
149 149 end
150 150
151 151 # Renders flash messages
152 152 def render_flash_messages
153 153 s = ''
154 154 flash.each do |k,v|
155 155 s << content_tag('div', v, :class => "flash #{k}")
156 156 end
157 157 s
158 158 end
159 159
160 160 # Renders the project quick-jump box
161 161 def render_project_jump_box
162 162 # Retrieve them now to avoid a COUNT query
163 163 projects = User.current.projects.all
164 164 if projects.any?
165 165 s = '<select onchange="if (this.value != \'\') { window.location = this.value; }">' +
166 166 "<option selected='selected'>#{ l(:label_jump_to_a_project) }</option>" +
167 167 '<option disabled="disabled">---</option>'
168 168 s << project_tree_options_for_select(projects) do |p|
169 169 { :value => url_for(:controller => 'projects', :action => 'show', :id => p, :jump => current_menu_item) }
170 170 end
171 171 s << '</select>'
172 172 s
173 173 end
174 174 end
175 175
176 176 def project_tree_options_for_select(projects, options = {})
177 177 s = ''
178 178 project_tree(projects) do |project, level|
179 179 name_prefix = (level > 0 ? ('&nbsp;' * 2 * level + '&#187; ') : '')
180 180 tag_options = {:value => project.id, :selected => ((project == options[:selected]) ? 'selected' : nil)}
181 181 tag_options.merge!(yield(project)) if block_given?
182 182 s << content_tag('option', name_prefix + h(project), tag_options)
183 183 end
184 184 s
185 185 end
186 186
187 187 # Yields the given block for each project with its level in the tree
188 188 def project_tree(projects, &block)
189 189 ancestors = []
190 190 projects.sort_by(&:lft).each do |project|
191 191 while (ancestors.any? && !project.is_descendant_of?(ancestors.last))
192 192 ancestors.pop
193 193 end
194 194 yield project, ancestors.size
195 195 ancestors << project
196 196 end
197 197 end
198
199 def project_nested_ul(projects, &block)
200 s = ''
201 if projects.any?
202 ancestors = []
203 projects.sort_by(&:lft).each do |project|
204 if (ancestors.empty? || project.is_descendant_of?(ancestors.last))
205 s << "<ul>\n"
206 else
207 ancestors.pop
208 s << "</li>"
209 while (ancestors.any? && !project.is_descendant_of?(ancestors.last))
210 ancestors.pop
211 s << "</ul></li>\n"
212 end
213 end
214 s << "<li>"
215 s << yield(project).to_s
216 ancestors << project
217 end
218 s << ("</li></ul>\n" * ancestors.size)
219 end
220 s
221 end
198 222
199 223 # Truncates and returns the string as a single line
200 224 def truncate_single_line(string, *args)
201 225 truncate(string, *args).gsub(%r{[\r\n]+}m, ' ')
202 226 end
203 227
204 228 def html_hours(text)
205 229 text.gsub(%r{(\d+)\.(\d+)}, '<span class="hours hours-int">\1</span><span class="hours hours-dec">.\2</span>')
206 230 end
207 231
208 232 def authoring(created, author, options={})
209 233 time_tag = @project.nil? ? content_tag('acronym', distance_of_time_in_words(Time.now, created), :title => format_time(created)) :
210 234 link_to(distance_of_time_in_words(Time.now, created),
211 235 {:controller => 'projects', :action => 'activity', :id => @project, :from => created.to_date},
212 236 :title => format_time(created))
213 237 author_tag = (author.is_a?(User) && !author.anonymous?) ? link_to(h(author), :controller => 'account', :action => 'show', :id => author) : h(author || 'Anonymous')
214 238 l(options[:label] || :label_added_time_by, author_tag, time_tag)
215 239 end
216 240
217 241 def l_or_humanize(s, options={})
218 242 k = "#{options[:prefix]}#{s}".to_sym
219 243 l_has_string?(k) ? l(k) : s.to_s.humanize
220 244 end
221 245
222 246 def day_name(day)
223 247 l(:general_day_names).split(',')[day-1]
224 248 end
225 249
226 250 def month_name(month)
227 251 l(:actionview_datehelper_select_month_names).split(',')[month-1]
228 252 end
229 253
230 254 def syntax_highlight(name, content)
231 255 type = CodeRay::FileType[name]
232 256 type ? CodeRay.scan(content, type).html : h(content)
233 257 end
234 258
235 259 def to_path_param(path)
236 260 path.to_s.split(%r{[/\\]}).select {|p| !p.blank?}
237 261 end
238 262
239 263 def pagination_links_full(paginator, count=nil, options={})
240 264 page_param = options.delete(:page_param) || :page
241 265 url_param = params.dup
242 266 # don't reuse params if filters are present
243 267 url_param.clear if url_param.has_key?(:set_filter)
244 268
245 269 html = ''
246 270 if paginator.current.previous
247 271 html << link_to_remote_content_update('&#171; ' + l(:label_previous), url_param.merge(page_param => paginator.current.previous)) + ' '
248 272 end
249 273
250 274 html << (pagination_links_each(paginator, options) do |n|
251 275 link_to_remote_content_update(n.to_s, url_param.merge(page_param => n))
252 276 end || '')
253 277
254 278 if paginator.current.next
255 279 html << ' ' + link_to_remote_content_update((l(:label_next) + ' &#187;'), url_param.merge(page_param => paginator.current.next))
256 280 end
257 281
258 282 unless count.nil?
259 283 html << [
260 284 " (#{paginator.current.first_item}-#{paginator.current.last_item}/#{count})",
261 285 per_page_links(paginator.items_per_page)
262 286 ].compact.join(' | ')
263 287 end
264 288
265 289 html
266 290 end
267 291
268 292 def per_page_links(selected=nil)
269 293 url_param = params.dup
270 294 url_param.clear if url_param.has_key?(:set_filter)
271 295
272 296 links = Setting.per_page_options_array.collect do |n|
273 297 n == selected ? n : link_to_remote(n, {:update => "content",
274 298 :url => params.dup.merge(:per_page => n),
275 299 :method => :get},
276 300 {:href => url_for(url_param.merge(:per_page => n))})
277 301 end
278 302 links.size > 1 ? l(:label_display_per_page, links.join(', ')) : nil
279 303 end
280 304
281 305 def breadcrumb(*args)
282 306 elements = args.flatten
283 307 elements.any? ? content_tag('p', args.join(' &#187; ') + ' &#187; ', :class => 'breadcrumb') : nil
284 308 end
285 309
286 310 def other_formats_links(&block)
287 311 concat('<p class="other-formats">' + l(:label_export_to), block.binding)
288 312 yield Redmine::Views::OtherFormatsBuilder.new(self)
289 313 concat('</p>', block.binding)
290 314 end
291 315
292 316 def html_title(*args)
293 317 if args.empty?
294 318 title = []
295 319 title << @project.name if @project
296 320 title += @html_title if @html_title
297 321 title << Setting.app_title
298 322 title.compact.join(' - ')
299 323 else
300 324 @html_title ||= []
301 325 @html_title += args
302 326 end
303 327 end
304 328
305 329 def accesskey(s)
306 330 Redmine::AccessKeys.key_for s
307 331 end
308 332
309 333 # Formats text according to system settings.
310 334 # 2 ways to call this method:
311 335 # * with a String: textilizable(text, options)
312 336 # * with an object and one of its attribute: textilizable(issue, :description, options)
313 337 def textilizable(*args)
314 338 options = args.last.is_a?(Hash) ? args.pop : {}
315 339 case args.size
316 340 when 1
317 341 obj = options[:object]
318 342 text = args.shift
319 343 when 2
320 344 obj = args.shift
321 345 text = obj.send(args.shift).to_s
322 346 else
323 347 raise ArgumentError, 'invalid arguments to textilizable'
324 348 end
325 349 return '' if text.blank?
326 350
327 351 only_path = options.delete(:only_path) == false ? false : true
328 352
329 353 # when using an image link, try to use an attachment, if possible
330 354 attachments = options[:attachments] || (obj && obj.respond_to?(:attachments) ? obj.attachments : nil)
331 355
332 356 if attachments
333 357 attachments = attachments.sort_by(&:created_on).reverse
334 358 text = text.gsub(/!((\<|\=|\>)?(\([^\)]+\))?(\[[^\]]+\])?(\{[^\}]+\})?)(\S+\.(bmp|gif|jpg|jpeg|png))!/i) do |m|
335 359 style = $1
336 360 filename = $6
337 361 rf = Regexp.new(Regexp.escape(filename), Regexp::IGNORECASE)
338 362 # search for the picture in attachments
339 363 if found = attachments.detect { |att| att.filename =~ rf }
340 364 image_url = url_for :only_path => only_path, :controller => 'attachments', :action => 'download', :id => found
341 365 desc = found.description.to_s.gsub(/^([^\(\)]*).*$/, "\\1")
342 366 alt = desc.blank? ? nil : "(#{desc})"
343 367 "!#{style}#{image_url}#{alt}!"
344 368 else
345 369 "!#{style}#{filename}!"
346 370 end
347 371 end
348 372 end
349 373
350 374 text = Redmine::WikiFormatting.to_html(Setting.text_formatting, text) { |macro, args| exec_macro(macro, obj, args) }
351 375
352 376 # different methods for formatting wiki links
353 377 case options[:wiki_links]
354 378 when :local
355 379 # used for local links to html files
356 380 format_wiki_link = Proc.new {|project, title, anchor| "#{title}.html" }
357 381 when :anchor
358 382 # used for single-file wiki export
359 383 format_wiki_link = Proc.new {|project, title, anchor| "##{title}" }
360 384 else
361 385 format_wiki_link = Proc.new {|project, title, anchor| url_for(:only_path => only_path, :controller => 'wiki', :action => 'index', :id => project, :page => title, :anchor => anchor) }
362 386 end
363 387
364 388 project = options[:project] || @project || (obj && obj.respond_to?(:project) ? obj.project : nil)
365 389
366 390 # Wiki links
367 391 #
368 392 # Examples:
369 393 # [[mypage]]
370 394 # [[mypage|mytext]]
371 395 # wiki links can refer other project wikis, using project name or identifier:
372 396 # [[project:]] -> wiki starting page
373 397 # [[project:|mytext]]
374 398 # [[project:mypage]]
375 399 # [[project:mypage|mytext]]
376 400 text = text.gsub(/(!)?(\[\[([^\]\n\|]+)(\|([^\]\n\|]+))?\]\])/) do |m|
377 401 link_project = project
378 402 esc, all, page, title = $1, $2, $3, $5
379 403 if esc.nil?
380 404 if page =~ /^([^\:]+)\:(.*)$/
381 405 link_project = Project.find_by_name($1) || Project.find_by_identifier($1)
382 406 page = $2
383 407 title ||= $1 if page.blank?
384 408 end
385 409
386 410 if link_project && link_project.wiki
387 411 # extract anchor
388 412 anchor = nil
389 413 if page =~ /^(.+?)\#(.+)$/
390 414 page, anchor = $1, $2
391 415 end
392 416 # check if page exists
393 417 wiki_page = link_project.wiki.find_page(page)
394 418 link_to((title || page), format_wiki_link.call(link_project, Wiki.titleize(page), anchor),
395 419 :class => ('wiki-page' + (wiki_page ? '' : ' new')))
396 420 else
397 421 # project or wiki doesn't exist
398 422 title || page
399 423 end
400 424 else
401 425 all
402 426 end
403 427 end
404 428
405 429 # Redmine links
406 430 #
407 431 # Examples:
408 432 # Issues:
409 433 # #52 -> Link to issue #52
410 434 # Changesets:
411 435 # r52 -> Link to revision 52
412 436 # commit:a85130f -> Link to scmid starting with a85130f
413 437 # Documents:
414 438 # document#17 -> Link to document with id 17
415 439 # document:Greetings -> Link to the document with title "Greetings"
416 440 # document:"Some document" -> Link to the document with title "Some document"
417 441 # Versions:
418 442 # version#3 -> Link to version with id 3
419 443 # version:1.0.0 -> Link to version named "1.0.0"
420 444 # version:"1.0 beta 2" -> Link to version named "1.0 beta 2"
421 445 # Attachments:
422 446 # attachment:file.zip -> Link to the attachment of the current object named file.zip
423 447 # Source files:
424 448 # source:some/file -> Link to the file located at /some/file in the project's repository
425 449 # source:some/file@52 -> Link to the file's revision 52
426 450 # source:some/file#L120 -> Link to line 120 of the file
427 451 # source:some/file@52#L120 -> Link to line 120 of the file's revision 52
428 452 # export:some/file -> Force the download of the file
429 453 # Forum messages:
430 454 # message#1218 -> Link to message with id 1218
431 455 text = text.gsub(%r{([\s\(,\-\>]|^)(!)?(attachment|document|version|commit|source|export|message)?((#|r)(\d+)|(:)([^"\s<>][^\s<>]*?|"[^"]+?"))(?=(?=[[:punct:]]\W)|\s|<|$)}) do |m|
432 456 leading, esc, prefix, sep, oid = $1, $2, $3, $5 || $7, $6 || $8
433 457 link = nil
434 458 if esc.nil?
435 459 if prefix.nil? && sep == 'r'
436 460 if project && (changeset = project.changesets.find_by_revision(oid))
437 461 link = link_to("r#{oid}", {:only_path => only_path, :controller => 'repositories', :action => 'revision', :id => project, :rev => oid},
438 462 :class => 'changeset',
439 463 :title => truncate_single_line(changeset.comments, 100))
440 464 end
441 465 elsif sep == '#'
442 466 oid = oid.to_i
443 467 case prefix
444 468 when nil
445 469 if issue = Issue.find_by_id(oid, :include => [:project, :status], :conditions => Project.visible_by(User.current))
446 470 link = link_to("##{oid}", {:only_path => only_path, :controller => 'issues', :action => 'show', :id => oid},
447 471 :class => (issue.closed? ? 'issue closed' : 'issue'),
448 472 :title => "#{truncate(issue.subject, 100)} (#{issue.status.name})")
449 473 link = content_tag('del', link) if issue.closed?
450 474 end
451 475 when 'document'
452 476 if document = Document.find_by_id(oid, :include => [:project], :conditions => Project.visible_by(User.current))
453 477 link = link_to h(document.title), {:only_path => only_path, :controller => 'documents', :action => 'show', :id => document},
454 478 :class => 'document'
455 479 end
456 480 when 'version'
457 481 if version = Version.find_by_id(oid, :include => [:project], :conditions => Project.visible_by(User.current))
458 482 link = link_to h(version.name), {:only_path => only_path, :controller => 'versions', :action => 'show', :id => version},
459 483 :class => 'version'
460 484 end
461 485 when 'message'
462 486 if message = Message.find_by_id(oid, :include => [:parent, {:board => :project}], :conditions => Project.visible_by(User.current))
463 487 link = link_to h(truncate(message.subject, 60)), {:only_path => only_path,
464 488 :controller => 'messages',
465 489 :action => 'show',
466 490 :board_id => message.board,
467 491 :id => message.root,
468 492 :anchor => (message.parent ? "message-#{message.id}" : nil)},
469 493 :class => 'message'
470 494 end
471 495 end
472 496 elsif sep == ':'
473 497 # removes the double quotes if any
474 498 name = oid.gsub(%r{^"(.*)"$}, "\\1")
475 499 case prefix
476 500 when 'document'
477 501 if project && document = project.documents.find_by_title(name)
478 502 link = link_to h(document.title), {:only_path => only_path, :controller => 'documents', :action => 'show', :id => document},
479 503 :class => 'document'
480 504 end
481 505 when 'version'
482 506 if project && version = project.versions.find_by_name(name)
483 507 link = link_to h(version.name), {:only_path => only_path, :controller => 'versions', :action => 'show', :id => version},
484 508 :class => 'version'
485 509 end
486 510 when 'commit'
487 511 if project && (changeset = project.changesets.find(:first, :conditions => ["scmid LIKE ?", "#{name}%"]))
488 512 link = link_to h("#{name}"), {:only_path => only_path, :controller => 'repositories', :action => 'revision', :id => project, :rev => changeset.revision},
489 513 :class => 'changeset',
490 514 :title => truncate_single_line(changeset.comments, 100)
491 515 end
492 516 when 'source', 'export'
493 517 if project && project.repository
494 518 name =~ %r{^[/\\]*(.*?)(@([0-9a-f]+))?(#(L\d+))?$}
495 519 path, rev, anchor = $1, $3, $5
496 520 link = link_to h("#{prefix}:#{name}"), {:controller => 'repositories', :action => 'entry', :id => project,
497 521 :path => to_path_param(path),
498 522 :rev => rev,
499 523 :anchor => anchor,
500 524 :format => (prefix == 'export' ? 'raw' : nil)},
501 525 :class => (prefix == 'export' ? 'source download' : 'source')
502 526 end
503 527 when 'attachment'
504 528 if attachments && attachment = attachments.detect {|a| a.filename == name }
505 529 link = link_to h(attachment.filename), {:only_path => only_path, :controller => 'attachments', :action => 'download', :id => attachment},
506 530 :class => 'attachment'
507 531 end
508 532 end
509 533 end
510 534 end
511 535 leading + (link || "#{prefix}#{sep}#{oid}")
512 536 end
513 537
514 538 text
515 539 end
516 540
517 541 # Same as Rails' simple_format helper without using paragraphs
518 542 def simple_format_without_paragraph(text)
519 543 text.to_s.
520 544 gsub(/\r\n?/, "\n"). # \r\n and \r -> \n
521 545 gsub(/\n\n+/, "<br /><br />"). # 2+ newline -> 2 br
522 546 gsub(/([^\n]\n)(?=[^\n])/, '\1<br />') # 1 newline -> br
523 547 end
524 548
525 549 def error_messages_for(object_name, options = {})
526 550 options = options.symbolize_keys
527 551 object = instance_variable_get("@#{object_name}")
528 552 if object && !object.errors.empty?
529 553 # build full_messages here with controller current language
530 554 full_messages = []
531 555 object.errors.each do |attr, msg|
532 556 next if msg.nil?
533 557 msg = msg.first if msg.is_a? Array
534 558 if attr == "base"
535 559 full_messages << l(msg)
536 560 else
537 561 full_messages << "&#171; " + (l_has_string?("field_" + attr) ? l("field_" + attr) : object.class.human_attribute_name(attr)) + " &#187; " + l(msg) unless attr == "custom_values"
538 562 end
539 563 end
540 564 # retrieve custom values error messages
541 565 if object.errors[:custom_values]
542 566 object.custom_values.each do |v|
543 567 v.errors.each do |attr, msg|
544 568 next if msg.nil?
545 569 msg = msg.first if msg.is_a? Array
546 570 full_messages << "&#171; " + v.custom_field.name + " &#187; " + l(msg)
547 571 end
548 572 end
549 573 end
550 574 content_tag("div",
551 575 content_tag(
552 576 options[:header_tag] || "span", lwr(:gui_validation_error, full_messages.length) + ":"
553 577 ) +
554 578 content_tag("ul", full_messages.collect { |msg| content_tag("li", msg) }),
555 579 "id" => options[:id] || "errorExplanation", "class" => options[:class] || "errorExplanation"
556 580 )
557 581 else
558 582 ""
559 583 end
560 584 end
561 585
562 586 def lang_options_for_select(blank=true)
563 587 (blank ? [["(auto)", ""]] : []) +
564 588 GLoc.valid_languages.collect{|lang| [ ll(lang.to_s, :general_lang_name), lang.to_s]}.sort{|x,y| x.last <=> y.last }
565 589 end
566 590
567 591 def label_tag_for(name, option_tags = nil, options = {})
568 592 label_text = l(("field_"+field.to_s.gsub(/\_id$/, "")).to_sym) + (options.delete(:required) ? @template.content_tag("span", " *", :class => "required"): "")
569 593 content_tag("label", label_text)
570 594 end
571 595
572 596 def labelled_tabular_form_for(name, object, options, &proc)
573 597 options[:html] ||= {}
574 598 options[:html][:class] = 'tabular' unless options[:html].has_key?(:class)
575 599 form_for(name, object, options.merge({ :builder => TabularFormBuilder, :lang => current_language}), &proc)
576 600 end
577 601
578 602 def back_url_hidden_field_tag
579 603 back_url = params[:back_url] || request.env['HTTP_REFERER']
580 604 back_url = CGI.unescape(back_url.to_s)
581 605 hidden_field_tag('back_url', CGI.escape(back_url)) unless back_url.blank?
582 606 end
583 607
584 608 def check_all_links(form_name)
585 609 link_to_function(l(:button_check_all), "checkAll('#{form_name}', true)") +
586 610 " | " +
587 611 link_to_function(l(:button_uncheck_all), "checkAll('#{form_name}', false)")
588 612 end
589 613
590 614 def progress_bar(pcts, options={})
591 615 pcts = [pcts, pcts] unless pcts.is_a?(Array)
592 616 pcts[1] = pcts[1] - pcts[0]
593 617 pcts << (100 - pcts[1] - pcts[0])
594 618 width = options[:width] || '100px;'
595 619 legend = options[:legend] || ''
596 620 content_tag('table',
597 621 content_tag('tr',
598 622 (pcts[0] > 0 ? content_tag('td', '', :style => "width: #{pcts[0].floor}%;", :class => 'closed') : '') +
599 623 (pcts[1] > 0 ? content_tag('td', '', :style => "width: #{pcts[1].floor}%;", :class => 'done') : '') +
600 624 (pcts[2] > 0 ? content_tag('td', '', :style => "width: #{pcts[2].floor}%;", :class => 'todo') : '')
601 625 ), :class => 'progress', :style => "width: #{width};") +
602 626 content_tag('p', legend, :class => 'pourcent')
603 627 end
604 628
605 629 def context_menu_link(name, url, options={})
606 630 options[:class] ||= ''
607 631 if options.delete(:selected)
608 632 options[:class] << ' icon-checked disabled'
609 633 options[:disabled] = true
610 634 end
611 635 if options.delete(:disabled)
612 636 options.delete(:method)
613 637 options.delete(:confirm)
614 638 options.delete(:onclick)
615 639 options[:class] << ' disabled'
616 640 url = '#'
617 641 end
618 642 link_to name, url, options
619 643 end
620 644
621 645 def calendar_for(field_id)
622 646 include_calendar_headers_tags
623 647 image_tag("calendar.png", {:id => "#{field_id}_trigger",:class => "calendar-trigger"}) +
624 648 javascript_tag("Calendar.setup({inputField : '#{field_id}', ifFormat : '%Y-%m-%d', button : '#{field_id}_trigger' });")
625 649 end
626 650
627 651 def include_calendar_headers_tags
628 652 unless @calendar_headers_tags_included
629 653 @calendar_headers_tags_included = true
630 654 content_for :header_tags do
631 655 javascript_include_tag('calendar/calendar') +
632 656 javascript_include_tag("calendar/lang/calendar-#{current_language}.js") +
633 657 javascript_include_tag('calendar/calendar-setup') +
634 658 stylesheet_link_tag('calendar')
635 659 end
636 660 end
637 661 end
638 662
639 663 def content_for(name, content = nil, &block)
640 664 @has_content ||= {}
641 665 @has_content[name] = true
642 666 super(name, content, &block)
643 667 end
644 668
645 669 def has_content?(name)
646 670 (@has_content && @has_content[name]) || false
647 671 end
648 672
649 673 # Returns the avatar image tag for the given +user+ if avatars are enabled
650 674 # +user+ can be a User or a string that will be scanned for an email address (eg. 'joe <joe@foo.bar>')
651 675 def avatar(user, options = { })
652 676 if Setting.gravatar_enabled?
653 677 email = nil
654 678 if user.respond_to?(:mail)
655 679 email = user.mail
656 680 elsif user.to_s =~ %r{<(.+?)>}
657 681 email = $1
658 682 end
659 683 return gravatar(email.to_s.downcase, options) unless email.blank? rescue nil
660 684 end
661 685 end
662 686
663 687 private
664 688
665 689 def wiki_helper
666 690 helper = Redmine::WikiFormatting.helper_for(Setting.text_formatting)
667 691 extend helper
668 692 return self
669 693 end
670 694
671 695 def link_to_remote_content_update(text, url_params)
672 696 link_to_remote(text,
673 697 {:url => url_params, :method => :get, :update => 'content', :complete => 'window.scrollTo(0,0)'},
674 698 {:href => url_for(:params => url_params)}
675 699 )
676 700 end
677 701
678 702 end
@@ -1,12 +1,27
1 1 <%= error_messages_for 'tracker' %>
2 <div class="box">
2
3 <div class="splitcontentleft">
4 <div class="box tabular">
3 5 <!--[form:tracker]-->
4 6 <p><%= f.text_field :name, :required => true %></p>
5 7 <p><%= f.check_box :is_in_chlog %></p>
6 8 <p><%= f.check_box :is_in_roadmap %></p>
7 9 <% if @tracker.new_record? && @trackers.any? %>
8 10 <p><label><%= l(:label_copy_workflow_from) %></label>
9 11 <%= select_tag(:copy_workflow_from, content_tag("option") + options_from_collection_for_select(@trackers, :id, :name)) %></p>
10 12 <% end %>
11 13 <!--[eoform:tracker]-->
12 14 </div>
15 </div>
16
17 <div class="splitcontentright">
18 <% if @projects.any? %>
19 <fieldset class="box" id="tracker_project_ids"><legend><%= l(:label_project_plural) %></legend>
20 <%= project_nested_ul(@projects) do |p|
21 content_tag('label', check_box_tag('tracker[project_ids][]', p.id, @tracker.projects.include?(p), :id => nil) + ' ' + h(p))
22 end %>
23 <%= hidden_field_tag('tracker[project_ids][]', '', :id => nil) %>
24 <p><%= check_all_links 'tracker_project_ids' %></p>
25 </fieldset>
26 <% end %>
27 </div>
@@ -1,6 +1,6
1 1 <h2><%=l(:label_tracker)%></h2>
2 2
3 <% labelled_tabular_form_for :tracker, @tracker, :url => { :action => 'edit' } do |f| %>
3 <% form_for :tracker, @tracker, :url => { :action => 'edit' }, :builder => TabularFormBuilder do |f| %>
4 4 <%= render :partial => 'form', :locals => { :f => f } %>
5 5 <%= submit_tag l(:button_save) %>
6 <% end %> No newline at end of file
6 <% end %>
@@ -1,6 +1,6
1 1 <h2><%=l(:label_tracker_new)%></h2>
2 2
3 <% labelled_tabular_form_for :tracker, @tracker, :url => { :action => 'new' } do |f| %>
3 <% form_for :tracker, @tracker, :url => { :action => 'new' }, :builder => TabularFormBuilder do |f| %>
4 4 <%= render :partial => 'form', :locals => { :f => f } %>
5 5 <%= submit_tag l(:button_create) %>
6 <% end %> No newline at end of file
6 <% end %>
@@ -1,701 +1,704
1 1 body { font-family: Verdana, sans-serif; font-size: 12px; color:#484848; margin: 0; padding: 0; min-width: 900px; }
2 2
3 3 h1, h2, h3, h4 { font-family: "Trebuchet MS", Verdana, sans-serif;}
4 4 h1 {margin:0; padding:0; font-size: 24px;}
5 5 h2, .wiki h1 {font-size: 20px;padding: 2px 10px 1px 0px;margin: 0 0 10px 0; border-bottom: 1px solid #bbbbbb; color: #444;}
6 6 h3, .wiki h2 {font-size: 16px;padding: 2px 10px 1px 0px;margin: 0 0 10px 0; border-bottom: 1px solid #bbbbbb; color: #444;}
7 7 h4, .wiki h3 {font-size: 13px;padding: 2px 10px 1px 0px;margin-bottom: 5px; border-bottom: 1px dotted #bbbbbb; color: #444;}
8 8
9 9 /***** Layout *****/
10 10 #wrapper {background: white;}
11 11
12 12 #top-menu {background: #2C4056; color: #fff; height:1.8em; font-size: 0.8em; padding: 2px 2px 0px 6px;}
13 13 #top-menu ul {margin: 0; padding: 0;}
14 14 #top-menu li {
15 15 float:left;
16 16 list-style-type:none;
17 17 margin: 0px 0px 0px 0px;
18 18 padding: 0px 0px 0px 0px;
19 19 white-space:nowrap;
20 20 }
21 21 #top-menu a {color: #fff; margin-right: 8px; font-weight: bold;}
22 22 #top-menu #loggedas { float: right; margin-right: 0.5em; color: #fff; }
23 23
24 24 #account {float:right;}
25 25
26 26 #header {height:5.3em;margin:0;background-color:#507AAA;color:#f8f8f8; padding: 4px 8px 0px 6px; position:relative;}
27 27 #header a {color:#f8f8f8;}
28 28 #quick-search {float:right;}
29 29
30 30 #main-menu {position: absolute; bottom: 0px; left:6px; margin-right: -500px;}
31 31 #main-menu ul {margin: 0; padding: 0;}
32 32 #main-menu li {
33 33 float:left;
34 34 list-style-type:none;
35 35 margin: 0px 2px 0px 0px;
36 36 padding: 0px 0px 0px 0px;
37 37 white-space:nowrap;
38 38 }
39 39 #main-menu li a {
40 40 display: block;
41 41 color: #fff;
42 42 text-decoration: none;
43 43 font-weight: bold;
44 44 margin: 0;
45 45 padding: 4px 10px 4px 10px;
46 46 }
47 47 #main-menu li a:hover {background:#759FCF; color:#fff;}
48 48 #main-menu li a.selected, #main-menu li a.selected:hover {background:#fff; color:#555;}
49 49
50 50 #main {background-color:#EEEEEE;}
51 51
52 52 #sidebar{ float: right; width: 17%; position: relative; z-index: 9; min-height: 600px; padding: 0; margin: 0;}
53 53 * html #sidebar{ width: 17%; }
54 54 #sidebar h3{ font-size: 14px; margin-top:14px; color: #666; }
55 55 #sidebar hr{ width: 100%; margin: 0 auto; height: 1px; background: #ccc; border: 0; }
56 56 * html #sidebar hr{ width: 95%; position: relative; left: -6px; color: #ccc; }
57 57
58 58 #content { width: 80%; background-color: #fff; margin: 0px; border-right: 1px solid #ddd; padding: 6px 10px 10px 10px; z-index: 10; }
59 59 * html #content{ width: 80%; padding-left: 0; margin-top: 0px; padding: 6px 10px 10px 10px;}
60 60 html>body #content { min-height: 600px; }
61 61 * html body #content { height: 600px; } /* IE */
62 62
63 63 #main.nosidebar #sidebar{ display: none; }
64 64 #main.nosidebar #content{ width: auto; border-right: 0; }
65 65
66 66 #footer {clear: both; border-top: 1px solid #bbb; font-size: 0.9em; color: #aaa; padding: 5px; text-align:center; background:#fff;}
67 67
68 68 #login-form table {margin-top:5em; padding:1em; margin-left: auto; margin-right: auto; border: 2px solid #FDBF3B; background-color:#FFEBC1; }
69 69 #login-form table td {padding: 6px;}
70 70 #login-form label {font-weight: bold;}
71 71
72 72 .clear:after{ content: "."; display: block; height: 0; clear: both; visibility: hidden; }
73 73
74 74 /***** Links *****/
75 75 a, a:link, a:visited{ color: #2A5685; text-decoration: none; }
76 76 a:hover, a:active{ color: #c61a1a; text-decoration: underline;}
77 77 a img{ border: 0; }
78 78
79 79 a.issue.closed { text-decoration: line-through; }
80 80
81 81 /***** Tables *****/
82 82 table.list { border: 1px solid #e4e4e4; border-collapse: collapse; width: 100%; margin-bottom: 4px; }
83 83 table.list th { background-color:#EEEEEE; padding: 4px; white-space:nowrap; }
84 84 table.list td { vertical-align: top; }
85 85 table.list td.id { width: 2%; text-align: center;}
86 86 table.list td.checkbox { width: 15px; padding: 0px;}
87 87
88 88 tr.project td.name a { padding-left: 16px; white-space:nowrap; }
89 89 tr.project.parent td.name a { background: url('../images/bullet_toggle_minus.png') no-repeat; }
90 90
91 91 tr.issue { text-align: center; white-space: nowrap; }
92 92 tr.issue td.subject, tr.issue td.category, td.assigned_to { white-space: normal; }
93 93 tr.issue td.subject { text-align: left; }
94 94 tr.issue td.done_ratio table.progress { margin-left:auto; margin-right: auto;}
95 95
96 96 tr.entry { border: 1px solid #f8f8f8; }
97 97 tr.entry td { white-space: nowrap; }
98 98 tr.entry td.filename { width: 30%; }
99 99 tr.entry td.size { text-align: right; font-size: 90%; }
100 100 tr.entry td.revision, tr.entry td.author { text-align: center; }
101 101 tr.entry td.age { text-align: right; }
102 102
103 103 tr.entry span.expander {background-image: url(../images/bullet_toggle_plus.png); padding-left: 8px; margin-left: 0; cursor: pointer;}
104 104 tr.entry.open span.expander {background-image: url(../images/bullet_toggle_minus.png);}
105 105 tr.entry.file td.filename a { margin-left: 16px; }
106 106
107 107 tr.changeset td.author { text-align: center; width: 15%; }
108 108 tr.changeset td.committed_on { text-align: center; width: 15%; }
109 109
110 110 tr.message { height: 2.6em; }
111 111 tr.message td.last_message { font-size: 80%; }
112 112 tr.message.locked td.subject a { background-image: url(../images/locked.png); }
113 113 tr.message.sticky td.subject a { background-image: url(../images/sticky.png); font-weight: bold; }
114 114
115 115 tr.user td { width:13%; }
116 116 tr.user td.email { width:18%; }
117 117 tr.user td { white-space: nowrap; }
118 118 tr.user.locked, tr.user.registered { color: #aaa; }
119 119 tr.user.locked a, tr.user.registered a { color: #aaa; }
120 120
121 121 tr.time-entry { text-align: center; white-space: nowrap; }
122 122 tr.time-entry td.subject, tr.time-entry td.comments { text-align: left; white-space: normal; }
123 123 td.hours { text-align: right; font-weight: bold; padding-right: 0.5em; }
124 124 td.hours .hours-dec { font-size: 0.9em; }
125 125
126 126 table.plugins td { vertical-align: middle; }
127 127 table.plugins td.configure { text-align: right; padding-right: 1em; }
128 128 table.plugins span.name { font-weight: bold; display: block; margin-bottom: 6px; }
129 129 table.plugins span.description { display: block; font-size: 0.9em; }
130 130 table.plugins span.url { display: block; font-size: 0.9em; }
131 131
132 132 table.list tbody tr:hover { background-color:#ffffdd; }
133 133 table td {padding:2px;}
134 134 table p {margin:0;}
135 135 .odd {background-color:#f6f7f8;}
136 136 .even {background-color: #fff;}
137 137
138 138 .highlight { background-color: #FCFD8D;}
139 139 .highlight.token-1 { background-color: #faa;}
140 140 .highlight.token-2 { background-color: #afa;}
141 141 .highlight.token-3 { background-color: #aaf;}
142 142
143 143 .box{
144 144 padding:6px;
145 145 margin-bottom: 10px;
146 146 background-color:#f6f6f6;
147 147 color:#505050;
148 148 line-height:1.5em;
149 149 border: 1px solid #e4e4e4;
150 150 }
151 151
152 152 div.square {
153 153 border: 1px solid #999;
154 154 float: left;
155 155 margin: .3em .4em 0 .4em;
156 156 overflow: hidden;
157 157 width: .6em; height: .6em;
158 158 }
159 159 .contextual {float:right; white-space: nowrap; line-height:1.4em;margin-top:5px; padding-left: 10px; font-size:0.9em;}
160 160 .contextual input {font-size:0.9em;}
161 161
162 162 .splitcontentleft{float:left; width:49%;}
163 163 .splitcontentright{float:right; width:49%;}
164 164 form {display: inline;}
165 165 input, select {vertical-align: middle; margin-top: 1px; margin-bottom: 1px;}
166 166 fieldset {border: 1px solid #e4e4e4; margin:0;}
167 167 legend {color: #484848;}
168 168 hr { width: 100%; height: 1px; background: #ccc; border: 0;}
169 169 blockquote { font-style: italic; border-left: 3px solid #e0e0e0; padding-left: 0.6em; margin-left: 2.4em;}
170 170 blockquote blockquote { margin-left: 0;}
171 171 textarea.wiki-edit { width: 99%; }
172 172 li p {margin-top: 0;}
173 173 div.issue {background:#ffffdd; padding:6px; margin-bottom:6px;border: 1px solid #d7d7d7;}
174 174 p.breadcrumb { font-size: 0.9em; margin: 4px 0 4px 0;}
175 175 p.subtitle { font-size: 0.9em; margin: -6px 0 12px 0; font-style: italic; }
176 176 p.footnote { font-size: 0.9em; margin-top: 0px; margin-bottom: 0px; }
177 177
178 178 fieldset#filters, fieldset#date-range { padding: 0.7em; margin-bottom: 8px; }
179 179 fieldset#filters p { margin: 1.2em 0 0.8em 2px; }
180 180 fieldset#filters table { border-collapse: collapse; }
181 181 fieldset#filters table td { padding: 0; vertical-align: middle; }
182 182 fieldset#filters tr.filter { height: 2em; }
183 183 fieldset#filters td.add-filter { text-align: right; vertical-align: top; }
184 184 .buttons { font-size: 0.9em; }
185 185
186 186 div#issue-changesets {float:right; width:45%; margin-left: 1em; margin-bottom: 1em; background: #fff; padding-left: 1em; font-size: 90%;}
187 187 div#issue-changesets .changeset { padding: 4px;}
188 188 div#issue-changesets .changeset { border-bottom: 1px solid #ddd; }
189 189 div#issue-changesets p { margin-top: 0; margin-bottom: 1em;}
190 190
191 191 div#activity dl, #search-results { margin-left: 2em; }
192 192 div#activity dd, #search-results dd { margin-bottom: 1em; padding-left: 18px; font-size: 0.9em; }
193 193 div#activity dt, #search-results dt { margin-bottom: 0px; padding-left: 20px; line-height: 18px; background-position: 0 50%; background-repeat: no-repeat; }
194 194 div#activity dt.me .time { border-bottom: 1px solid #999; }
195 195 div#activity dt .time { color: #777; font-size: 80%; }
196 196 div#activity dd .description, #search-results dd .description { font-style: italic; }
197 197 div#activity span.project:after, #search-results span.project:after { content: " -"; }
198 198 div#activity dd span.description, #search-results dd span.description { display:block; }
199 199
200 200 #search-results dd { margin-bottom: 1em; padding-left: 20px; margin-left:0px; }
201 201
202 202 div#search-results-counts {float:right;}
203 203 div#search-results-counts ul { margin-top: 0.5em; }
204 204 div#search-results-counts li { list-style-type:none; float: left; margin-left: 1em; }
205 205
206 206 dt.issue { background-image: url(../images/ticket.png); }
207 207 dt.issue-edit { background-image: url(../images/ticket_edit.png); }
208 208 dt.issue-closed { background-image: url(../images/ticket_checked.png); }
209 209 dt.issue-note { background-image: url(../images/ticket_note.png); }
210 210 dt.changeset { background-image: url(../images/changeset.png); }
211 211 dt.news { background-image: url(../images/news.png); }
212 212 dt.message { background-image: url(../images/message.png); }
213 213 dt.reply { background-image: url(../images/comments.png); }
214 214 dt.wiki-page { background-image: url(../images/wiki_edit.png); }
215 215 dt.attachment { background-image: url(../images/attachment.png); }
216 216 dt.document { background-image: url(../images/document.png); }
217 217 dt.project { background-image: url(../images/projects.png); }
218 218
219 219 #search-results dt.issue.closed { background-image: url(../images/ticket_checked.png); }
220 220
221 221 div#roadmap fieldset.related-issues { margin-bottom: 1em; }
222 222 div#roadmap fieldset.related-issues ul { margin-top: 0.3em; margin-bottom: 0.3em; }
223 223 div#roadmap .wiki h1:first-child { display: none; }
224 224 div#roadmap .wiki h1 { font-size: 120%; }
225 225 div#roadmap .wiki h2 { font-size: 110%; }
226 226
227 227 div#version-summary { float:right; width:380px; margin-left: 16px; margin-bottom: 16px; background-color: #fff; }
228 228 div#version-summary fieldset { margin-bottom: 1em; }
229 229 div#version-summary .total-hours { text-align: right; }
230 230
231 231 table#time-report td.hours, table#time-report th.period, table#time-report th.total { text-align: right; padding-right: 0.5em; }
232 232 table#time-report tbody tr { font-style: italic; color: #777; }
233 233 table#time-report tbody tr.last-level { font-style: normal; color: #555; }
234 234 table#time-report tbody tr.total { font-style: normal; font-weight: bold; color: #555; background-color:#EEEEEE; }
235 235 table#time-report .hours-dec { font-size: 0.9em; }
236 236
237 237 form#issue-form .attributes { margin-bottom: 8px; }
238 238 form#issue-form .attributes p { padding-top: 1px; padding-bottom: 2px; }
239 239 form#issue-form .attributes select { min-width: 30%; }
240 240
241 241 ul.projects { margin: 0; padding-left: 1em; }
242 242 ul.projects.root { margin: 0; padding: 0; }
243 243 ul.projects ul { border-left: 3px solid #e0e0e0; }
244 244 ul.projects li { list-style-type:none; }
245 245 ul.projects li.root { margin-bottom: 1em; }
246 246 ul.projects li.child { margin-top: 1em;}
247 247 ul.projects div.root a.project { font-family: "Trebuchet MS", Verdana, sans-serif; font-weight: bold; font-size: 16px; margin: 0 0 10px 0; }
248 248 .my-project { padding-left: 18px; background: url(../images/fav.png) no-repeat 0 50%; }
249 249
250 #tracker_project_ids ul { margin: 0; padding-left: 1em; }
251 #tracker_project_ids li { list-style-type:none; }
252
250 253 ul.properties {padding:0; font-size: 0.9em; color: #777;}
251 254 ul.properties li {list-style-type:none;}
252 255 ul.properties li span {font-style:italic;}
253 256
254 257 .total-hours { font-size: 110%; font-weight: bold; }
255 258 .total-hours span.hours-int { font-size: 120%; }
256 259
257 260 .autoscroll {overflow-x: auto; padding:1px; margin-bottom: 1.2em;}
258 261 #user_firstname, #user_lastname, #user_mail, #my_account_form select { width: 90%; }
259 262
260 263 .pagination {font-size: 90%}
261 264 p.pagination {margin-top:8px;}
262 265
263 266 /***** Tabular forms ******/
264 267 .tabular p{
265 268 margin: 0;
266 269 padding: 5px 0 8px 0;
267 270 padding-left: 180px; /*width of left column containing the label elements*/
268 271 height: 1%;
269 272 clear:left;
270 273 }
271 274
272 275 html>body .tabular p {overflow:hidden;}
273 276
274 277 .tabular label{
275 278 font-weight: bold;
276 279 float: left;
277 280 text-align: right;
278 281 margin-left: -180px; /*width of left column*/
279 282 width: 175px; /*width of labels. Should be smaller than left column to create some right
280 283 margin*/
281 284 }
282 285
283 286 .tabular label.floating{
284 287 font-weight: normal;
285 288 margin-left: 0px;
286 289 text-align: left;
287 290 width: 270px;
288 291 }
289 292
290 293 input#time_entry_comments { width: 90%;}
291 294
292 295 #preview fieldset {margin-top: 1em; background: url(../images/draft.png)}
293 296
294 297 .tabular.settings p{ padding-left: 300px; }
295 298 .tabular.settings label{ margin-left: -300px; width: 295px; }
296 299
297 300 .required {color: #bb0000;}
298 301 .summary {font-style: italic;}
299 302
300 303 #attachments_fields input[type=text] {margin-left: 8px; }
301 304
302 305 div.attachments { margin-top: 12px; }
303 306 div.attachments p { margin:4px 0 2px 0; }
304 307 div.attachments img { vertical-align: middle; }
305 308 div.attachments span.author { font-size: 0.9em; color: #888; }
306 309
307 310 p.other-formats { text-align: right; font-size:0.9em; color: #666; }
308 311 .other-formats span + span:before { content: "| "; }
309 312
310 313 a.atom { background: url(../images/feed.png) no-repeat 1px 50%; padding: 2px 0px 3px 16px; }
311 314
312 315 /***** Flash & error messages ****/
313 316 #errorExplanation, div.flash, .nodata, .warning {
314 317 padding: 4px 4px 4px 30px;
315 318 margin-bottom: 12px;
316 319 font-size: 1.1em;
317 320 border: 2px solid;
318 321 }
319 322
320 323 div.flash {margin-top: 8px;}
321 324
322 325 div.flash.error, #errorExplanation {
323 326 background: url(../images/false.png) 8px 5px no-repeat;
324 327 background-color: #ffe3e3;
325 328 border-color: #dd0000;
326 329 color: #550000;
327 330 }
328 331
329 332 div.flash.notice {
330 333 background: url(../images/true.png) 8px 5px no-repeat;
331 334 background-color: #dfffdf;
332 335 border-color: #9fcf9f;
333 336 color: #005f00;
334 337 }
335 338
336 339 div.flash.warning {
337 340 background: url(../images/warning.png) 8px 5px no-repeat;
338 341 background-color: #FFEBC1;
339 342 border-color: #FDBF3B;
340 343 color: #A6750C;
341 344 text-align: left;
342 345 }
343 346
344 347 .nodata, .warning {
345 348 text-align: center;
346 349 background-color: #FFEBC1;
347 350 border-color: #FDBF3B;
348 351 color: #A6750C;
349 352 }
350 353
351 354 #errorExplanation ul { font-size: 0.9em;}
352 355
353 356 /***** Ajax indicator ******/
354 357 #ajax-indicator {
355 358 position: absolute; /* fixed not supported by IE */
356 359 background-color:#eee;
357 360 border: 1px solid #bbb;
358 361 top:35%;
359 362 left:40%;
360 363 width:20%;
361 364 font-weight:bold;
362 365 text-align:center;
363 366 padding:0.6em;
364 367 z-index:100;
365 368 filter:alpha(opacity=50);
366 369 opacity: 0.5;
367 370 }
368 371
369 372 html>body #ajax-indicator { position: fixed; }
370 373
371 374 #ajax-indicator span {
372 375 background-position: 0% 40%;
373 376 background-repeat: no-repeat;
374 377 background-image: url(../images/loading.gif);
375 378 padding-left: 26px;
376 379 vertical-align: bottom;
377 380 }
378 381
379 382 /***** Calendar *****/
380 383 table.cal {border-collapse: collapse; width: 100%; margin: 0px 0 6px 0;border: 1px solid #d7d7d7;}
381 384 table.cal thead th {width: 14%;}
382 385 table.cal tbody tr {height: 100px;}
383 386 table.cal th { background-color:#EEEEEE; padding: 4px; }
384 387 table.cal td {border: 1px solid #d7d7d7; vertical-align: top; font-size: 0.9em;}
385 388 table.cal td p.day-num {font-size: 1.1em; text-align:right;}
386 389 table.cal td.odd p.day-num {color: #bbb;}
387 390 table.cal td.today {background:#ffffdd;}
388 391 table.cal td.today p.day-num {font-weight: bold;}
389 392
390 393 /***** Tooltips ******/
391 394 .tooltip{position:relative;z-index:24;}
392 395 .tooltip:hover{z-index:25;color:#000;}
393 396 .tooltip span.tip{display: none; text-align:left;}
394 397
395 398 div.tooltip:hover span.tip{
396 399 display:block;
397 400 position:absolute;
398 401 top:12px; left:24px; width:270px;
399 402 border:1px solid #555;
400 403 background-color:#fff;
401 404 padding: 4px;
402 405 font-size: 0.8em;
403 406 color:#505050;
404 407 }
405 408
406 409 /***** Progress bar *****/
407 410 table.progress {
408 411 border: 1px solid #D7D7D7;
409 412 border-collapse: collapse;
410 413 border-spacing: 0pt;
411 414 empty-cells: show;
412 415 text-align: center;
413 416 float:left;
414 417 margin: 1px 6px 1px 0px;
415 418 }
416 419
417 420 table.progress td { height: 0.9em; }
418 421 table.progress td.closed { background: #BAE0BA none repeat scroll 0%; }
419 422 table.progress td.done { background: #DEF0DE none repeat scroll 0%; }
420 423 table.progress td.open { background: #FFF none repeat scroll 0%; }
421 424 p.pourcent {font-size: 80%;}
422 425 p.progress-info {clear: left; font-style: italic; font-size: 80%;}
423 426
424 427 /***** Tabs *****/
425 428 #content .tabs {height: 2.6em; border-bottom: 1px solid #bbbbbb; margin-bottom:1.2em; position:relative;}
426 429 #content .tabs ul {margin:0; position:absolute; bottom:-2px; padding-left:1em;}
427 430 #content .tabs>ul { bottom:-1px; } /* others */
428 431 #content .tabs ul li {
429 432 float:left;
430 433 list-style-type:none;
431 434 white-space:nowrap;
432 435 margin-right:8px;
433 436 background:#fff;
434 437 }
435 438 #content .tabs ul li a{
436 439 display:block;
437 440 font-size: 0.9em;
438 441 text-decoration:none;
439 442 line-height:1.3em;
440 443 padding:4px 6px 4px 6px;
441 444 border: 1px solid #ccc;
442 445 border-bottom: 1px solid #bbbbbb;
443 446 background-color: #eeeeee;
444 447 color:#777;
445 448 font-weight:bold;
446 449 }
447 450
448 451 #content .tabs ul li a:hover {
449 452 background-color: #ffffdd;
450 453 text-decoration:none;
451 454 }
452 455
453 456 #content .tabs ul li a.selected {
454 457 background-color: #fff;
455 458 border: 1px solid #bbbbbb;
456 459 border-bottom: 1px solid #fff;
457 460 }
458 461
459 462 #content .tabs ul li a.selected:hover {
460 463 background-color: #fff;
461 464 }
462 465
463 466 /***** Diff *****/
464 467 .diff_out { background: #fcc; }
465 468 .diff_in { background: #cfc; }
466 469
467 470 /***** Wiki *****/
468 471 div.wiki table {
469 472 border: 1px solid #505050;
470 473 border-collapse: collapse;
471 474 margin-bottom: 1em;
472 475 }
473 476
474 477 div.wiki table, div.wiki td, div.wiki th {
475 478 border: 1px solid #bbb;
476 479 padding: 4px;
477 480 }
478 481
479 482 div.wiki .external {
480 483 background-position: 0% 60%;
481 484 background-repeat: no-repeat;
482 485 padding-left: 12px;
483 486 background-image: url(../images/external.png);
484 487 }
485 488
486 489 div.wiki a.new {
487 490 color: #b73535;
488 491 }
489 492
490 493 div.wiki pre {
491 494 margin: 1em 1em 1em 1.6em;
492 495 padding: 2px;
493 496 background-color: #fafafa;
494 497 border: 1px solid #dadada;
495 498 width:95%;
496 499 overflow-x: auto;
497 500 }
498 501
499 502 div.wiki ul.toc {
500 503 background-color: #ffffdd;
501 504 border: 1px solid #e4e4e4;
502 505 padding: 4px;
503 506 line-height: 1.2em;
504 507 margin-bottom: 12px;
505 508 margin-right: 12px;
506 509 margin-left: 0;
507 510 display: table
508 511 }
509 512 * html div.wiki ul.toc { width: 50%; } /* IE6 doesn't autosize div */
510 513
511 514 div.wiki ul.toc.right { float: right; margin-left: 12px; margin-right: 0; width: auto; }
512 515 div.wiki ul.toc.left { float: left; margin-right: 12px; margin-left: 0; width: auto; }
513 516 div.wiki ul.toc li { list-style-type:none;}
514 517 div.wiki ul.toc li.heading2 { margin-left: 6px; }
515 518 div.wiki ul.toc li.heading3 { margin-left: 12px; font-size: 0.8em; }
516 519
517 520 div.wiki ul.toc a {
518 521 font-size: 0.9em;
519 522 font-weight: normal;
520 523 text-decoration: none;
521 524 color: #606060;
522 525 }
523 526 div.wiki ul.toc a:hover { color: #c61a1a; text-decoration: underline;}
524 527
525 528 a.wiki-anchor { display: none; margin-left: 6px; text-decoration: none; }
526 529 a.wiki-anchor:hover { color: #aaa !important; text-decoration: none; }
527 530 h1:hover a.wiki-anchor, h2:hover a.wiki-anchor, h3:hover a.wiki-anchor { display: inline; color: #ddd; }
528 531
529 532 /***** My page layout *****/
530 533 .block-receiver {
531 534 border:1px dashed #c0c0c0;
532 535 margin-bottom: 20px;
533 536 padding: 15px 0 15px 0;
534 537 }
535 538
536 539 .mypage-box {
537 540 margin:0 0 20px 0;
538 541 color:#505050;
539 542 line-height:1.5em;
540 543 }
541 544
542 545 .handle {
543 546 cursor: move;
544 547 }
545 548
546 549 a.close-icon {
547 550 display:block;
548 551 margin-top:3px;
549 552 overflow:hidden;
550 553 width:12px;
551 554 height:12px;
552 555 background-repeat: no-repeat;
553 556 cursor:pointer;
554 557 background-image:url('../images/close.png');
555 558 }
556 559
557 560 a.close-icon:hover {
558 561 background-image:url('../images/close_hl.png');
559 562 }
560 563
561 564 /***** Gantt chart *****/
562 565 .gantt_hdr {
563 566 position:absolute;
564 567 top:0;
565 568 height:16px;
566 569 border-top: 1px solid #c0c0c0;
567 570 border-bottom: 1px solid #c0c0c0;
568 571 border-right: 1px solid #c0c0c0;
569 572 text-align: center;
570 573 overflow: hidden;
571 574 }
572 575
573 576 .task {
574 577 position: absolute;
575 578 height:8px;
576 579 font-size:0.8em;
577 580 color:#888;
578 581 padding:0;
579 582 margin:0;
580 583 line-height:0.8em;
581 584 }
582 585
583 586 .task_late { background:#f66 url(../images/task_late.png); border: 1px solid #f66; }
584 587 .task_done { background:#66f url(../images/task_done.png); border: 1px solid #66f; }
585 588 .task_todo { background:#aaa url(../images/task_todo.png); border: 1px solid #aaa; }
586 589 .milestone { background-image:url(../images/milestone.png); background-repeat: no-repeat; border: 0; }
587 590
588 591 /***** Icons *****/
589 592 .icon {
590 593 background-position: 0% 40%;
591 594 background-repeat: no-repeat;
592 595 padding-left: 20px;
593 596 padding-top: 2px;
594 597 padding-bottom: 3px;
595 598 }
596 599
597 600 .icon22 {
598 601 background-position: 0% 40%;
599 602 background-repeat: no-repeat;
600 603 padding-left: 26px;
601 604 line-height: 22px;
602 605 vertical-align: middle;
603 606 }
604 607
605 608 .icon-add { background-image: url(../images/add.png); }
606 609 .icon-edit { background-image: url(../images/edit.png); }
607 610 .icon-copy { background-image: url(../images/copy.png); }
608 611 .icon-del { background-image: url(../images/delete.png); }
609 612 .icon-move { background-image: url(../images/move.png); }
610 613 .icon-save { background-image: url(../images/save.png); }
611 614 .icon-cancel { background-image: url(../images/cancel.png); }
612 615 .icon-file { background-image: url(../images/file.png); }
613 616 .icon-folder { background-image: url(../images/folder.png); }
614 617 .open .icon-folder { background-image: url(../images/folder_open.png); }
615 618 .icon-package { background-image: url(../images/package.png); }
616 619 .icon-home { background-image: url(../images/home.png); }
617 620 .icon-user { background-image: url(../images/user.png); }
618 621 .icon-mypage { background-image: url(../images/user_page.png); }
619 622 .icon-admin { background-image: url(../images/admin.png); }
620 623 .icon-projects { background-image: url(../images/projects.png); }
621 624 .icon-help { background-image: url(../images/help.png); }
622 625 .icon-attachment { background-image: url(../images/attachment.png); }
623 626 .icon-index { background-image: url(../images/index.png); }
624 627 .icon-history { background-image: url(../images/history.png); }
625 628 .icon-time { background-image: url(../images/time.png); }
626 629 .icon-stats { background-image: url(../images/stats.png); }
627 630 .icon-warning { background-image: url(../images/warning.png); }
628 631 .icon-fav { background-image: url(../images/fav.png); }
629 632 .icon-fav-off { background-image: url(../images/fav_off.png); }
630 633 .icon-reload { background-image: url(../images/reload.png); }
631 634 .icon-lock { background-image: url(../images/locked.png); }
632 635 .icon-unlock { background-image: url(../images/unlock.png); }
633 636 .icon-checked { background-image: url(../images/true.png); }
634 637 .icon-details { background-image: url(../images/zoom_in.png); }
635 638 .icon-report { background-image: url(../images/report.png); }
636 639 .icon-comment { background-image: url(../images/comment.png); }
637 640
638 641 .icon22-projects { background-image: url(../images/22x22/projects.png); }
639 642 .icon22-users { background-image: url(../images/22x22/users.png); }
640 643 .icon22-tracker { background-image: url(../images/22x22/tracker.png); }
641 644 .icon22-role { background-image: url(../images/22x22/role.png); }
642 645 .icon22-workflow { background-image: url(../images/22x22/workflow.png); }
643 646 .icon22-options { background-image: url(../images/22x22/options.png); }
644 647 .icon22-notifications { background-image: url(../images/22x22/notifications.png); }
645 648 .icon22-authent { background-image: url(../images/22x22/authent.png); }
646 649 .icon22-info { background-image: url(../images/22x22/info.png); }
647 650 .icon22-comment { background-image: url(../images/22x22/comment.png); }
648 651 .icon22-package { background-image: url(../images/22x22/package.png); }
649 652 .icon22-settings { background-image: url(../images/22x22/settings.png); }
650 653 .icon22-plugin { background-image: url(../images/22x22/plugin.png); }
651 654
652 655 img.gravatar {
653 656 padding: 2px;
654 657 border: solid 1px #d5d5d5;
655 658 background: #fff;
656 659 }
657 660
658 661 div.issue img.gravatar {
659 662 float: right;
660 663 margin: 0 0 0 1em;
661 664 padding: 5px;
662 665 }
663 666
664 667 div.issue table img.gravatar {
665 668 height: 14px;
666 669 width: 14px;
667 670 padding: 2px;
668 671 float: left;
669 672 margin: 0 0.5em 0 0;
670 673 }
671 674
672 675 #history img.gravatar {
673 676 padding: 3px;
674 677 margin: 0 1.5em 1em 0;
675 678 float: left;
676 679 }
677 680
678 681 td.username img.gravatar {
679 682 float: left;
680 683 margin: 0 1em 0 0;
681 684 }
682 685
683 686 #activity dt img.gravatar {
684 687 float: left;
685 688 margin: 0 1em 1em 0;
686 689 }
687 690
688 691 #activity dt,
689 692 .journal {
690 693 clear: left;
691 694 }
692 695
693 696 h2 img { vertical-align:middle; }
694 697
695 698
696 699 /***** Media print specific styles *****/
697 700 @media print {
698 701 #top-menu, #header, #main-menu, #sidebar, #footer, .contextual, .other-formats { display:none; }
699 702 #main { background: #fff; }
700 703 #content { width: 99%; margin: 0; padding: 0; border: 0; background: #fff; overflow: visible !important;}
701 704 }
General Comments 0
You need to be logged in to leave comments. Login now