Skip to content

Commit

Permalink
Fixed short desc, updated Discord name validation (#13)
Browse files Browse the repository at this point in the history
* Fixed short desc, updated Discord name validation

* updated Discord validation

---------

Co-authored-by: Fenrikur <3359222+Fenrikur@users.noreply.github.com>
  • Loading branch information
julsteele and Fenrikur authored Aug 9, 2023
1 parent 937fca4 commit 40628e8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
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

0 comments on commit 40628e8

Please sign in to comment.