<commit_before>{% extends 'base.navigation.html.twig' %}

{% block javascripts %}
    {{ parent() }}
    {% if organism.eol_accession is defined %}
        <script src="{{ asset('assets/js/helpers/organismDetails.js') }}"></script>
        <script type="text/javascript">
            var eol_id = {{ organism.eol_accession }};
            var img_template = '<a class="thumbnail" href="<%= href %>"><img src="<%= src %>"/></a><a href="<%= source %>"><div>(c) <%= rightsHolder %> <%= license %></div></a>';
            var progress = $(".loading-progress").progressTimer({
                timeLimit: 60,
                onFinish: function(){
                    $(".loading-progress").remove();
                }
            });
            $.ajax({
                method: "GET",
                url: "http://eol.org/api/pages/1.0.json",
                data: {
                    id: eol_id,
                    batch: false,
                    images_per_page: 3,
                    images_page: 1,
                    videos_per_page: 0,
                    videos_page: 1,
                    sounds_per_page: 0,
                    sounds_page: 1,
                    maps_per_page: 0,
                    maps_page: 1,
                    texts_per_page: 3,
                    texts_page: 1,
                    iucn: true,
                    subjects: "overview",
                    licenses: "cc-by|cc-by-nc|cc-by-sa|cc-by-nc-sa|pd",
                    details: true,
                    common_names: true,
                    synonyms: true,
                    references: true,
                    taxonomy: true,
                    vetted: 0,
                    cache_ttl: 60,
                    language: "en"
                },
                success: function(result){
                    console.log(result);
                    var txtCounter = 1;
                    for(dob in result["dataObjects"]){
                        if(result["dataObjects"][dob]["dataType"] === "http://purl.org/dc/dcmitype/StillImage"){
                            var url = result["dataObjects"][dob]["eolMediaURL"];
                            var license = result["dataObjects"][dob]["license"];
                            var rightsHolder = result["dataObjects"][dob]["rightsHolder"];
                            var source = result["dataObjects"][dob]["source"];
                            var img_element = _.template(img_template)({src: url, href: url, license: license, rightsHolder: rightsHolder, source: source});
                            $('#organism-img-column').append(img_element);
                        }
                        if(result["dataObjects"][dob]["dataType"] === "http://purl.org/dc/dcmitype/Text"){
                            $("#title"+txtCounter).text(result["dataObjects"][dob]["title"]);
                            $("#txt"+txtCounter).html(result["dataObjects"][dob]["description"]);
                            txtCounter++;
                        }
                    }
                    $("#vernacularName").text(getBestVernacularNameEOL(result));
                }
            }).done(function(){
                progress.progressTimer('complete');
            });
        </script>
    {% endif %}
{% endblock %}

{% block content %}
    <h1 class="page-header">{{ organism.scientific_name }}</h1>
    <div class="col-md-12">
        <div>
            <ul class="nav nav-tabs" role="tablist">
                <li role="presentation" class="active"><a class="organism-link" href="#overview" role="tab" data-toggle="tab">Overview</a></li>
                <li role="presentation"><a class="organism-link" href="#traits" aria-controls="traits" role="tab" data-toggle="tab">Traits</a></li>
                <li role="presentation"><a class="organism-link" href="#taxonomy" aria-controls="taxonomy" role="tab" data-toggle="tab">Taxonomy</a></li>
            </ul>
            <div class="tab-content">
                <div role="tabpanel" class="tab-pane active" id="overview">
                    <div class="alert alert-success alert-dismissable" role="alert" style="margin-top: 10px;">
                        <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                            <span aria-hidden="true">&times;</span>
                        </button>
                        Content on this page is dynamically included from <a href="http://eol.org">EOL</a> via its <a href="http://eol.org/api">API</a>. <a href="http://eol.org/pages/{{ organism.eol_accession }}">Visit full page at EOL for this organism (id {{ organism.eol_accession }})</a>.
                    </div>
                    <div class='row'>
                        <div class='col-xs-12'>
                            <div class='loading-progress'></div>
                        </div>
                    </div>
                    <h2 id="vernacularName"></h2><commit_msg>Call to eol is working again<commit_after>{% extends 'base.navigation.html.twig' %}

