frontend fixes, timezone updated, delete confirmation added

This commit is contained in:
s416422 2019-12-20 14:09:16 +01:00
parent 1a1d79a5f4
commit 1cbbfe6186
17 changed files with 199 additions and 112 deletions

View File

@ -12,18 +12,16 @@ use App\Room;
class UserSubjectsController extends Controller class UserSubjectsController extends Controller
{ {
public function index($groupBy = 'weekday') { public function index($groupBy = 'weekday') {
setlocale(LC_ALL, 'pl', 'pl_PL', 'pl_PL.ISO8859-2', 'plk', 'polish', 'Polish');
$user_id = Auth::id(); $user_id = Auth::id();
$subjects = Subject::where('user_id', $user_id)->orderBy('name','ASC')->get(); $subjects = Subject::where('user_id', $user_id)->orderBy('name','ASC')->get();
$subjects_grouped = $subjects->groupBy($groupBy); $subjects_grouped = $subjects->groupBy($groupBy);
$rooms = Room::all(); $rooms = Room::all();
$weekdays = ['Poniedziałek', 'Wtorek', 'Środa', 'Czwartek', 'Piątek', 'Sobota', 'Niedziela']; $weekdays = ['Poniedziałek', 'Wtorek', 'Środa', 'Czwartek', 'Piątek', 'Sobota', 'Niedziela'];
// $types = ['Lecture', 'Excercises', 'Labs', 'Other'];
$defaultTime = date("H:i"); $defaultTime = date("H:i");
if(date('w')-1 < 0 ) { if(date('w')-1 < 0 ) {
$defaultWeekday = $weekdays[6]; $defaultWeekday = $weekdays[6];
} else { } else {
$defaultWeekday = "Poniedziałek";//$weekdays[date('w') - 1]; $defaultWeekday = $weekdays[date('w') - 1];
} }
return view('user.user_subjects', ['subjects' => $subjects, 'weekdays' => $weekdays, 'subjects_grouped' => $subjects_grouped, 'grouped_by' => $groupBy, 'defaultTime' => $defaultTime, 'defaultWeekday' => $defaultWeekday, 'rooms' => $rooms]); return view('user.user_subjects', ['subjects' => $subjects, 'weekdays' => $weekdays, 'subjects_grouped' => $subjects_grouped, 'grouped_by' => $groupBy, 'defaultTime' => $defaultTime, 'defaultWeekday' => $defaultWeekday, 'rooms' => $rooms]);
} }

View File

@ -67,7 +67,7 @@ return [
| |
*/ */
'timezone' => 'UTC', 'timezone' => 'Europe/Warsaw',
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------

View File

@ -11157,7 +11157,7 @@ a.text-dark:focus {
margin-bottom: 50px; margin-bottom: 50px;
} }
.subjects-table { .custom-table {
margin-bottom: 50px; margin-bottom: 50px;
} }
@ -11198,3 +11198,4 @@ a.text-dark:focus {
main { main {
padding-top: 20px; padding-top: 20px;
} }

View File

@ -217,10 +217,18 @@ a.checkout-button {
padding: 50px 100px; padding: 50px 100px;
font-size: 30px; font-size: 30px;
display: none; display: none;
width: 70%; width: 50%;
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1), 0 3px 10px 0 rgba(0, 0, 0, 0.1); box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1), 0 3px 10px 0 rgba(0, 0, 0, 0.1);
} }
.card-reader div {
margin: 5px 0;
}
.card-reader-form input {
width: 50%;
padding: 10px;
font-size: 20px;
border: 1px solid #3490dc;
}
.card-reader.open { .card-reader.open {
display: block; display: block;
} }

View File

@ -5,7 +5,7 @@
.preview-page-content { .preview-page-content {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: flex-start;
height: 100%; height: 100%;
margin: 40px; margin: 40px;
} }

View File

