|
1 | 1 | @inherits RazorSlice<MarkdownLayoutViewModel> |
2 | | -<aside class="sidebar md:block w-full lg:max-w-65 md:order-2 px-6 md:px-10 lg:px-0"> |
3 | | - <nav id="toc-nav" class="sidebar-nav lg:h-full flex flex-row-reverse lg:block items-center gap-4"> |
4 | | - @if (Model.Features.VersionDropdownEnabled) |
5 | | - { |
6 | | - <div class="mt-6"> |
7 | | - <version-dropdown all-versions-url="@Model.AllVersionsUrl" current-version='@(Model.CurrentVersion)' items='@(new HtmlString(Model.VersionDropdownSerializedModel))' /> |
8 | | - </div> |
9 | | - } |
10 | | - else |
11 | | - { |
12 | | - <div id="page-version-dropdown" tabindex="1" |
13 | | - class="mt-6 block group font-sans text-sm relative z-50"> |
14 | | - <button |
15 | | - class="text-left border-1 rounded-2xl grid grid-cols-[1fr_auto] cursor-pointer font-semibold gap-1 hover:text-black pl-4 pr-1 py-1 group-open:border-b-1 border-grey-20"> |
16 | | - <div> |
17 | | - <span class="page-version-dropdown_active text-ink"> |
18 | | - @if (Model.CurrentVersion is not null) |
19 | | - { |
20 | | - <span>Current version (@Model.CurrentVersion)</span> |
21 | | - } |
22 | | - else |
23 | | - { |
24 | | - <span>Current version</span> |
25 | | - } |
26 | | - </span> |
27 | | - </div> |
28 | | - <div class="flex items-center my-auto justify-center size-5 hover:bg-grey-20 rounded-xl"> |
29 | | - <svg |
30 | | - xmlns="http://www.w3.org/2000/svg" |
31 | | - fill="none" |
32 | | - viewBox="0 0 24 24" |
33 | | - stroke-width="1.5" |
34 | | - stroke="currentColor" |
35 | | - class="w-4 group-open:rotate-180"> |
36 | | - <path stroke-linecap="round" stroke-linejoin="round" d="m19.5 9.25-7.5 8.5-7.5-8.5"/> |
37 | | - </svg> |
38 | | - </div> |
39 | | - </button> |
40 | | - <div class="hidden group-focus-within:block left-0 right-0 absolute top-full w-max min-w-30 max-w-60"> |
41 | | - <ul class="mt-1 py-0 mb-4 bg-white border-1 border-grey-20 rounded-sm shadow-md"> |
42 | | - <li class="block"> |
43 | | - <a |
44 | | - |
45 | | - class="block py-1 px-4 font-semibold text-grey-60 cursor-default" |
46 | | - @Htmx.GetNavHxAttributes(false, "mouseover") |
47 | | - > |
48 | | - @if (Model.CurrentVersion is not null) |
49 | | - { |
50 | | - <span>@Model.CurrentVersion ✓</span> |
51 | | - } |
52 | | - else |
53 | | - { |
54 | | - <span>current ✓</span> |
55 | | - } |
56 | | - </a> |
57 | | - </li> |
58 | | - @foreach (var legacyPage in Model.LegacyPages ?? []) |
59 | | - { |
60 | | - <li class="block"> |
61 | | - @if (legacyPage.Exists) |
62 | | - { |
63 | | - <a |
64 | | - class="block py-1 px-4 text-sm hover:underline hover:text-black hover:bg-grey-10 active:bg-blue-elastic-70 active:text-white font-semibold text-ink rounded-sm" |
65 | | - href="@legacyPage"> |
66 | | - @legacyPage.Version |
67 | | - </a> |
68 | | - } |
69 | | - else |
70 | | - { |
71 | | - <a |
72 | | - class="block py-1 px-4 font-semibold text-grey-60 cursor-default"> |
73 | | - @legacyPage.Version |
74 | | - </a> |
75 | | - } |
76 | | - |
77 | | - </li> |
78 | | - } |
79 | | - @if (Model.LegacyPages is null) // This means there is no mapping because the page is new in v3 |
80 | | - { |
81 | | - <li class="block border-t-1 border-grey-20"> |
82 | | - <div class="py-1 px-4 text-sm"> |
83 | | - There is no previous version of this page. |
84 | | - </div> |
85 | | - </li> |
86 | | - } |
87 | | - else if (Model.LegacyPages.Length == 0) // This means there is a legacy page mapping with 0 entries, which means the page was fully migrated and is also redirecting to the new system. |
88 | | - { |
89 | | - <li class="block border-t-1 border-grey-20"> |
90 | | - <div class="py-1 px-4 text-sm"> |
91 | | - This page was fully migrated to the current version. |
92 | | - </div> |
93 | | - </li> |
94 | | - } |
95 | | - </ul> |
96 | | - </div> |
| 2 | +<aside class="sidebar hidden lg:block max-w-65 md:hidden"> |
| 3 | + <nav id="toc-nav" class="sidebar-nav h-full"> |
| 4 | + <div class="mt-6"> |
| 5 | + <version-dropdown all-versions-url="@Model.AllVersionsUrl" current-version='@(Model.CurrentVersion)' items='@(new HtmlString(Model.VersionDropdownSerializedModel))' /> |
97 | 6 | </div> |
98 | | - } |
99 | | - <ul class="mt-6 hidden md:flex items-center lg:block gap-4"> |
100 | | - |
| 7 | + <ul class="mt-6"> |
101 | 8 | @if (Model.GithubEditUrl is not null) |
102 | 9 | { |
103 | 10 | <li class="edit-this-page lg:not-first:mt-1"> |
|
0 commit comments