<!doctype html>
<html class="no-js" lang="en" ng-app="archDB">
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

	<title ng-controller="TitleController" ng-cloak>{[{ Page.getTitle() }]}</title>

	<!-- Place favicon.ico and apple-touch-icon.png in the root of your domain and delete these references -->
	<link rel="shortcut icon" type="image/x-icon" href="{!! URL::asset('favicon.ico') !!}">

	@section('meta')
		<meta name="description" content="ArchDB - Computer Assistance Database">
		<meta name="author" content="Dan Ursu">
		<meta name="csrf-token" content="{{ csrf_token() }}">

		<meta name="viewport" content="width=device-width,initial-scale=1">
	@show

	@section('css')
		<link rel="stylesheet" type="text/css" href="{{ asset('css/main.css') }}?v={{ time() }}">
		<link rel="stylesheet" type="text/css" href="{{ asset('css/all.css') }}?v={{ time() }}">
		<link rel="stylesheet" type="text/css" href="{{ asset('css/custom_navbar_fix.css') }}?v={{ time() }}">				
		<link rel="stylesheet" type="text/css" href="{{ asset('css/angular-loading-overlay.css') }}?v={{ time() }}">		
	@show

</head>
<body @if(!Request::is('login') && !Request::is('login/*')) ng-app="archDB" @endif>

      
@section('body')
	
	@if(!Request::is('login') && !Request::is('login/*'))
	<div class="angular-loading-overlay">
		<div class="loading-content">
			<div class="loading-spinner">
				<i class="fa fa-spinner fa-spin"></i>
			</div>
			<h3 class="loading-text">Loading Application...</h3>
			<p class="loading-subtext">Please wait while the interface initializes</p>
		</div>
	</div>
	@endif
	

	<div id="wrapper" class="page-container">

		{{-- <navbar></navbar> --}}
		@yield('header')

		<div class="container-fluid @if(!Request::is('login') && !Request::is('login/*')) angular-content-hidden @endif" id="container">

			<div class="row">

				<div class="col-sm-10">
					<!-- API Warnings -->
					<api-warnings></api-warnings>
					
					<div class="content">
						@yield('content')
					</div>
				</div>

				<!-- Side bar -->
				<div class="col-sm-2 relative">
				<div class="col-sm-2 relative">
					@if (Auth::check())
						<sidebar></sidebar>
						{{-- @include('common.sidebar') --}}
					@endif
				</div>
			</div>

		</div> <!--! end of #container -->

	</div>

	<footer>
		<div class="copyright">Copyright &copy; {{ date('Y') }} - Software Assistance. All rights reserved.</div>
	</footer>
	
@show


<!-- Load working vendor.js and app.js from Laravel5 -->
<script type="text/javascript" src="{{ asset('js/vendor.js') }}?v={{ config('app.version', '1.0') }}"></script>
<script type="text/javascript" src="{{ asset('js/app.js') }}?v={{ time() }}"></script>
<script type="text/javascript" src="{{ asset('js/daterangepicker-monday-override.js') }}?v={{ time() }}"></script>

<!-- All v2 scripts (Vue.js, html.js, navforold.js, moment.js) loaded strictly AFTER main app scripts -->
<!-- Do NOT move these above vendor.js or app.js, or jQuery plugins will break -->
<script src="/v2/js/html.js"></script>
<script src="/v2/vender/vue.js"></script>
<!-- Global CSRF Token Manager - Must load BEFORE other scripts that make AJAX requests -->
<script src="{{ asset('js/csrf-manager.js') }}?v={{ time() }}"></script>
<!-- FileUpload CSRF Fix - Must load AFTER csrf-manager and jQuery -->
<script src="{{ asset('js/fileupload-csrf-fix.js') }}?v={{ time() }}"></script>
<!-- Progressive Loading Script - prevents blank pages during initialization -->
<script src="{{ asset('js/progressive-loading.js') }}"></script>
<!-- Configure Vue.js to ignore Angular UI Bootstrap components (only once) -->
<script>
    Vue.config.ignoredElements = [
        'uib-tabset',
        'uib-tab', 
        'uib-tab-heading',
        'uib-rating',
        'uib-modal',
        'uib-dropdown',
        'uib-accordion',
        'uib-accordion-group',
        'uib-alert',
        'uib-carousel',
        'uib-slide',
        'uib-datepicker',
        'uib-timepicker',
        'uib-pagination',
        'uib-pager',
        'uib-popover',
        'uib-tooltip',
        'uib-typeahead',
        'script'  // Ignore script tags to prevent template parsing warnings
    ];
    // Custom template compilation that ignores AngularJS elements
    Vue.config.isCustomElement = function(tag) {
        return tag.startsWith('ng-') || 
               tag.includes('ng-') ||
               tag === 'script' ||
               tag.startsWith('uib-');
    };
    // Suppress Vue warnings for AngularJS templates
    Vue.config.silent = false; // Keep false for debugging, set to true for production
    Vue.config.devtools = true; // Enable Vue devtools for debugging
    // Suppress specific Vue template warnings
    const originalWarn = Vue.config.warnHandler;
    Vue.config.warnHandler = function (msg, vm, trace) {
        // Ignore specific template warnings related to script tags and Angular directives
        if (msg.includes('Templates should only be responsible for mapping the state') ||
            msg.includes('Avoid placing tags with side-effects') ||
            msg.includes('script') ||
            msg.includes('ng-')) {
            return; // Suppress these warnings
        }
        // Log other warnings normally
        if (originalWarn) {
            originalWarn(msg, vm, trace);
        } else {
            console.warn('[Vue warn]: ' + msg + trace);
        }
    };
    console.log('🔧 Vue.js configured to ignore Angular UI Bootstrap components and suppress template warnings');
</script>
<script type="module" src="/v2/js/navforold.js?v={{ time() }}"></script>
<script src="/v2/vender/moment.min.js"></script>
<!-- Add moment-timezone via CDN for proper timezone handling -->
<script src="/v2/vender/moment-timezone-with-data-10-year-range.min.js"></script>
<script>
    // Set default timezone to Europe/London for all moment operations
    // This ensures all dates/times are displayed in UK timezone regardless of user's browser timezone
    if (typeof moment !== 'undefined' && moment.tz && moment.tz.setDefault) {
        moment.tz.setDefault('Europe/London');
        console.log('✅ Moment timezone set to Europe/London');
    } else {
        console.warn('⚠️ Moment timezone not available');
    }
</script>

<!-- Default site configuration -->
<script type="text/javascript">
	var site_url = '/';

	$(document).ready(function(){
		Messenger.options = {
			extraClasses: 'messenger-fixed messenger-on-top',
			theme: 'future'
		};
		$("#tasks_reset_button").click(function () {
            $(".task_radio").prop("checked", false);
        });
	});

</script>

<!-- scripts concatenated and minified via ant build script-->
@section('js')
@show
<!-- end scripts-->

</body>
</html>
