docbrown/app/views/admin/shared/_tabbed_navbar.html.erb
Ridhwana cf5207564f
RFC#50-P5 Prepares the admin restructure to be tested (#13114)
* feat: make the sidebar more dynamic

* refactor: use the action in the same controller instead of the whole path

* feat: remove hardcoded routes

* feat: move routes into file

* feat: use rails 6 draw for the admin routes

* add a helper method

* oops: fix super

* feat: add the hacky helper methods :( )

* WIP: created different path helpers for the new routes and point the old helpers to the new ones if the FF is toggled

* feat: update the module

* chore: add new paths

* feat: change link_to's use paths instead

* feat: feedback_messages to scoped admin route

* chore: update the feature flag urls helpers

* feat: feedback_messages issue

* chore: remove all the workarounds

* chore: rubucop

* fix: oops remove helper

* chore: comment out the tests that touch the tabbed navbar which is affected by the rails application needing to be reloaded

* feat: ensure that we chcek if the db table exists
2021-04-15 14:53:46 +02:00

23 lines
982 B
Text

<!-- menu_items.is_a?(Hash) we have this condition because /reports changes to /feedback_messages -->
<% if menu_items.present? && menu_items.is_a?(Hash) && menu_items[:children].any? %>
<header class="mb-3 admin__tabbed-navbar">
<h2 class="crayons-title"><%= menu_items[:name].to_s.titleize %></h2>
<div class="block s:flex items-center space-between">
<nav>
<ul class="crayons-tabs crayons-tabs--wrapped">
<% menu_items[:children].each do |item| %>
<% if item[:visible] %>
<li>
<a
href="/admin/<%= deduced_scope(request) %>/<%= item[:controller] %>"
class="crayons-tabs__item <%= "crayons-tabs__item--current" if deduced_controller(request)&.match?(item[:controller]) %>">
<%= item[:name].to_s.titleize %>
</a>
</li>
<% end %>
<% end %>
</ul>
</nav>
</div>
</header>
<% end %>