@ -7,18 +7,26 @@ $(document).ready(function(){
$('.add-subject-btn').on('click', function () { $('.add-subject-btn').on('click', function () {
$('.add-subject').toggleClass('open'); $('.add-subject').toggleClass('open');
if ($('.add-subject').first().hasClass('open')) { if ($('.add-subject').first().hasClass('open')) {
$(this).text('Anuluj') $(this).addClass('btn-danger');
$(this).html('<i class="fa fa-times"></i> Anuluj');
$(this).attr('title', 'Anuluj');
} else { } else {
$(this).text('Dodaj nowy') $(this).removeClass('btn-danger');
$(this).html('<i class="fa fa-plus"></i> Dodaj nowy przedmiot');
$(this).attr('title', 'Dodaj nowy przedmiot');
} }
}); });
$('.add-attendance-btn').on('click', function () { $('.add-attendance-btn').on('click', function () {
$('.add-attendance').toggleClass('open'); $('.add-attendance').toggleClass('open');
if ($('.add-attendance').first().hasClass('open')) { if ($('.add-attendance').first().hasClass('open')) {
$(this).text('Anuluj') $(this).addClass('btn-danger');
$(this).html('<i class="fa fa-times"></i> Anuluj');
$(this).attr('title', 'Anuluj');
} else { } else {
$(this).text('Dodaj nowy wpis') $(this).removeClass('btn-danger');
$(this).html('<i class="fa fa-plus"></i> Dodaj nowy wpis');
$(this).attr('title', 'Dodaj nowy wpis');
} }
}); });
@ -59,5 +67,4 @@ $(document).ready(function(){
}); });
} }
setSelectedOptionGroup(); setSelectedOptionGroup();
}); });

View File

@ -16,6 +16,7 @@
<link href="https://fonts.googleapis.com/css?family=Nunito:200,600" rel="stylesheet"> <link href="https://fonts.googleapis.com/css?family=Nunito:200,600" rel="stylesheet">
<!-- Styles --> <!-- Styles -->
<link rel="stylesheet" type="text/css" href="//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link href="{{ asset('css/app.css') }}" rel="stylesheet"> <link href="{{ asset('css/app.css') }}" rel="stylesheet">
<link rel="shortcut icon" href="{{ asset('img/favicon.png') }}"> <link rel="shortcut icon" href="{{ asset('img/favicon.png') }}">
@yield('additional_meta') @yield('additional_meta')
@ -61,8 +62,8 @@
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown"> <div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="{{ route('logout') }}" <a class="dropdown-item" href="{{ route('logout') }}"
onclick="event.preventDefault(); onclick="event.preventDefault();
document.getElementById('logout-form').submit();"> document.getElementById('logout-form').submit();"> <i class="fa fa-power-off"></i>
{{ __('Wyloguj się') }} {{ __(' Wyloguj się ') }}
</a> </a>
<form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;"> <form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
@csrf @csrf

View File

@ -18,8 +18,8 @@
<textarea class="form-control" id="note_content" name="note_content">{{ $attendance->notes }}</textarea> <textarea class="form-control" id="note_content" name="note_content">{{ $attendance->notes }}</textarea>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Anuluj</button> <button type="button" class="btn btn-secondary" data-dismiss="modal" title="Anuluj"> Anuluj </button>
<button type="submit" class="btn btn-primary">Zapisz</button> <button type="submit" class="btn btn-primary" title="Zapisz notatkę"> Zapisz </button>
</div> </div>
</form> </form>
</div> </div>

View File

