Merge pull request #1615 from pixelfed/staging

Update Register view
This commit is contained in:
daniel 2019-08-17 01:49:34 -06:00 committed by GitHub
commit 5117a9c161
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 39 additions and 26 deletions

View file

@ -76,7 +76,7 @@ class RegisterController extends Controller
'name' => 'required|string|max:'.config('pixelfed.max_name_length'),
'username' => $usernameRules,
'email' => 'required|string|email|max:255|unique:users',
'password' => 'required|string|min:6|confirmed',
'password' => 'required|string|min:8|confirmed',
];
return Validator::make($data, $rules);
@ -123,14 +123,17 @@ class RegisterController extends Controller
*/
public function showRegistrationForm()
{
$count = User::count();
$limit = config('pixelfed.max_users');
if($limit && $limit <= $count) {
$view = 'site.closed-registration';
if(config('pixelfed.open_registration')) {
$limit = config('pixelfed.max_users');
if($limit) {
abort_if($limit <= User::count(), 404);
return view('auth.register');
} else {
return view('auth.register');
}
} else {
$view = config('pixelfed.open_registration') == true ? 'auth.register' : 'site.closed-registration';
abort(404);
}
return view($view);
}
/**

View file

@ -10,7 +10,8 @@ class ProfileSponsorController extends Controller
{
public function get(Request $request, $id)
{
$res = ProfileSponsor::whereProfileId($id)->firstOrFail()->sponsors;
return response($res)->header('Content-Type', 'application/json');
$profile = ProfileSponsor::whereProfileId($id)->first();
$res = $profile ? $profile->sponsors : [];
return response()->json($res);
}
}

View file

@ -269,6 +269,7 @@ class PublicApiController extends Controller
'local',
'reply_count',
'comments_disabled',
'place_id',
'created_at',
'updated_at'
)->where('id', $dir, $id)
@ -299,6 +300,7 @@ class PublicApiController extends Controller
'reply_count',
'comments_disabled',
'created_at',
'place_id',
'updated_at'
)->whereIn('type', ['photo', 'photo:album', 'video', 'video:album'])
->with('profile', 'hashtags', 'mentions')
@ -377,6 +379,7 @@ class PublicApiController extends Controller
'local',
'reply_count',
'comments_disabled',
'place_id',
'created_at',
'updated_at'
)->whereIn('type', ['photo', 'photo:album', 'video', 'video:album'])
@ -405,6 +408,7 @@ class PublicApiController extends Controller
'local',
'reply_count',
'comments_disabled',
'place_id',
'created_at',
'updated_at'
)->whereIn('type', ['photo', 'photo:album', 'video', 'video:album'])
@ -523,7 +527,9 @@ class PublicApiController extends Controller
public function relationships(Request $request)
{
abort_if(!Auth::check(), 403);
if(!Auth::check()) {
return response()->json([]);
}
$this->validate($request, [
'id' => 'required|array|min:1|max:20',

View file

@ -403,4 +403,9 @@ class Status extends Model
return $res[$audience];
}
public function place()
{
return $this->belongsTo(Place::class);
}
}

View file

@ -103,7 +103,7 @@ class Inbox
public function actorFirstOrCreate($actorUrl)
{
return Helpers::profileFirstOrNew($actorUrl);
return Helpers::profileFetch($actorUrl);
}
public function handleCreateActivity()

View file

@ -131,7 +131,7 @@ class Image
$quality = config('pixelfed.image_quality');
$img->save($newPath, $quality);
$img->destroy();
if (!$thumbnail) {
$media->orientation = $orientation;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4 KiB

View file

@ -3,26 +3,17 @@
@section('content')
<div class="container mt-4">
<div class="row justify-content-center">
<div class="col-md-6 col-lg-7 mb-3">
<div class="card">
<div class="card-body text-center">
<p class="h4 font-weight-bold pt-5">A Photo Sharing Experience For Everyone</p>
<div class="p-5 mb-5">
<img src="/img/Macbook__ipad__iphone.svg" width="100%">
</div>
</div>
</div>
</div>
<div class="col-md-6 col-lg-5">
<div class="col-lg-5">
<div class="card">
<div class="card-header bg-white p-3 text-center font-weight-bold">{{ __('Register a new account') }}</div>
<div class="card-body">
<form method="POST" action="{{ route('register') }}" class="px-5">
<form method="POST" action="{{ route('register') }}" class="px-md-3">
@csrf
<div class="form-group row">
<div class="col-md-12">
<label class="small font-weight-bold text-lighter">Name</label>
<input id="name" type="text" class="form-control{{ $errors->has('name') ? ' is-invalid' : '' }}" name="name" value="{{ old('name') }}" placeholder="{{ __('Name') }}" required autofocus>
@if ($errors->has('name'))
@ -35,6 +26,7 @@
<div class="form-group row">
<div class="col-md-12">
<label class="small font-weight-bold text-lighter">Username</label>
<input id="username" type="text" class="form-control{{ $errors->has('username') ? ' is-invalid' : '' }}" name="username" value="{{ old('username') }}" placeholder="{{ __('Username') }}" required>
@if ($errors->has('username'))
@ -47,6 +39,7 @@
<div class="form-group row">
<div class="col-md-12">
<label class="small font-weight-bold text-lighter">Email</label>
<input id="email" type="email" class="form-control{{ $errors->has('email') ? ' is-invalid' : '' }}" name="email" value="{{ old('email') }}" placeholder="{{ __('E-Mail Address') }}" required>
@if ($errors->has('email'))
@ -59,6 +52,7 @@
<div class="form-group row">
<div class="col-md-12">
<label class="small font-weight-bold text-lighter">Password</label>
<input id="password" type="password" class="form-control{{ $errors->has('password') ? ' is-invalid' : '' }}" name="password" placeholder="{{ __('Password') }}" required>
@if ($errors->has('password'))
@ -71,9 +65,12 @@
<div class="form-group row">
<div class="col-md-12">
<label class="small font-weight-bold text-lighter">Confirm Password</label>
<input id="password-confirm" type="password" class="form-control" name="password_confirmation" placeholder="{{ __('Confirm Password') }}" required>
</div>
</div>
<p class="small">By signing up, you agree to our <a href="{{route('site.terms')}}" class="font-weight-bold text-dark">Terms of Use</a> and <a href="{{route('site.privacy')}}" class="font-weight-bold text-dark">Privacy Policy</a>.</p>
<div class="form-group row">
<div class="col-md-12">
@ -82,7 +79,6 @@
</button>
</div>
</div>
<p class="mb-0 font-weight-bold text-lighter small">By signing up, you agree to our <a href="{{route('site.terms')}}" class="text-muted">Terms of Use</a> and <a href="{{route('site.privacy')}}" class="text-muted">Privacy Policy</a>.</p>
</form>
</div>
</div>

View file

@ -20,9 +20,11 @@
@endauth
@guest
<ul class="navbar-nav ml-auto">
<li><a class="nav-link font-weight-bold text-primary" href="{{ route('login') }}" title="Login">{{ __('Login') }}</a></li>
<li><a class="nav-link font-weight-bold" href="{{ route('register') }}" title="Register">{{ __('Register') }}</a></li>
@if(config('pixelfed.open_registration'))
<li><a class="nav-link font-weight-bold" href="{{ route('register') }}" title="Register">{{ __('Register') }}</a></li>@endif
@else
<ul class="navbar-nav ml-auto">
<div class="d-none d-md-block">