<commit_before>- if @record.try(:name)
  - cluster_title = title_for_cluster_record(@record)
  #accordion.panel-group
    = miq_accordion_panel(truncate(@record.name, :length => truncate_length), true, "icon") do
      = render :partial => "layouts/quadicon", :locals => {:mode => :icon, :item => @record, :size => 72, :typ => :listnav}

    = miq_accordion_panel(_("Properties"), false, "ems_prop") do
      %ul.nav.nav-pills.nav-stacked
        %li
          = link_to(_('Summary'),
            {:action => 'show', :id => @record, :display => 'main'},
            :title => _("Show Summary"))
        - if @cluster_config.nil? || @cluster_config.empty?
          %li.disabled
            = link_to(_('Configuration'), '#')
        - else
          %li
            = link_to(_('Configuration'),
              {:action => 'show', :id => @record, :display => 'config_info'},
              :title   => _("Show configuration"),
              :onclick => "return miqCheckForChanges()")
        - if @record.has_perf_data?
          %li
            = link_to(_('Capacity & Utilization'),
              {:action => 'show', :id => @record, :display => 'performance'},
              :title => _("Show Capacity & Utilization"))
        - else
          %li.disabled
            = link_to(_('Capacity & Utilization'), '#')
        - if @record.has_events? || @record.has_events?(:policy_events)
          %li
            = link_to(_('Timelines'),
              {:action => 'show', :id => @record, :display => 'timeline'},
              :title => _("Show Timelines"))
        - else
          %li.disabled
            = link_to(_('Timelines'), '#')

    = miq_accordion_panel(_("Relationships"), false, "ems_rel") do
      %ul.nav.nav-pills.nav-stacked
        - if role_allows(:feature => "host_show_list")
          - hosts_title = title_for_hosts
          - if @record.total_hosts == 0
            %li.disabled
              = link_to("#{hosts_title} (#{@record.total_hosts})")
          - else
            %li
              = link_to("#{hosts_title} (#{@record.total_hosts})",
                {:action => 'show', :id => @record, :display => 'hosts'},
                :title => _("Show %s") % hosts_title)

        - if role_allows(:feature => "vm_show_list")
          - if @record.total_direct_vms == 0
            %li.disabled
              = link_to(_('Direct VMs: 0'), "#")
          - else
            %li
              = link_to(_("Direct VMs: %{total_direct_vms}") % {:total_direct_vms => @record.total_direct_vms},
                {:action => 'show', :display => "vms", :id => @record.id.to_s},
                :title => _("Show VMs in this %{cluster_title}, but not in Resource Pools below") % {:cluster_title => cluster_title})
        - if role_allows(:feature => "vm_show_list")
          - if @record.total_vms == 0
            %li.disabled
              = link_to(_('All VMs: 0'), "#")
          - else
            %li
              = link_to(_("All VMs: %{total_vms}") % {:total_vms => @record.total_vms},
                {:action => 'show', :display => "all_vms", :id => @record.id.to_s},
                :title => _("Show all VMs in this %{cluster_title}") % {:cluster_title => cluster_title})
        - if role_allows(:feature => "miq_template_show_list")
          - if @record.total_miq_templates == 0
            %li.disabled
              = link_to(_('All Templates: 0'), "#")
          - else
            %li
              = link_to(_("All Templates: %{total_miq_templates}") % {:total_miq_templates => @record.total_miq_templates},
                {:action => 'show', :display => "miq_templates", :id => @record.id.to_s},
                :title => _("Show all Templates in this %{cluster_title}") % {:cluster_title => cluster_title})
        - if role_allows(:feature => "vm_show_list")
          - if @record.total_vms == 0
            %li.disabled
              = link_to(_('All VMs (Tree View): 0'), "#")
          - else
            %li
              = link_to(_("All VMs (Tree View): %{total_vms}") % {:total_vms => @record.total_vms},
                {:action => 'show', :display => "descendant_vms", :id => @record.id.to_s},
                :title => _("Show tree of all VMs by Resource Pool in this %{cluster_title}") % {:cluster_title => cluster_title})
        - if role_allows(:feature => "resource_pool_show_list")
          - if @record.number_of(:resource_pools) == 0
            %li.disabled
              = link_to(_("Resource Pools (%{resource_pools})") % {:resource_pools => @record.number_of(:resource_pools)}, "#")
          - else
            %li
              = link_to(_("Resource Pools (%{resource_pools})") % {:resource_pools => @record.number_of(:resource_pools)},
                {:action => 'show', :id => @record, :display => 'resource_pools'},
                :title => _("Show Resource Pools"))
        - if role_allows(:feature => "ems_cluster_drift")
          - if @record.number_of(:drift_states) == 0
            %li.disabled
              = link_to(_('Drift History (%{drift_states})') % {:drift_states => @record.number_of(:drift_states)}, "#")
          - else
            %li
              = link_to(_("Drift History (%{drift_states})") % {:drift_states => @record.number_of(:drift_states)},
                {:action => 'drift_history', :id => @record},
                :title => _("Show %{cluster_title} drift history") % {:cluster_title => cluster_title})

    - if get_vmdb_config[:product][:storage]
      = miq_accordion_panel(_("Storage Relationships"), false, "host_inf_rel") do
        %ul.nav.nav-pills.nav-stacked
          - if role_allows(:feature => "ontap_storage_system_show_list")
            = li_link_if_nonzero(:count => @record.storage_systems.count,
              :record_id             => @record.id,
              :tables                => 'ontap_storage_system',
              :display               => 'storage_systems',
              :action                => 'show',
              :title                 => _("Show all %{ontap_storage_system}") % {:ontap_storage_system => ui_lookup(:tables => "ontap_storage_system")})
          - if role_allows(:feature => "ontap_storage_volume_show_list")
            = li_link_if_nonzero(:count => @record.storage_volumes.count,
              :record_id             => @record.id,
              :tables                => 'ontap_storage_volume',
              :display               => 'ontap_storage_volumes',
              :action                => 'show',
              :title                 => ui_lookup(:tables => "ontap_storage_volume"))<commit_msg>Refactoring the Relationships part of Infra/Cluster navigation<commit_after>- if @record.try(:name)
  - cluster_title = title_for_cluster_record(@record)
  #accordion.panel-group
    = miq_accordion_panel(truncate(@record.name, :length => truncate_length), true, "icon") do
      = render :partial => "layouts/quadicon", :locals => {:mode => :icon, :item => @record, :size => 72, :typ => :listnav}

    = miq_accordion_panel(_("Properties"), false, "ems_prop") do
      %ul.nav.nav-pills.nav-stacked
        %li
          = link_to(_('Summary'),
            {:action => 'show', :id => @record, :display => 'main'},
            :title => _("Show Summary"))
        - if @cluster_config.nil? || @cluster_config.empty?
          %li.disabled
            = link_to(_('Configuration'), '#')
        - else
          %li
            = link_to(_('Configuration'),
              {:action => 'show', :id => @record, :display => 'config_info'},
              :title   => _("Show configuration"),
              :onclick => "return miqCheckForChanges()")
        - if @record.has_perf_data?
          %li
            = link_to(_('Capacity & Utilization'),
              {:action => 'show', :id => @record, :display => 'performance'},
              :title => _("Show Capacity & Utilization"))
        - else
          %li.disabled
            = link_to(_('Capacity & Utilization'), '#')
        - if @record.has_events? || @record.has_events?(:policy_events)
          %li
            = link_to(_('Timelines'),
              {:action => 'show', :id => @record, :display => 'timeline'},
              :title => _("Show Timelines"))
        - else
          %li.disabled
            = link_to(_('Timelines'), '#')

    = miq_accordion_panel(_("Relationships"), false, "ems_rel") do
      %ul.nav.nav-pills.nav-stacked
        - if role_allows(:feature => "host_show_list")
          = li_link_if_nonzero(:text    => title_for_hosts,
                               :count   => @record.total_hosts,
                               :record_id => @record.id,
                               :display => 'hosts',
                               :title   => _("Show %s") % title_for_hosts)
        - if role_allows(:feature => "vm_show_list")
          = li_link_if_nonzero(:text    => _("Direct VMs"),
                               :count   => @record.total_direct_vms,
                               :record_id => @record.id,
                               :display => "vms",
                               :title   => ("Show VMs in this %{cluster_title}, but not in Resource Pools below") % {:cluster_title => cluster_title})
        - if role_allows(:feature => "vm_show_list")
          = li_link_if_nonzero(:text    => _("All VMs"),
                               :count   => @record.total_vms,
                               :record_id => @record.id,
                               :display => "all_vms",
                               :title   => _("Show all VMs in this %{cluster_title}") % {:cluster_title => cluster_title})
        - if role_allows(:feature => "miq_template_show_list")
          = li_link_if_nonzero(:text    => _("All Templates"),
                               :count   => @record.total_miq_templates,
                               :record_id => @record.id,
                               :display => "miq_templates",
                               :title   => _("Show all Templates in this %{cluster_title}") % {:cluster_title => cluster_title})
        - if role_allows(:feature => "vm_show_list")
          = li_link_if_nonzero(:text    => _('All VMs (Tree View)'),
                               :count   => @record.total_vms,
                               :record_id => @record.id,
                               :display => "descendant_vms",
                               :title   => _("Show tree of all VMs by Resource Pool in this %{cluster_title}") % {:cluster_title => cluster_title})
        - if role_allows(:feature => "resource_pool_show_list")
          = li_link_if_nonzero(:text    => _('Resource Pools'),
                               :count   => @record.number_of(:resource_pools),
                               :record_id => @record.id,
                               :display => 'resource_pools',
                               :title   => _("Show Resource Pools"))
        - if role_allows(:feature => "resource_pool_show_list")
          = li_link_if_nonzero(:text    => _('Drift History'),
                               :count   => @record.number_of(:drift_states),
                               :record_id => @record.id,
                               :display => nil,
                               :title   => _("Show %{cluster_title} drift history") % {:cluster_title => cluster_title})
        -# = ems_cluster_relationship_links(@record)

    - if get_vmdb_config[:product][:storage]
      = miq_accordion_panel(_("Storage Relationships"), false, "host_inf_rel") do
        %ul.nav.nav-pills.nav-stacked
          - if role_allows(:feature => "ontap_storage_system_show_list")
            = li_link_if_nonzero(:count => @record.storage_systems.count,
              :record_id             => @record.id,
              :tables                => 'ontap_storage_system',
              :display               => 'storage_systems',
              :action                => 'show',
              :title                 => _("Show all %{ontap_storage_system}") % {:ontap_storage_system => ui_lookup(:tables => "ontap_storage_system")})
          - if role_allows(:feature => "ontap_storage_volume_show_list")
            = li_link_if_nonzero(:count => @record.storage_volumes.count,
              :record_id             => @record.id,
              :tables                => 'ontap_storage_volume',
              :display               => 'ontap_storage_volumes',
              :action                => 'show',
              :title                 => ui_lookup(:tables => "ontap_storage_volume"))
{'fraction_non_alphanumeric': 0.15194628726720485, 'fraction_numerical': 0.0011989449284629525, 'mean_word_length': 1.8301289301063108, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 179, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4619470', 'n_tokens_mistral': 3706, 'n_tokens_neox': 3578, 'n_words': 668}