|
13 | 13 | h2 Recent messages (last 30 days) |
14 | 14 |
|
15 | 15 | - if activity_entries.any? |
| 16 | + - show_sender = local_assigns.fetch(:show_sender, false) |
16 | 17 | - summary = local_assigns[:activity_summary] || {} |
17 | 18 | - total = summary[:total] || activity_entries.size |
18 | 19 | - started = summary[:started_thread] || 0 |
|
45 | 46 | thead |
46 | 47 | tr |
47 | 48 | th Activity |
| 49 | + - if show_sender |
| 50 | + th Sender |
48 | 51 | th Thread |
49 | 52 | th Sent |
50 | 53 | tbody |
51 | 54 | - activity_entries.each do |entry| |
52 | 55 | - topic = entry[:topic] |
| 56 | + - message = entry[:message] |
53 | 57 | - types = entry[:activity_types] || [] |
54 | 58 | tr |
55 | 59 | td.activity-types |
|
65 | 69 | span.activity-tag.tag-patch First patch |
66 | 70 | - when :sent_followup_patch |
67 | 71 | span.activity-tag.tag-patch Follow-up patch |
| 72 | + - if show_sender |
| 73 | + - sender_alias = message.sender_display_alias |
| 74 | + td |
| 75 | + - if sender_alias && message.sender_person |
| 76 | + = link_to person_path(sender_alias.email), class: "activity-sender", data: { turbo_frame: "_top" } do |
| 77 | + = image_tag sender_alias.gravatar_url(size: 32), class: "activity-sender-avatar", alt: sender_alias.name |
| 78 | + span.activity-sender-name = sender_alias.name |
| 79 | + - elsif sender_alias |
| 80 | + .activity-sender |
| 81 | + = image_tag sender_alias.gravatar_url(size: 32), class: "activity-sender-avatar", alt: sender_alias.name |
| 82 | + span.activity-sender-name = sender_alias.name |
| 83 | + - else |
| 84 | + span.activity-sender-name Unknown |
68 | 85 | td |
69 | | - = link_to topic.title, topic_path(topic, anchor: "message-#{entry[:message].id}"), class: "activity-topic", data: { turbo_frame: "_top" } |
| 86 | + = link_to topic.title, topic_path(topic, anchor: "message-#{message.id}"), class: "activity-topic", data: { turbo_frame: "_top" } |
70 | 87 | td |
71 | 88 | = time_ago_in_words(entry[:sent_at]) |
72 | 89 | | ago |
|
0 commit comments