{% extends "withnav_template.html" %}
{% from "components/page-footer.html" import page_footer %}
{% from "components/textbox.html" import textbox %}
{% from "components/api-key.html" import api_key %}

{% block service_page_title %}
  {{ template.name }}
{% endblock %}

{% block maincolumn_content %}


  <h1 class="heading-large">{{ template.name }}</h1>

  <div class="grid-row">
    {% with show_title=False, expanded=True %}
      {% include 'views/templates/_template.html' %}
    {% endwith %}
  </div>

  <div class="bottom-gutter">
    {{ api_key(template.id, name="Template ID", thing='template ID') }}
  </div>

  {% if template._template.updated_at %}
    <div class="bottom-gutter-2">
      <h2 class="heading-small">Last edited {{ template._template.updated_at|format_datetime_relative }}</h2>
      <p>
        <a href="{{ url_for('.view_template_versions', service_id=current_service.id, template_id=template.id) }}">See previous versions</a>
      </p>
    </div>
  {% endif %}

{% endblock %}
