denny/ShinyCMS-ruby

View on GitHub
plugins/ShinyAccess/app/components/shiny_access/admin/menu/section_component.html.erb

Summary

Maintainability
Test Coverage
<% return unless @current_user.can? :list, :access_groups %>

<%= component 'admin/menu/section',
    text: t( 'shiny_access.admin.menu' ), icon: 'lock-locked' do %>

  <%= component 'admin/menu/item', link: shiny_access.groups_path,
      text: t( 'shiny_access.admin.groups.index.title' ), icon: 'lock-locked' %>

  <%= component 'admin/menu/item', link: shiny_access.new_group_path,
      text: t( 'shiny_access.admin.groups.new.title' ), icon: 'lock-unlocked',
      if: @current_user.can?( :add, :access_groups ) %>

<% end %>