<div class="viewblock-header_right">
  <div class="button-padding">
    <%= link_to t('.edit_template'), edit_template_path(@template), class: "btn" if can? :edit, @template %>

    <% if can? :delete, @template %>
      <% if @template.is_deletable? %>
        <%= link_to t('.delete_template'), @template, data: { confirm: t(:are_you_sure_delete_model_key, model: ::Template.model_name.human, key: @template.name) }, method: :delete, class: "btn"  %>
      <% else %>
        <%= link_to t('.delete_template'), '#', class: "btn disabled tooltip-basic", 'data-tooltip-text' => t(:cannot_delete_template, screens: @template.screen_dependencies.collect { |s| s.name if can? :read, s}.join(", ")) %>
      <% end %>
    <% end %>

    <%= link_to t('.export_template'), export_template_path(@template), { class: "btn", "data-no-turbolink" => true } if can? :edit, @template %>
  </div>
</div>

<div class="default-padding">
  <h1 id="contentlist">
    <%= link_to t(:all_model, model: ::Template.model_name.human(count: 42)), templates_path %> &gt;
    <%= @template.name %>
  </h1>
</div>
