gitlabhq/app/views/projects/_recent_messages.html.haml

53 lines
1.8 KiB
Plaintext
Raw Normal View History

2011-10-18 16:44:43 +02:00
- @messages.group_by{ |x| [x.noteable_id, x.noteable_type]}.each do |item, notes|
- id, type = item[0], item[1]
- parent = load_note_parent(id, type, @project)
- next unless parent
- case type
- when "Issue"
2011-10-19 15:25:22 +02:00
- css_class = "dash_issue"
2011-10-18 16:44:43 +02:00
- issue = parent
- item_code = issue.author.email
- link_item_name = truncate(issue.title, :length => 50)
- link_to_item = project_issue_path(@project, issue)
- when "Snippet"
- css_class = "dash_snippet"
- item_code = parent.author.email
- link_item_name = parent.title
- link_to_item = project_snippet_path(@project, parent)
2011-10-18 16:44:43 +02:00
- when "Commit"
2011-10-19 15:25:22 +02:00
- css_class = "dash_commit"
2011-10-18 16:44:43 +02:00
- commit = parent
- item_code = commit.author.email
- link_item_name = truncate_commit_message(commit, 50)
- link_to_item = project_commit_path(@project, :id => commit.id)
- else
2011-10-19 15:25:22 +02:00
- css_class = "dash_wall"
2011-10-18 16:44:43 +02:00
- item_code = @project.name
- link_item_name = "Project Wall"
- link_to_item = wall_project_path(@project)
2011-10-19 15:25:22 +02:00
%div{ :class => "recent_message_parent #{css_class}"}
2011-10-18 16:44:43 +02:00
= image_tag gravatar_icon(item_code), :class => "left", :width => 40
%h4
= link_to(link_item_name, link_to_item)
%span
= type
.clear
- notes.sort {|x,y| x.updated_at <=> y.updated_at }.each do |note|
%div.message
= image_tag gravatar_icon(note.author.email), :class => "left", :width => 24, :style => "padding-right:5px;"
%p{:style => "margin-bottom: 3px;"}
%span.author
= note.author.name
2011-10-19 15:25:22 +02:00
= link_to truncate(note.note, :length => 200), link_to_item + "#note_#{note.id}"
2011-10-18 16:44:43 +02:00
- if note.attachment.url
%br
Attachment:
= link_to note.attachment_identifier, note.attachment.url
%br
%br
.append-bottom
&nbsp;
.clear