ManageIQ/manageiq-ui-classic

View on GitHub
app/views/miq_ae_class/_all_tabs.html.haml

Summary

Maintainability
Test Coverage
= render :partial => "layouts/flash_msg"
#ae_tabs
  -# Toplevel Tabbar
  - nodes = x_node.split('-')
  - case nodes.first
  - when "aec"
    %ul.nav.nav-tabs{'role' => 'tablist'}
      = miq_tab_header("instances", @sb[:active_tab]) do
        = _('Instances')
      = miq_tab_header("methods", @sb[:active_tab]) do
        = _('Methods')
      = miq_tab_header("props", @sb[:active_tab]) do
        = _('Properties')
      = miq_tab_header("schema", @sb[:active_tab]) do
        = _('Schema')
    .tab-content
      = miq_tab_content("instances", @sb[:active_tab]) do
        = render :partial => "class_instances"
      = miq_tab_content("methods", @sb[:active_tab]) do
        #class_methods_div
          = render :partial => "class_methods"
      = miq_tab_content("props", @sb[:active_tab]) do
        = render :partial => "class_props"
      = miq_tab_content("schema", @sb[:active_tab]) do
        = render :partial => "class_fields"
  - when "aei"
    = render :partial => "instance_fields"
  - when "aem"
    = render :partial => "method_inputs"
  - when "aen"
    - if @in_a_form && @edit.key?(:ae_class_id)
      = render :partial => "class_add"
    - else
      - if !@in_a_form
        = render :partial => "ns_details"
      - else
        = render :partial => "ns_list"
  - when "root"
    = render :partial => "ns_list"

:javascript
  // method takes hash that can have 4 keys: tabs div id, active_tab label,
  // url to go to when tab is changed, and whether to check for abandon changes or not
  miq_tabs_init("#ae_tabs", "/miq_ae_class/change_tab");
  if (ManageIQ.editor !== null) ManageIQ.editor.refresh();

-# disable any other tabs on screen when in edit
- if @in_a_form || @angular_form
  :javascript
    miq_tabs_disable_inactive('#ae_tabs');