mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-26 08:13:16 +00:00
Merge pull request #546 from pixelfed/frontend-ui-refactor
Frontend ui refactor
This commit is contained in:
commit
833d17db4e
2 changed files with 22 additions and 5 deletions
|
@ -2,12 +2,15 @@
|
||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use App\Follower;
|
use App\{
|
||||||
use App\FollowRequest;
|
Follower,
|
||||||
use App\Jobs\FollowPipeline\FollowPipeline;
|
FollowRequest,
|
||||||
use App\Profile;
|
Profile,
|
||||||
|
UserFilter
|
||||||
|
};
|
||||||
use Auth;
|
use Auth;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
use App\Jobs\FollowPipeline\FollowPipeline;
|
||||||
|
|
||||||
class FollowerController extends Controller
|
class FollowerController extends Controller
|
||||||
{
|
{
|
||||||
|
@ -31,6 +34,16 @@ class FollowerController extends Controller
|
||||||
$user = Auth::user()->profile;
|
$user = Auth::user()->profile;
|
||||||
$target = Profile::where('id', '!=', $user->id)->findOrFail($item);
|
$target = Profile::where('id', '!=', $user->id)->findOrFail($item);
|
||||||
$private = (bool) $target->is_private;
|
$private = (bool) $target->is_private;
|
||||||
|
$blocked = UserFilter::whereUserId($target->id)
|
||||||
|
->whereFilterType('block')
|
||||||
|
->whereFilterableId($user->id)
|
||||||
|
->whereFilterableType('App\Profile')
|
||||||
|
->exists();
|
||||||
|
|
||||||
|
if($blocked == true) {
|
||||||
|
return redirect()->back()->with('error', 'You cannot follow this user.');
|
||||||
|
}
|
||||||
|
|
||||||
$isFollowing = Follower::whereProfileId($user->id)->whereFollowingId($target->id)->count();
|
$isFollowing = Follower::whereProfileId($user->id)->whereFollowingId($target->id)->count();
|
||||||
|
|
||||||
if($private == true && $isFollowing == 0) {
|
if($private == true && $isFollowing == 0) {
|
||||||
|
|
|
@ -1,7 +1,11 @@
|
||||||
@extends('layouts.app',['title' => $user->username . " on " . config('app.name')])
|
@extends('layouts.app',['title' => $user->username . " on " . config('app.name')])
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
|
@if (session('error'))
|
||||||
|
<div class="alert alert-danger text-center font-weight-bold mb-0">
|
||||||
|
{{ session('error') }}
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
@include('profile.partial.private-info')
|
@include('profile.partial.private-info')
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
|
Loading…
Reference in a new issue