@using System.Collections
@using System.Net.Http
@using System.Web.Mvc.Html
@using Umbraco.Core
@using ClientDependency.Core
@using ClientDependency.Core.Mvc
@using Microsoft.Owin.Security
@using Newtonsoft.Json
@using Newtonsoft.Json.Linq
@using Umbraco.Core.IO
@using Umbraco.Web
@using Umbraco.Web.Editors
@using Umbraco.Core.Configuration
@inherits System.Web.Mvc.WebViewPage<Umbraco.Web.Editors.BackOfficeModel>
@{
    Layout = null;

    Html
        .RequiresCss("assets/css/umbraco.css", "Umbraco")
        .RequiresCss("lib/bootstrap-social/bootstrap-social.css", "Umbraco")
        .RequiresCss("lib/font-awesome/css/font-awesome.min.css", "Umbraco");
}

<!DOCTYPE html>

<html lang="en">
<head>
    <base href="@Model.GlobalSettings.Path.EnsureEndsWith('/')" />
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>Umbraco</title>

    @Html.RenderCssHere(
        new BasicPath("Umbraco", IOHelper.ResolveUrl(SystemDirectories.Umbraco)))

    @*Because we're lazy loading angular js, the embedded cloak style will not be loaded initially, but we need it*@
    <style>
        [ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak {
            display: none !important;
        }
    </style>

</head>
<body id="umbracoMainPageBody" ng-controller="Umbraco.AuthorizeUpgradeController" class="login-only">

    <umb-login on-login="loginAndRedirect()"></umb-login>

    <umb-notifications></umb-notifications>

    @{
        var externalLoginUrl = Url.Action("ExternalLogin", "BackOffice", new
        {
            area = ViewData.GetUmbracoPath(),
            //Custom redirect URL since we don't want to just redirect to the back office since this is for authing upgrades
            redirectUrl = Url.Action("AuthorizeUpgrade", "BackOffice")
        });
    }
    @Html.BareMinimumServerVariablesScript(Url, externalLoginUrl, Model.Features, Model.GlobalSettings)

    <script type="text/javascript">
    document.angularReady = function (app) {

        @Html.AngularValueExternalLoginInfoScript(ViewData.GetExternalSignInError())
        @Html.AngularValueResetPasswordCodeInfoScript(ViewData["PasswordResetCode"])

    }
    </script>

    @*And finally we can load in our angular app*@
    <script type="text/javascript" src="lib/lazyload-js/lazyload.min.js"></script>
    <script type="text/javascript" src="@Url.GetUrlWithCacheBust("Application", "BackOffice")"></script>

</body>
</html>
