noesya/osuny

View on GitHub
app/views/admin/communication/websites/menus/show.html.erb

Summary

Maintainability
Test Coverage
<% content_for :title, @menu %>

<% if @menu.automatic %>
  <div class="p-3 mb-2 border border-success">
    <span class="badge bg-success">
      <%= Communication::Website::Menu.human_attribute_name('automatic') %>
    </span>
    <p class="mt-2 mb-0"><%= sanitize t('communication.website.menus.automatic') %></p>
  </div>
<% end %>
<%= render 'admin/communication/websites/menus/items/list', items: @root_items if @items.any? %>

<% content_for :action_bar_left do %>
  <%= destroy_link @menu %>
  <%= static_link static_admin_communication_website_menu_path(@menu) %>
<% end %>

<% content_for :action_bar_right do %>
  <%= edit_link @menu %>
  <%= link_to t('create'),
              new_admin_communication_website_menu_item_path(website_id: @website, menu_id: @menu.id),
              class: button_classes if can?(:create, Communication::Website::Menu::Item) %>
<% end %>