263 |
263 |
def subject_for_project(project, options)
|
264 |
264 |
case options[:format]
|
265 |
265 |
when :html
|
266 |
|
subject = "<span class='icon icon-projects #{project.overdue? ? 'project-overdue' : ''}'>"
|
|
266 |
text_style = "width:#{options[:subject_width]-options[:indent]-20}px;" if options[:subject_width]
|
|
267 |
|
|
268 |
subject = "<span class=\"gantt_subject-text icon icon-projects #{project.overdue? ? 'project-overdue' : ''}\""
|
|
269 |
subject << " style=\"#{text_style}\"" if text_style
|
|
270 |
subject << '>'
|
267 |
271 |
subject << view.link_to_project(project)
|
268 |
272 |
subject << '</span>'
|
269 |
273 |
html_subject(options, subject, :css => "project-name")
|
... | ... | |
301 |
305 |
def subject_for_version(version, options)
|
302 |
306 |
case options[:format]
|
303 |
307 |
when :html
|
304 |
|
subject = "<span class='icon icon-package #{version.behind_schedule? ? 'version-behind-schedule' : ''} #{version.overdue? ? 'version-overdue' : ''}'>"
|
|
308 |
text_style = "width:#{options[:subject_width]-options[:indent]-20}px;" if options[:subject_width]
|
|
309 |
|
|
310 |
subject = "<span class=\"gantt_subject-text icon icon-package #{version.behind_schedule? ? 'version-behind-schedule' : ''} #{version.overdue? ? 'version-overdue' : ''}\""
|
|
311 |
subject << " style=\"#{text_style}\"" if text_style
|
|
312 |
subject << '>'
|
305 |
313 |
subject << view.link_to_version(version)
|
306 |
314 |
subject << '</span>'
|
307 |
315 |
html_subject(options, subject, :css => "version-name")
|
... | ... | |
345 |
353 |
|
346 |
354 |
output = case options[:format]
|
347 |
355 |
when :html
|
348 |
|
css_classes = ''
|
|
356 |
|
|
357 |
css_classes = 'gantt_subject-text'
|
349 |
358 |
css_classes << ' issue-overdue' if issue.overdue?
|
350 |
359 |
css_classes << ' issue-behind-schedule' if issue.behind_schedule?
|
351 |
|
css_classes << ' icon icon-issue' unless Setting.gravatar_enabled? && issue.assigned_to
|
352 |
|
|
353 |
|
subject = "<span class='#{css_classes}'>"
|
354 |
|
if issue.assigned_to.present?
|
|
360 |
|
|
361 |
if Setting.gravatar_enabled? && issue.assigned_to.present?
|
355 |
362 |
assigned_string = l(:field_assigned_to) + ": " + issue.assigned_to.name
|
356 |
|
subject << view.avatar(issue.assigned_to, :class => 'gravatar icon-gravatar', :size => 10, :title => assigned_string)
|
|
363 |
subject = view.avatar(issue.assigned_to, :class => 'gravatar icon-gravatar', :size => 10, :title => assigned_string)
|
|
364 |
text_style = 'left:20px;'
|
|
365 |
else
|
|
366 |
css_classes << ' icon icon-issue'
|
|
367 |
subject = ''
|
|
368 |
text_style = ''
|
357 |
369 |
end
|
|
370 |
|
|
371 |
text_style += "width:#{options[:subject_width]-options[:indent]-20}px;" if options[:subject_width]
|
|
372 |
|
|
373 |
subject << "<span class=\"#{css_classes}\""
|
|
374 |
subject << " style=\"#{text_style}\"" if text_style
|
|
375 |
subject << '>'
|
358 |
376 |
subject << view.link_to_issue(issue)
|
359 |
377 |
subject << '</span>'
|
360 |
|
html_subject(options, subject, :css => "issue-subject") + "\n"
|
|
378 |
html_subject(options, subject, :css => 'issue-subject') + "\n"
|
361 |
379 |
when :image
|
362 |
380 |
image_subject(options, issue.subject)
|
363 |
381 |
when :pdf
|
... | ... | |
369 |
387 |
@issue_ancestors << issue
|
370 |
388 |
options[:indent] += options[:indent_increment]
|
371 |
389 |
end
|
372 |
|
|
|
390 |
|
373 |
391 |
output
|
374 |
392 |
end
|
375 |
393 |
|
... | ... | |
709 |
727 |
end
|
710 |
728 |
|
711 |
729 |
def html_subject(params, subject, options={})
|
712 |
|
output = "<div class=' #{options[:css] }' style='position: absolute;line-height:1.2em;height:16px;top:#{params[:top]}px;left:#{params[:indent]}px;overflow:hidden;'>"
|
|
730 |
output = "<div class=\"gantt_subject #{options[:css] }\" style=\"top:#{params[:top]}px;left:#{params[:indent]}px;\">"
|
713 |
731 |
output << subject
|
714 |
732 |
output << "</div>"
|
715 |
733 |
@subjects << output
|