templates/specieslist_species.html.twig line 1

Open in your IDE?
  1. {% extends "base.html.twig" %}
  2. {% block css %}
  3. <link id="bsdp-css" href="https://unpkg.com/bootstrap-datepicker@1.9.0/dist/css/bootstrap-datepicker3.min.css" rel="stylesheet">
  4. <link href="https://cdn.jsdelivr.net/npm/@yaireo/tagify@3.7.3/dist/tagify.css" rel="stylesheet">
  5. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ekko-lightbox/5.3.0/ekko-lightbox.css" />
  6. {% endblock %}
  7. {% block title %} {{ 'Soortenlijst'|trans }} {% if app.request.locale == 'nl' %}{{ title.namenl }}{% else %}{{ title.nameen }}{% endif %} {% endblock %}
  8. {% block body %}
  9.         <p>&nbsp;</p>
  10.         <div class="row flex-md-row h-md-250 position-relative">
  11.           <div class="col-md-9 position-static">
  12.             <!-- Begin Page Content -->
  13.             <h2>{{ 'Soortenlijst'|trans }}
  14.             {% if type == 'location' %}<a href="{{ path('locations_fossil', { 'id': title.id })}}">
  15.             {% elseif type == 'era' %}<a href="{{ path('glossary', { 'id': title.glossary.id, 'url': title.glossary.url })}}">
  16.             {% endif %}
  17.             {% if app.request.locale == 'nl' %}{{ title.namenl }}{% else %}{{ title.nameen }}{% endif %}
  18.             </a>
  19.             </h2>
  20.             <p></p>
  21.               <div class="row">
  22.                 <div class="col-sm-12">
  23.                   <a href="{{ path('specieslist_item', { 'type' : type, 'id' : id })}}"><button class="btn btn-paleontica"><span class="feather-18" data-feather="arrow-left-circle"></span> {{ 'Terug'|trans }}</button></a>
  24.                   <h3>{% if taxanomytype is not null %}<a href="{{ path('glossary_by_title', {title: taxanomytype.namescientific|lower}) }}"><img src="/images/icons/fossil/has_{{ taxanomytype.namescientific|lower }}{{ taxanomytype.namescientificclarification }}.png"></a>{% if app.request.locale == 'nl' %}{{ taxanomytype.namenl }}{% else %}{{ taxanomytype.nameen }}{% endif %}{% else %}{{ 'Onbekend'|trans }}{% endif %}</h3>
  25.                 </div>
  26.               </div>
  27.               <div class="row d-flex justify-content-between">
  28.                 <div class="col-sm-2">
  29.                   {{ fossils.getTotalItemCount }} {{ 'gevonden'|trans }}.
  30.                 </div>
  31.                 <div class="col-sm-6 pagnation-paleontica">
  32.                     {{ knp_pagination_render(fossils) }}
  33.                 </div>
  34.               </div>
  35.               {% for fossil in fossils %}
  36.               <div class="row">
  37.                 <div class="col-sm-12">
  38.                     <b>
  39.                     {% if fossil.genus is null or fossil.genus is empty %}
  40.                       {% set fossildbsearchgenusurl = '' %}
  41.                       {% set genus = '' %}
  42.                       {% set genus_set = 0 %}
  43.                     {% else %}
  44.                       {% set fossildbsearchgenusurl = '[{"value":"' ~ fossil.genus ~ '"}]' %}
  45.                       {% set genus = fossil.genus %}
  46.                       {% set genus_set = 1 %}
  47.                     {% endif %}
  48.                     {% if fossil.species is null or fossil.species is empty %}
  49.                       {% set fossildbsearchspeciesurl = '' %}
  50.                       {% set species = '' %}
  51.                       {% set species_set = 0 %}
  52.                     {# ToDo-Ante: make this work 
  53.                     {% elseif fossil.species == "sp."%}
  54.                       {% set fossildbsearchspeciesurl = '' %}
  55.                       {% set species = fossil.species %}
  56.                       {% set species = '' %} #}
  57.                     {% else %}
  58.                       {% set fossildbsearchspeciesurl = '[{"value":"' ~ fossil.species ~ '"}]' %}
  59.                       {% set species = fossil.species %}
  60.                       {% set species_set = 1 %}
  61.                     {% endif %}
  62.                     {# genus and species #}
  63.                     {% if genus_set == 1 and species_set == 1 %}
  64.                       <i><a href="{{ path('fossildb', { 'page': '1', 'filter[genus]': fossildbsearchgenusurl, 'filter[species]': fossildbsearchspeciesurl }) }}">{{ genus }} {{ species }}</i></a></b>
  65.                     {# genus #}
  66.                     {% elseif genus_set == 1 and species_set == 0 %}
  67.                         <i><a href="{{ path('fossildb', { 'page': '1', 'filter[genus]': fossildbsearchgenusurl }) }}">{{ genus }}</i></a></b>
  68.                     {# species #}
  69.                     {% elseif genus_set == 0 and species_set == 1 %}
  70.                         <i><a href="{{ path('fossildb', { 'page': '1', 'filter[species]': fossildbsearchspeciesurl }) }}">{{ species }}</i></a></b>
  71.                     {# none #}
  72.                     {% elseif (fossil.genus is null or fossil.genus is empty) and (fossil.species is null or fossil.species is empty)%}
  73.                       {{ '[Ongedetermineerd]'|trans }}
  74.                     {% endif %}
  75.                     {% if fossil.author is defined and fossil.author != ""%} ({{ fossil.author }}{% if fossil.authoryear is defined and fossil.authoryear != "" %}, {{ fossil.authoryear }}{% endif %}){% endif %}</b>
  76.                 </div>
  77.               </div>
  78.               <div class="row">
  79.                 <div class="col-sm-12">
  80.                 {# ToDo-Ante: gallery per soort niet per fossil.id #}
  81.                   {#{{% set random_id = random(0, 10000) %}}#}
  82.                   {% set random_id = null %}
  83.                   {% for fossil in fossil.fossils %}
  84.                     {% if random_id is null %}{% set random_id = fossil.id %}{% endif %}
  85.                     {% for photo in fossil.FossildbPhotos %}
  86.                       {% set thumbnail = '/uploads/fossildb/' ~ photo.filename|slice(0, 2) ~ "/" ~ photo.filename %}
  87.                       <a href="/uploads/fossildb/{{photo.filename|slice(0, 2)}}/{{photo.filename}}" data-toggle="lightbox" data-gallery="fossildb-gallery-{{ random_id }}"><img src="{{ thumbnail|imagine_filter('fossildb_thumb_tiny') }}" class="img-fluid img-thumbnail"></a>
  88.                     {% endfor %}
  89.                   {% endfor %}
  90.                 </div>
  91.               </div>
  92.               <br><br>
  93.               {% endfor %}
  94.               <div class="row d-flex justify-content-between">
  95.                 <div class="col-sm-2">
  96.                   &nbsp;
  97.                 </div>
  98.                 <div class="col-sm-6 pagnation-paleontica">
  99.                     {{ knp_pagination_render(fossils) }}
  100.                 </div>
  101.               </div>
  102.               <p></p>
  103.             <!-- END Page Content -->
  104.           </div>
  105.           {% include 'sidebar.html.twig' %}
  106.         </div>
  107. {% endblock %}
  108. {% block javascript %}
  109.     <script src="https://cdn.jsdelivr.net/autocomplete.js/0/autocomplete.jquery.min.js"></script>
  110.     <script src="https://unpkg.com/bootstrap-datepicker@1.9.0/dist/js/bootstrap-datepicker.min.js"></script>
  111.     <script>
  112.         jQuery(document).ready(function() {
  113.           $('.js-datepicker').datepicker({
  114.             calendarWeeks: true,
  115.             autoclose: true,
  116.             clearBtn: true,
  117.             todayHighlight: true,
  118.             format: "dd-mm-yyyy",
  119.           });
  120.         $('.js-autocomplete').each(function() {
  121.             var autocompleteUrl = $(this).data('autocomplete-url');
  122.             $(this).autocomplete({hint: false}, [
  123.                 {
  124.                     source: function(query, cb) {
  125.                         $.ajax({
  126.                             url: autocompleteUrl+'?query='+query,
  127.                         }).then(function(data) {
  128.                             cb(data.pages);
  129.                         });
  130.                     },
  131.                     displayKey: 'id',
  132.                     name: 'page',
  133.                     debounce: 500 // only request every 1/2 second
  134.                 }
  135.             ])
  136.         });
  137.       });
  138.     </script>
  139.     <script src="https://cdnjs.cloudflare.com/ajax/libs/ekko-lightbox/5.3.0/ekko-lightbox.min.js"></script>
  140.     <script>
  141.     $(document).on('click', '[data-toggle="lightbox"]', function(event) {
  142.         event.preventDefault();
  143.         $(this).ekkoLightbox({
  144.             wrapping: true,
  145.         });
  146.     });
  147.     </script>
  148. {% endblock %}