@ -1,4 +1,4 @@
<table class="table table-striped subjects-table"> <table class="table table-striped table-borderless custom-table">
<tr class="thead-dark"> <tr class="thead-dark">
<th> Nazwa zajęć </th> <th> Nazwa zajęć </th>
<th> Nr indeksu </th> <th> Nr indeksu </th>
@ -21,24 +21,25 @@
<td> {{ $attendance->student_name}}</td> <td> {{ $attendance->student_name}}</td>
<td> {{ $attendance->seat_number }} </td> <td> {{ $attendance->seat_number }} </td>
@if(!$export == 1) @if(!$export == 1)
<td>
<a href="{{ route('user_delete_attendance', [$attendance->id]) }}" name="delete-attendance-btn" class="btn btn-danger"> Usuń </a>
</td>
@if(!$attendance->notes) @if(!$attendance->notes)
<td> <td>
<button type="button" name="note-attendance-btn" class="btn btn-info" data-toggle="modal" data-target="#noteModal-{{ $attendance->id }}"> Dodaj notatkę </button> <button type="button" name="note-attendance-btn" class="btn btn-primary" data-toggle="modal" data-target="#noteModal-{{ $attendance->id }}" title="Dodaj notatkę"> <i class="fa fa-plus"></i> Dodaj notatkę </button>
</td> </td>
@else @else
<td> <td>
<button type="button" name="note-attendance-btn" class="btn btn-info" data-toggle="modal" data-target="#noteModal-{{ $attendance->id }}"> Edytuj notatkę </button> <button type="button" name="note-attendance-btn" class="btn btn-secondary" data-toggle="modal" data-target="#noteModal-{{ $attendance->id }}" title="Edytuj notatkę"> <i class="fa fa-pencil"></i> Edytuj notatkę </button>
</td> </td>
@endif @endif
@include('user.attendance_note', [$attendance]) <td>
<button type="button" name="delete-attendance-btn" class="btn btn-danger" data-toggle="modal" data-target="#attendanceConfirmationModal-{{ $attendance->id }}" title="Usuń wpis"> <i class="fa fa-trash-o"></i> Usuń </button>
</td>
@else @else
<td> <td>
{{ $attendance->notes }} {{ $attendance->notes }}
</td> </td>
@endif @endif
</tr> </tr>
@include('user.attendance_note', [$attendance])
@include('user.delete_confirmation_attendance', [$attendance])
@endforeach @endforeach
</table> </table>

View File

@ -1,4 +1,4 @@
<table class="table subjects-table"> <table class="table table-borderless custom-table">
<tr class="thead-light"> <tr class="thead-light">
<th> Nr indeksu </th> <th> Nr indeksu </th>
<th> Nazwisko </th> <th> Nazwisko </th>
@ -18,25 +18,26 @@
<td> {{ $attendance->student_name}}</td> <td> {{ $attendance->student_name}}</td>
<td> {{ $attendance->seat_number }} </td> <td> {{ $attendance->seat_number }} </td>
@if(!$export == 1) @if(!$export == 1)
<td>
<a href="{{ route('user_delete_attendance', [$attendance->id]) }}" name="delete-attendance-btn" class="btn btn-danger"> Usuń </a>
</td>
@if(!$attendance->notes) @if(!$attendance->notes)
<td> <td>
<button type="button" name="note-attendance-btn" class="btn btn-info" data-toggle="modal" data-target="#noteModal-{{ $attendance->id }}"> Dodaj notatkę </button> <button type="button" name="note-attendance-btn" class="btn btn-primary" data-toggle="modal" data-target="#noteModal-{{ $attendance->id }}" title="Dodaj notatkę"> <i class="fa fa-plus"></i> <i class="fa fa-sticky-note"></i> </button>
</td> </td>
@else @else
<td> <td>
<button type="button" name="note-attendance-btn" class="btn btn-info" data-toggle="modal" data-target="#noteModal-{{ $attendance->id }}"> Edytuj notatkę </button> <button type="button" name="note-attendance-btn" class="btn btn-secondary" data-toggle="modal" data-target="#noteModal-{{ $attendance->id }}" title="Edytuj notatkę"> <i class="fa fa-pencil"></i> <i class="fa fa-sticky-note"></i> </button>
</td> </td>
@endif @endif
@include('user.attendance_note', [$attendance]) <td>
<button type="button" name="delete-attendance-btn" class="btn btn-danger" data-toggle="modal" data-target="#attendanceConfirmationModal-{{ $attendance->id }}" title="Usuń wpis"> <i class="fa fa-trash-o"></i></button>
</td>
@else @else
<td> <td>
{{ $attendance->notes }} {{ $attendance->notes }}
</td> </td>
@endif @endif
</tr> </tr>
@include('user.attendance_note', [$attendance])
@include('user.delete_confirmation_attendance', [$attendance])
@endforeach @endforeach
</table> </table>

View File

