ManageIQ/manageiq-ui-classic

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

Summary

Maintainability
Test Coverage
#method_inputs_div
  - if @in_a_form || @angular_form
    #method_form_div
      - if playbook_style_location?(@ae_method.location)
        = render :partial => "angular_method_form",
                 :locals  => {:prefix => "", :location => @ae_method.location }
      - else
        = render :partial => "method_form", :locals  => {:prefix => ""}
  - else
    = method_details(@ae_method, @sb)
    - if @ae_method.location == 'inline'
      = render :partial => "embedded_methods"
    = render :partial => "domain_overrides", :locals => {:node_prefix => "aem", :model => "Method"}
    - if @ae_method.location == "inline"
      - if @in_a_form
        %h3= @ae_method.location == 'builtin' ? _('Builtin name') : _('Data')
        = text_area("method1",
          "data",
          :value    => @ae_method.data,
          :size     => "90x20",
          :disabled => true,
          :style    => "display:none;")
        -# Create a MyCodeMirror editor for the text area
        = render :partial => "/layouts/my_code_mirror",
          :locals  => {:text_area_id => "method1_data",
            :mode                    => "ruby",
            :line_numbers            => true,
            :read_only               => true}
      - else
        = method_built_in_data(@ae_method)
    - elsif @ae_method.location == 'expression'
      = @expression
    - elsif playbook_style_location?(@ae_method.location)
      .form-horizontal
        - if @ae_method.location == 'playbook'
          .form-group
            = format_form_group(_('Repository'), @playbook_details[:repository])
          .form-group
            = format_form_group(_('Playbook'), @playbook_details[:playbook])
          .form-group
            = format_form_group(_('Machine Credential'), @playbook_details[:machine_credential])
          .form-group
            = format_form_group(_('Vault Credential'), @playbook_details[:vault_credential])
          .form-group
            = format_form_group(_('Cloud Credential'), @playbook_details[:cloud_credential])
          .form-group
            = format_form_group(_('Escalate Privilege'), @playbook_details[:become_enabled])
        - else
          .form-group
            = format_form_group(_('Provider'), @playbook_details[:manager_name])
          .form-group
            = format_form_group(playbook_label(@ae_method.location), @playbook_details[:ansible_template])

        .form-group
          = format_form_group(_('Max TTL'), @playbook_details[:execution_ttl])

        - if %w[playbook ansible_job_template].include?(@ae_method.location)
          .form-group
            = format_form_group(_('Hosts'), @playbook_details[:hosts])
        .form-group
          = format_form_group(_('Logging Output'), _(ViewHelper::LOG_OUTPUT_LEVELS[@playbook_details[:log_output]]))

        - if @ae_method.location == 'playbook'
          .form-group
            = format_form_group(_('Verbosity'), _(ViewHelper::VERBOSITY_LEVELS[@playbook_details[:verbosity]]))
    - else
      = @ae_method.data
    -# show inputs parameters grid if there are any inputs
    #params_div{:style => @record.inputs.empty? ? "display: none;" : ""}
      %hr
      %h3= _('Input Parameters')
      %table#params_grid.table.table-striped.table-bordered
        %thead
          %tr
            %th= _('Input Name')
            %th= _('Data Type')
            %th= _('Default Value')
        %tbody
          - @record.inputs.each do |record|
            %tr
              %td= record_name(record)
              %td= record.datatype.blank? ? 'string' : record.datatype
              %td
                = record.datatype == 'password' ? '********' : record.default_value