Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update comments in tooltip

  • Loading branch information...
commit 944525ec6f02745e9ea2fd4074d132637ba49119 1 parent a9d32db
@den-plugins authored
View
4 app/controllers/task_boards_controller.rb
@@ -152,6 +152,7 @@ def update_issue
@issue.init_journal(User.current, '')
@issue.update_attributes(params[:issue])
@selected_resource = params[:selected_resource] ? params[:selected_resource] : ""
+ @journals = get_journals(@issue)
parents = @issue.update_parents
@status_grouped = (params[:board].to_i.eql?(1) ? IssueStatusGroup::TASK_GROUPED : IssueStatusGroup::BUG_GROUPED)
@@ -212,9 +213,10 @@ def ordered_keys(values)
def render_comment
@journals = get_journals(@issue)
+ @loaded = true
render :update do |page|
page.replace_html "#{@issue.id}_discussion".to_sym, :partial => "discussion", :locals => {:issue => @issue}
- page.replace_html "#{@issue.id}_tip".to_sym, page.task_board_tooltip(@issue)
+ page.replace_html "#{@issue.id}_tip".to_sym, page.task_board_tooltip(@issue, @journals)
end
end
View
16 app/helpers/task_boards_helper.rb
@@ -73,19 +73,23 @@ def update_sticky_note container, issue, board=nil
page.visual_effect(:highlight, "#{container}")
end
- def task_board_tooltip(ticket)
+ def task_board_tooltip(ticket, journals=nil)
content = "<strong>#{l(:field_subject)}</strong>: #{textilizable ticket.subject}<br />" +
"<strong>#{l(:field_description)}</strong>: #{textilizable ticket.description}<br />" +
"<strong>#{l(:field_assigned_to)}</strong>: #{ticket.assigned_to}<br />" +
((ticket.feature? or ticket.children.any?) ? "" : "<strong>#{l(:field_estimated_hours)}</strong>: #{ticket.estimated_hours ? ticket.estimated_hours : 0} #{l(:field_sp_hours)}<br />") +
((ticket.feature? or ticket.children.any?) ? "" : "<strong>#{l(:field_remaining_effort)}</strong>: #{ticket.remaining_effort ? ticket.remaining_effort : 0} #{l(:field_sp_hours)}<br />") +
"<strong>#{l(:field_comments)}</strong>: <br />"
- if @journals
- content += "<ul>"
- @journals.take(5).reverse.each do |j|
- content += "<li style='padding-left: 4px; margin: 0;'>&raquo; #{j.notes}</li>"
+ unless journals.nil?
+ if journals.empty?
+ content += "<span>No comments yet.</span>"
+ else
+ content += "<ul>"
+ journals.take(5).reverse.each do |j|
+ content += "<li style='padding-left: 4px; margin: 0;'>&raquo; #{j.notes}</li>"
+ end
+ content += "</ul>"
end
- content += "</ul>"
else
content += "<span>Click #{image_tag 'talk.png', :plugin => 'scrum_task_board'} to load comments.</span>"
end
View
2  app/views/task_boards/_feature.rhtml
@@ -2,7 +2,7 @@
<%= link_to "#{feature.parent.issue_from_id} &raquo; ", "##{dom_id(feature.parent.issue_from)}",
:class => "to_parent", :style => "color: orange;", :title => "Jump to parent." if !feature.parent.nil? %>
<div class="tooltip">
- <%= link_to_issue feature %><span id="<%= feature.id %>_tip" class="tip"><%= task_board_tooltip(feature) %></span>
+ <%= link_to_issue feature %><span id="<%= feature.id %>_tip" class="tip"><%= task_board_tooltip(feature, @journals) %></span>
</div>
</div>
View
2  app/views/task_boards/_issue.html.erb
@@ -13,7 +13,7 @@
:title => "Jump to parent." if !issue.parent.nil? %>
<% end %>
<div class="tooltip">
- <%= link_to_issue issue %><span id="<%= issue.id %>_tip" class="tip"><%= task_board_tooltip(issue) %></span>
+ <%= link_to_issue issue %><span id="<%= issue.id %>_tip" class="tip"><%= task_board_tooltip(issue, @journals) %></span>
</div>
</div>
Please sign in to comment.
Something went wrong with that request. Please try again.