Sha256: 9964c881767bac99e829daf793c78d244c9d83e9bf9707c9f58b7b6e7a89b79b

Contents?: true

Size: 1.92 KB

Versions: 11

Compression:

Stored size: 1.92 KB

Contents

<%
  json = {
    "organization": current_organization,
    "location": current_location,
    "hostgroups": @hostgroups,
    "foremanDataUrl": ui_acd_foreman_data_path("__id__"),
    "ansibleDataUrl": ui_acd_ansible_data_path("__id__"),
    "services": [],
    "ansibleVarsAll": [],
  }

  if @app_definition.new_record?
    json["mode"] = "newDefinition"
    json["ansiblePlaybooks"] = @ansible_playbooks
  else
    json["mode"] = "editDefinition"
    json["ansiblePlaybook"] = @app_definition.ansible_playbook.as_unified_structobj
  end

  if @app_definition.services.present?
    json["services"] = JSON.parse(@app_definition.services)
  end

  if @app_definition.ansible_vars_all.present?
    json["ansibleVarsAll"] = JSON.parse(@app_definition.ansible_vars_all)
  end

   json["supportedPlugins"] = {}
   json["supportedPlugins"]["puppet"] = defined?(ForemanPuppet) != nil
   json["supportedPlugins"]["katello"] = defined?(Katello) != nil
%>

<%= form_for @app_definition, :url => (@app_definition.new_record? ? app_definitions_path : app_definition_path(:id => @app_definition.id)) do |f| %>
  <%= base_errors_for @app_definition %>
  <ul class="nav nav-tabs" data-tabs="tabs">
    <li class="active"><a href="#primary" data-toggle="tab"><%= _('Application Definitions') %></a></li>
    <% if show_location_tab? %>
          <li><a href="#locations" data-toggle="tab"><%= _("Locations") %></a></li>
      <% end %>
      <% if show_organization_tab? %>
          <li><a href="#organizations" data-toggle="tab"><%= _("Organizations") %></a></li>
      <% end %>
  </ul>

  <div class="tab-content">
    <div class="tab-pane active" id="primary">
      <%= text_f f, :name %>
      <%= text_f f, :description %>

      <div id='app_definition'></div>
      <%=  react_component('ApplicationDefinition', :data => json) %>
    </div>

    <%= render 'taxonomies/loc_org_tabs', :f => f, :obj => @app_definition %>
  </div>

  <%= submit_or_cancel f %>
<% end %>

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
foreman_acd-0.11.0 app/views/foreman_acd/app_definitions/_form.html.erb
foreman_acd-0.10.0 app/views/foreman_acd/app_definitions/_form.html.erb
foreman_acd-0.9.7 app/views/foreman_acd/app_definitions/_form.html.erb
foreman_acd-0.9.5 app/views/foreman_acd/app_definitions/_form.html.erb
foreman_acd-0.9.4 app/views/foreman_acd/app_definitions/_form.html.erb
foreman_acd-0.9.3 app/views/foreman_acd/app_definitions/_form.html.erb
foreman_acd-0.9.2.3 app/views/foreman_acd/app_definitions/_form.html.erb
foreman_acd-0.9.2.2 app/views/foreman_acd/app_definitions/_form.html.erb
foreman_acd-0.9.2.1 app/views/foreman_acd/app_definitions/_form.html.erb
foreman_acd-0.9.2 app/views/foreman_acd/app_definitions/_form.html.erb
foreman_acd-0.9.1 app/views/foreman_acd/app_definitions/_form.html.erb