Sala33_FreebirdTech/Views/Shared/Components/Navbar/Default.cshtml
@*
    For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
*@
@{
}

<style>
    a.fa-comments {
        position: relative;
        font-size: 2em;
        color: grey;
        cursor: pointer;
    }

    span.fa-comment {
        position: absolute;
        font-size: 0.6em;
        top: -4px;
        color: red;
        right: -4px;
    }

    span.num {
        position: absolute;
        font-size: 0.3em;
        top: 1px;
        color: #fff;
        right: 2px;
    }
</style>


<nav class="navbar fixed-top navbar-expand-lg navbar-light bg-white text_orange justify-content-between">
    <a class="navbar-brand" href="/">

        <!-- LOGO -->
        <svg class="freebird-logo" xmlns="http://www.w3.org/2000/svg" width="40.999" height="44.274"
             viewBox="0 0 40.999 44.274">
            <g id="Group_90" data-name="Group 90" transform="translate(-886 -56.864)">
                <path id="Path_22" data-name="Path 22"
                      d="M152.241,226.188h-8.533a4,4,0,0,1-3.657-5.615,13.95,13.95,0,0,1,12.16-8.317.581.581,0,0,1,.608.579V225.61A.579.579,0,0,1,152.241,226.188Z"
                      transform="translate(746.293 -155.379)" fill="#fe9d08" />
                <path id="Path_23" data-name="Path 23"
                      d="M175.818,234.348V214.859a2.644,2.644,0,0,1,2.988-2.624,22.316,22.316,0,0,1,19.323,22.113Z"
                      transform="translate(720.253 -155.348)" fill="#eb4424" />
                <path id="Path_24" data-name="Path 24"
                      d="M194.838,234.8h0a4.057,4.057,0,0,1-4.057,4.057h0a4.057,4.057,0,0,1,0-8.114h0a4.057,4.057,0,0,1,4.057,4.057"
                      transform="translate(712.389 -168.713)" fill="#fff" />
                <path id="Path_25" data-name="Path 25"
                      d="M198.129,291.585v19.488a2.645,2.645,0,0,1-2.988,2.624,22.316,22.316,0,0,1-19.323-22.113Z"
                      transform="translate(720.253 -212.584)" fill="#fe9d08" />
            </g>
        </svg>
    </a>
    <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
    </button>
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
        <ul class="navbar-nav me-auto mb-2 mb-lg-0">
            <li class="nav-item text_orange mt-2">
                <a class="mx-3 text_orange" aria-current="page" href="/search">Todos os Serviços</a>
            </li>
            @if (User.Identity.IsAuthenticated)
            {
                @*<li class="nav-item mt-2">
                        <a class="mx-3 text_orange" href="/artistarea">Cadastre seu trabalho</a>
                    </li>*@
            }

            <li class="nav-item mt-2">
                <a class="mx-3 text_orange" href="Blogs" tabindex="-1" aria-disabled="false">Notícias</a>
            </li>
            @if (User.Identity.IsAuthenticated)
            {
                <li class="nav-item dropdown">
                    <a class="nav-link dropdown-toggle text_orange" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                        Configurações
                    </a>
                    <div class="dropdown-menu" aria-labelledby="navbarDropdown">
                        <a asp-action="Create" asp-controller="Artists" class="dropdown-item text_orange">Editar Perfil</a>
                        <a asp-action="Index" asp-controller="Servicos" class="dropdown-item text_orange">Meus Serviços</a>
                        <a asp-action="Index" asp-controller="Calendar" class="dropdown-item text_orange">Calendário</a>
                        <div class="dropdown-divider"></div>
                        <a class="dropdown-item text_orange" asp-action="Create" asp-controller="Servicos">Adicionar Serviço</a>
                        <div class="dropdown-divider"></div>
                    </div>
                </li>
            }

        </ul>

        <div class="form-inline my-lg-0">
            <form asp-controller="Search" asp-action="Index" method="get">
                <input class="form-control mr-sm-2" type="text" name="search" placeholder="Procurar" aria-label="Procurar">
                <input type="submit" hidden />
            </form>
            <form>
                @if (User.Identity.IsAuthenticated)
                {
                    <a class="mx-3 text_orange" asp-area="Identity" asp-page="/Account/Logout" asp-route-returnUrl="@Url.Page("/", new { area = "" })" method="post">Logout</a>
                }
                else
                {
                    <a class="mx-3 text_orange" href="/Identity/Account/login">Login</a>
                    <button type="button" class="mx-3 btn btn-primary rounded-pill  btn-sm" onclick="location.href='/Identity/Account/register'">Cadastre-se</button>
                }
            </form>
        </div>
    </div>
    @if (User.Identity.IsAuthenticated)
    {
        <a asp-action="Create" asp-controller="Messages" class="far fa-comments">
            <span id="Notification" class="fa fa-comment"></span>
        </a>
    }

</nav>

@if (User.Identity.IsAuthenticated)
{
    <script>
        var jqxhr = $.get('/api/MessageNotification', function (data) {

            if (data == false)
                $('#Notification').hide();

        });
    </script>

}

