{{define "title"}}Message Inbox{{end}} {{define "content"}}
{{$Root := .}} {{$UserMap := .UserMap}} {{$Request := .Request}}
{{if .ViewThread}}
To:
{{template "avatar-24x24" .ReplyTo}}
{{InputCSRF}}

Markdown formatting supported.

Reminder: don't share sensitive information over Direct Messages. Please review the Privacy Policy and Terms of Service as it pertains to DMs on the main website and the chat room.

{{range .ViewThread}}
{{$SourceUser := $UserMap.Get .SourceUserID}}
{{template "avatar-64x64" $SourceUser}}

{{$SourceUser.NameOrUsername}} {{if $SourceUser.IsAdmin}} Admin {{end}}

{{$SourceUser.Username}} {{if not $SourceUser.Certified}} Not Certified! {{end}}

{{ToMarkdown .Message}} {{if and (ne .SourceUserID $Root.CurrentUser.ID) .IsLikelySpam}}

Be careful about possible scams!

If @{{$Root.ReplyTo.Username}} is asking to take you to a messenger app within the first couple of messages, be wary! It is a well-known tactic for con artists to move your conversation away to another platform as soon as possible, in order to evade detection from the website.

Please report this message if you think it may be a scam. The certification requirement for {{PrettyTitle}} cannot guarantee protection against malicious intent.

{{end}}
Sent {{SincePrettyCoarse .CreatedAt}} ago {{if not .Read}}UNREAD{{end}} {{if eq $Root.CurrentUser.ID $SourceUser.ID}}
{{InputCSRF}}
{{end}}

{{end}}
Found {{.ThreadPager.Total}} message{{Pluralize64 .ThreadPager.Total}} in this thread (page {{.ThreadPager.Page}} of {{.ThreadPager.Pages}}).
{{InputCSRF}}
{{if .ThreadPager.HasPrevious}} Previous {{end}} {{if .ThreadPager.HasNext}} Next Page {{end}}
{{else}}

You have {{.Unread}} unread message{{Pluralize64 .Unread}}. Select a message on the other column to read the conversation here.

Pro Tip: Do you get a lot of thirsty, unsolicited messages from strangers and wish you could do something about that? In your Privacy Settings there is an option to limit who can slide into your DMs. You can always reach out first and start a chat with someone regardless of this setting.

{{end}}
{{if eq .Box "threads"}}
Showing {{.Pager.Total}} conversation threads with others (ordered by most recent, grouped by sender name). Note: messages you have Sent but which have not been replied to will only appear on the "Sent" tab.
{{else if eq .Box "inbox"}}
Showing all {{.Pager.Total}} inbound messages to you, ordered by most recent.
{{else if eq .Box "sent"}}
Showing {{.Pager.Total}} messages sent by you to other people.
{{end}} {{range .Messages}} {{end}}
{{if eq $Root.Box "sent"}} {{$User := $UserMap.Get .TargetUserID}}
Sent To
{{template "avatar-24x24" $User}}
{{$User.Username}}
{{else}} {{$User := $UserMap.Get .SourceUserID}}
From
{{template "avatar-24x24" $User}}
{{$User.Username}}
{{end}}
Found {{.Pager.Total}} {{if eq .Box "threads"}}conversation{{else}}message{{end}}{{Pluralize64 .Pager.Total}} (page {{.Pager.Page}} of {{.Pager.Pages}}).
{{if .Pager.HasPrevious}} Previous {{end}} {{if .Pager.HasNext}} Next Page {{end}}
{{end}} {{define "scripts"}} {{end}}