Skip to content

Commit

Permalink
Merge pull request #46 from itinerare/feature/art-design-credits-hotfix
Browse files Browse the repository at this point in the history
Feature/art design credits hotfix-- 
- Fix character creation art/design credit forms
- Fix alias comparison from url being case-sensitive
- Fix bug with url match failure causing error on viewing user profile
No further action necessary
  • Loading branch information
itinerare authored Nov 19, 2020
2 parents 64af6ff + 8f40064 commit e75d1e2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/Models/User/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ public function updateArtDesignCredits()
// Find all deviantArt urls
foreach($urlCreators as $key=>$creator) preg_match_all('/deviantart\.com\/([A-Za-z0-9_-]+)/', $creator, $matches[$key]);
// Find all alias matches within those, and update the relevant CharacterImageCreator
foreach($matches as $key=>$match) if($match[1][0] == $this->alias) CharacterImageCreator::find($key)->update(['url' => null, 'user_id' => $this->id]);
foreach($matches as $key=>$match) if($match[1] != [] && strtolower($match[1][0]) == strtolower($this->alias)) CharacterImageCreator::find($key)->update(['url' => null, 'user_id' => $this->id]);
}
}

Expand Down
10 changes: 5 additions & 5 deletions resources/views/admin/masterlist/create_character.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,19 +153,19 @@
</div>
</div>
<p class="alert alert-info">
This section is for crediting the image creators. The first box is for the designer's deviantART name (if any). If the designer has an account on the site, it will link to their site profile; if not, it will link to their dA page. The second is for a custom URL if they don't use dA. Both are optional - you can fill in the alias and ignore the URL, or vice versa. If you fill in both, it will link to the given URL, but use the alias field as the link name.
This section is for crediting the image creators. The first box is for the designer or artist's on-site username (if any). The second is for a link to the designer or artist if they don't have an account on the site.
</p>
<div class="form-group">
{!! Form::label('Designer(s)') !!}
<div id="designerList">
<div class="mb-2 d-flex">
{!! Form::text('designer_alias[]', null, ['class' => 'form-control mr-2', 'placeholder' => 'Designer Alias']) !!}
{!! Form::select('designer_alias[]', $userOptions, null, ['class'=> 'form-control mr-2 selectize', 'placeholder' => 'Select a Designer']) !!}
{!! Form::text('designer_url[]', null, ['class' => 'form-control mr-2', 'placeholder' => 'Designer URL']) !!}
<a href="#" class="add-designer btn btn-link" data-toggle="tooltip" title="Add another designer">+</a>
</div>
</div>
<div class="designer-row hide mb-2">
{!! Form::text('designer_alias[]', null, ['class' => 'form-control mr-2', 'placeholder' => 'Designer Alias']) !!}
{!! Form::select('designer_alias[]', $userOptions, null, ['class'=> 'form-control mr-2 designer-select', 'placeholder' => 'Select a Designer']) !!}
{!! Form::text('designer_url[]', null, ['class' => 'form-control mr-2', 'placeholder' => 'Designer URL']) !!}
<a href="#" class="add-designer btn btn-link" data-toggle="tooltip" title="Add another designer">+</a>
</div>
Expand All @@ -174,13 +174,13 @@
{!! Form::label('Artist(s)') !!}
<div id="artistList">
<div class="mb-2 d-flex">
{!! Form::text('artist_alias[]', null, ['class' => 'form-control mr-2', 'placeholder' => 'Artist Alias']) !!}
{!! Form::select('artist_alias[]', $userOptions, null, ['class'=> 'form-control mr-2 selectize', 'placeholder' => 'Select an Artist']) !!}
{!! Form::text('artist_url[]', null, ['class' => 'form-control mr-2', 'placeholder' => 'Artist URL']) !!}
<a href="#" class="add-artist btn btn-link" data-toggle="tooltip" title="Add another artist">+</a>
</div>
</div>
<div class="artist-row hide mb-2">
{!! Form::text('artist_alias[]', null, ['class' => 'form-control mr-2', 'placeholder' => 'Artist Alias']) !!}
{!! Form::select('artist_alias[]', $userOptions, null, ['class'=> 'form-control mr-2 artist-select', 'placeholder' => 'Select an Artist']) !!}
{!! Form::text('artist_url[]', null, ['class' => 'form-control mr-2', 'placeholder' => 'Artist URL']) !!}
<a href="#" class="add-artist btn btn-link mb-2" data-toggle="tooltip" title="Add another artist">+</a>
</div>
Expand Down

0 comments on commit e75d1e2

Please sign in to comment.