docbrown/app/views/layouts/_nav_menu.html.erb
Jeremy Friesen f790c3c0c1
Encapsulating the "why we hide/show" something (#17166)
* Encapsulating the "why we hide/show" something

Prior to this commit, we were relying on our views/templates to
understand why it might want to append the "hidden" dom class.  That is
not ideal, because it required repeating knowledge about the conditions
of the policy outside of the policy's domain.

With this commit, we're removing a duplication of knowledge; or more
appropriately asking the steward responsible for the knowledge to
produce the answer.

* Refining the note to not describe a course of action
2022-04-11 13:40:16 -04:00

36 lines
1.8 KiB
Text

<div class="crayons-dropdown left-2 right-2 s:left-auto crayons-header__menu__dropdown inline-block m:-mr-2 top-100">
<ul class="m-0" id="crayons-header__menu__dropdown__list">
<li id="user-profile-link-placeholder" class="border-0 border-b-1 border-solid border-base-20 pb-2 mb-2">
<a href="#" id="first-nav-link" class="c-link c-link--default c-link--block lh-tight">
<div>
<span class="fw-medium block"><%= t("views.main.nav.placeholder") %></span>
<small class="fs-s opacity-75"></small>
</div>
</a>
</li>
<li class="js-header-menu-admin-link hidden">
<a href="<%= admin_path %>" class="c-link c-link--block" data-no-instant><%= t("views.main.nav.admin") %></a>
</li>
<li>
<a href="<%= dashboard_path %>" class="c-link c-link--block"><%= t("views.main.nav.dashboard") %></a>
</li>
<li>
<a href="<%= mod_path %>" class="c-link c-link--block trusted-visible-block"><%= t("views.main.nav.moderator_center") %></a>
</li>
<%= application_policy_content_tag("li", record: Article, query: :create?) do %>
<a href="<%= new_path %>" class="c-link c-link--block"><%= t("views.main.create_post") %></a>
<% end %>
<li>
<a href="<%= readinglist_path %>" class="c-link c-link--block"><%= t("views.main.nav.list") %></a>
</li>
<li class="border-0 border-b-1 border-solid border-base-20 pb-2">
<a href="<%= user_settings_path %>" class="c-link c-link--block" id="second-last-nav-link"><%= t("views.main.nav.settings") %></a>
</li>
<li class="pt-2">
<a href="<%= signout_confirm_path %>" class="c-link c-link--block" id="last-nav-link"><%= t("views.main.signout") %></a>
</li>
</ul>
</div>
<%= javascript_packs_with_chunks_tag "applyApplicationPolicyToggles", defer: true %>