klnodekb/views/vehicle_details.pug

62 lines
2.1 KiB
Plaintext

extends layout_vehicles
block content
link(rel='stylesheet' href='/bower_components/jquery-typeahead/dist/jquery.typeahead.min.css')
link(rel='stylesheet', href='https://use.fontawesome.com/releases/v5.6.1/css/all.css', integrity='sha384-gfdkjb5BdAXd+lj+gudLWI+BXq4IuLW5IT+brZEZsLFm++aCMlF1V92rMkPaX4PP', crossorigin='anonymous')
link(href='https://cdn.jsdelivr.net/npm/bootstrap@4.5.0/dist/css/bootstrap.css' rel='stylesheet')
link(href='https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.13.1/css/all.css' rel='stylesheet')
style(type="text/css").
#calendar {
max-width: 1100px;
margin: 40px auto;
}
.container#wrapper(style='width:100%;')
h2.contHeader #{title}
#calendar(style="background-color: white")
//-script(type='text/javascript',src='/build/pdfmake.js')
//-script(type='text/javascript', src='/core/index.global.min.js')
script.
document.addEventListener('DOMContentLoaded', function() {
$.ajax({
url: "/vehicles/getvehicle/#{Vehicle._id}",
type: 'GET',
dataType: 'json', // added data type
success: function(res) {
//console.log(res.at(-1).title);
// alert(res.at(-1).title);
var newEvent = new Object();
newEvent.title = "some text";
newEvent.start = new Date();
newEvent.allDay = false;
var calendarEl = document.getElementById('calendar');
var calendar = new FullCalendar.Calendar(calendarEl, {
initialView: 'dayGridMonth',
locale: 'hu',
firstDay: 1,
initialEvents: res,
weekNumbers: true,
themeSystem: 'default'});
calendar.render();
}
});
});
$(document).ready(function () {
/* var vehi="#{Vehicle.lastCity[0]}";
if (typeof vehi != undefined)
console.log("veh:"+vehi); */
// $("#vehicle").click();
// $("#vehiclelist").addClass("active");
});