1
0
Fork 0

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 59 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;
}

View File

@ -1,33 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="897px" height="452px" viewBox="0 0 897 452" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
<!-- Generator: Sketch 3.0.4 (8054) - http://www.bohemiancoding.com/sketch -->
<title>IPAD 2</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">
<g id="IPAD" sketch:type="MSLayerGroup" transform="translate(681.000000, 55.000000)" stroke="#7E89A3">
<path d="M202.986,317 L12.097,317 C5.462,317 0.083,311.623 0.083,304.99 L0.083,12.093 C0.083,5.46 5.461,0.083 12.097,0.083 L202.986,0.083 C209.622,0.083 215,5.46 215,12.093 L215,304.99 C215,311.623 209.622,317 202.986,317 Z" id="bezel" stroke-width="2" fill="#FDFDFD" sketch:type="MSShapeGroup"></path>
<path d="M202.986,317 L12.097,317 C5.462,317 0.083,311.623 0.083,304.99 L0.083,12.093 C0.083,5.46 5.461,0.083 12.097,0.083 L202.986,0.083 C209.622,0.083 215,5.46 215,12.093 L215,304.99 C215,311.623 209.622,317 202.986,317 Z" id="bezel-2" stroke-width="2" fill="#FDFDFD" sketch:type="MSShapeGroup"></path>
<rect id="screen" fill="#FFFFFF" sketch:type="MSShapeGroup" x="17" y="32" width="181.999" height="252.917"></rect>
<circle id="lock" sketch:type="MSShapeGroup" cx="108.021" cy="300.021" r="8.021"></circle>
<circle id="camera" sketch:type="MSShapeGroup" cx="106.99" cy="16.99" r="2.99"></circle>
</g>
<g id="Laptop" sketch:type="MSLayerGroup" transform="translate(1.000000, 1.000000)" stroke="#8492A5">
<path d="M594,0 L98,0 C84.50415,0 73,11.0738184 73,24.7901127 L73,351.027995 L619,351.027985 L619,24.7901127 C618.999971,11.0728209 607.537479,0 594,0 Z" id="bezel" stroke-width="2" fill="#FEFEFE" sketch:type="MSShapeGroup"></path>
<circle id="webcam" stroke-width="2" sketch:type="MSShapeGroup" cx="347" cy="19" r="4"></circle>
<g id="bottom" transform="translate(0.000000, 351.000000)" sketch:type="MSShapeGroup">
<path d="M640.812,31.01 L51.288,31.01 C20.641,31.01 0,20.494 0,16.022 L0,2.428 C0,1.084 1.335,0 2.995,0 L689.104,0 C690.766,0 692.103,1.084 692.103,2.428 L692.103,16.557 C692.096,20.092 676.112,31.01 640.812,31.01 Z" id="Shape" stroke-width="2" fill="#FDFDFD"></path>
<path d="M0.5,14.5 L690.242676,14.5" id="Line" stroke-linecap="square"></path>
</g>
<rect id="screen" fill="#FFFFFF" sketch:type="MSShapeGroup" x="95" y="39" width="501.073853" height="292.009"></rect>
<path d="M421,352 L421,355.087 C421,357.288 416.666719,357.952714 413.386719,357.952714 L278.815286,357.952714 C275.364286,357.952714 271,357.289 271,355.087 L271,352" id="touchpad" fill="#FFFFFF" sketch:type="MSShapeGroup"></path>
</g>
<g id="iphone" sketch:type="MSLayerGroup" transform="translate(576.000000, 177.000000)" stroke="#7E89A3">
<path d="M130,257.964 C130,266.797 122.809,273.956 113.938,273.956 L16.063,273.956 C7.192,273.956 0.001,266.797 0.001,257.964 L0.001,16.073 C0.001,7.24 7.192,0.081 16.063,0.081 L113.938,0.081 C122.809,0.081 130,7.24 130,16.073 L130,257.964 L130,257.964 Z" id="bezel" stroke-width="2" fill="#FDFDFD" sketch:type="MSShapeGroup"></path>
<rect id="screen" fill="#FFFFFF" sketch:type="MSShapeGroup" x="9" y="36" width="111.93" height="199.084"></rect>
<path d="M77,25.746 C77,26.381 76.561,26.893 76.02,26.893 L55.918,26.893 C55.376,26.893 54.938,26.38 54.938,25.746 L54.938,23.166 C54.938,22.531 55.377,22.019 55.918,22.019 L76.02,22.019 C76.561,22.019 77,22.532 77,23.166 L77,25.746 L77,25.746 Z" id="speaker" sketch:type="MSShapeGroup"></path>
<circle id="camera" sketch:type="MSShapeGroup" cx="66" cy="12" r="3"></circle>
<ellipse id="lock" sketch:type="MSShapeGroup" cx="65.04" cy="254.001" rx="10.04" ry="10.001"></ellipse>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 4.0 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,10 +65,13 @@
<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">
<button type="submit" class="btn btn-primary btn-block py-0 font-weight-bold">
@ -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">