Sha256: c8315ea6e8c0fd62a3ad5ba500be4f231a9faf9db8d20705e6c43ae5ef625049

Contents?: true

Size: 1.03 KB

Versions: 2

Compression:

Stored size: 1.03 KB

Contents

# frozen_string_literal: true

module EacRailsBase0
  module LayoutHelper
    APP_TITLE_METHOD = 'app_title'
    APP_MAIN_MENU_ENTRIES_METHOD = 'app_main_menu_entries'

    def base0_app_title
      if respond_to?(APP_TITLE_METHOD)
        send(APP_TITLE_METHOD)
      else
        "Implement the helper method \"#{APP_TITLE_METHOD}\""
      end
    end

    def base0_app_main_menu_entries
      if respond_to?(APP_MAIN_MENU_ENTRIES_METHOD)
        send(APP_MAIN_MENU_ENTRIES_METHOD, base0_app_main_menu_default_entries)
      else
        base0_app_main_menu_default_entries
      end
    end

    def base0_app_main_menu_default_entries
      {
        'Administração' => {
          ::EacUsersSupport::User.model_name.human(count: 2) =>
            [eac_users_support.admin_users_path],
          t('activerecord.models.scheduled_task.other') => [main_app.status_scheduled_tasks_path],
          'Conteúdo remoto' => {
            ::Aranha::Address.model_name.human(count: 2) => [aranha.addresses_path]
          }
        }
      }
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
eac_rails_base0-0.9.0 app/helpers/eac_rails_base0/layout_helper.rb
eac_rails_base0-0.8.0 app/helpers/eac_rails_base0/layout_helper.rb