aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMateja <mail@matejamaric.com>2020-11-24 21:45:30 +0100
committerMateja <mail@matejamaric.com>2020-11-24 21:45:30 +0100
commitadcc4c9cb49939d55bc84610c5dfd2351c452bf8 (patch)
treee1d692229c0c70b65149d4c672032dbe3314ab7e
parent400e73d5407555a22ae6fe4c5282bafc7685833c (diff)
downloadyota-laravel-adcc4c9cb49939d55bc84610c5dfd2351c452bf8.tar.gz
yota-laravel-adcc4c9cb49939d55bc84610c5dfd2351c452bf8.zip
Activities special callsign description added.
-rw-r--r--public/js/activities.js64
-rw-r--r--resources/views/pages/activities.blade.php28
-rw-r--r--resources/views/pages/reserve.blade.php3
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('<tr><td class="font-weight-bold text-center" colspan="6">Loading...</td></tr>');
+ tableData = jQuery('table#ajax-table>tbody').first();
+ tableData.html('<tr><td class="font-weight-bold text-center" colspan="6">Loading...</td></tr>');
- 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 = '<tr><td>' + data.data[i].operatorCall + '</td>' +
- '<td>' + data.data[i].fromTime + '</td>' +
- '<td>' + data.data[i].toTime + '</td>' +
- '<td>' + data.data[i].specialCall + '</td>' +
- '<td>' + data.data[i].frequencies + '</td>' +
- '<td>' + data.data[i].qso + '</td></tr>';
- tableData.append(tr);
- }
- }
- else {
- tableData.html('<tr><td class="font-weight-bold text-center" colspan="6">No data...</td></tr>');
- }
- }
- else {
- tableData.html('<tr><td class="font-weight-bold text-center" colspan="6">Error!</td></tr>');
- }
+ descDiv = jQuery('div#sign-desc-div');
+ if (sign === 'all') {
+ descDiv.empty();
+ } else {
+ jQuery.get('/special-calls/show/' + sign, function (data, status) {
+ descDiv.html('<div class="card"><div class="card-body pb-1">' + data + '</div></div>');
+ 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 = '<tr><td>' + data.data[i].operatorCall + '</td>' +
+ '<td>' + data.data[i].fromTime + '</td>' +
+ '<td>' + data.data[i].toTime + '</td>' +
+ '<td>' + data.data[i].specialCall + '</td>' +
+ '<td>' + data.data[i].frequencies + '</td>' +
+ '<td>' + data.data[i].qso + '</td></tr>';
+ tableData.append(tr);
+ }
+ }
+ else {
+ tableData.html('<tr><td class="font-weight-bold text-center" colspan="6">No data...</td></tr>');
+ }
+ }
+ else {
+ tableData.html('<tr><td class="font-weight-bold text-center" colspan="6">Error!</td></tr>');
+ }
+ });
}
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
</select>
+<div id="sign-desc-div"></div>
+
<div class="table-responsive mt-2">
<table id="ajax-table" class="table table-striped table-bordered" style="white-space:nowrap;">
<thead class="thead-dark">
@@ -25,32 +27,6 @@
</tbody>
</table>
</div>
-
-{{--@if (count($activities) > 0)--}}
-{{--<div class="table-responsive">--}}
- {{--<table class="table table-striped table-bordered"><!-- table-hover -->--}}
- {{--<thead class="thead-dark">--}}
- {{--<tr><th>Operator</th><th>From</th><th>To</th><th>Special Callsign</th><th>Frequencies</th><th>QSO</th></tr>--}}
- {{--</thead>--}}
- {{--<tbody>--}}
- {{--@foreach ($activities as $row)--}}
- {{--<tr>--}}
- {{--<td>{{ $row->operatorCall }}</td>--}}
- {{--<td>{{ $row->fromTime }}</td>--}}
- {{--<td>{{ $row->toTime }}</td>--}}
- {{--<td>{{ $row->specialCall }}</td>--}}
- {{--<td>{{ $row->frequencies }}</td>--}}
- {{--<td>{{ $row->qso }}</td>--}}
- {{--</tr>--}}
- {{--@endforeach--}}
- {{--</tbody>--}}
- {{--</table>--}}
-{{--</div>--}}
-{{--@else--}}
-{{--<div class="text-center">--}}
- {{--<strong>There are currently no approved activities.</strong>--}}
-{{--</div>--}}
-{{--@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 @@
<div class="form-group">
<label for="special-call">Special Callsign:</label>
<select class="form-control @error('scall') is-invalid @enderror" id="special-call" name="scall" required>
- {{--<option value="YT50SCWC">YT50SCWC</option>--}}
@foreach ($signs as $sign)
<option value="{{ $sign->sign }}" {{ old('scall') == $sign->sign ? 'selected' : '' }}>{{ $sign->sign }}</option>
@endforeach
@@ -32,7 +31,7 @@
</div>
<div class="card mb-3">
- <div class="card-body pb-2">
+ <div class="card-body pb-1">
<div class="card-text" id="call-desc"></div>
</div>
</div>