mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-19 13:01:26 +00:00
Merge pull request #817 from pixelfed/frontend-ui-refactor
Frontend ui refactor
This commit is contained in:
commit
432e7505b3
2 changed files with 21 additions and 112 deletions
|
@ -66,18 +66,9 @@ class ProfileController extends Controller
|
||||||
if ($isPrivate == true || $isBlocked == true) {
|
if ($isPrivate == true || $isBlocked == true) {
|
||||||
return view('profile.private', compact('user', 'is_following'));
|
return view('profile.private', compact('user', 'is_following'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$is_admin = is_null($user->domain) ? $user->user->is_admin : false;
|
$is_admin = is_null($user->domain) ? $user->user->is_admin : false;
|
||||||
$timeline = $user->statuses()
|
$profile = $user;
|
||||||
->whereHas('media')
|
return view('profile.show', compact('user', 'profile', 'settings', 'owner', 'is_following', 'is_admin', 'timeline'));
|
||||||
->whereNull('in_reply_to_id')
|
|
||||||
->whereNull('reblog_of_id')
|
|
||||||
->whereIn('visibility', ['public', 'unlisted'])
|
|
||||||
->orderBy('created_at', 'desc')
|
|
||||||
->withCount(['comments', 'likes'])
|
|
||||||
->simplePaginate(21);
|
|
||||||
|
|
||||||
return view('profile.show', compact('user', 'settings', 'owner', 'is_following', 'is_admin', 'timeline'));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function permalinkRedirect(Request $request, $username)
|
public function permalinkRedirect(Request $request, $username)
|
||||||
|
@ -130,6 +121,7 @@ class ProfileController extends Controller
|
||||||
{
|
{
|
||||||
switch ($profile->status) {
|
switch ($profile->status) {
|
||||||
case 'disabled':
|
case 'disabled':
|
||||||
|
case 'suspended':
|
||||||
case 'delete':
|
case 'delete':
|
||||||
return view('profile.disabled');
|
return view('profile.disabled');
|
||||||
break;
|
break;
|
||||||
|
@ -248,4 +240,13 @@ class ProfileController extends Controller
|
||||||
$is_admin = is_null($user->domain) ? $user->user->is_admin : false;
|
$is_admin = is_null($user->domain) ? $user->user->is_admin : false;
|
||||||
return view('profile.show', compact('user', 'settings', 'owner', 'following', 'timeline', 'is_following', 'is_admin'));
|
return view('profile.show', compact('user', 'settings', 'owner', 'following', 'timeline', 'is_following', 'is_admin'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function createCollection(Request $request)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function collections(Request $request)
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
@extends('layouts.app',['title' => $user->username . " on " . config('app.name')])
|
@extends('layouts.app',['title' => $profile->username . " on " . config('app.name')])
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
@if (session('error'))
|
@if (session('error'))
|
||||||
|
@ -6,116 +6,24 @@
|
||||||
{{ session('error') }}
|
{{ session('error') }}
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
@include('profile.partial.user-info')
|
|
||||||
|
|
||||||
@if(true === $owner)
|
<profile profile-id="{{$profile->id}}"></profile>
|
||||||
<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
|
@endsection
|
||||||
|
|
||||||
@push('meta')<meta property="og:description" content="{{$user->bio}}">
|
@push('meta')<meta property="og:description" content="{{$profile->bio}}">
|
||||||
<meta property="og:image" content="{{$user->avatarUrl()}}">
|
<meta property="og:image" content="{{$profile->avatarUrl()}}">
|
||||||
<link href="{{$user->permalink('.atom')}}" rel="alternate" title="{{$user->username}} on PixelFed" type="application/atom+xml">
|
<link href="{{$profile->permalink('.atom')}}" rel="alternate" title="{{$profile->username}} on PixelFed" type="application/atom+xml">
|
||||||
@if(false == $settings->crawlable || $user->remote_url)
|
@if(false == $settings->crawlable || $profile->remote_url)
|
||||||
<meta name="robots" content="noindex, nofollow">
|
<meta name="robots" content="noindex, nofollow">
|
||||||
@endif
|
@endif
|
||||||
@endpush
|
@endpush
|
||||||
|
|
||||||
@push('scripts')
|
@push('scripts')
|
||||||
|
<script type="text/javascript" src="{{ mix('js/profile.js') }}"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).ready(function() {
|
new Vue({
|
||||||
$('.pagination-container').hide();
|
el: '#content'
|
||||||
$('.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>
|
</script>
|
||||||
|
|
||||||
@endpush
|
@endpush
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue