<% title template.id.present? ? template.title : "New Template" %>
<% modifiable = template.latest? && !template.customization_of.present? && template.id.present? && (template.org_id = current_user.org.id) %>
<div class="row">
  <div class="col-md-12">
    <h1><%= template.id.present? ? template.title : _('New Template') %></h1>
    <%= link_to _('View all templates'), referrer, class: 'btn btn-default pull-right' %>
  </div>
</div>
<div class="row">
  <div class="col-md-12">
    <!-- render navigation tabs for the template-->
    <%= render partial: "org_admin/templates/navigation", locals: local_assigns.merge({ modifiable: modifiable }) %>
    <div class="tab-content">
      <div role="tabpanel" class="tab-pane active">
        <div class="panel panel-default">
          <div class="panel-body">
            <%= render partial: partial_path, locals: local_assigns.merge({ referrer: referrer, modifiable: modifiable }) %>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>