<% disabled = (not authorized_via_my_scope("host_editing", "edit_params")) %>
<div class="fields">
  <table class="row">
    <tbody>
      <tr class="form-group <%= 'has-error' if f.object.errors.any? %>">
        <% if controller_name =~ /(host|hostgroup)/ %>
          <td class="col-md-3">
            <%= content_tag(:input, '', :class => "form-control", :disabled => true,  :value => _('Global'), :type=> :text ) %>
          </td>
        <% end %>
        <td class="col-md-2">
          <%= f.text_field(:name,  :class => "form-control", :disabled => disabled, :placeholder => _("Name")) %>
        </td>
        <td class="col-md-4 value">
          <% if f.object.hidden_value? %>
            <%= f.password_field(:value, :class => 'form-control',
                             :disabled => disabled,
                             :value => f.object.value) %>
          <% else %>
            <%= f.text_area(:value,
                        :class => "form-control",
                        :rows => line_count(f, :value),
                        :disabled => disabled,
                        :placeholder => _("Value")) %>

          <% end %>
        </td>
        <td class="col-md-1">
          <%= fullscreen_button("$(this).parent().prev().find('textarea')") unless f.object.hidden_value? %>
        </td>
        <td>
          <span class="help-block">
            <%= f.check_box(:hidden_value,
                      :class => 'hidden_value_textarea_switch',
                      :onclick => 'turn_textarea_switch()',
                      :disabled => disabled) %>
            <%= _('hide') %><br />
            <%= link_to_remove_fields('', f) if authorized_via_my_scope("host_editing", "destroy_params") %><%= _('remove') %>
          </span>
        </td>
        <span class="help-block">
          <%= f.object.errors.full_messages.to_sentence %>
        </span>
      </tr>
    </tbody>
  </table>
  <%= f.hidden_field :nested %>
</div>