{% block javascripts %}
    {{ parent() }}
    {% if organism.eol_accession is defined %}
        <script type="text/javascript">
            var eol_id = {{ organism.eol_accession }};
            var img_template = '<a class="thumbnail" href="<%= href %>"><img src="<%= src %>"/></a><a href="<%= source %>"><div>(c) <%= rightsHolder %> <%= license %></div></a>';
            var progress = $(".loading-progress").progressTimer({
                timeLimit: 60,
                onFinish: function(){
                    $(".loading-progress").remove();
                }
            });
            $.ajax({
                method: "GET",
                url: "http://eol.org/api/pages/1.0.json",
                data: {
                    id: eol_id,
                    batch: false,
                    images_per_page: 3,
                    images_page: 1,
                    videos_per_page: 0,
                    videos_page: 1,
                    sounds_per_page: 0,
                    sounds_page: 1,
                    maps_per_page: 0,
                    maps_page: 1,
                    texts_per_page: 3,
                    texts_page: 1,
                    iucn: true,
                    subjects: "overview",
                    licenses: "cc-by|cc-by-nc|cc-by-sa|cc-by-nc-sa|pd",
                    details: true,
                    common_names: true,
                    synonyms: true,
                    references: true,
                    taxonomy: true,
                    vetted: 0,
                    cache_ttl: 60,
                    language: "en"
                },
                success: function(result){
                    console.log(result);
                    var txtCounter = 1;
                    $.each(result["dataObjects"], function (dob) {
                        if(result["dataObjects"][dob]["dataType"] === "http://purl.org/dc/dcmitype/StillImage"){
                            var url = result["dataObjects"][dob]["eolMediaURL"];
                            var license = result["dataObjects"][dob]["license"];
                            var rightsHolder = result["dataObjects"][dob]["rightsHolder"];
                            var source = result["dataObjects"][dob]["source"];
                            var img_element = _.template(img_template)({src: url, href: url, license: license, rightsHolder: rightsHolder, source: source});
                            $('#organism-img-column').append(img_element);
                        }
                        if(result["dataObjects"][dob]["dataType"] === "http://purl.org/dc/dcmitype/Text"){
                            $("#title"+txtCounter).text(result["dataObjects"][dob]["title"]);
                            $("#txt"+txtCounter).html(result["dataObjects"][dob]["description"]);
                            txtCounter++;
                        }
                    });
                    $("#vernacularName").text(getBestVernacularNameEOL(result));
                }
            }).done(function(){
                // progress.progressTimer('complete');
            });
        </script>
        <script src="{{ asset('assets/js/helpers/organismDetails.js') }}"></script>
    {% endif %}
{% endblock %}

{% block content %}
    <h1 class="page-header">{{ organism.scientific_name }}</h1>
    <div class="col-md-12">
        <div>
            <ul class="nav nav-tabs" role="tablist">
                <li role="presentation" class="active"><a class="organism-link" href="#overview" role="tab" data-toggle="tab">Overview</a></li>
                <li role="presentation"><a class="organism-link" href="#traits" aria-controls="traits" role="tab" data-toggle="tab">Traits</a></li>
                <li role="presentation"><a class="organism-link" href="#taxonomy" aria-controls="taxonomy" role="tab" data-toggle="tab">Taxonomy</a></li>
            </ul>
            <div class="tab-content">
                <div role="tabpanel" class="tab-pane active" id="overview">
                    <div class="alert alert-success alert-dismissable" role="alert" style="margin-top: 10px;">
                        <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                            <span aria-hidden="true">&times;</span>
                        </button>
                        Content on this page is dynamically included from <a href="http://eol.org">EOL</a> via its <a href="http://eol.org/api">API</a>. <a href="http://eol.org/pages/{{ organism.eol_accession }}">Visit full page at EOL for this organism (id {{ organism.eol_accession }})</a>.
                    </div>
                    <div class='row'>
                        <div class='col-xs-12'>
                            <div class='loading-progress'></div>
                        </div>
                    </div>
                    <h2 id="vernacularName"></h2>
{'fraction_non_alphanumeric': 0.15494949494949495, 'fraction_numerical': 0.0056565656565656566, 'mean_word_length': 1.4721598002496878, 'pattern_counts': {'":': 0, '<': 115, '<?xml version=': 0, '>': 115, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2358838', 'n_tokens_mistral': 2796, 'n_tokens_neox': 2561, 'n_words': 480}