mirror of https://github.com/pixelfed/pixelfed
Update legacy components to properly handle follow/unfollowing
parent
87dfc55b43
commit
60fbf0e7d5
@ -1,121 +0,0 @@
|
||||
@extends('layouts.app',['title' => $user->username . " on " . config('app.name')])
|
||||
|
||||
@section('content')
|
||||
@if (session('error'))
|
||||
<div class="alert alert-danger text-center font-weight-bold mb-0">
|
||||
{{ session('error') }}
|
||||
</div>
|
||||
@endif
|
||||
@include('profile.partial.user-info')
|
||||
|
||||
@if(true === $owner)
|
||||
<div>
|
||||
<ul class="nav nav-topbar d-flex justify-content-center border-0">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link {{request()->is($user->username) ? 'active': ''}} font-weight-bold text-uppercase" href="{{$user->url()}}">Posts</a>
|
||||
</li>
|
||||
{{-- <li class="nav-item">
|
||||
<a class="nav-link {{request()->is('*/collections') ? 'active': ''}} font-weight-bold text-uppercase" href="{{$user->url()}}/collections">Collections</a>
|
||||
</li> --}}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link {{request()->is('*/saved') ? 'active':''}} font-weight-bold text-uppercase" href="{{$user->url('/saved')}}">Saved</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
<div class="container">
|
||||
@if($owner && request()->is('*/saved'))
|
||||
<div class="col-12">
|
||||
<p class="text-muted font-weight-bold small">{{__('profile.savedWarning')}}</p>
|
||||
</div>
|
||||
@endif
|
||||
<div class="profile-timeline mt-2 mt-md-4">
|
||||
<div class="row">
|
||||
@if($timeline->count() > 0)
|
||||
@foreach($timeline as $status)
|
||||
<div class="col-4 p-0 p-sm-2 p-md-3">
|
||||
<a class="card info-overlay card-md-border-0" href="{{$status->url()}}">
|
||||
<div class="square {{$status->firstMedia()->filter_class}}">
|
||||
@switch($status->viewType())
|
||||
@case('album')
|
||||
@case('photo:album')
|
||||
<span class="float-right mr-3" style="color:#fff;position:relative;margin-top:10px;z-index: 999999;opacity:0.6;text-shadow: 3px 3px 16px #272634;"><i class="fas fa-images fa-2x"></i></span>
|
||||
@break
|
||||
@case('video')
|
||||
<span class="float-right mr-3" style="color:#fff;position:relative;margin-top:10px;z-index: 999999;opacity:0.6;text-shadow: 3px 3px 16px #272634;"><i class="fas fa-video fa-2x"></i></span>
|
||||
@break
|
||||
@case('video-album')
|
||||
<span class="float-right mr-3" style="color:#fff;position:relative;margin-top:10px;z-index: 999999;opacity:0.6;text-shadow: 3px 3px 16px #272634;"><i class="fas fa-film fa-2x"></i></span>
|
||||
@break
|
||||
@endswitch
|
||||
<div class="square-content" style="background-image: url('{{$status->thumb()}}')">
|
||||
</div>
|
||||
<div class="info-overlay-text">
|
||||
<h5 class="text-white m-auto font-weight-bold">
|
||||
<span>
|
||||
<span class="far fa-heart fa-lg p-2 d-flex-inline"></span>
|
||||
<span class="d-flex-inline">{{App\Util\Lexer\PrettyNumber::convert($status->likes_count)}}</span>
|
||||
</span>
|
||||
<span>
|
||||
<span class="far fa-comment fa-lg p-2 d-flex-inline"></span>
|
||||
<span class="d-flex-inline">{{App\Util\Lexer\PrettyNumber::convert($status->comments_count)}}</span>
|
||||
</span>
|
||||
</h5>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
<div class="pagination-container">
|
||||
<div class="d-flex justify-content-center">
|
||||
{{$timeline->links()}}
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body py-5 my-5">
|
||||
<div class="d-flex my-5 py-5 justify-content-center align-items-center">
|
||||
@if($owner && request()->is('*/saved'))
|
||||
<p class="lead font-weight-bold">{{ __('profile.emptySaved') }}</p>
|
||||
@else
|
||||
<p class="lead font-weight-bold">{{ __('profile.emptyTimeline') }}</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
@push('meta')<meta property="og:description" content="{{$user->bio}}">
|
||||
<meta property="og:image" content="{{$user->avatarUrl()}}">
|
||||
<link href="{{$user->permalink('.atom')}}" rel="alternate" title="{{$user->username}} on Pixelfed" type="application/atom+xml">
|
||||
@if(false == $settings->crawlable || $user->remote_url)
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
@endif
|
||||
@endpush
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$('.pagination-container').hide();
|
||||
$('.pagination').hide();
|
||||
let elem = document.querySelector('.profile-timeline');
|
||||
let infScroll = new InfiniteScroll( elem, {
|
||||
path: '.pagination__next',
|
||||
append: '.profile-timeline .row',
|
||||
status: '.page-load-status',
|
||||
history: false,
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
@endpush
|
||||
|
||||
@ -1,92 +0,0 @@
|
||||
<div class="bg-white py-5 border-bottom">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-4 d-flex">
|
||||
<div class="profile-avatar mx-auto">
|
||||
<img class="rounded-circle box-shadow" src="{{$user->avatarUrl()}}" width="172px" height="172px">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-md-8 d-flex align-items-center">
|
||||
<div class="profile-details">
|
||||
<div class="username-bar pb-2 d-flex align-items-center">
|
||||
<span class="font-weight-ultralight h1">{{$user->username}}</span>
|
||||
@if($is_admin == true)
|
||||
<span class="pl-4">
|
||||
<span class="btn btn-outline-danger font-weight-bold py-0">ADMIN</span>
|
||||
</span>
|
||||
@endif
|
||||
@if($owner == true)
|
||||
<span class="pl-4">
|
||||
<a class="fas fa-cog fa-lg text-muted" href="{{route('settings')}}"></a>
|
||||
</span>
|
||||
@elseif (Auth::check() && $is_following == true)
|
||||
<span class="pl-4">
|
||||
<form class="follow-form" method="post" action="/i/follow" style="display: inline;" data-id="{{$user->id}}" data-action="unfollow">
|
||||
@csrf
|
||||
<input type="hidden" name="item" value="{{$user->id}}">
|
||||
<button class="btn btn-outline-secondary font-weight-bold px-4 py-0" type="submit">Unfollow</button>
|
||||
</form>
|
||||
</span>
|
||||
@elseif (Auth::check() && $is_following == false)
|
||||
<span class="pl-4">
|
||||
<form class="follow-form" method="post" action="/i/follow" style="display: inline;" data-id="{{$user->id}}" data-action="follow">
|
||||
@csrf
|
||||
<input type="hidden" name="item" value="{{$user->id}}">
|
||||
<button class="btn btn-primary font-weight-bold px-4 py-0" type="submit">Follow</button>
|
||||
</form>
|
||||
</span>
|
||||
@endif
|
||||
{{-- <span class="pl-4">
|
||||
<div class="dropdown">
|
||||
<button class="btn btn-link text-muted dropdown-toggle py-0" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" style="text-decoration: none;">
|
||||
<i class="fas fa-ellipsis-v"></i>
|
||||
</button>
|
||||
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
|
||||
<a class="dropdown-item font-weight-bold" href="#">Report User</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item font-weight-bold" href="#">Mute User</a>
|
||||
<a class="dropdown-item font-weight-bold" href="#">Block User</a>
|
||||
<a class="dropdown-item font-weight-bold mute-users" href="#">Mute User & User Followers</a>
|
||||
<a class="dropdown-item font-weight-bold" href="#">Block User & User Followers</a>
|
||||
</div>
|
||||
</div>
|
||||
</span>
|
||||
--}}
|
||||
</div>
|
||||
<div class="profile-stats pb-3 d-inline-flex lead">
|
||||
<div class="font-weight-light pr-5">
|
||||
<a class="text-dark" href="{{$user->url()}}">
|
||||
<span class="font-weight-bold">{{$user->statusCount()}}</span>
|
||||
Posts
|
||||
</a>
|
||||
</div>
|
||||
@if($settings->show_profile_follower_count)
|
||||
<div class="font-weight-light pr-5">
|
||||
<a class="text-dark" href="{{$user->url('/followers')}}">
|
||||
<span class="font-weight-bold">{{$user->followerCount(true)}}</span>
|
||||
Followers
|
||||
</a>
|
||||
</div>
|
||||
@endif
|
||||
@if($settings->show_profile_following_count)
|
||||
<div class="font-weight-light pr-5">
|
||||
<a class="text-dark" href="{{$user->url('/following')}}">
|
||||
<span class="font-weight-bold">{{$user->followingCount(true)}}</span>
|
||||
Following
|
||||
</a>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
<p class="lead mb-0 d-flex align-items-center">
|
||||
<span class="font-weight-bold pr-3">{{$user->name}}</span>
|
||||
@if($user->remote_url)
|
||||
<span class="btn btn-outline-secondary btn-sm py-0">REMOTE PROFILE</span>
|
||||
@endif
|
||||
</p>
|
||||
<div class="mb-0 lead" v-pre>{!!str_limit($user->bio, 127)!!}</div>
|
||||
<p class="mb-0"><a href="{{$user->website}}" class="font-weight-bold" rel="me external nofollow noopener" target="_blank">{{str_limit($user->website, 30)}}</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Loading…
Reference in New Issue