Merge pull request #2859 from pixelfed/staging

Staging
This commit is contained in:
daniel 2021-07-20 23:17:26 -06:00 committed by GitHub
commit e86b4d8007
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 162 additions and 129 deletions

View file

@ -65,6 +65,8 @@
- Updated presenters, improve content warnings. ([86422c81](https://github.com/pixelfed/pixelfed/commit/86422c81)) - Updated presenters, improve content warnings. ([86422c81](https://github.com/pixelfed/pixelfed/commit/86422c81))
- Updated Timeline.vue, increase pagination limit from 3 to 12 and add empty feed placeholder. ([916e8f71](https://github.com/pixelfed/pixelfed/commit/916e8f71)) - Updated Timeline.vue, increase pagination limit from 3 to 12 and add empty feed placeholder. ([916e8f71](https://github.com/pixelfed/pixelfed/commit/916e8f71))
- Updated Timeline.vue, improve followed hashtags. ([728f10d7](https://github.com/pixelfed/pixelfed/commit/728f10d7)) - Updated Timeline.vue, improve followed hashtags. ([728f10d7](https://github.com/pixelfed/pixelfed/commit/728f10d7))
- Updated PostComponent, use profileUrl method for comments. ([7ed65fc9](https://github.com/pixelfed/pixelfed/commit/7ed65fc9))
- Updated Timeline, fix empty timeline card. ([11eb6acd](https://github.com/pixelfed/pixelfed/commit/11eb6acd))
- ([](https://github.com/pixelfed/pixelfed/commit/)) - ([](https://github.com/pixelfed/pixelfed/commit/))
## [v0.11.0 (2021-06-01)](https://github.com/pixelfed/pixelfed/compare/v0.10.10...v0.11.0) ## [v0.11.0 (2021-06-01)](https://github.com/pixelfed/pixelfed/compare/v0.10.10...v0.11.0)

View file

@ -364,6 +364,8 @@ class StatusController extends Controller
if($photos >= 1 && $videos >= 1) { if($photos >= 1 && $videos >= 1) {
return 'photo:video:album'; return 'photo:video:album';
} }
return 'text';
} }
public function toggleVisibility(Request $request) { public function toggleVisibility(Request $request) {

View file

@ -416,6 +416,7 @@ class Helpers {
public static function importNoteAttachment($data, Status $status) public static function importNoteAttachment($data, Status $status)
{ {
if(self::verifyAttachments($data) == false) { if(self::verifyAttachments($data) == false) {
$status->viewType();
return; return;
} }
$attachments = isset($data['object']) ? $data['object']['attachment'] : $data['attachment']; $attachments = isset($data['object']) ? $data['object']['attachment'] : $data['attachment'];

BIN
public/js/profile.js vendored

Binary file not shown.

BIN
public/js/rempos.js vendored

Binary file not shown.

BIN
public/js/status.js vendored

Binary file not shown.

BIN
public/js/timeline.js vendored

Binary file not shown.

Binary file not shown.

View file

@ -149,7 +149,7 @@
<div class="media-body"> <div class="media-body">
<div v-if="reply.sensitive == true"> <div v-if="reply.sensitive == true">
<span class="py-3"> <span class="py-3">
<a class="text-dark font-weight-bold mr-1" :href="reply.account.url" v-bind:title="reply.account.username">{{truncate(reply.account.username,15)}}</a> <a class="text-dark font-weight-bold mr-1" :href="profileUrl(reply)" v-bind:title="reply.account.username">{{!reply.account.local ? '@' : '' }}{{truncate(reply.account.username,15)}}</a>
<span class="text-break"> <span class="text-break">
<span class="font-italic text-muted">This comment may contain sensitive material</span> <span class="font-italic text-muted">This comment may contain sensitive material</span>
<span class="text-primary cursor-pointer pl-1" @click="reply.sensitive = false;">Show</span> <span class="text-primary cursor-pointer pl-1" @click="reply.sensitive = false;">Show</span>
@ -159,7 +159,7 @@
<div v-else> <div v-else>
<p class="d-flex justify-content-between align-items-top read-more" style="overflow-y: hidden;"> <p class="d-flex justify-content-between align-items-top read-more" style="overflow-y: hidden;">
<span> <span>
<a class="text-dark font-weight-bold mr-1 text-break" :href="reply.account.url" v-bind:title="reply.account.username">{{truncate(reply.account.username,15)}}</a> <a class="text-dark font-weight-bold mr-1 text-break" :href="profileUrl(reply)" v-bind:title="reply.account.username">{{!reply.account.local ? '@' : '' }}{{truncate(reply.account.username,15)}}</a>
<span class="text-break comment-body" style="word-break: break-all;" v-html="reply.content"></span> <span class="text-break comment-body" style="word-break: break-all;" v-html="reply.content"></span>
</span> </span>
<span style="min-width:38px;"> <span style="min-width:38px;">
@ -182,7 +182,7 @@
<div class="media-body"> <div class="media-body">
<p class="d-flex justify-content-between align-items-top read-more" style="overflow-y: hidden;"> <p class="d-flex justify-content-between align-items-top read-more" style="overflow-y: hidden;">
<span> <span>
<a class="text-dark font-weight-bold mr-1" :href="s.account.url" :title="s.account.username">{{s.account.username}}</a> <a class="text-dark font-weight-bold mr-1" :href="profileUrl(s)" :title="s.account.username">{{!s.account.local ? '@' : '' }}{{s.account.username}}</a>
<span class="text-break comment-body" style="word-break: break-all;" v-html="s.content"></span> <span class="text-break comment-body" style="word-break: break-all;" v-html="s.content"></span>
</span> </span>
<span class="pl-2" style="min-width:38px"> <span class="pl-2" style="min-width:38px">
@ -1567,6 +1567,14 @@ export default {
return '/i/web/post/_/' + status.account.id + '/' + status.id; return '/i/web/post/_/' + status.account.id + '/' + status.id;
}, },
profileUrl(status) {
if(status.local == true) {
return status.account.url;
}
return '/i/web/profile/_/' + status.account.id;
},
showTaggedPeopleModal() { showTaggedPeopleModal() {
if(!$('body').hasClass('loggedIn') && this.loaded) { if(!$('body').hasClass('loggedIn') && this.loaded) {
return; return;

View file

@ -49,16 +49,17 @@
<span v-bind:class="[size =='lg' ? 'fas fa-ellipsis-v fa-lg text-muted' : 'fas fa-ellipsis-v fa-sm text-lighter']"></span> <span v-bind:class="[size =='lg' ? 'fas fa-ellipsis-v fa-lg text-muted' : 'fas fa-ellipsis-v fa-sm text-lighter']"></span>
</span> </span>
<div class="modal" tabindex="-1" role="dialog" :id="'mt_pid_'+status.id"> <div class="modal" tabindex="-1" role="dialog" :id="'mt_pid_'+status.id">
<div class="modal-dialog modal-sm" role="document"> <div class="modal-dialog modal-sm modal-dialog-centered" role="document">
<div class="modal-content"> <div class="modal-content">
<div class="modal-body text-center"> <div class="modal-body text-center">
<div class="list-group text-dark"> <div class="list-group">
<a class="list-group-item text-dark text-decoration-none" :href="status.url">Go to post</a> <a class="list-group-item text-dark text-decoration-none" :href="statusUrl(status)">Go to post</a>
<!-- a class="list-group-item font-weight-bold text-decoration-none" :href="status.url">Share</a> <!-- a class="list-group-item font-weight-bold text-decoration-none" :href="status.url">Share</a>
<a class="list-group-item font-weight-bold text-decoration-none" :href="status.url">Embed</a> --> <a class="list-group-item font-weight-bold text-decoration-none" :href="status.url">Embed</a> -->
<a class="list-group-item text-dark text-decoration-none" href="#" @click.prevent="hidePost(status)">Hide</a> <a class="list-group-item text-dark text-decoration-none" href="#" @click.prevent="hidePost(status)">Hide</a>
<a v-if="activeSession == true && !statusOwner(status)" class="list-group-item text-danger font-weight-bold text-decoration-none" :href="reportUrl(status)">Report</a> <a v-if="activeSession == true && !statusOwner(status)" class="list-group-item text-danger font-weight-bold text-decoration-none" :href="reportUrl(status)">Report</a>
<div v-if="activeSession == true && statusOwner(status) == true || profile.is_admin == true" class="list-group-item text-danger font-weight-bold cursor-pointer" @click.prevent="deletePost">Delete</div> <div v-if="activeSession == true && statusOwner(status) == true || profile.is_admin == true" class="list-group-item text-danger font-weight-bold cursor-pointer" @click.prevent="deletePost">Delete</div>
<a class="list-group-item text-lighter text-decoration-none" href="#" @click.prevent="closeModal()">Close</a>
</div> </div>
</div> </div>
</div> </div>
@ -199,7 +200,27 @@
}).catch(err => { }).catch(err => {
swal('Error', 'Something went wrong. Please try again later.', 'error'); swal('Error', 'Something went wrong. Please try again later.', 'error');
}); });
},
statusUrl(status) {
if(status.local == true) {
return status.url;
}
return '/i/web/post/_/' + status.account.id + '/' + status.id;
},
profileUrl(status) {
if(status.local == true) {
return status.account.url;
}
return '/i/web/profile/_/' + status.account.id;
},
closeModal() {
$('#mt_pid_'+this.status.id).modal('hide');
} }
} }
} }
</script> </script>

View file

@ -198,7 +198,7 @@
:recommended="true" /> :recommended="true" />
</div> </div>
<div v-if="!loading && emptyFeed"> <div v-if="!loading && emptyFeed && scope !== 'home'">
<div class="card rounded-0 mt-3 status-card rounded-0 shadow-none border"> <div class="card rounded-0 mt-3 status-card rounded-0 shadow-none border">
<div class="card-body py-5 my-5"> <div class="card-body py-5 my-5">
<p class="text-center"><i class="fas fa-battery-empty fa-8x text-lighter"></i></p> <p class="text-center"><i class="fas fa-battery-empty fa-8x text-lighter"></i></p>

View file

@ -1,128 +1,127 @@
<nav class="navbar navbar-expand navbar-light navbar-laravel shadow-none border-bottom sticky-top py-1"> <nav class="navbar navbar-expand navbar-light navbar-laravel shadow-none border-bottom sticky-top py-1">
<div class="container"> <div class="container">
<a class="navbar-brand d-flex align-items-center" href="{{ route('timeline.personal') }}" title="Logo"> <a class="navbar-brand d-flex align-items-center" href="{{ route('timeline.personal') }}" title="Logo">
<img src="/img/pixelfed-icon-color.svg" height="30px" class="px-2" loading="eager" alt="Pixelfed logo"> <img src="/img/pixelfed-icon-color.svg" height="30px" class="px-2" loading="eager" alt="Pixelfed logo">
<span class="font-weight-bold mb-0 d-none d-sm-block" style="font-size:20px;">{{ config_cache('app.name') }}</span> <span class="font-weight-bold mb-0 d-none d-sm-block" style="font-size:20px;">{{ config_cache('app.name') }}</span>
</a> </a>
<div class="collapse navbar-collapse"> <div class="collapse navbar-collapse">
@auth @auth
<div class="navbar-nav d-none d-md-block mx-auto"> <div class="navbar-nav d-none d-md-block mx-auto">
<form class="form-inline search-bar" method="get" action="/i/results"> <form class="form-inline search-bar" method="get" action="/i/results">
<input class="form-control form-control-sm" name="q" placeholder="{{__('navmenu.search')}}" aria-label="search" autocomplete="off" required style="line-height: 0.6;width:200px" role="search"> <input class="form-control form-control-sm" name="q" placeholder="{{__('navmenu.search')}}" aria-label="search" autocomplete="off" required style="line-height: 0.6;width:200px" role="search">
</form> </form>
</div> </div>
@endauth @endauth
@guest @guest
<ul class="navbar-nav ml-auto"> <ul class="navbar-nav ml-auto">
<li> <li>
<a class="nav-link font-weight-bold text-dark" href="{{ route('login') }}" title="Login"> <a class="nav-link font-weight-bold text-dark" href="{{ route('login') }}" title="Login">
{{ __('Login') }} {{ __('Login') }}
</a> </a>
</li> </li>
@if(config_cache('pixelfed.open_registration') && config('instance.restricted.enabled') == false) @if(config_cache('pixelfed.open_registration') && in_array(config_cache('system.user_mode'), ['default', 'admin']))
<li> <li>
<a class="ml-3 nav-link font-weight-bold text-dark" href="{{ route('register') }}" title="Register"> <a class="ml-3 nav-link font-weight-bold text-dark" href="{{ route('register') }}" title="Register">
{{ __('Register') }} {{ __('Register') }}
</a> </a>
</li> </li>
@endif @endif
@else @else
<div class="ml-auto"> <div class="ml-auto">
<ul class="navbar-nav align-items-center"> <ul class="navbar-nav align-items-center">
<li class="nav-item px-md-2 d-none d-md-block"> <li class="nav-item px-md-2 d-none d-md-block">
<a class="nav-link font-weight-bold text-dark" href="/" title="Home" data-toggle="tooltip" data-placement="bottom"> <a class="nav-link font-weight-bold text-dark" href="/" title="Home" data-toggle="tooltip" data-placement="bottom">
<i class="fas fa-home fa-lg"></i> <i class="fas fa-home fa-lg"></i>
<span class="sr-only">Home</span> <span class="sr-only">Home</span>
</a> </a>
</li> </li>
<li class="nav-item px-md-2 d-none d-md-block"> <li class="nav-item px-md-2">
<div class="nav-link font-weight-bold text-dark cursor-pointer" title="Compose" data-toggle="tooltip" data-placement="bottom" onclick="App.util.compose.post()"> <a class="nav-link font-weight-bold text-dark" href="/account/direct" title="Direct" data-toggle="tooltip" data-placement="bottom">
<i class="far fa-plus-square fa-lg"></i> <i class="far fa-comment-dots fa-lg"></i>
<span class="sr-only">Compose</span> <span class="sr-only">Direct</span>
</div> </a>
</li> </li>
<li class="nav-item px-md-2"> <li class="nav-item px-md-2 d-none d-md-block">
<a class="nav-link font-weight-bold text-dark" href="/account/direct" title="Direct" data-toggle="tooltip" data-placement="bottom"> <a class="nav-link font-weight-bold text-dark" href="/account/activity" title="Notifications" data-toggle="tooltip" data-placement="bottom">
<i class="far fa-comment-dots fa-lg"></i> <i class="far fa-bell fa-lg"></i>
<span class="sr-only">Direct</span> <span class="sr-only">Notifications</span>
</a> </a>
</li> </li>
<li class="nav-item px-md-2 d-none d-md-block"> <li class="nav-item px-md-2 d-none d-md-block">
<a class="nav-link font-weight-bold text-dark" href="/account/activity" title="Notifications" data-toggle="tooltip" data-placement="bottom"> <div class="nav-link btn btn-primary btn-sm py-1 font-weight-bold text-white" title="Compose" data-toggle="tooltip" data-placement="bottom" onclick="App.util.compose.post()">
<i class="far fa-bell fa-lg"></i> <span>New Post</span>
<span class="sr-only">Notifications</span> </div>
</a> </li>
</li> <li class="nav-item dropdown ml-2">
<li class="nav-item dropdown ml-2"> <a id="navbarDropdown" class="nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" title="User Menu" data-toggle="tooltip" data-placement="bottom">
<a id="navbarDropdown" class="nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" title="User Menu" data-toggle="tooltip" data-placement="bottom"> <i class="far fa-user fa-lg text-dark"></i>
<i class="far fa-user fa-lg text-dark"></i> <span class="sr-only">User Menu</span>
<span class="sr-only">User Menu</span> <img class="d-none" src="/storage/avatars/default.png?v=0" class="rounded-circle border shadow" width="34" height="34" onerror="this.onerror=null;this.src='/storage/avatars/default.png?v=0';">
<img class="d-none" src="/storage/avatars/default.png?v=0" class="rounded-circle border shadow" width="34" height="34" onerror="this.onerror=null;this.src='/storage/avatars/default.png?v=0';"> </a>
</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown"> <div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown">
@if(config('federation.network_timeline')) @if(config('federation.network_timeline'))
<a class="dropdown-item font-weight-bold" href="{{route('timeline.public')}}"> <a class="dropdown-item font-weight-bold" href="{{route('timeline.public')}}">
<span class="fas fa-stream pr-2 text-lighter"></span> <span class="fas fa-stream pr-2 text-lighter"></span>
Public Public
</a> </a>
<a class="dropdown-item font-weight-bold" href="{{route('timeline.network')}}"> <a class="dropdown-item font-weight-bold" href="{{route('timeline.network')}}">
<span class="fas fa-globe pr-2 text-lighter"></span> <span class="fas fa-globe pr-2 text-lighter"></span>
Network Network
</a> </a>
@else @else
<a class="dropdown-item font-weight-bold" href="/"> <a class="dropdown-item font-weight-bold" href="/">
<span class="fas fa-home pr-2 text-lighter"></span> <span class="fas fa-home pr-2 text-lighter"></span>
Home Home
</a> </a>
<a class="dropdown-item font-weight-bold" href="{{route('timeline.public')}}"> <a class="dropdown-item font-weight-bold" href="{{route('timeline.public')}}">
<span class="fas fa-stream pr-2 text-lighter"></span> <span class="fas fa-stream pr-2 text-lighter"></span>
Public Public
</a> </a>
@endif @endif
<div class="dropdown-divider"></div> <div class="dropdown-divider"></div>
<a class="dropdown-item font-weight-bold" href="{{route('discover')}}"> <a class="dropdown-item font-weight-bold" href="{{route('discover')}}">
<span class="far fa-compass pr-2 text-lighter"></span> <span class="far fa-compass pr-2 text-lighter"></span>
{{__('navmenu.discover')}} {{__('navmenu.discover')}}
</a> </a>
<a class="dropdown-item font-weight-bold" href="/i/stories/new"> <a class="dropdown-item font-weight-bold" href="/i/stories/new">
<span class="fas fa-history text-lighter pr-2"></span> <span class="fas fa-history text-lighter pr-2"></span>
Stories Stories
</a> </a>
<div class="dropdown-divider"></div> <div class="dropdown-divider"></div>
<a class="dropdown-item font-weight-bold" href="/i/me"> <a class="dropdown-item font-weight-bold" href="/i/me">
<span class="far fa-user pr-2 text-lighter"></span> <span class="far fa-user pr-2 text-lighter"></span>
{{__('navmenu.myProfile')}} {{__('navmenu.myProfile')}}
</a> </a>
<a class="dropdown-item font-weight-bold" href="{{route('settings')}}"> <a class="dropdown-item font-weight-bold" href="{{route('settings')}}">
<span class="fas fa-cog pr-2 text-lighter"></span> <span class="fas fa-cog pr-2 text-lighter"></span>
{{__('navmenu.settings')}} {{__('navmenu.settings')}}
</a> </a>
@if(Auth::user()->is_admin == true) @if(Auth::user()->is_admin == true)
<a class="dropdown-item font-weight-bold" href="{{ route('admin.home') }}"> <a class="dropdown-item font-weight-bold" href="{{ route('admin.home') }}">
<span class="fas fa-shield-alt fa-sm pr-2 text-lighter"></span> <span class="fas fa-shield-alt fa-sm pr-2 text-lighter"></span>
{{__('navmenu.admin')}} {{__('navmenu.admin')}}
</a> </a>
@endif @endif
<div class="dropdown-divider"></div> <div class="dropdown-divider"></div>
<a class="dropdown-item font-weight-bold" href="{{ route('logout') }}" <a class="dropdown-item font-weight-bold" href="{{ route('logout') }}"
onclick="event.preventDefault(); onclick="event.preventDefault();
document.getElementById('logout-form').submit();"> document.getElementById('logout-form').submit();">
<span class="fas fa-sign-out-alt pr-2"></span> <span class="fas fa-sign-out-alt pr-2"></span>
{{ __('navmenu.logout') }} {{ __('navmenu.logout') }}
</a> </a>
<form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;"> <form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
@csrf @csrf
</form> </form>
</div> </div>
</li> </li>
</div> </div>
@endguest @endguest
</ul> </ul>
</div> </div>
</div> </div>
</nav> </nav>