<% action ||= :create %> <% if @dirmon_entry.errors.present? %>
Invalid Dirmon entry!
<% @dirmon_entry.errors.messages.each_pair do |field, message| %>
<%= field %>: <%= message %>
<% end %> <% end %> <%= form_for @dirmon_entry, url: {action: action} do |f| %>
<%= f.label :name %> <%= f.text_field :name, class: 'form-control' %>
<%= f.label :job_class_name %> <%= f.text_field :job_class_name, class: 'form-control', disabled: action != :create %>
<%= f.label :pattern %> <%= f.text_field :pattern, class: 'form-control' %>
<%= f.label :archive_directory %> <%= f.text_field :archive_directory, class: 'form-control' %>
<% if @dirmon_entry.job_class %>
Job Properties
<%= f.fields_for :properties do |properties| %> <% @dirmon_entry.job_class.user_editable_fields.each do |property_name| %> <%= properties.label property_name.to_s %> <%= editable_field_html(@dirmon_entry.job_class, property_name, @dirmon_entry.properties[property_name], properties, true) %> <% end %> <% end %>
<% end %>
<%= f.submit action, class: 'btn btn-primary' %> <%= link_to 'cancel', :back, class: 'btn btn-default' %>
<% if action == :create %> <%= button_tag 'properties', type: 'button', class: 'btn btn-default', id: 'properties', data: {url: rocket_job_mission_control.new_dirmon_entry_path} %> <% end %>
<% end %>