ManageIQ/manageiq-ui-classic

View on GitHub
app/views/miq_request/_prov_vm_migrate_dialog.html.haml

Summary

Maintainability
Test Coverage
-# wf          The workflow object currently in use
-# dialog      The name (symbol) of the selected dialog

- current_tab = @edit && @edit[:new] ? @edit[:new][:current_tab_key] : @options[:current_tab_key]
%br

- if dialog == current_tab
  - case current_tab
  - when :requester
    - keys = [:owner_email, :owner_first_name, :owner_last_name, :owner_address, :owner_city, :owner_state, :owner_zip, :owner_country, :owner_title, :owner_company, :owner_department, :owner_office, :owner_phone, :owner_phone_mobile, :request_notes]
    = render(:partial => "/miq_request/prov_dialog_fieldset",
      :locals         => {:workflow => wf,
        :dialog                     => dialog,
        :label                      => _("Request Information"),
        :keys                       => keys})

    - keys = [:owner_manager, :owner_manager_mail, :owner_manager_mail]
    = render(:partial => "/miq_request/prov_dialog_fieldset",
      :locals         => {:workflow => wf,
        :dialog                     => dialog,
        :label                      => _("Manager"),
        :keys                       => keys})
  - when :environment
    - if wf.field_supported(:datacenter)
      - keys = [:placement_dc_name]
      = render(:partial => "/miq_request/prov_dialog_fieldset",
        :locals         => {:workflow => wf,
          :dialog                     => dialog,
          :label                      => _("Datacenter"),
          :keys                       => keys})

    - if wf.field_supported(:cluster)
      - keys = [:cluster_filter, :placement_cluster_name]
      = render(:partial => "/miq_request/prov_dialog_fieldset",
        :locals         => {:workflow => wf,
          :dialog                     => dialog,
          :label                      => _("Cluster"),
          :keys                       => keys})

    - if wf.field_supported(:respool)
      - keys = [:rp_filter, :placement_rp_name]
      = render(:partial => "/miq_request/prov_dialog_fieldset",
        :locals         => {:workflow => wf,
          :dialog                     => dialog,
          :label                      => _("Resource Pool"),
          :keys                       => keys})

    - if wf.field_supported(:folder)
      - keys = [:placement_folder_name]
      = render(:partial => "/miq_request/prov_dialog_fieldset",
        :locals         => {:workflow => wf,
          :dialog                     => dialog,
          :label                      => _("Folder"),
          :keys                       => keys})

    - keys = [wf.field_supported(:host_filter) ? :host_filter : nil, :placement_host_name].compact
    = render(:partial => "/miq_request/prov_dialog_fieldset",
      :locals         => {:workflow => wf,
        :dialog                     => dialog,
        :label                      => _("Host"),
        :keys                       => keys,
        :extra_table_attributes     => "width=100%"})

    - if wf.field_supported(:storage)
      - keys = [:ds_filter, :placement_ds_name]
      = render(:partial => "/miq_request/prov_dialog_fieldset",
        :locals         => {:workflow     => wf,
          :dialog                         => dialog,
          :label                          => _("Datastore"),
          :keys                           => keys,
          :extra_table_attributes         => "width=100%"})

  - when :hardware
    - keys = [:disk_format]
    = render(:partial => "/miq_request/prov_dialog_fieldset",
      :locals         => {:workflow => wf,
        :dialog                     => dialog,
        :label                      => _("VM Hardware"),
        :keys                       => keys})
  - when :schedule
    - has_schedule_time = (@edit && @edit[:new] && @edit[:new][:schedule_type] && @edit[:new][:schedule_type][0] == "schedule") || (@options && @options[:schedule_type] && @options[:schedule_type][0] == "schedule")
    - keys = [:schedule_type, has_schedule_time ? :schedule_time : nil].compact
    = render(:partial => "/miq_request/prov_dialog_fieldset",
      :locals         => {:workflow => wf,
        :dialog                     => dialog,
        :label                      => _("Schedule Info"),
        :keys                       => keys})