@ -0,0 +1,21 @@
<div class="modal fade" id="attendanceConfirmationModal-{{ $attendance->id }}" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5> Usuwanie wpisu obecności </h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<p> Czy na pewno chcesz usunąć obecność studenta {{ $attendance->student_name }} {{ $attendance->student_surname }}
(numer indeksu {{ $attendance->student_id_number }}) z zajęć {{ App\Subject::find(App\Classes::find($attendance->classes_id)->subject_id)->name }},
które odbyły się {{ App\Classes::find($attendance->classes_id)-> date }} o godzinie {{ App\Subject::find(App\Classes::find($attendance->classes_id)->subject_id)->time }}?</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal" title="Anuluj"> Anuluj </button>
<a href="{{ route('user_delete_attendance', [$attendance->id]) }}" name="delete-attendance-btn" class="btn btn-danger" title="Usuń wpis"> Tak, usuń </a>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,20 @@
<div class="modal fade" id="classesConfirmationModal-{{ $classes_item->id }}" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5> Usuwanie zajęć </h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<p> Czy na pewno chcesz usunąć zajęcia {{ App\Subject::find(App\Classes::find($classes_item->id)->subject_id)->name }}, które odbyły się
{{ App\Classes::find($classes_item->id)-> date }} o godzinie {{ App\Subject::find(App\Classes::find($classes_item->id)->subject_id)->time }}?</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal" title="Anuluj"> Anuluj </button>
<a href="{{ route('user_delete_classes', [$classes_item->id]) }}" name="delete-classes-btn" class="btn btn-danger" title="Usuń zajęcia"> Tak, usuń </a>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,19 @@
<div class="modal fade" id="subjectConfirmationModal-{{ $subject->id }}" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5> Usuwanie przedmiotu </h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<p> Czy na pewno chcesz usunąć przedmiot {{ $subject->name }}, który odbywa się w każdy {{ $subject->weekday }} o godzinie {{ $subject->time }} w sali {{ App\Room::find($subject->room_id)->name }}?</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal" title="Anuluj"> Anuluj </button>
<a href="{{ route('user_delete_subject', [$subject->id]) }}" name="delete-subject-btn" class="btn btn-danger hover-btn" title="Usuń przedmiot"> Tak, usuń </a>
</div>
</div>
</div>
</div>

View File

@ -6,8 +6,11 @@
<div class="row justify-content-center"> <div class="row justify-content-center">
<div class="col-md-12"> <div class="col-md-12">
<div class="card-header custom-header"> <div class="card-header custom-header">
<h4> Wszystkie obecności: ({{ $attendances->count() }}) </h4> <h4> Wszystkie obecności <span class="badge badge-secondary"> {{ $attendances->count() }} </span> </h4>
<button type="button" class="btn btn-primary btn-custom add-attendance-btn"> Dodaj nowy wpis </button> <div>
<a href="{{ route('user_export_grouped', [$grouped_by]) }}" class="btn btn-success btn-export" title="Wyeksportuj wszystko do xlsx"> <i class="fa fa-file-excel-o"></i> Wyeksportuj (.xlsx) </a>
<button type="button" class="btn btn-primary add-attendance-btn" title="Dodaj nowy wpis"> <i class="fa fa-plus"></i> Dodaj nowy wpis </button>
</div>
</div> </div>
<div class="card-body add-attendance"> <div class="card-body add-attendance">
@ -22,7 +25,6 @@
<select id="classes_id" class="form-control @error('classes_id') is-invalid @enderror" name="classes_id" required> <select id="classes_id" class="form-control @error('classes_id') is-invalid @enderror" name="classes_id" required>
@foreach ($classes as $classes_item) @foreach ($classes as $classes_item)
<option value="{{ $classes_item->id }}">{{ App\Subject::find(App\Classes::find($classes_item->id)->subject_id)->name }}, <option value="{{ $classes_item->id }}">{{ App\Subject::find(App\Classes::find($classes_item->id)->subject_id)->name }},
{{ App\Subject::find(App\Classes::find($classes_item->id)->subject_id)->type }},
{{ App\Classes::find($classes_item->id)-> date }} {{ App\Subject::find(App\Classes::find($classes_item->id)->subject_id)->time }} {{ App\Classes::find($classes_item->id)-> date }} {{ App\Subject::find(App\Classes::find($classes_item->id)->subject_id)->time }}
</option> </option>
@endforeach @endforeach
@ -108,7 +110,7 @@
<div class="form-group row mb-0"> <div class="form-group row mb-0">
<div class="col-md-6 offset-md-4"> <div class="col-md-6 offset-md-4">
<button type="submit" class="btn btn-primary"> <button type="submit" class="btn btn-primary" title="Dodaj nowy wpis">
{{ __('Dodaj') }} {{ __('Dodaj') }}
</button> </button>
</div> </div>
@ -133,14 +135,16 @@
@if($grouped_by == 'classes_id') @if($grouped_by == 'classes_id')
<h5 class="card-title"> {{ App\Subject::find(App\Classes::find($attendances_group_name)->subject_id)->name }}, <h5 class="card-title"> {{ App\Subject::find(App\Classes::find($attendances_group_name)->subject_id)->name }},
{{ App\Classes::find($attendances_group_name)-> date }} {{ App\Subject::find(App\Classes::find($attendances_group_name)->subject_id)->time }} {{ App\Classes::find($attendances_group_name)-> date }} {{ App\Subject::find(App\Classes::find($attendances_group_name)->subject_id)->time }}
({{ $attendances_list->count() }}) </h5> <span class="badge badge-secondary"> {{ $attendances_list->count() }}</span> </h5>
@else @else
<h5 class="card-title"> {{ $attendances_group_name }} ({{ $attendances_list->count() }}) </h5> <h5 class="card-title"> {{ $attendances_group_name }} <span class="badge badge-secondary"> {{ $attendances_list->count() }} </span> </h5>
@endif @endif
@else @else
<h5 class="card-title"> Inne ({{ $attendances_list->count() }})</h5> <h5 class="card-title"> Inne <span class="badge badge-secondary"> {{ $attendances_list->count() }}</span></h5>
@endif @endif
<div class="table-responsive">
@include('user.attendances_table', ['attendances_list' => $attendances_list, 'export' => 0]) @include('user.attendances_table', ['attendances_list' => $attendances_list, 'export' => 0])
</div>
@endforeach @endforeach
</div> </div>
@else @else

