diff --git a/app/Http/Controllers/User/UserClassesController.php b/app/Http/Controllers/User/UserClassesController.php
index b038492..ccd216a 100644
--- a/app/Http/Controllers/User/UserClassesController.php
+++ b/app/Http/Controllers/User/UserClassesController.php
@@ -105,7 +105,12 @@ class UserClassesController extends Controller
if(!$room_arrangement) {
$room_arrangement = Room::where('name', 'Inna sala')->first()->arrangement;
}
- return view('map.seat_map', ['student_name' => $student_name, 'student_surname' => $student_surname, 'student_id_number' => $student_id_number, 'classes_id' => $classes->id, 'seat_numbers' => $seat_numbers, 'room_arrangement' => $room_arrangement]);
+ if(count(explode("++", $room_arrangement)) > 4) {
+ $twoparts = true;
+ } else {
+ $twoparts = false;
+ }
+ return view('map.seat_map', ['student_name' => $student_name, 'student_surname' => $student_surname, 'student_id_number' => $student_id_number, 'classes_id' => $classes->id, 'seat_numbers' => $seat_numbers, 'room_arrangement' => $room_arrangement, 'twoparts' => $twoparts]);
}
public function save_classes_data(Request $request)
@@ -136,7 +141,12 @@ class UserClassesController extends Controller
if(!$room_arrangement) {
$room_arrangement = Room::where('name', 'Inna sala')->first()->arrangement;
}
+ if(count(explode("++", $room_arrangement)) > 4) {
+ $twoparts = true;
+ } else {
+ $twoparts = false;
+ }
}
- return view('user.user_preview_classes', ['classes_id' => $classes_id, 'room_arrangement' => $room_arrangement, 'attendances' => $attendances, 'seat_numbers' => $seat_numbers, 'orderBy' => $orderBy, 'orderDirection' => $orderDirection]);
+ return view('user.user_preview_classes', ['classes_id' => $classes_id, 'room_arrangement' => $room_arrangement, 'attendances' => $attendances, 'seat_numbers' => $seat_numbers, 'orderBy' => $orderBy, 'orderDirection' => $orderDirection, 'twoparts' => $twoparts]);
}
}
diff --git a/public/css/app.css b/public/css/app.css
index 52a91bc..20ea729 100644
--- a/public/css/app.css
+++ b/public/css/app.css
@@ -11210,3 +11210,6 @@ a.text-dark:focus {
.form-custom {
width: auto;
}
+.carousel-control-prev, .carousel-control-next {
+ filter: invert(100%);
+}
diff --git a/public/css/map/seatchart-preview.css b/public/css/map/seatchart-preview.css
index 178feee..0389dce 100644
--- a/public/css/map/seatchart-preview.css
+++ b/public/css/map/seatchart-preview.css
@@ -53,20 +53,19 @@ body {
.preview-attendance-table, .seat-chart-wrapper {
margin: 0 30px;
}
-.seatCharts-space {
- background-color: unset!important;
+div.seatCharts-space {
+ background-color: unset;
}
-.seatCharts-container {
- width: 100%!important;
+div.seatCharts-row {
+ height: 130px;
+ justify-content: flex-start;
+ margin: 0 auto;
+ width: auto;
}
-.seatCharts-row {
- width: 100%!important;
- height: 130px!important;
-}
-.seatCharts-cell {
- width: 120px!important;
- height: 120px!important;
- line-height: 37px!important;
+div.seatCharts-cell {
+ width: 120px;
+ height: 120px;
+ line-height: 37px;
}
.preview-name {
color: rgba(0,0,0,0.7);
diff --git a/public/css/map/seatchart.css b/public/css/map/seatchart.css
index a7d5070..333daad 100644
--- a/public/css/map/seatchart.css
+++ b/public/css/map/seatchart.css
@@ -72,10 +72,10 @@ div.seatCharts-seat {
}
div.seatCharts-row {
height: 100px;
- width: 90%;
display: flex;
- /*align-items: center;*/
- justify-content: center;
+ justify-content: flex-start;
+ margin: 0 auto;
+ width: auto;
}
div.seatCharts-seat.available {
background-color: #649a24;
@@ -94,10 +94,10 @@ div.seatCharts-seat.unavailable {
}
div.seatCharts-container {
- width: 80%;
- padding: 20px 0;
- margin: 0 auto;
text-align: center;
+ width: fit-content;
+ padding: 30px;
+ margin: auto;
}
div.seatCharts-legend {
diff --git a/public/js/map/seatchart-preview.js b/public/js/map/seatchart-preview.js
index b01504f..a72a295 100644
--- a/public/js/map/seatchart-preview.js
+++ b/public/js/map/seatchart-preview.js
@@ -1,10 +1,19 @@
function assignPlaces() {
const attendances = $('.attendance-id');
+ const twoparts = $('#twoparts').val();
attendances.each(function() {
const seat_number = $(this).attr('id').split('++')[0];
const name = $(this).attr('id').split('++')[1];
const surname = $(this).attr('id').split('++')[2];
- const map_seat = $('#seat-map').find(`#${seat_number}`);
+ let map_seat = '';
+ if(!twoparts) {
+ map_seat = $('#seat-map').find(`#${seat_number}`);
+ } else {
+ map_seat = $('#seat-map-first').find(`#${seat_number}`);
+ if (!map_seat.length) {
+ map_seat = $('#seat-map-second').find(`#${seat_number}`);
+ }
+ }
map_seat.html(`${seat_number}
${name} ${surname}`)
map_seat.on('mouseover', () => {
map_seat.css('backgroundColor', 'lightgrey');
@@ -33,14 +42,26 @@ function checkForUnavailablePlaces() {
if(unavailablePlaces){
allPlaces.each(function(){
if(unavailablePlaces.includes($(this).text().split(" ")[0]) && !$(this).parent().hasClass('seatCharts-legendItem')) {
- $(this).addClass('taken');
- console.log($(this));
- }
+ $(this).addClass('taken');}
});
}
}
+function checkMap() {
+ const $this = $('#map-carousel');
+ if ($('.carousel-inner .item:first').hasClass('active')) {
+ $this.children('.left.carousel-control').hide();
+ $this.children('.right.carousel-control').show();
+ } else if ($('.carousel-inner .item:last').hasClass('active')) {
+ $this.children('.right.carousel-control').hide();
+ $this.children('.left.carousel-control').show();
+ } else {
+ $this.children('.carousel-control').show();
+ }
+}
+
$(document).ready(function(){
assignPlaces();
checkForUnavailablePlaces();
+ $('#map-carousel').on('slid.bs.carousel', checkMap);
});
diff --git a/public/js/map/seatchart.js b/public/js/map/seatchart.js
index 39126bb..85beb85 100644
--- a/public/js/map/seatchart.js
+++ b/public/js/map/seatchart.js
@@ -1,101 +1,133 @@
-var firstSeatLabel = 1;
-
$(document).ready(function() {
- const seat_map = $('#room_arrangement').val().split('++');
- var $cart = $('#selected-seats'),
- seatNumber = '',
- $counter = $('#counter'),
- $total = $('#total'),
- sc = $('#seat-map').seatCharts({
- map: seat_map,
- seats: {
- h: {
- price : 2500,
- classes : 'student-class',
- category: 'Student Seat'
+ function createMap(seats_rows, seats_container) {
+ let $cart = $('#selected-seats');
+ let seat_selected = false;
+ seats_container.seatCharts({
+ map: seats_rows,
+ naming: {
+ rows: ['', '', '', ''],
+ top: false,
+ left: false,
},
- },
- naming : {
- rows: ['','','',''],
- top : false,
- left: false,
- getLabel : function (character, row, column) {
- if (row === '1') {
- return column;
- } else if (row === '2') {
- return column;
- } else if (row === '3') {
- return column;
- }
+ legend: {
+ node: $('#legend'),
+ items: [
+ ['c', 'available', 'Dostępne miejsce'],
+ ['f', 'unavailable', 'Zajęte miejsce']
+ ]
},
- },
- legend : {
- node : $('#legend'),
- items : [
- [ 'c', 'available', 'Dostępne miejsce'],
- [ 'f', 'unavailable', 'Zajęte miejsce']
- ]
- },
- click: function () {
- if (this.status() == 'available' && recalculateTotal(sc) < 1) {
- //let's create a new
{{ App\Subject::find(App\Classes::find($classes_id)->subject_id)->name }}, @@ -21,7 +21,36 @@ sala {{ App\Room::find(App\Subject::find(App\Classes::find($classes_id)->subject_id)->room_id)->name }}
+ {{ App\Subject::find(App\Classes::find($classes_id)->subject_id)->name }}, + {{ App\Subject::find(App\Classes::find($classes_id)->subject_id)->weekday }} + {{ App\Classes::find($classes_id)->date }} {{ App\Subject::find(App\Classes::find($classes_id)->subject_id)->time }}, + sala {{ App\Room::find(App\Subject::find(App\Classes::find($classes_id)->subject_id)->room_id)->name }} +
+Kod: {{ $classes_code }}