Skip to content

Commit

Permalink
Improve outbox UX
Browse files Browse the repository at this point in the history
  • Loading branch information
benpate committed Jan 28, 2024
1 parent d1474c3 commit 250d89b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 15 deletions.
33 changes: 18 additions & 15 deletions _embed/templates/user-outbox/outbox-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,29 @@
{{- range $index, $stream := $outbox -}}
{{- $document := $outboxRenderer.ActivityStream $stream.URL -}}
<hr>
<div class="hover-trigger">
<div hx-get="/{{$stream.Token}}" hx-push-url="true" role="link" class="flex-row h-entry margin-bottom">
<div class="hover-trigger flex-row">
<div hx-get="/{{$stream.Token}}" hx-push-url="true" role="link" class="width-100-percent flex-row h-entry margin-bottom">
<div class="flex-shrink-0" style="width:80px;">
<img src="{{$stream.AttributedTo.ImageURL}}" class="circle-64" loading="lazy">
</div>
<div style="flex-grow:1">
<div style="max-width:600px;">
{{- if ne "" $stream.Label -}}
<div class="h-name bold black">{{$stream.Label}}</div>
{{- end -}}
<div class="h-summary black">{{$stream.ContentHTML | html }}</div>
{{- if ne $stream.ImageURL ""}}
<div style="margin-top:var(--rhythm);">
<img src="{{$stream.ImageURL}}" loading="lazy" style="border:solid 1px var(--gray40); border-radius:16px; max-width:100%; object-fit:contain;">
</div>
{{- end -}}
<div class="text-sm text-light-gray p-published">{{$stream.PublishDate | humanizeTime}}</div>
</div>
<div class="flex-grow-1" style="max-width:600px;">
{{- if ne "" $stream.Label -}}
<div class="h-name bold black">{{$stream.Label}}</div>
{{- end -}}
<div class="h-summary black">{{$stream.ContentHTML | html }}</div>
{{- if ne $stream.ImageURL ""}}
<div style="margin-top:var(--rhythm);">
<img src="{{$stream.ImageURL}}" loading="lazy" style="border:solid 1px var(--gray40); border-radius:16px; max-width:100%; object-fit:contain;">
</div>
{{- end -}}
<div class="text-sm text-light-gray p-published">{{$stream.PublishDate | humanizeTime}}</div>
</div>
</div>
{{- if $outboxRenderer.UserCan "edit" -}}
<div class="text-sm">
<button hx-get="/{{$stream.ID}}/edit">Edit</button>
</div>
{{- end -}}
</div>
{{- end -}}

Expand Down
4 changes: 4 additions & 0 deletions model/streamSummary.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ func (summary StreamSummary) Fields() []string {
* Other Data Accessors
*************************************/

func (summary StreamSummary) ID() string {
return summary.ObjectID.Hex()
}

func (summary StreamSummary) Author() PersonLink {
return summary.AttributedTo
}
Expand Down

0 comments on commit 250d89b

Please sign in to comment.