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

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

</div>
