mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 22:41:27 +00:00
Merge pull request #2775 from pixelfed/staging
Update liked by, fix remote username urls
This commit is contained in:
commit
014d6144f8
9 changed files with 23 additions and 5 deletions
|
@ -101,6 +101,7 @@
|
||||||
- Updated NotificationCard component, fix default value. ([78ad4e77](https://github.com/pixelfed/pixelfed/commit/78ad4e77))
|
- Updated NotificationCard component, fix default value. ([78ad4e77](https://github.com/pixelfed/pixelfed/commit/78ad4e77))
|
||||||
- Updated Timeline component, show counts and make sidebar footer lighter. ([0788bffa](https://github.com/pixelfed/pixelfed/commit/0788bffa))
|
- Updated Timeline component, show counts and make sidebar footer lighter. ([0788bffa](https://github.com/pixelfed/pixelfed/commit/0788bffa))
|
||||||
- Updated AuthServiceProvider, increase default token + refresh token lifetime. ([178ed63d](https://github.com/pixelfed/pixelfed/commit/178ed63d))
|
- Updated AuthServiceProvider, increase default token + refresh token lifetime. ([178ed63d](https://github.com/pixelfed/pixelfed/commit/178ed63d))
|
||||||
|
- Updated liked by, fix remote username urls. ([f767d99a](https://github.com/pixelfed/pixelfed/commit/f767d99a))
|
||||||
- ([](https://github.com/pixelfed/pixelfed/commit/))
|
- ([](https://github.com/pixelfed/pixelfed/commit/))
|
||||||
|
|
||||||
## [v0.10.10 (2021-01-28)](https://github.com/pixelfed/pixelfed/compare/v0.10.9...v0.10.10)
|
## [v0.10.10 (2021-01-28)](https://github.com/pixelfed/pixelfed/compare/v0.10.9...v0.10.10)
|
||||||
|
|
|
@ -199,8 +199,15 @@ class PublicApiController extends Controller
|
||||||
|
|
||||||
public function statusLikes(Request $request, $username, $id)
|
public function statusLikes(Request $request, $username, $id)
|
||||||
{
|
{
|
||||||
|
abort_if(!$request->user(), 404);
|
||||||
$status = Status::findOrFail($id);
|
$status = Status::findOrFail($id);
|
||||||
$this->scopeCheck($status->profile, $status);
|
$this->scopeCheck($status->profile, $status);
|
||||||
|
$page = $request->input('page');
|
||||||
|
if($page && $page >= 3 && $request->user()->profile_id != $status->profile_id) {
|
||||||
|
return response()->json([
|
||||||
|
'data' => []
|
||||||
|
]);
|
||||||
|
}
|
||||||
$likes = $this->getLikes($status);
|
$likes = $this->getLikes($status);
|
||||||
return response()->json([
|
return response()->json([
|
||||||
'data' => $likes
|
'data' => $likes
|
||||||
|
@ -209,9 +216,16 @@ class PublicApiController extends Controller
|
||||||
|
|
||||||
public function statusShares(Request $request, $username, $id)
|
public function statusShares(Request $request, $username, $id)
|
||||||
{
|
{
|
||||||
|
abort_if(!$request->user(), 404);
|
||||||
$profile = Profile::whereUsername($username)->whereNull('status')->firstOrFail();
|
$profile = Profile::whereUsername($username)->whereNull('status')->firstOrFail();
|
||||||
$status = Status::whereProfileId($profile->id)->findOrFail($id);
|
$status = Status::whereProfileId($profile->id)->findOrFail($id);
|
||||||
$this->scopeCheck($profile, $status);
|
$this->scopeCheck($profile, $status);
|
||||||
|
$page = $request->input('page');
|
||||||
|
if($page && $page >= 3 && $request->user()->profile_id != $status->profile_id) {
|
||||||
|
return response()->json([
|
||||||
|
'data' => []
|
||||||
|
]);
|
||||||
|
}
|
||||||
$shares = $this->getShares($status);
|
$shares = $this->getShares($status);
|
||||||
return response()->json([
|
return response()->json([
|
||||||
'data' => $shares
|
'data' => $shares
|
||||||
|
|
|
@ -71,13 +71,16 @@ class LikeService {
|
||||||
|
|
||||||
$id = $like->profile_id;
|
$id = $like->profile_id;
|
||||||
|
|
||||||
|
$profile = ProfileService::get($id);
|
||||||
|
$profileUrl = $profile['local'] ? $profile['url'] : '/i/web/profile/_/' . $profile['id'];
|
||||||
$res = [
|
$res = [
|
||||||
'username' => ProfileService::get($id)['username'],
|
'username' => $profile['username'],
|
||||||
'others' => $status->likes_count >= 5,
|
'url' => $profileUrl,
|
||||||
|
'others' => $status->likes_count >= 3,
|
||||||
];
|
];
|
||||||
|
|
||||||
if(request()->user() && request()->user()->profile_id == $status->profile_id) {
|
if(request()->user() && request()->user()->profile_id == $status->profile_id) {
|
||||||
$res['total_count'] = $status->likes_count;
|
$res['total_count'] = ($status->likes_count - 1);
|
||||||
$res['total_count_pretty'] = number_format($res['total_count']);
|
$res['total_count_pretty'] = number_format($res['total_count']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
BIN
public/js/network-timeline.js
vendored
BIN
public/js/network-timeline.js
vendored
Binary file not shown.
BIN
public/js/status.js
vendored
BIN
public/js/status.js
vendored
Binary file not shown.
BIN
public/js/timeline.js
vendored
BIN
public/js/timeline.js
vendored
Binary file not shown.
Binary file not shown.
|
@ -223,7 +223,7 @@
|
||||||
<div class="reaction-counts mb-0">
|
<div class="reaction-counts mb-0">
|
||||||
<div v-if="status.liked_by.username && status.liked_by.username !== user.username" class="likes mb-1">
|
<div v-if="status.liked_by.username && status.liked_by.username !== user.username" class="likes mb-1">
|
||||||
<span class="like-count">Liked by
|
<span class="like-count">Liked by
|
||||||
<a class="font-weight-bold text-dark" :href="'/'+status.liked_by.username">{{status.liked_by.username}}</a>
|
<a class="font-weight-bold text-dark" :href="status.liked_by.url">{{status.liked_by.username}}</a>
|
||||||
<span v-if="status.liked_by.others == true">
|
<span v-if="status.liked_by.others == true">
|
||||||
and <span class="font-weight-bold text-dark cursor-pointer" @click="likesModal"><span v-if="status.liked_by.total_count_pretty">{{status.liked_by.total_count_pretty}}</span> others</span>
|
and <span class="font-weight-bold text-dark cursor-pointer" @click="likesModal"><span v-if="status.liked_by.total_count_pretty">{{status.liked_by.total_count_pretty}}</span> others</span>
|
||||||
</span>
|
</span>
|
||||||
|
|
|
@ -226,7 +226,7 @@
|
||||||
|
|
||||||
<div v-if="status.liked_by.username && status.liked_by.username !== profile.username" class="likes mb-1">
|
<div v-if="status.liked_by.username && status.liked_by.username !== profile.username" class="likes mb-1">
|
||||||
<span class="like-count">Liked by
|
<span class="like-count">Liked by
|
||||||
<a class="font-weight-bold text-dark" :href="'/'+status.liked_by.username">{{status.liked_by.username}}</a>
|
<a class="font-weight-bold text-dark" :href="status.liked_by.url">{{status.liked_by.username}}</a>
|
||||||
<span v-if="status.liked_by.others == true">
|
<span v-if="status.liked_by.others == true">
|
||||||
and <span class="font-weight-bold" v-if="status.liked_by.total_count_pretty">{{status.liked_by.total_count_pretty}}</span> <span class="font-weight-bold">others</span>
|
and <span class="font-weight-bold" v-if="status.liked_by.total_count_pretty">{{status.liked_by.total_count_pretty}}</span> <span class="font-weight-bold">others</span>
|
||||||
</span>
|
</span>
|
||||||
|
|
Loading…
Reference in a new issue