mirror of https://gitlab.com/ngerakines/tavern.git
65 lines
3.4 KiB
HTML
65 lines
3.4 KiB
HTML
{{ define "activity_create_note" }}
|
|
{{ $actors := .actors }}
|
|
{{ $announcements := .announcements }}
|
|
{{ with $item := .item }}
|
|
{{ with $note := $item.create_note}}
|
|
<li class="media mb-3 border-top border-secondary pt-2">
|
|
<i class="fas fa-comment align-self-start fa-2x mr-3 text-secondary"></i>
|
|
<div class="media-body">
|
|
<p>
|
|
<img src="{{- $actors.Lookup "icon" $note.author -}}?size=14" alt="icon" />
|
|
{{ if $note.in_reply_to }}
|
|
<a href="{{ $note.author }}">
|
|
{{- $actors.Lookup "name" $note.author -}}
|
|
</a>
|
|
replied to
|
|
{{ if $note.in_reply_to_author }}
|
|
<a href="{{ $note.in_reply_to }}">
|
|
{{- $actors.Lookup "name" $note.in_reply_to_author -}}
|
|
</a>
|
|
{{ else }}
|
|
<a href="{{ $note.in_reply_to }}"><u>a note</u></a>
|
|
{{ end }}
|
|
{{ else }}
|
|
<a href="{{ $note.author }}">
|
|
{{- $actors.Lookup "name" $note.author -}}
|
|
</a> wrote
|
|
{{ end }}
|
|
on {{ datetime $note.published_at }}
|
|
</p>
|
|
{{- $note.content | toHTML -}}
|
|
<div class="card">
|
|
{{ if or $note.tags $note.mentions }}
|
|
<div class="card-body m-1 p-1">
|
|
{{ if $note.tags}}
|
|
Tags:
|
|
{{ range $tag, $tagLink := $note.tags }}
|
|
<a href="{{ $tagLink }}">{{ $tag }}</a>
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ if $note.mentions }}
|
|
Mentions:
|
|
{{ range $tag, $tagLink := $note.mentions }}
|
|
<a class="card-link" href="{{ $tagLink }}">{{ $tag }}</a>
|
|
{{ end }}
|
|
{{ end }}
|
|
</div>
|
|
{{ end }}
|
|
<div class="card-body m-1 p-1">
|
|
{{ if eq true (lookupBool $announcements $note.object_id false) }}
|
|
<a href="#" class="btn btn-primary btn-sm disabled"
|
|
data-object="{{ $note.object_id }}">Announced</a>
|
|
{{ else }}
|
|
<a href="#" class="btn btn-primary btn-sm announce"
|
|
data-object="{{ $note.object_id }}">Announce</a>
|
|
{{ end }}
|
|
{{- if $note.conversation -}}
|
|
<a href="{{ url "compose" }}?inReplyTo={{ urlEncode $note.object_id }}" class="btn btn-primary btn-sm">Reply</a>
|
|
{{ end }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</li>
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ end }} |