View File

@ -46,7 +46,7 @@
<div class="form-group row mb-0"> <div class="form-group row mb-0">
<div class="col-md-6 offset-md-4"> <div class="col-md-6 offset-md-4">
<button type="submit" class="btn btn-primary"> <button type="submit" class="btn btn-primary" title="Dodaj zajęcia i rozpocznij zapisy">
{{ __('Dodaj zajęcia i rozpocznij zapisy') }} {{ __('Dodaj zajęcia i rozpocznij zapisy') }}
</button> </button>
</div> </div>
@ -55,7 +55,7 @@
</div> </div>
@if ($classes->count() > 0) @if ($classes->count() > 0)
<div class="card-header custom-header"> <div class="card-header custom-header">
<h4> Moje zajęcia: ({{ $classes->count() }}) </h4> <h4> Moje zajęcia <span class="badge badge-secondary"> {{ $classes->count() }} </span> </h4>
</div> </div>
<div class="card-body card-custom"> <div class="card-body card-custom">
@ -72,14 +72,15 @@
@if($classes_group_name) @if($classes_group_name)
@if($grouped_by == 'subject_id') @if($grouped_by == 'subject_id')
<h5 class="card-title"> {{ App\Subject::find($classes_group_name)->name }}, <h5 class="card-title"> {{ App\Subject::find($classes_group_name)->name }},
{{ App\Subject::find($classes_group_name)->weekday }} {{ App\Subject::find($classes_group_name)->time }} ({{ $classes_list->count() }}) </h5> {{ App\Subject::find($classes_group_name)->weekday }} {{ App\Subject::find($classes_group_name)->time }} <span class="badge badge-secondary"> {{ $classes_list->count() }} </span> </h5>
@else @else
<h5 class="card-title"> {{ $classes_group_name }} ({{ $classes_list->count() }}) </h5> <h5 class="card-title"> {{ $classes_group_name }} <span class="badge badge-secondary"> {{ $classes_list->count() }} </span> </h5>
@endif @endif
@else @else
<h5 class="card-title"> Inne ({{ $classes_list->count() }})</h5> <h5 class="card-title"> Inne <span class="badge badge-secondary"> {{ $classes_list->count() }} </span></h5>
@endif @endif
<table class="table table-striped subjects-table"> <div class="table-responsive">
<table class="table table-striped table-borderless custom-table">
<tr class="thead-dark"> <tr class="thead-dark">
<th> Nazwa przedmiotu </th> <th> Nazwa przedmiotu </th>
<th> Data </th> <th> Data </th>
@ -94,18 +95,20 @@
<td> {{ $classes_item->date }} </td> <td> {{ $classes_item->date }} </td>
<td> <td>
@if($classes_item->classes_code) @if($classes_item->classes_code)
<a href="{{ route('user_start_classes', [$classes_item->id]) }}" name="start-classes-btn" class="btn btn-warning"> Kontynuuj zapisy </a> <a href="{{ route('user_start_classes', [$classes_item->id]) }}" name="start-classes-btn" class="btn btn-secondary" title="Kontynuuj zapisy"> <i class="fa fa-play"></i> Kontynuuj zapisy </a>
@endif @endif
</td> </td>
<td> <td>
<a href="{{ route('user_preview_classes', [$classes_item->id]) }}" name="preview-classes-btn" class="btn btn-info"> Zobacz podgląd sali </a> <a href="{{ route('user_preview_classes', [$classes_item->id]) }}" name="preview-classes-btn" class="btn btn-primary" title="Zobacz podgląd sali"> <i class="fa fa-television"></i> Zobacz salę </a>
</td> </td>
<td> <td>
<a href="{{ route('user_delete_classes', [$classes_item->id]) }}" name="delete-classes-btn" class="btn btn-danger"> Usuń </a> <button type="button" name="delete-classes-btn" class="btn btn-danger" data-toggle="modal" data-target="#classesConfirmationModal-{{ $classes_item->id }}" title="Usuń zajęcia"> <i class="fa fa-trash-o"></i> Usuń </button>
</td> </td>
</tr> </tr>
@include('user.delete_confirmation_classes', [$classes_item])
@endforeach @endforeach
</table> </table>
</div>
@endforeach @endforeach
</div> </div>
@else @else

