parent
aaaf2e7c00
commit
060bebf8fe
@ -9,7 +9,7 @@
|
|||||||
{{ $pirep->airline->code }}{{ $pirep->ident }}
|
{{ $pirep->airline->code }}{{ $pirep->ident }}
|
||||||
</a>
|
</a>
|
||||||
</h5>
|
</h5>
|
||||||
<div>
|
<div id="pirep_{{ $pirep->id }}_status_container">
|
||||||
@if($pirep->state === PirepState::PENDING)
|
@if($pirep->state === PirepState::PENDING)
|
||||||
<div class="badge badge-warning">
|
<div class="badge badge-warning">
|
||||||
@elseif($pirep->state === PirepState::ACCEPTED)
|
@elseif($pirep->state === PirepState::ACCEPTED)
|
||||||
@ -82,3 +82,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@ -65,6 +65,23 @@
|
|||||||
changeStatus(values, (data) => {
|
changeStatus(values, (data) => {
|
||||||
const destContainer = '#pirep_' + values.pirep_id + '_actionbar';
|
const destContainer = '#pirep_' + values.pirep_id + '_actionbar';
|
||||||
$(destContainer).html(data);
|
$(destContainer).html(data);
|
||||||
|
|
||||||
|
const statusContainer = '#pirep_' + values.pirep_id + '_status_container';
|
||||||
|
let new_badge;
|
||||||
|
let new_badge_text;
|
||||||
|
|
||||||
|
if (values.new_status === '{{ App\Models\Enums\PirepState::ACCEPTED }}') {
|
||||||
|
new_badge = 'badge badge-success';
|
||||||
|
new_badge_text = 'Accepted'
|
||||||
|
}
|
||||||
|
|
||||||
|
if (values.new_status === '{{ App\Models\Enums\PirepState::REJECTED }}') {
|
||||||
|
new_badge = 'badge badge-danger';
|
||||||
|
new_badge_text = 'Rejected'
|
||||||
|
}
|
||||||
|
|
||||||
|
$(statusContainer).children(0).removeClass().addClass(new_badge);
|
||||||
|
$(statusContainer).children(0).html(new_badge_text);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user