Skip to content

Commit

Permalink
Inbox UX progress
Browse files Browse the repository at this point in the history
  • Loading branch information
benpate committed Nov 26, 2023
1 parent 7d01ec2 commit 673562b
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 29 deletions.
11 changes: 10 additions & 1 deletion _embed/templates/user-inbox/list-before.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@

{{- range $index, $message := $inbox -}}

{{- $stream := $inboxRenderer.ActivityStream $message.URL -}}
{{- $stats := $stream.Statistics -}}

<div
id="item_{{.MessageID.Hex}}"
role="button"
Expand All @@ -46,7 +49,13 @@
{{- end -}}
</div>

{{- $inboxRenderer.Responses $message -}}
<div class="space-above">
{{ $stats.Replies }} Replies &middot;
{{ $stats.Likes }} Likes &middot;
{{ $stats.Announces }} Shares &middot;
{{- $inboxRenderer.Responses $message -}}
</div>

<hr>

{{- end -}}
Expand Down
6 changes: 6 additions & 0 deletions _embed/templates/user-inbox/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
{{- $inboxRenderer := . -}}
{{- range $index, $message := $inbox -}}

{{- $stream := $inboxRenderer.ActivityStream $message.URL -}}
{{- $stats := $stream.Statistics -}}

<div
id="item_{{.MessageID.Hex}}"
role="button"
Expand All @@ -57,6 +60,9 @@
</div>

<div class="space-above">
{{ $stats.Replies }} Replies &middot;
{{ $stats.Likes }} Likes &middot;
{{ $stats.Announces }} Shares &middot;
{{- $inboxRenderer.Responses $message -}}
</div>

Expand Down
24 changes: 24 additions & 0 deletions _embed/templates/user-message/activity.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{{- if ne "" .Name -}}
<h1><a href="{{.URL}}" target="_blank" class="text-black">{{.Name}}</a></h1>
{{- end -}}

<div class="content space-above space-below">
{{- $image := .Image -}}
{{- if $image.NotNil -}}
<div class="space-below">
<a href="{{.URL}}" target="_blank"><img src="{{$image.URL}}" style="width:100%;
{{- if $image.HasDimensions}} aspect-ratio:{{$image.AspectRatio}};{{end}}"/></a>
</div>
{{- end -}}

<div class="text-gray flex-row">
<div class="bold">{{ .Published | longDate -}}</div>
</div>

{{- if .HasContent -}}
<div>{{- .Content | html -}}</div>
{{- else if .HasSummary -}}
<div>{{- .Summary -}}</div>
{{- end -}}

</div>
31 changes: 3 additions & 28 deletions _embed/templates/user-message/view.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{{- $activity := .ActivityStream -}}

<div id="modal-body" script="install message(messageId:'{{.MessageID}}')">

<div class="space-below">
Expand Down Expand Up @@ -82,34 +84,7 @@
</a>
{{- end -}}

{{- if ne "" .Label -}}
<h1><a href="{{.URL}}" target="_blank" class="text-black">{{.Label}}</a></h1>
{{- end -}}

<div class="content space-above space-below">
{{- if not .HasContentImage -}}
{{- if .HasImage -}}
<div class="space-below">
<a href="{{.URL}}" target="_blank"><img src="{{.ImageURL}}" style="width:100%;"/></a>
</div>
{{- end -}}
{{- end -}}

<div class="text-gray flex-row">
<div class="bold">{{ .PublishDate | longDate -}}</div>
{{.Responses}}
</div>

{{- if .HasSummary -}}
{{- if .HasContent -}}
<div>{{- .ContentHTML -}}</div>
{{- else -}}
<div>{{- .Summary | html -}}</div>
{{- end -}}
{{- else -}}
<div>{{- .ContentHTML -}}</div>
{{- end -}}
</div>
{{ template "activity" $activity -}}

<div id="replies" class="space-below">
<hr>
Expand Down

0 comments on commit 673562b

Please sign in to comment.