View File

@ -28,8 +28,8 @@
<div class="preview-page-content"> <div class="preview-page-content">
<div class="preview-attendance-table"> <div class="preview-attendance-table">
<div class="card-header custom-header"> <div class="card-header custom-header">
<h4> Lista obecności </h4> <h4> Lista obecności <span class="badge badge-secondary"> {{ $attendances->count() }} </span></h4>
<a href="{{ route('user_export', [$classes_id]) }}" class="btn btn-success btn-export"> Wyeksportuj do xlsx </a> <a href="{{ route('user_export', [$classes_id]) }}" class="btn btn-success btn-export" title="Wyeksportuj tabelę do xlsx"> <i class="fa fa-file-excel-o"></i> Wyeksportuj (.xlsx) </a>
</div> </div>
<div class="card-body card-custom"> <div class="card-body card-custom">
<span class="sort-span"> Sortuj: </span> <span class="sort-span"> Sortuj: </span>
@ -44,8 +44,10 @@
<option value="{{ route('user_preview_classes', ['classes_id' => $classes_id, 'orderBy' => 'seat_number', 'orderDirection' => 'DESC']) }}">po numerze miejsca malejąco</option> <option value="{{ route('user_preview_classes', ['classes_id' => $classes_id, 'orderBy' => 'seat_number', 'orderDirection' => 'DESC']) }}">po numerze miejsca malejąco</option>
</select> </select>
</div> </div>
<div class="table-responsive">
@include('user.attendances_table_preview', ['attendances' => $attendances, 'export' => 0]) @include('user.attendances_table_preview', ['attendances' => $attendances, 'export' => 0])
</div> </div>
</div>
<div class="seat-chart-wrapper"> <div class="seat-chart-wrapper">
@if($twoparts) @if($twoparts)
<div id="map-carousel" class="carousel slide" data-ride="carousel" data-interval="false" data-wrap="false"> <div id="map-carousel" class="carousel slide" data-ride="carousel" data-interval="false" data-wrap="false">

View File

