<template>
    <div>
        <nav class="navbar navbar-expand-lg navbar-dark fixed-top navbar-shrink" id="mainNav">
            <div class="container">
                <a class="navbar-brand js-scroll-trigger" href="/">NG-Tracker</a>
                <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse"
                        data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false"
                        aria-label="Toggle navigation">
                    Menu
                    <i class="fa fa-bars"></i>
                </button>
                <div class="collapse navbar-collapse" id="navbarResponsive">
                    <ul class="navbar-nav text-uppercase ml-auto">
                        <li class="nav-item">
                            <a class="nav-link js-scroll-trigger" target="_blank" href="#landing">НИО-17</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link js-scroll-trigger" target="_blank" href="http://is.ulstu.ru">Сайт
                                кафедры</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link js-scroll-trigger" target="_blank"
                               th:href="@{'http://timetable.athene.tech?filter='+${currentUser}}">Расписание</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link js-scroll-trigger" target="_blank" href="https://kias.rfbr.ru/">КИАС
                                РФФИ</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link js-scroll-trigger" href="/logout">Выход</a>
                        </li>
                    </ul>
                </div>
            </div>
        </nav>
        <div class="container-fluid">
            <section id="portfolio">
                <div class="container">

                <router-view></router-view>
                </div>
            </section>
        </div>
        <footer>
            <div class="container">
                <div class="row">
                    <div class="col-md-4">
                        <span class="copyright">Copyright © НИО17 2018</span>
                    </div>
                    <div class="col-md-4">
                    </div>
                    <div class="col-md-4">
                        <ul class="list-inline quicklinks">
                            <li class="list-inline-item">
                                <a href="/swagger-ui.html">Разработчикам</a>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
        </footer>
    </div>
</template>

<script>
    module.exports = {
        components: {
            "app-messages": httpVueLoaderEx("/core-components/app-messages.vue"),
            "paper-list": httpVueLoaderEx("/papers/paper-list.vue")
        },
        methods: {
            getVersion: function () {
                return appConfig.version;
            },
            getMessage: function () {
                return "hell, Vue!";
            }
        },
        mounted: function () {
            this.$nextTick(function () {
                var self = this;
                window.onerror = function myErrorHandler(errorMsg, url, lineNumber) {
                    self.$store.dispatch("addDangerMessage", lineNumber + ": " + errorMsg + " (" + url + ")");
                };
            });
        }
    }
</script>