{% extends 'layout.jinja2' %}
{% block head %}
  {{ super() }}
  <meta name="og:type" content="website" />
  <meta name="og:url" content="{{ request.route_url('skosprovider.conceptscheme', scheme_id=conceptscheme.scheme_id) }}" />
  <meta name="og:title" content="{{ conceptscheme.title }}" />
  {% if conceptscheme.notes|length > 0 %}
    <meta name="og:description" content="{{ conceptscheme.notes[0]|safe }}" />
  {% endif %}
  <meta name="twitter:card" content="summary" />
  <meta name="twitter:site" content="{{ request.registry.settings['twitter.site']}}" />
  <meta name="twitter:title" content="{{ conceptscheme.title }}" />
  {% if conceptscheme.notes|length > 0 %}
    <meta name="twitter:description" content="{{ conceptscheme.notes[0]|safe }}" />
  {% endif %}
  <link rel="canonical" href="{{ request.route_url('skosprovider.conceptscheme', scheme_id=conceptscheme.scheme_id) }}" />
{% endblock %}
{% block html_title %}{{ conceptscheme.title }}{% endblock %}

{% from "macros.jinja2" import
    print_labels,
    print_concepts,
    get_conceptscheme_label
  %}

{% block content %}
  <div class="large-12 columns">
    <div class="row">
      <div class="clearfix">
        <ul class="downloadtop right">
          <li>DOWNLOAD</li>
          <li><a title="Download the scheme and it's top concepts in RDF/XML format." href="{{request.route_path('skosprovider.conceptscheme.rdf', scheme_id=conceptscheme.scheme_id)}}">RDF/XML</a></li>
          <li><a title="Download the scheme and it's top concepts in JSON-LD format." href="{{request.route_path('skosprovider.conceptscheme.jsonld', scheme_id=conceptscheme.scheme_id)}}">JSON-LD</a></li>
          <li><a title="Download the scheme and it's top concepts in N3/Turle format." href="{{request.route_path('skosprovider.conceptscheme.ttl', scheme_id=conceptscheme.scheme_id)}}">N3/Turtle</a></li>
          <li><a title="Download the scheme and all it's concepts and collections in RDF/XML format." href="{{request.route_path('skosprovider.conceptscheme.cs.rdf', scheme_id=conceptscheme.scheme_id)}}">Full RDF/XML</a></li>
          <li><a title="Download the scheme and all it's concepts and collections in N3/Turtle format." href="{{request.route_path('skosprovider.conceptscheme.cs.ttl', scheme_id=conceptscheme.scheme_id)}}">Full N3/Turtle</a></li>
          <li><a title="Open a printable scheme tree and all it's concepts." href="{{request.route_path('scheme_tree_html', scheme_id=conceptscheme.scheme_id)}}">Printable Tree</a></li>
        </ul>
      </div>

      <div class="large-12 columns panel">
        <h1 class="panel-header left">{{ conceptscheme.title }}</h1>
        <h2 class="id-header right">[ ID : {{ conceptscheme.scheme_id }} ]</h2>
        <hr>

        <dl class="infolist clearfix">
          {% if conceptscheme.uri %}
            <dt>uri</dt>
            <dd><a href="{{ conceptscheme.uri }}">{{ conceptscheme.uri }}</a></dd>
          {% endif %}

          {% if conceptscheme.labels %}
            {{ print_labels(conceptscheme.labels) }}
          {% endif %}
        </dl>

        {% if conceptscheme.notes %}
          <ul class="scopeNote">
            {% if conceptscheme.notes|length > 0 %}
              <h3>{% trans %}notes{% endtrans %}</h3>
              {%- for note in conceptscheme.notes %}
                <li lang="{{ note.language }}">
                  <strong>{{ note.type|capitalize }}</strong> <em>({{ note.language }})</em>: {{ note.note|safe }}
                </li>
              {%- endfor %}
            {% endif %}
          </ul>
        {% endif %}

        {% if conceptscheme.sources %}
          <ul class="scopeNote">
            {% if conceptscheme.sources|length > 0 %}
              <h3>{% trans %}sources{% endtrans %}</h3>
              {%- for source in conceptscheme.sources %}
                <li>
                  {{ source.citation|safe }}
                </li>
              {%- endfor %}
            {% endif %}
          </ul>
        {% endif %}
        {% if request.has_permission('edit') %}
          <div class="row">
            <div class="large-2 columns right">
              <a href="{{ request.route_path('admin') + '#/conceptschemes/' + conceptscheme.scheme_id }}"
                 class="fa fa-pencil editIcon"
                 title="Edit concept">
              </a>
            </div>
          </div>
        {% endif %}
      </div>
    </div>
  </div>
  <div class="large-12 columns" style="margin-top: 20px;">
    <div class="row" title="{% trans %}tree_help{% endtrans %}">
      {% include "tree.jinja2" %}
    </div>
  </div>
{% endblock %}
