Added a remove operation to each access code. Cannot remove from the frontend if the code has been used

This commit is contained in:
Etienne Marais 2019-02-13 15:44:25 +02:00
parent b525a561c8
commit 3b60ad95d4
No known key found for this signature in database
GPG Key ID: 5CE3285D17AE9F29
1 changed files with 6 additions and 2 deletions

View File

@ -40,12 +40,13 @@
<div class="col-md-12">
@if($event->access_codes->count())
<div class="table-responsive">
<table class="table">
<table class="table" id="event_discount_codes">
<thead>
<tr>
<th width="70%">@lang("DiscountCodes.discount_codes_code")</th>
<th width="65%">@lang("DiscountCodes.discount_codes_code")</th>
<th width="10%" class="has-text-center">@lang("DiscountCodes.discount_codes_usage_count")</th>
<th width="20%" class="has-text-center">@lang("DiscountCodes.discount_codes_created_at")</th>
<th width="5%"></th>
</tr>
</thead>
<tbody>
@ -54,6 +55,9 @@
<td><strong>{{ $discountCode->code }}</strong></td>
<td class="has-text-center"><strong>{{ $discountCode->usage_count }}</strong></td>
<td class="has-text-center">{{ $discountCode->created_at }}</td>
@if ($discountCode->usage_count === 0) {{-- Can only remove if haven't been used before--}}
<td><a href="" class="remove" data-url="{{ $discountCode->id }}">Remove</a></td>
@endif
</tr>
@endforeach
</tbody>