forked from hackorum-dev/hackorum
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_recent_threads.html.slim
More file actions
91 lines (90 loc) · 3.8 KB
/
_recent_threads.html.slim
File metadata and controls
91 lines (90 loc) · 3.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
.profile-section
- if activity_period
- case activity_period[:type]
- when :day
h2 Messages on #{activity_period[:date].strftime('%B %d, %Y')}
- when :week
h2 Messages in week #{activity_period[:week]} (#{activity_period[:start_date].strftime('%b %d')} - #{activity_period[:end_date].strftime('%b %d, %Y')})
- when :month
h2 Messages in #{Date.new(activity_period[:year], activity_period[:month], 1).strftime('%B %Y')}
- when :recent
h2 Recent messages (last 30 days)
- else
h2 Recent messages (last 30 days)
- if activity_entries.any?
- show_sender = local_assigns.fetch(:show_sender, false)
- summary = local_assigns[:activity_summary] || {}
- total = summary[:total] || activity_entries.size
- started = summary[:started_thread] || 0
- replied_own = summary[:replied_own_thread] || 0
- replied_other = summary[:replied_other_thread] || 0
- replied_other_topics = summary[:replied_other_topics] || 0
- first_patch = summary[:sent_first_patch] || 0
- followup_patch = summary[:sent_followup_patch] || 0
.activity-summary
span.activity-summary-total #{total} messages
span.activity-summary-item
span.activity-tag.tag-started = started
| started threads
span.activity-summary-item
span.activity-tag.tag-replied = replied_own
| replied (own)
span.activity-summary-item
span.activity-tag.tag-replied = replied_other
| replied (other)
span.activity-summary-item
span.activity-tag.tag-replied = replied_other_topics
| other threads
span.activity-summary-item
span.activity-tag.tag-patch = first_patch
| first patch
span.activity-summary-item
span.activity-tag.tag-patch = followup_patch
| follow-up patch
table.activity-table
thead
tr
th Activity
- if show_sender
th Sender
th Thread
th Sent
tbody
- activity_entries.each do |entry|
- topic = entry[:topic]
- message = entry[:message]
- types = entry[:activity_types] || []
tr
td.activity-types
- types.each do |type|
- case type
- when :started_thread
span.activity-tag.tag-started Started thread
- when :replied_own_thread
span.activity-tag.tag-replied Replied (own)
- when :replied_other_thread
span.activity-tag.tag-replied Replied (other)
- when :sent_first_patch
span.activity-tag.tag-patch First patch
- when :sent_followup_patch
span.activity-tag.tag-patch Follow-up patch
- if show_sender
- sender_alias = message.sender_display_alias
td
- if sender_alias && message.sender_person
= link_to person_path(sender_alias.email), class: "activity-sender", data: { turbo_frame: "_top" } do
= image_tag sender_alias.gravatar_url(size: 32), class: "activity-sender-avatar", alt: sender_alias.name
span.activity-sender-name = sender_alias.name
- elsif sender_alias
.activity-sender
= image_tag sender_alias.gravatar_url(size: 32), class: "activity-sender-avatar", alt: sender_alias.name
span.activity-sender-name = sender_alias.name
- else
span.activity-sender-name Unknown
td
= link_to topic.title, topic_path(topic, anchor: "message-#{message.id}"), class: "activity-topic", data: { turbo_frame: "_top" }
td
= time_ago_in_words(entry[:sent_at])
| ago
- else
p No recent activity.