Skip to content

Commit

Permalink
fix(characters): make sale value always editable (#781)
Browse files Browse the repository at this point in the history
* suggestion(character): Sale value switch gets removed

* forgot the backslash, pardon

* refactor: fix blade formatting

---------

Co-authored-by: SpeedyD <[email protected]>
  • Loading branch information
SpeedyD and SpeedyD authored Jan 3, 2024
1 parent fbbf5b4 commit 100abc0
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 35 deletions.
27 changes: 19 additions & 8 deletions resources/views/character/_tab_stats.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,26 @@

<hr />

<h5><i class="text-{{ $character->is_giftable ? 'success far fa-circle' : 'danger fas fa-times' }} fa-fw mr-2"></i> {{ $character->is_giftable ? 'Can' : 'Cannot' }} be gifted</h5>
<h5><i class="text-{{ $character->is_tradeable ? 'success far fa-circle' : 'danger fas fa-times' }} fa-fw mr-2"></i> {{ $character->is_tradeable ? 'Can' : 'Cannot' }} be traded</h5>
<h5><i class="text-{{ $character->is_sellable ? 'success far fa-circle' : 'danger fas fa-times' }} fa-fw mr-2"></i> {{ $character->is_sellable ? 'Can' : 'Cannot' }} be sold</h5>
<div class="row">
<div class="col-lg-3 col-4">
<h5>Sale Value</h5>

<h5>
<i class="text-{{ $character->is_giftable ? 'success far fa-circle' : 'danger fas fa-times' }} fa-fw mr-2"></i> {{ $character->is_giftable ? 'Can' : 'Cannot' }} be gifted
</h5>
<h5>
<i class="text-{{ $character->is_tradeable ? 'success far fa-circle' : 'danger fas fa-times' }} fa-fw mr-2"></i> {{ $character->is_tradeable ? 'Can' : 'Cannot' }} be traded
</h5>
<h5>
<i class="text-{{ $character->is_sellable ? 'success far fa-circle' : 'danger fas fa-times' }} fa-fw mr-2"></i> {{ $character->is_sellable ? 'Can' : 'Cannot' }} be sold
</h5>
@if ($character->sale_value > 0)
<div class="row">
<div class="col-lg-3 col-4">
<h5>Sale Value</h5>
</div>
<div class="col-lg-9 col-8">
{{ Config::get('lorekeeper.settings.currency_symbol') }}{{ $character->sale_value }}
</div>
</div>
<div class="col-lg-9 col-8">{{ config('lorekeeper.settings.currency_symbol') }}{{ $character->sale_value }}</div>
</div>
@endif
@if ($character->transferrable_at && $character->transferrable_at->isFuture())
<div class="row">
<div class="col-lg-3 col-4">
Expand Down
30 changes: 3 additions & 27 deletions resources/views/character/admin/_edit_stats_modal.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,9 @@
{!! Form::checkbox('is_sellable', 1, $character->is_sellable, ['class' => 'form-check-input', 'data-toggle' => 'toggle', 'id' => 'resellable']) !!}
{!! Form::label('is_sellable', 'Is Resellable', ['class' => 'form-check-label ml-3']) !!}
</div>
<div class="card mb-3" id="resellOptions">
<div class="card-body">
{!! Form::label('Resale Value') !!} {!! add_help('This value is publicly displayed on the character\'s page.') !!}
{!! Form::text('sale_value', $character->sale_value, ['class' => 'form-control']) !!}
</div>
<div class="form-group">
{!! Form::label('Resale Value') !!} {!! add_help('This value is publicly displayed on the character\'s page. It\'s hidden if zero or lower.') !!}
{!! Form::text('sale_value', $character->sale_value, ['class' => 'form-control']) !!}
</div>
<div class="form-group">
{!! Form::label('On Transfer Cooldown Until (Optional)') !!}
Expand All @@ -66,27 +64,5 @@
dateFormat: "yy-mm-dd",
timeFormat: 'HH:mm:ss',
});
//$('[data-toggle=toggle]').bootstrapToggle();
// Resell options /////////////////////////////////////////////////////////////////////////////
var $resellable = $('#resellable');
var $resellOptions = $('#resellOptions');
var resellable = $resellable.is(':checked');
updateOptions();
$resellable.on('change', function(e) {
resellable = $resellable.is(':checked');
updateOptions();
});
function updateOptions() {
if (resellable) $resellOptions.removeClass('hide');
else $resellOptions.addClass('hide');
}
});
</script>

0 comments on commit 100abc0

Please sign in to comment.