Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed short desc, updated Discord name validation #13

Merged
merged 4 commits into from
Aug 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/Http/Controllers/ProfileController.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public static function getValidations()
'nullable',
// Discord user name validation: https://discord.com/developers/docs/resources/user
// (simplified because we don't need to check all edge cases)
'regex:/^[^@#:]{2,32}#[0-9]{4}$/',
'regex:/^[^@#:]{2,32}(#[0-9]{4})?$/',
],
"tweet" => [
'max:280',
Expand Down
2 changes: 1 addition & 1 deletion lang/en/validation.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
'regex' => 'Please verify your Telegram handle, it must be between 5 and 32 characters and only contain letters, numbers and underscores (_).'
],
'discord' => [
'regex' => 'Please verify your Discord handle, it must consist of your username (between 2 and 32 characters) followed by a # and four digits (e.g. "mynick#1234").'
'regex' => 'Please verify your Discord handle, it must be between 2 and 32 characters and may optionally have the old format appended to it (e.g. mynick#1234).'
],
'attends_sat' => [
'required_without_all' => 'Please select at least one day when you will be in the Dealers\' Den.'
Expand Down
4 changes: 2 additions & 2 deletions resources/views/forms/profile.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ class="form-control @error('short_desc') is-invalid @enderror" id="short_desc">{
<div class="invalid-feedback">{{ $message }}</div>
@enderror
<div id="short_descHelp" class="form-text">
A short description, 1 - 3 sentences, to appear in the dealer list next to your thumbnail image.
A short description, 1 - 3 sentences, to appear in your profile header.
</div>
</div>
</div>
Expand Down Expand Up @@ -356,7 +356,7 @@ class="form-control @error('telegram') is-invalid @enderror" id="telegram"
<div class="row mb-3">
<label for="discord" class="col-sm-2 col-form-label fw-bold">Dis&shy;cord</label>
<div class="col-sm-10">
<input type="text" name="discord" placeholder="YourDiscordHandle#0000"
<input type="text" name="discord" placeholder="YourDiscordHandle"
class="form-control @error('discord') is-invalid @enderror" id="discord"
value="{{ old('_token') ? old('discord') : $profile?->discord }}">
@error('discord')
Expand Down