<fieldset id="calculator_fields" data-hook>
  <legend><%= t(:calculator) %></legend>
  <div id="preference-settings" data-hook>
    <p>
      <%= f.label(:calc_type, t(:calculator), :for => 'calc-type') %>
      <%= f.select(:calculator_type, @calculators.map { |c| [c.description, c.name] }, {}, {:id => 'calc-type'}) %>
    </p>
    <% if !@object.new_record? %>
      <div class="calculator-settings">
        <%= f.fields_for :calculator do |calculator_form| %>
          <%= preference_fields(@object.calculator, calculator_form) %>
        <% end %>
      </div>
      <% if @object.calculator.respond_to?(:preferences) %>
        <div class="calculator-settings-warning"><%= t(:calculator_settings_warning) %></div>
      <% end %>
    <% end %>
  </div>
</fieldset>
