Files
marechai/Marechai/Shared/NavMenu.razor

76 lines
3.0 KiB
Plaintext
Raw Permalink Normal View History

2020-06-01 02:12:50 +01:00
@{
2020-12-20 21:34:13 +00:00
/******************************************************************************
2020-06-01 02:12:50 +01:00
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
2020-12-31 23:24:15 +00:00
// Copyright © 2003-2021 Natalia Portillo
2020-06-01 02:12:50 +01:00
*******************************************************************************/
}
@inject StringLocalizer<NavMenu> L
2020-12-20 21:34:13 +00:00
<div class="navbar navbar-dark pl-4 top-row">
2020-05-21 15:05:03 +01:00
<a class="navbar-brand" href="">Marechai</a>
<button class="navbar-toggler" @onclick="ToggleNavMenu">
<span class="navbar-toggler-icon"></span>
</button>
</div>
<div class="@NavMenuCssClass" @onclick="ToggleNavMenu">
2020-12-20 21:34:13 +00:00
<ul class="flex-column nav">
2020-05-21 15:05:03 +01:00
<li class="nav-item px-3">
<NavLink class="nav-link" href="" Match="NavLinkMatch.All">
2020-12-20 21:34:13 +00:00
<span aria-hidden="true" class="fa fa-newspaper"></span>&nbsp;@L["News"]
2020-05-21 15:05:03 +01:00
</NavLink>
</li>
2020-05-21 20:25:47 +01:00
<li class="nav-item px-3">
<NavLink class="nav-link" href="companies">
2020-12-20 21:34:13 +00:00
<span aria-hidden="true" class="fa fa-building"></span>&nbsp;@L["Companies"]
2020-05-21 20:25:47 +01:00
</NavLink>
</li>
2020-05-22 00:45:58 +01:00
<li class="nav-item px-3">
<NavLink class="nav-link" href="computers">
2020-12-20 21:34:13 +00:00
<span aria-hidden="true" class="fa fa-desktop"></span>&nbsp;@L["Computers"]
2020-05-22 00:45:58 +01:00
</NavLink>
</li>
<li class="nav-item px-3">
<NavLink class="nav-link" href="consoles">
2020-12-20 21:34:13 +00:00
<span aria-hidden="true" class="fa fa-gamepad"></span>&nbsp;@L["Consoles"]
2020-05-22 00:45:58 +01:00
</NavLink>
</li>
2020-05-24 02:41:23 +01:00
<AuthorizeView Roles="UberAdmin, Admin">
<li class="nav-item px-3">
<NavLink class="nav-link" href="admin">
2020-12-20 21:34:13 +00:00
<span aria-hidden="true" class="fa fa-tools"></span>&nbsp;@L["Admin area"]
2020-05-24 02:41:23 +01:00
</NavLink>
</li>
</AuthorizeView>
2020-05-21 15:05:03 +01:00
</ul>
</div>
@code {
2020-05-24 02:41:23 +01:00
private bool _collapseNavMenu = true;
2020-05-21 15:05:03 +01:00
2020-05-24 02:41:23 +01:00
private string NavMenuCssClass => _collapseNavMenu ? "collapse" : null;
2020-05-21 15:05:03 +01:00
private void ToggleNavMenu()
{
2020-05-24 02:41:23 +01:00
_collapseNavMenu = !_collapseNavMenu;
2020-05-21 15:05:03 +01:00
}
}