mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-25 15:55:22 +00:00
Merge pull request #246 from m4sk1n/maxlength
Add info about max bio length, make names length customizable
This commit is contained in:
commit
47b82d1a9a
4 changed files with 28 additions and 5 deletions
|
@ -65,7 +65,7 @@ class RegisterController extends Controller
|
||||||
];
|
];
|
||||||
|
|
||||||
$rules = [
|
$rules = [
|
||||||
'name' => 'required|string|max:255',
|
'name' => 'required|string|max' . config('pixelfed.max_name_length'),
|
||||||
'username' => $usernameRules,
|
'username' => $usernameRules,
|
||||||
'email' => 'required|string|email|max:255|unique:users',
|
'email' => 'required|string|email|max:255|unique:users',
|
||||||
'password' => 'required|string|min:6|confirmed',
|
'password' => 'required|string|min:6|confirmed',
|
||||||
|
|
|
@ -30,8 +30,8 @@ class SettingsController extends Controller
|
||||||
public function homeUpdate(Request $request)
|
public function homeUpdate(Request $request)
|
||||||
{
|
{
|
||||||
$this->validate($request, [
|
$this->validate($request, [
|
||||||
'name' => 'required|string|max:30',
|
'name' => 'required|string|max:' . config('pixelfed.max_name_length'),
|
||||||
'bio' => 'nullable|string|max:125',
|
'bio' => 'nullable|string|max:' . config('pixelfed.max_bio_length')
|
||||||
'website' => 'nullable|url',
|
'website' => 'nullable|url',
|
||||||
'email' => 'nullable|email'
|
'email' => 'nullable|email'
|
||||||
]);
|
]);
|
||||||
|
|
|
@ -108,6 +108,26 @@ return [
|
||||||
*/
|
*/
|
||||||
'max_caption_length' => env('MAX_CAPTION_LENGTH', 500),
|
'max_caption_length' => env('MAX_CAPTION_LENGTH', 500),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Bio length limit
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Change the bio length limit for user profiles.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
'max_bio_length' => env('MAX_BIO_LENGTH', 125),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| User name length limit
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Change the length limit for user names.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
'max_name_length' => env('MAX_NAME_LENGTH', 30),
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Album size limit
|
| Album size limit
|
||||||
|
@ -138,4 +158,4 @@ return [
|
||||||
*/
|
*/
|
||||||
'image_quality' => (int) env('IMAGE_QUALITY', 80),
|
'image_quality' => (int) env('IMAGE_QUALITY', 80),
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
|
@ -39,6 +39,9 @@
|
||||||
<label for="bio" class="col-sm-3 col-form-label font-weight-bold text-right">Bio</label>
|
<label for="bio" class="col-sm-3 col-form-label font-weight-bold text-right">Bio</label>
|
||||||
<div class="col-sm-9">
|
<div class="col-sm-9">
|
||||||
<textarea class="form-control" id="bio" name="bio" placeholder="Add a bio here" rows="2">{{Auth::user()->profile->bio}}</textarea>
|
<textarea class="form-control" id="bio" name="bio" placeholder="Add a bio here" rows="2">{{Auth::user()->profile->bio}}</textarea>
|
||||||
|
<small class="form-text text-muted">
|
||||||
|
Max length: {{config('pixelfed.max_bio_length')}} characters.
|
||||||
|
</small>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="pt-5">
|
<div class="pt-5">
|
||||||
|
@ -134,4 +137,4 @@
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
@endpush
|
@endpush
|
||||||
|
|
Loading…
Reference in a new issue