{{define "notification"}} {{$notification := (notification .NotificationID)}}
{{if (not (eq $notification.ActionUserID 0))}}
{{template "circle-profile-img" (user $notification.ActionUserID)}} {{/*template "author-info" (user $notification.ActionUserID)*/}} {{if (gt (len $notification.UserIDs) 1)}} {{$max_display_users := 10}} {{range $i, $user_id := $notification.UserIDs}} {{if (ne $user_id $notification.ActionUserID)}} {{/* don't duplicate main user */}} {{/* Only render the first 10-ish users */}} {{if (lt $i $max_display_users)}} {{template "circle-profile-img" (user $user_id)}} {{end}} {{end}} {{end}} {{if (gt (len $notification.UserIDs) (add $max_display_users 1))}} ... {{end}} {{end}}
{{end}}
{{if (eq $notification.Type 1)}} {{/* LIKE */}} {{(user $notification.ActionUserID).DisplayName}} liked your tweet {{else if (eq $notification.Type 2)}} {{/* RETWEET */}} {{(user $notification.ActionUserID).DisplayName}} retweeted you {{else if (eq $notification.Type 3)}} {{/* QUOTE_TWEET */}} {{(user $notification.ActionUserID).DisplayName}} quote-tweeted you {{else if (eq $notification.Type 4)}} {{/* REPLY */}} {{(user $notification.ActionUserID).DisplayName}} replied to you {{else if (eq $notification.Type 5)}} {{/* FOLLOW */}} {{(user $notification.ActionUserID).DisplayName}} followed you! {{else if (eq $notification.Type 6)}} {{/* MENTION */}} {{(user $notification.ActionUserID).DisplayName}} mentioned you {{else if (eq $notification.Type 7)}} {{/* USER_IS_LIVE */}} {{(user $notification.ActionUserID).DisplayName}} is live {{else if (eq $notification.Type 8)}} {{/* POLL_ENDED */}} Poll ended. {{else if (eq $notification.Type 9)}} {{/* LOGIN */}} New login on your account. {{else if (eq $notification.Type 10)}} {{/* COMMUNITY_PINNED_POST */}} {{(user $notification.ActionUserID).DisplayName}} posted in community {{else if (eq $notification.Type 11)}} {{/* RECOMMENDED_POST */}} You've been recommended a post from {{(user $notification.ActionUserID).DisplayName}} {{else}} {{"<>: "}}{{$notification.Type}} {{end}}
{{if (ne .TweetID 0)}} {{template "tweet" .}} {{end}}
{{end}}