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 << " title=\"#{project.name}\""
|
|
270 |
subject << " style=\"#{text_style}\"" if text_style
|
|
271 |
subject << '>'
|
267 |
272 |
subject << view.link_to_project(project)
|
268 |
273 |
subject << '</span>'
|
269 |
274 |
html_subject(options, subject, :css => "project-name")
|
... | ... | |
301 |
306 |
def subject_for_version(version, options)
|
302 |
307 |
case options[:format]
|
303 |
308 |
when :html
|
304 |
|
subject = "<span class='icon icon-package #{version.behind_schedule? ? 'version-behind-schedule' : ''} #{version.overdue? ? 'version-overdue' : ''}'>"
|
|
309 |
text_style = "width:#{options[:subject_width]-options[:indent]-20}px;" if options[:subject_width]
|
|
310 |
|
|
311 |
subject = "<span class=\"gantt_subject-text icon icon-package #{version.behind_schedule? ? 'version-behind-schedule' : ''} #{version.overdue? ? 'version-overdue' : ''}\""
|
|
312 |
subject << " title=\"#{version.to_s_with_project}\""
|
|
313 |
subject << " style=\"#{text_style}\"" if text_style
|
|
314 |
subject << '>'
|
305 |
315 |
subject << view.link_to_version(version)
|
306 |
316 |
subject << '</span>'
|
307 |
317 |
html_subject(options, subject, :css => "version-name")
|
... | ... | |
345 |
355 |
|
346 |
356 |
output = case options[:format]
|
347 |
357 |
when :html
|
348 |
|
css_classes = ''
|
|
358 |
|
|
359 |
css_classes = 'gantt_subject-text'
|
349 |
360 |
css_classes << ' issue-overdue' if issue.overdue?
|
350 |
361 |
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?
|
|
362 |
|
|
363 |
if Setting.gravatar_enabled? && issue.assigned_to.present?
|
355 |
364 |
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)
|
|
365 |
subject = view.avatar(issue.assigned_to, :class => 'gravatar icon-gravatar', :size => 10, :title => assigned_string)
|
|
366 |
text_style = 'left:20px;'
|
|
367 |
else
|
|
368 |
css_classes << ' icon icon-issue'
|
|
369 |
subject = ''
|
|
370 |
text_style = ''
|
357 |
371 |
end
|
|
372 |
|
|
373 |
text_style += "width:#{options[:subject_width]-options[:indent]-20}px;" if options[:subject_width]
|
|
374 |
|
|
375 |
subject << "<span class=\"#{css_classes}\""
|
|
376 |
subject << " title=\"#{issue.subject}\""
|
|
377 |
subject << " style=\"#{text_style}\"" if text_style
|
|
378 |
subject << '>'
|
358 |
379 |
subject << view.link_to_issue(issue)
|
359 |
380 |
subject << '</span>'
|
360 |
|
html_subject(options, subject, :css => "issue-subject") + "\n"
|
|
381 |
html_subject(options, subject, :css => 'issue-subject') + "\n"
|
361 |
382 |
when :image
|
362 |
383 |
image_subject(options, issue.subject)
|
363 |
384 |
when :pdf
|
... | ... | |
369 |
390 |
@issue_ancestors << issue
|
370 |
391 |
options[:indent] += options[:indent_increment]
|
371 |
392 |
end
|
372 |
|
|
|
393 |
|
373 |
394 |
output
|
374 |
395 |
end
|
375 |
396 |
|
... | ... | |
709 |
730 |
end
|
710 |
731 |
|
711 |
732 |
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;'>"
|
|
733 |
output = "<div class=\"gantt_subject #{options[:css] }\" style=\"top:#{params[:top]}px;left:#{params[:indent]}px;\">"
|
713 |
734 |
output << subject
|
714 |
735 |
output << "</div>"
|
715 |
736 |
@subjects << output
|