aboutsummaryrefslogtreecommitdiff
path: root/resources
diff options
context:
space:
mode:
authorMateja <mail@matejamaric.com>2020-11-13 01:47:38 +0100
committerMateja <mail@matejamaric.com>2020-11-13 01:47:38 +0100
commitcddef1ffc9cb204d87299cea7e9f2de0cf6e58c3 (patch)
treea35436b5e59a28a2b03bd77750368e9f30fdfc5f /resources
parent470a54a8c6e92416a8245af0bc87170ad934fae0 (diff)
downloadyota-laravel-cddef1ffc9cb204d87299cea7e9f2de0cf6e58c3.tar.gz
yota-laravel-cddef1ffc9cb204d87299cea7e9f2de0cf6e58c3.zip
Work on activities...
Diffstat (limited to 'resources')
-rw-r--r--resources/js/activities.js15
-rw-r--r--resources/js/reservations.js0
-rw-r--r--resources/views/pages/activities.blade.php75
3 files changed, 57 insertions, 33 deletions
diff --git a/resources/js/activities.js b/resources/js/activities.js
new file mode 100644
index 0000000..f9c19ac
--- /dev/null
+++ b/resources/js/activities.js
@@ -0,0 +1,15 @@
+$.ajaxSetup({
+ headers: {
+ 'X-CSRF-TOKEN': $('input[name="csrf-token"]').attr('content')
+ }
+});
+
+jQuery('select#call-sign').change(fillTable);
+jQuery(document).ready(fillTable);
+
+function fillTable() {
+ sign = jQuery('select#call-sign').first().val();
+ jQuery.post('/api/activities', {'call-sign': sign}, function (data, status) {
+ console.log(data);
+ });
+}
diff --git a/resources/js/reservations.js b/resources/js/reservations.js
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/resources/js/reservations.js
diff --git a/resources/views/pages/activities.blade.php b/resources/views/pages/activities.blade.php
index 57b5100..0c558af 100644
--- a/resources/views/pages/activities.blade.php
+++ b/resources/views/pages/activities.blade.php
@@ -5,40 +5,49 @@
@section('navbar', View::make('inc.special_navbar'))
@section('content')
-@if (count($activities) > 0)
+<input type="hidden" name="csrf-token" content="{{ csrf_token() }}">
+<label for="call-sign">Filter by special callsign: </label>
+<select id="call-sign">
+ <option value="all">All</option>
+ @if (count($signs) > 0)
+ @foreach ($signs as $sign)
+ <option value="{{ $sign->sign }}">{{ $sign->sign }}</option>
+ @endforeach
+ @endif
+</select>
+
<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)
-{{--'approved'--}}
-{{--'specialCall'--}}
-{{--'fromTime'--}}
-{{--'toTime'--}}
-{{--'frequencies'--}}
-{{--'modes'--}}
-{{--'operatorCall'--}}
-{{--'operatorName'--}}
-{{--'operatorEmail'--}}
-{{--'operatorPhone'--}}
-{{--'qso'--}}
- <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 id="ajax-table" class="table table-striped table-bordered">
</table>
</div>
-@else
-<div class="text-center">
- <strong>There are currently no approved activities.</strong>
-</div>
-@endif
+
+{{--@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')
+ <script src="{{ asset('js/activities.js') }}"></script>
+@endsection