feat: Add webmention counts and icons for replies, likes, and reposts.

- Add new SVG icons for the "reply", "like", and "repost" actions
- Update webmention info display in note template to include counts and icons for replies, likes, and reposts
- Add webmention counts to FrontPageController.php and modify queries in NotesController.php
- Modify WebMentionsTableSeeder.php to change URLs, commentable ID, and add new WebMentions
This commit is contained in:
Jonny Barnes 2023-11-25 16:08:07 +00:00
parent 5bc03f36d2
commit 92098a793e
Signed by: jonny
SSH key fingerprint: SHA256:CTuSlns5U7qlD9jqHvtnVmfYV3Zwl2Z7WnJ4/dqOaL8
15 changed files with 179 additions and 35 deletions

View file

@ -25,29 +25,36 @@
</div>
@endforeach
@if($note->webmentions->filter(function ($webmention) {
return ($webmention->type == 'like-of');
})->count() > 0) <h1 class="notes-subtitle">Likes</h1>
@foreach($note->webmentions->filter(function ($webmention) {
return ($webmention->type == 'like-of');
}) as $like)
<a href="{{ $like['author']['properties']['url'][0] }}"><img src="{{ $like['author']['properties']['photo'][0] }}" alt="profile picture of {{ $like['author']['properties']['name'][0] }}" class="like-photo"></a>
@endforeach
return ($webmention->type === 'like-of');
})->count() > 0)
<h1 class="notes-subtitle">Likes</h1>
<div class="webmentions-author-list">
@foreach($note->webmentions->filter(function ($webmention) {
return ($webmention->type === 'like-of');
}) as $like)
<a href="{{ $like['author']['properties']['url'][0] }}">
<img src="{{ $like['author']['properties']['photo'][0] }}" alt="profile picture of {{ $like['author']['properties']['name'][0] }}" class="like-photo">
</a>
@endforeach
</div>
@endif
@if($note->webmentions->filter(function ($webmention) {
return ($webmention->type == 'repost-of');
})->count() > 0) <h1 class="notes-subtitle">Reposts</h1>
@foreach($note->webmentions->filter(function ($webmention) {
return ($webmention->type == 'repost-of');
}) as $repost)
<p>
<a class="h-card vcard mini-h-card p-author" href="{{ $repost['author']['properties']['url'][0] }}">
<img src="{{ $repost['author']['properties']['photo'][0] }}" alt="profile picture of {{ $repost['author']['properties']['name'][0] }}" class="photo u-photo logo"> <span class="fn">{{ $repost['author']['properties']['name'][0] }}</span>
</a> reposted this at <a href="{{ $repost['source'] }}">{{ $repost['published'] }}</a>.
</p>
@endforeach
return ($webmention->type === 'repost-of');
})->count() > 0)
<h1 class="notes-subtitle">Reposts</h1>
<div class="webmentions-author-list">
@foreach($note->webmentions->filter(function ($webmention) {
return ($webmention->type == 'repost-of');
}) as $repost)
<a href="{{ $repost['source'] }}">
<img src="{{ $repost['author']['properties']['photo'][0] }}" alt="{{ $repost['author']['properties']['name'][0] }} reposted this at {{ $repost['published'] }}">
</a>
@endforeach
</div>
@endif
@stop
@section('scripts')
<link rel="stylesheet" href="/assets/highlight/zenburn.css">
@parent
<link rel="stylesheet" href="/assets/highlight/zenburn.css">
@stop