|                                                                                            | 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 | {% extends 'base.html' %}
{% block content %}
<div class="cell-margin grid mt-16 lg:grid-cols-2">
    <div class="left ">
        <div class="mb-4 capitalize">{{ resource['type'] }}</div>
        <div class="lg:border-r-2 lg:border-black lg:pr-8 resource">
            <h2 class="block-margin huge-title {{ resource['type'] }}">
                {% block title %}
                {% autoescape false %}
                {{ resource['name'] | replace(" ","<br>") }}
                {% endautoescape %}
                {% endblock %}
            </h2>
            {% if current_user.is_authenticated %}
            {% if resource['type'] == 'tool' %}
            <div class="row text-center py-3">
                <a href="{{ url_for('tool.edit_tool', tool_id=resource['id']) }}">
                    <span class="">Edit</span>
                </a>
            </div>
            {% elif resource['type'] == 'practice' %}
            <div class="row text-center py-3">
                <a href="{{ url_for('practice.edit_practice', practice_id=resource['id']) }}">
                    <span class="">Edit</span>
                </a>
            </div>
            {% endif %}
            {% endif %}
            <div class="facts">
                {% if resource.type == 'tool' %}
                    {% if resource['description'] %}
                    <div class="">
                        <h3>Description</h3>
                        {{ resource['description']|safe }}
                    </div>
                    {% endif %}
                    <!-- fields for tools -->
                    {% if resource['developer'] %}
                    <div class="">
                        <h3>Developer</h3>
                        {% if resource['developerUrl'] %}
                        <a href="{{ resource['developerUrl'] }}">{{ resource['developer'] }}</a>
                        {% else %}
                        {{ resource['developer'] }}
                        {% endif %}
                    </div>
                    {% endif %}
                    {% if resource['license'] %}
                    <div class="">
                        <h3>Software license</h3>
                        {{ resource['license'] }}
                    </div>
                    {% endif %}
                    {% if resource['scriptingLanguage'] %}
                    <div class="">
                        <h3>Software language(s)</h3>
                        {{ resource['scriptingLanguage'] }}
                    </div>
                    {% endif %}
                    {% if resource['projectUrl'] %}
                    <div class="">
                        <h3>Project page</h3>
                        <a href="{{ resource['projectUrl'] }}">{{ resource['projectUrl'] }}</a>
                    </div>
                    {% endif %}
                    {% if resource['repositoryUrl'] %}
                    <div class="">
                        <h3>Code repository</h3>
                        <a href="{{ resource['repositoryUrl'] }}">{{ resource['repositoryUrl'] }}</a>
                    </div>
                    {% endif %}
                    {% if resource['ingestFormats'] %}
                    <div class="">
                        <h3>Import / ingest formats</h3>
                        {{ resource['ingestFormats'] }}
                    </div>
                    {% endif %}
                    {% if resource['outputFormats'] %}
                    <div class="">
                        <h3>Output formats</h3>
                        {{ resource['outputFormats'] }}
                    </div>
                    {% endif %}
                    {% if resource['status'] %}
                    <div class="">
                        <h3>Platform status</h3>
                        {{ resource['status'] }}
                        {% if resource['commitDate'] %}
                            : last <a href="{{ resource['repositoryUrl'] }}">GitHub commit</a> on {{ resource['commitDate']}}
                        {% endif %}
                    </div>
                    {% endif %}
                    {% if resource['updated'] %}
                    <div class="">
                        <h3>Entry last updated</h3>
                        {{ resource['updated'].strftime('%Y-%m-%d')|safe }}
                    </div>
                    {% endif %}
                {% elif resource.type == 'practice' %}
                    {{ practice_markdown | safe }}
                {% endif %}
            </div>
            {% if resource['videoUrl'] %}
            <div id="embedded-video" class="lg:col-span-12">
                <h3>Accompanying video</h3>
                <iframe src="{{ resource['videoUrl']|safe }}" frameborder="0" webkitallowfullscreen="true" mozallowfullscreen="true" allowfullscreen></iframe>
            </div>
            {% endif %}
        </div>
    </div>
    <div class="right p-4 pr-8 lg:p-0 ">
        <div class="grid lg:grid-cols-2">
            {{ relationships_links(resource) }}
        </div>
    </div>
</div>
{% endblock %}
 |