app/helpers/application_helper.rb
# Derive the browser title text based on the layout value
Derive the browser title text based on the layout value
Derive the browser title text based on the layout value
def title_from_layout(layout)
    title = I18n.t('product.name')
    if layout.blank?  
    elsif ["configuration", "dashboard", "chargeback", "about"].include?(layout)
      title += ": #{layout.titleize}"
    elsif @layout == "ems_cluster"
      title += ": #{title_for_clusters}"
    elsif @layout == "host"
      title += ": #{title_for_hosts}"
    elsif layout == "miq_server"
      title += _(": Servers")
    elsif layout == "usage"
      title += _(": VM Usage")
    elsif layout == "scan_profile"
      title += _(": Analysis Profiles")
    elsif layout == "miq_policy_rsop"
      title += _(": Policy Simulation")
    elsif layout == "all_ui_tasks"
      title += _(": All UI Tasks")
    elsif layout == "my_ui_tasks"
      title += _(": My UI Tasks")
    elsif layout == "rss"
      title += _(": RSS")
    elsif layout == "storage_manager"
      title += _(": Storage - Storage Managers")
    elsif layout == "ops"
      title += _(": Configuration")
    elsif layout == "provider_foreman"
      title += ": #{ui_lookup(:ui_title => "foreman")} #{ui_lookup(:model => "ExtManagementSystem")}"
    elsif layout == "pxe"
      title += _(": PXE")
    elsif layout == "explorer"
      title += ": #{controller_model_name(params[:controller])} Explorer"
    elsif layout == "vm_cloud"
      title += _(": Instances")
    elsif layout == "vm_infra"
      title += _(": Virtual Machines")
    elsif layout == "vm_or_template"
      title += _(": Workloads")
    elsif layout.starts_with?("miq_ae_")
      title += _(": Automate")
    elsif layout.starts_with?("miq_policy")
      title += _(": Control")
    elsif layout.starts_with?("miq_capacity")
      title += _(": Optimize")
    elsif layout.starts_with?("miq_request")
      title += _(": Requests")
    elsif layout.starts_with?("cim_",
                              "snia_")
      title += _(": Storage - %{tables}") % {:tables => ui_lookup(:tables => layout)}
    elsif layout == "login"
      title += _(": Login")
    else
      title += ": #{ui_lookup(:tables => layout)}"
    end
    title
  end
def title_from_layout ( layout ) title = I18n . t ( 'product.name' ) if layout . blank? elsif [ "configuration" , "dashboard" , "chargeback" , "about" ] . include? ( layout ) title += ": #{layout.titleize}" elsif @layout == "ems_cluster" title += ": #{title_for_clusters}" elsif @layout == "host" title += ": #{title_for_hosts}" elsif layout == "miq_server" title += _ ( ": Servers" ) elsif layout == "usage" title += _ ( ": VM Usage" ) elsif layout == "scan_profile" title += _ ( ": Analysis Profiles" ) elsif layout == "miq_policy_rsop" title += _ ( ": Policy Simulation" ) elsif layout == "all_ui_tasks" title += _ ( ": All UI Tasks" ) elsif layout == "my_ui_tasks" title += _ ( ": My UI Tasks" ) elsif layout == "rss" title += _ ( ": RSS" ) elsif layout == "storage_manager" title += _ ( ": Storage - Storage Managers" ) elsif layout == "ops" title += _ ( ": Configuration" ) elsif layout == "provider_foreman" title += ": #{ui_lookup(:ui_title => "foreman")} #{ui_lookup(:model => "ExtManagementSystem")}" elsif layout == "pxe" title += _ ( ": PXE" ) elsif layout == "explorer" title += ": #{controller_model_name(params[:controller])} Explorer" elsif layout == "vm_cloud" title += _ ( ": Instances" ) elsif layout == "vm_infra" title += _ ( ": Virtual Machines" ) elsif layout == "vm_or_template" title += _ ( ": Workloads" ) elsif layout . starts_with? ( "miq_ae_" ) title += _ ( ": Automate" ) elsif layout . starts_with? ( "miq_policy" ) title += _ ( ": Control" ) elsif layout . starts_with? ( "miq_capacity" ) title += _ ( ": Optimize" ) elsif layout . starts_with? ( "miq_request" ) title += _ ( ": Requests" ) elsif layout . starts_with? ( "cim_" , "snia_" ) title += _ ( ": Storage - %{tables}" ) % { :tables => ui_lookup ( :tables => layout ) } elsif layout == "login" title += _ ( ": Login" ) else title += ": #{ui_lookup(:tables => layout)}" end title end
Derive the browser title text based on the layout value
Derive the browser title text based on the layout value
# TODO: leave I18n until we have productization capability in gettext # no layout, leave title alone # Specific titles for certain layouts # Specific titles for groups of layouts # Assume layout is a table name and look up the plural version
layout
<not_specific>