|
| 1 | +@using Elastic.Markdown.Helpers; |
1 | 2 | @inherits RazorSlice<LayoutViewModel>
|
2 | 3 | <aside class="sidebar hidden lg:block order-3">
|
3 |
| - <nav id="toc-nav" class="sidebar-nav pl-4"> |
4 |
| - <div class="pt-6 pb-20"> |
| 4 | + <nav id="toc-nav" class="sidebar-nav"> |
| 5 | + <div id="page-version-dropdown" tabindex="1" |
| 6 | + class="mt-6 block group font-sans text-sm relative z-50"> |
| 7 | + <button |
| 8 | + 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"> |
| 9 | + <div> |
| 10 | + <span class="page-version-dropdown_active text-ink"> |
| 11 | + Current version |
| 12 | + </span> |
| 13 | + </div> |
| 14 | + <div class="flex items-center my-auto justify-center size-5 hover:bg-grey-20 rounded-xl"> |
| 15 | + <svg |
| 16 | + xmlns="http://www.w3.org/2000/svg" |
| 17 | + fill="none" |
| 18 | + viewBox="0 0 24 24" |
| 19 | + stroke-width="1.5" |
| 20 | + stroke="currentColor" |
| 21 | + class="w-4 group-open:rotate-180"> |
| 22 | + <path stroke-linecap="round" stroke-linejoin="round" d="m19.5 9.25-7.5 8.5-7.5-8.5"/> |
| 23 | + </svg> |
| 24 | + </div> |
| 25 | + </button> |
| 26 | + <div class="hidden group-focus-within:block left-0 right-0 absolute top-full w-max"> |
| 27 | + <ul class="mt-1 py-0 bg-white border-1 border-grey-20 rounded-sm shadow-md"> |
| 28 | + <li class="block"> |
| 29 | + <a |
| 30 | + class="block py-2 px-4 hover:underline hover:text-black hover:bg-grey-10 active:bg-blue-elastic-70 active:text-white font-semibold text-ink rounded-sm" |
| 31 | + @Htmx.GetNavHxAttributes(false, "mouseover") |
| 32 | + > |
| 33 | + Current version ✓ |
| 34 | + </a> |
| 35 | + </li> |
| 36 | + <li class="block"> |
| 37 | + @if (Model.LegacyPage is not null) |
| 38 | + { |
| 39 | + <a |
| 40 | + class="block py-2 px-4 hover:underline hover:text-black hover:bg-grey-10 active:bg-blue-elastic-70 active:text-white font-semibold text-ink rounded-sm" |
| 41 | + href="@Model.LegacyPage.Url" |
| 42 | + @Htmx.GetNavHxAttributes(false, "mouseover")> |
| 43 | + Previous |
| 44 | + version @(string.IsNullOrEmpty(Model.LegacyPage.Version) ? string.Empty : $"({Model.LegacyPage.Version})") |
| 45 | + </a> |
| 46 | + } |
| 47 | + else |
| 48 | + { |
| 49 | + <a |
| 50 | + class="block py-2 px-4 font-semibold text-grey-60 cursor-default" |
| 51 | + @Htmx.GetNavHxAttributes(false, "mouseover") |
| 52 | + title="Current is the only version of this page."> |
| 53 | + Previous version |
| 54 | + </a> |
| 55 | + } |
| 56 | + </li> |
| 57 | + </ul> |
| 58 | + </div> |
| 59 | + </div> |
| 60 | + <div class="pt-6 pb-20 pl-4"> |
5 | 61 | @if (Model.PageTocItems.Count > 0)
|
6 | 62 | {
|
7 | 63 | <div>
|
|
23 | 79 | </div>
|
24 | 80 | </div>
|
25 | 81 | }
|
26 |
| - |
| 82 | + |
27 | 83 | <ul class="mt-6">
|
28 |
| - @if (Model.LegacyUrl is not null) |
29 |
| - { |
30 |
| - <li class="edit-this-page not-first:mt-1"> |
31 |
| - <a href="@Model.LegacyUrl" class="link text-sm" target="_blank"> |
32 |
| - <svg class="link-icon" |
33 |
| - xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="1 0 22 22" stroke-width="1.5" stroke="currentColor"> |
34 |
| - <path stroke-linecap="round" stroke-linejoin="round" d="m20.25 7.5-.625 10.632a2.25 2.25 0 0 1-2.247 2.118H6.622a2.25 2.25 0 0 1-2.247-2.118L3.75 7.5M10 11.25h4M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125Z" /> |
35 |
| - </svg> |
36 |
| - View previous version |
37 |
| - </a> |
38 |
| - </li> |
39 |
| - } |
| 84 | + |
40 | 85 | @if (Model.GithubEditUrl is not null)
|
41 | 86 | {
|
42 | 87 | <li class="edit-this-page not-first:mt-1">
|
|
0 commit comments