-
Notifications
You must be signed in to change notification settings - Fork 2.4k
/
Layout.cshtml
74 lines (69 loc) · 3.12 KB
/
Layout.cshtml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
@using OrchardCore.Admin.Models
@using OrchardCore.DisplayManagement
@using OrchardCore.DisplayManagement.ModelBinding
@using OrchardCore.Entities
@using OrchardCore.Themes.Services
@using OrchardCore.Users.Models
@inject IDisplayManager<Navbar> DisplayManager
@inject IUpdateModelAccessor UpdateModelAccessor
@inject ThemeTogglerService ThemeTogglerService
@{
// Navbar is pre-rendered to allow resource injection.
var navbar = await DisplayAsync(await DisplayManager.BuildDisplayAsync(UpdateModelAccessor.ModelUpdater));
}
<!DOCTYPE html>
<html lang="@Orchard.CultureName()" dir="@Orchard.CultureDir()" data-bs-theme="@await ThemeTogglerService.CurrentTheme()" data-tenant="@ThemeTogglerService.CurrentTenant">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@RenderTitleSegments(Site.SiteName, "before")</title>
<link type="image/x-icon" rel="shortcut icon" href="~/TheTheme/images/favicon.ico">
<!-- This script can't wait till the footer -->
<script asp-name="theme-head" version="1" at="Head"></script>
@if (Orchard.IsRightToLeft())
{
<style asp-name="bootstrap-rtl" version="5" at="Head"></style>
<style asp-name="TheTheme" depends-on="bootstrap-rtl" asp-src="~/TheTheme/styles/theme.min.css" debug-src="~/TheTheme/styles/theme.css" at="Foot"></style>
}
else
{
<style asp-name="bootstrap" version="5" at="Head"></style>
<style asp-name="TheTheme" depends-on="bootstrap" asp-src="~/TheTheme/styles/theme.min.css" debug-src="~/TheTheme/styles/theme.css" at="Foot"></style>
}
<script asp-name="bootstrap" version="5" at="Foot"></script>
<script asp-name="theme-manager" at="Foot"></script>
<script asp-name="font-awesome" at="Foot" version="6"></script>
<resources type="Header" />
@await RenderSectionAsync("HeadMeta", required: false)
</head>
<body>
<nav class="navbar navbar-expand-md fixed-top">
<div class="container">
<shape type="Branding" />
<button type="button" class="navbar-toggler" data-bs-toggle="collapse" data-bs-target="#navbar" aria-expanded="false" aria-controls="navbar" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbar">
<div class="d-flex w-100 align-items-end justify-content-end justify-content-md-between flex-column flex-md-row">
<menu alias="alias:main-menu" cache-id="main-menu" cache-fixed-duration="00:05:00" cache-tag="alias:main-menu" />
@navbar
</div>
</div>
</div>
</nav>
@await RenderSectionAsync("Header", required: false)
<main class="container">
@await RenderSectionAsync("Messages", required: false)
@await RenderBodyAsync()
</main>
@if (IsSectionDefined("Footer"))
{
<footer>
<div class="container">
@await RenderSectionAsync("Footer", required: false)
</div>
</footer>
}
<resources type="FootScript" />
</body>
</html>