<div class="tab-pane" id="templates">
  <% if @operatingsystem.new_record? %>
    <%= alert(:class => 'alert-info',
              :header => _("It is not possible to assign provisioning templates at this stage."),
              :text => _("Please save the Operating System first and try again.")) %>
  <% else %>
    <% if ProvisioningTemplate.joins(:operatingsystems).
        where(:operatingsystems => { :id => @operatingsystem.id }).empty? %>
      <%= alert(:class => 'alert-info',
                :header => _("No templates found!"),
                :text => (_("You probably need to configure your %s first.") %
                          link_to("templates", provisioning_templates_path)).html_safe) %>
    <% end %>

    <%= f.fields_for :os_default_templates do |builder| %>
      <%= render 'templates', :f => builder %>
    <% end %>
  <% end %>

</div>
