From adcc4c9cb49939d55bc84610c5dfd2351c452bf8 Mon Sep 17 00:00:00 2001 From: Mateja Date: Tue, 24 Nov 2020 21:45:30 +0100 Subject: Activities special callsign description added. --- public/js/activities.js | 64 +++++++++++++++++------------- resources/views/pages/activities.blade.php | 28 +------------ resources/views/pages/reserve.blade.php | 3 +- 3 files changed, 40 insertions(+), 55 deletions(-) diff --git a/public/js/activities.js b/public/js/activities.js index 6529e6b..82385c8 100644 --- a/public/js/activities.js +++ b/public/js/activities.js @@ -1,38 +1,48 @@ $.ajaxSetup({ - headers: { - 'X-CSRF-TOKEN': $('input[name="csrf-token"]').attr('content') - } + headers: { + 'X-CSRF-TOKEN': $('input[name="csrf-token"]').attr('content') + } }); jQuery('select#call-sign').change(fillTable); jQuery(document).ready(fillTable); function fillTable() { - tableData = jQuery('table#ajax-table>tbody').first(); - tableData.html('Loading...'); + tableData = jQuery('table#ajax-table>tbody').first(); + tableData.html('Loading...'); - sign = jQuery('select#call-sign').first().val(); + sign = jQuery('select#call-sign').first().val(); - jQuery.post('/api/activities', {'call-sign': sign}, function (data, status) { - if (status === 'success') { - if (data.data.length > 0) { - tableData.empty(); - for (i = 0, len = data.data.length; i < len; i++) { - tr = '' + data.data[i].operatorCall + '' + - '' + data.data[i].fromTime + '' + - '' + data.data[i].toTime + '' + - '' + data.data[i].specialCall + '' + - '' + data.data[i].frequencies + '' + - '' + data.data[i].qso + ''; - tableData.append(tr); - } - } - else { - tableData.html('No data...'); - } - } - else { - tableData.html('Error!'); - } + descDiv = jQuery('div#sign-desc-div'); + if (sign === 'all') { + descDiv.empty(); + } else { + jQuery.get('/special-calls/show/' + sign, function (data, status) { + descDiv.html('
' + data + '
'); + console.log(data); }); + } + + jQuery.post('/api/activities', {'call-sign': sign}, function (data, status) { + if (status === 'success') { + if (data.data.length > 0) { + tableData.empty(); + for (i = 0, len = data.data.length; i < len; i++) { + tr = '' + data.data[i].operatorCall + '' + + '' + data.data[i].fromTime + '' + + '' + data.data[i].toTime + '' + + '' + data.data[i].specialCall + '' + + '' + data.data[i].frequencies + '' + + '' + data.data[i].qso + ''; + tableData.append(tr); + } + } + else { + tableData.html('No data...'); + } + } + else { + tableData.html('Error!'); + } + }); } diff --git a/resources/views/pages/activities.blade.php b/resources/views/pages/activities.blade.php index c8ccc04..1c5c32d 100644 --- a/resources/views/pages/activities.blade.php +++ b/resources/views/pages/activities.blade.php @@ -16,6 +16,8 @@ @endif +
+
@@ -25,32 +27,6 @@
- -{{--@if (count($activities) > 0)--}} -{{--
--}} - {{----}} - {{----}} - {{----}} - {{----}} - {{----}} - {{--@foreach ($activities as $row)--}} - {{----}} - {{----}} - {{----}} - {{----}} - {{----}} - {{----}} - {{----}} - {{----}} - {{--@endforeach--}} - {{----}} - {{--
OperatorFromToSpecial CallsignFrequenciesQSO
{{ $row->operatorCall }}{{ $row->fromTime }}{{ $row->toTime }}{{ $row->specialCall }}{{ $row->frequencies }}{{ $row->qso }}
--}} -{{--
--}} -{{--@else--}} -{{--
--}} - {{--There are currently no approved activities.--}} -{{--
--}} -{{--@endif--}} @endsection() @section('scripts') diff --git a/resources/views/pages/reserve.blade.php b/resources/views/pages/reserve.blade.php index f58d7d9..fc7f16f 100644 --- a/resources/views/pages/reserve.blade.php +++ b/resources/views/pages/reserve.blade.php @@ -21,7 +21,6 @@