@ -6,8 +6,8 @@
<div class="row justify-content-center"> <div class="row justify-content-center">
<div class="col-md-12"> <div class="col-md-12">
<div class="card-header custom-header"> <div class="card-header custom-header">
<h4> Moje przedmioty: ({{ $subjects->count() }}) </h4> <h4> Moje przedmioty <span class="badge badge-secondary"> {{ $subjects->count() }} </span></h4>
<button type="button" class="btn btn-primary btn-custom add-subject-btn"> Dodaj nowy </button> <button type="button" class="btn btn-primary add-subject-btn" title="Dodaj nowy przedmiot"> <i class="fa fa-plus"></i> Dodaj nowy przedmiot </button>
</div> </div>
<div class="card-body add-subject"> <div class="card-body add-subject">
@ -101,7 +101,7 @@
<div class="form-group row mb-0"> <div class="form-group row mb-0">
<div class="col-md-6 offset-md-4"> <div class="col-md-6 offset-md-4">
<button type="submit" class="btn btn-primary"> <button type="submit" class="btn btn-primary" title="Dodaj nowy przedmiot">
{{ __('Dodaj') }} {{ __('Dodaj') }}
</button> </button>
</div> </div>
@ -126,17 +126,17 @@
@foreach ($subjects_grouped as $subject_group_name => $subjects_list) @foreach ($subjects_grouped as $subject_group_name => $subjects_list)
@if($subject_group_name) @if($subject_group_name)
@if($grouped_by == 'room_id') @if($grouped_by == 'room_id')
<h5 class="card-title"> {{ App\Room::find($subject_group_name)->name }} ({{ $subjects_list->count() }}) </h5> <h5 class="card-title"> {{ App\Room::find($subject_group_name)->name }} <span class="badge badge-secondary"> {{ $subjects_list->count() }} </span></h5>
@else @else
<h5 class="card-title"> {{ $subject_group_name }} ({{ $subjects_list->count() }})</h5> <h5 class="card-title"> {{ $subject_group_name }} <span class="badge badge-secondary"> {{ $subjects_list->count() }} </span></h5>
@endif @endif
@else @else
<h5 class="card-title"> Inne ({{ $subjects_list->count() }})</h5> <h5 class="card-title"> Inne <span class="badge badge-secondary"> {{ $subjects_list->count() }} </span></h5>
@endif @endif
<table class="table table-striped subjects-table"> <div class="table-responsive">
<table class="table table-striped table-borderless custom-table">
<tr class="thead-dark"> <tr class="thead-dark">
<th> Nazwa </th> <th> Nazwa </th>
{{--<th> Type </th>--}}
<th> Dzień tygodnia </th> <th> Dzień tygodnia </th>
<th> Godzina </th> <th> Godzina </th>
<th> Prowadzący </th> <th> Prowadzący </th>
@ -147,20 +147,21 @@
@foreach ($subjects_list as $subject) @foreach ($subjects_list as $subject)
<tr> <tr>
<td> {{ $subject->name }} </td> <td> {{ $subject->name }} </td>
{{--<td> {{ $subject->type }} </td>--}}
<td> {{ $subject->weekday }} </td> <td> {{ $subject->weekday }} </td>
<td> {{ $subject->time }} </td> <td> {{ $subject->time }} </td>
<td> {{ App\User::find($subject->user_id)->name }} {{ App\User::find($subject->user_id)->surname }}</td> <td> {{ App\User::find($subject->user_id)->name }} {{ App\User::find($subject->user_id)->surname }}</td>
<td> {{ App\Room::find($subject->room_id)->name }} </td> <td> {{ App\Room::find($subject->room_id)->name }} </td>
<td> <td>
<a href="{{ route('user_delete_subject', [$subject->id]) }}" name="delete-subject-btn" class="btn btn-danger"> Usuń </a> <button type="button" name="delete-subject-btn" class="btn btn-danger" data-toggle="modal" data-target="#subjectConfirmationModal-{{ $subject->id }}" title="Usuń przedmiot"> <i class="fa fa-trash-o"></i> Usuń </button>
</td>
<td>
<a href="{{ route('user_edit_subject', [$subject->id]) }}" name="edit-subject-btn" class="btn btn-secondary" title="Edytuj przedmiot"> <i class="fa fa-pencil"></i> Edytuj </a>
</td> </td>
{{--<td>--}}
{{--<a href="{{ route('user_edit_subject', [$subject->id]) }}" name="edit-subject-btn" class="btn btn-secondary"> Edytuj </a>--}}
{{--</td>--}}
</tr> </tr>
@include('user.delete_confirmation_subject', [$subject])
@endforeach @endforeach
</table> </table>
</div>
@endforeach @endforeach
</div> </div>
@else @else