src/Ox/HoardBundle/Resources/views/search/list.html.twig line 1

Open in your IDE?
  1. {% extends '@OxHoardBundle/layout.html.twig' %}
  2. {% block title %}Hoards{% endblock %}
  3. {% block javascripts %}
  4.     {{ parent() }}
  5.     <script type="text/javascript">
  6.         let OcreTableUrl = '{{ path('hoard_ocre_table') }}';
  7.         var addMapExport = true;
  8.         $(function() {
  9.             $( ".tabs" ).tabs({
  10.               active:  window.location.hash ? null : {{ active_tab }},
  11.               activate: function(event, ui) {  
  12.                   window.location.hash = ui.newTab.find('a')[0].hash;
  13.                   $(window).scrollTop(0)
  14.               }
  15.             });
  16.         });
  17.     </script>
  18.     <script type="text/javascript">
  19.           //add dropdown values to javascript
  20.           queryOptions = {};
  21.           queryOptions.isAdmin = {% if is_admin %}true{% else %}false{% endif %};
  22.           queryOptions.isAuthenticated = {% if is_authenticated%}true{% else %}false{% endif %};
  23.           queryOptions.hoardTypes = { {% for i in queryOptions.hoardTypes %}  {{i.id}}: "{{i | replace({"\r\n":"", "'":"’", "\n":" "}) }}"  {% if not loop.last %},{% endif %}{% endfor %} };
  24.           queryOptions.countries = { {% for i in queryOptions.countries %}  {{i.id}}: "{{i}}"  {% if not loop.last %},{% endif %}{% endfor %} };
  25.           queryOptions.provinces = { {% for i in queryOptions.provinces %}  {{i.id}}: "{{i}}"  {% if not loop.last %},{% endif %}{% endfor %} };
  26.           queryOptions.ancientPlaces = { {% for i in queryOptions.ancientPlaces %}  {{i.id}}: "{{i}}"  {% if not loop.last %},{% endif %}{% endfor %} };
  27.           queryOptions.findSpotLocationDetails = { {% for i in queryOptions.findSpotLocationDetails %}  {{i.id}}: "{{i | replace({"\r\n":"", "'":"’", "\n":" "}) }}"  {% if not loop.last %},{% endif %}{% endfor %} };
  28.           queryOptions.reigns = { {% for i in queryOptions.reigns %}  {{i.id}}: "{{i}}"  {% if not loop.last %},{% endif %}{% endfor %} };
  29.           queryOptions.discoveryMethods = { {% for i in queryOptions.discoveryMethods %}  {{i.id}}: "{{i | replace({"\r\n":"", "'":"’", "\n":" "}) }}"  {% if not loop.last %},{% endif %}{% endfor %} };
  30.           queryOptions.discoveryLandUses = { {% for i in queryOptions.discoveryLandUses %}  {{i.id}}: "{{i | replace({"\r\n":"", "'":"’", "\n":" "}) }}"  {% if not loop.last %},{% endif %}{% endfor %} };
  31.           queryOptions.archaeologyRecoveryMethods = { {% for i in queryOptions.archaeologyRecoveryMethods %}  {{i.id}}: "{{i | replace({"\r\n":"", "'":"’", "\n":" "}) }}"  {% if not loop.last %},{% endif %}{% endfor %} };
  32.           queryOptions.archaeologySiteContexts = { {% for i in queryOptions.archaeologySiteContexts %}  {{i.id}}: "{{i | replace({"\r\n":"", "'":"’", "\n":" "}) }}"  {% if not loop.last %},{% endif %}{% endfor %} };
  33.           queryOptions.archaeologySiteContextDetails = { {% for i in queryOptions.archaeologySiteContextDetails %}  {{i.id}}: "{{i | replace({"\r\n":"", "'":"’", "\n":" "}) }}"  {% if not loop.last %},{% endif %}{% endfor %} };
  34.           queryOptions.archaeologyPeriods = { {% for i in queryOptions.archaeologyPeriods %}  {{i.id}}: "{{i}}"  {% if not loop.last %},{% endif %}{% endfor %} };
  35.           queryOptions.archaeologyContextNatures = { {% for i in queryOptions.archaeologyContextNatures %}  {{i.id}}: "{{i | replace({"\r\n":"", "'":"’", "\n":" "}) }}"  {% if not loop.last %},{% endif %}{% endfor %} };
  36.           queryOptions.ratings = { {% for i in queryOptions.ratings %}  {{i.rating}}: "{{i}}"  {% if not loop.last %},{% endif %}{% endfor %} };
  37.         queryOptions.hideWhats = { {% for i in queryOptions.hideWhats %}  {{i.id}}: "{{i}}"  {% if not loop.last %},{% endif %}{% endfor %} };
  38.         queryOptions.hideFroms = { {% for i in queryOptions.hideFroms %}  {{i.id}}: "{{i}}"  {% if not loop.last %},{% endif %}{% endfor %} };
  39.           queryOptions.coinLevelDatas = { {% for i in queryOptions.coinLevelDatas %}  {{i.id}}: "{{i.coinLevelData}}"  {% if not loop.last %},{% endif %}{% endfor %} };
  40.           queryOptions.persons = { {% for i in queryOptions.persons %}  {{i.id}}: "{{i}}"  {% if not loop.last %},{% endif %}{% endfor %} };
  41.           queryOptions.period = { {% for i in queryOptions.period %}  {{i.id}}: "{{i}}"  {% if not loop.last %},{% endif %}{% endfor %} };
  42.           queryOptions.reigns = { {% for i in queryOptions.reigns %}  {{i.id}}: "{{i}}"  {% if not loop.last %},{% endif %}{% endfor %} };
  43.           queryOptions.mints = { {% for i in queryOptions.mints %}  {{i.id}}: "{{i}}"  {% if not loop.last %},{% endif %}{% endfor %} };
  44.           queryOptions.denominations = { {% for i in queryOptions.denominations %}  {{i.id}}: "{{i}}"  {% if not loop.last %},{% endif %}{% endfor %} };
  45.           queryOptions.materials = { {% for i in queryOptions.materials %}  "{{i.ids}}": "{{i.name}}"  {% if not loop.last %},{% endif %}{% endfor %} };
  46.           queryOptions.condition = { {% for i in queryOptions.condition %}  {{i.id}}: "{{i | replace({"\r\n":"", "'":"’", "\n":" "}) }}"  {% if not loop.last %},{% endif %}{% endfor %} };
  47.           queryOptions.aspects = { {% for i in queryOptions.aspects %}  {{i.id}}: "{{i | replace({"\r\n":"", "'":"’", "\n":" "}) }}"  {% if not loop.last %},{% endif %}{% endfor %} };
  48.           queryOptions.references = { {% for i in queryOptions.references %}  '{{i.id}}': "{{i | replace({"\r\n":"", "'":"’", "\n":" "}) }}"  {% if not loop.last %},{% endif %}{% endfor %} };
  49.           queryOptions.containerForms = { {% for i in queryOptions.containerForms %}  {{i.id}}: "{{i | replace({"\r\n":"", "'":"’", "\n":" "}) }}"  {% if not loop.last %},{% endif %}{% endfor %} };
  50.       </script>
  51.     
  52.     {% embed 'import-libs/underscore.js.html.twig' %}{% endembed %}
  53.     <script type="text/javascript" src='/bundles/oxhoard/js/search_hoard.js'></script>
  54.     <script type="text/javascript" src='/bundles/oxhoard/js/utils.js'></script>
  55.     {% embed 'import-libs/select2.js.html.twig' %}{% endembed %}
  56.     {% embed 'import-libs/backbone.js.html.twig' %}{% endembed %}
  57.     {% embed 'import-libs/backgrid.js.html.twig' %}{% endembed %}
  58.     <script type="text/javascript" src='/bundles/oxhoard/js/libs/backgrid-select2-cell/backgrid-select2-cell.js'></script>
  59.     <script type="text/javascript" src='/bundles/oxhoard/js/libs/backgrid-text-cell/backgrid-text-cell.js'></script>
  60.     <script type="text/javascript" src='/bundles/oxhoard/js/query-builder-select2-plugin.js'></script>
  61.     <script type="text/javascript" src='/bundles/oxhoard/js/advanced_search.js'></script>
  62.     <script type="text/javascript" src="/bundles/oxhoard/js/ocre_table.js"></script>
  63.     {% embed 'import-libs/jqueryExtendext.js.html.twig' %}{% endembed %}
  64.     {% embed 'import-libs/dot.js.html.twig' %}{% endembed %}
  65.     {% embed 'import-libs/queryBuilder.js.html.twig' %}{% endembed %}
  66.         <script type="text/javascript">
  67.           var dteNow = new Date();
  68.           var currentYear = dteNow.getFullYear();
  69.           minDiscoveryYear = {{ initialHoardDiscoveryYearRangeStart }};
  70.           maxDiscoveryYear = {{ initialHoardDiscoveryYearRangeEnd }};
  71.           minTerminalYear = {{ initialHoardTerminalYearRangeStart }};
  72.           maxTerminalYear = {{ initialHoardTerminalYearRangeEnd }};
  73.           minOpeningYear = {{ initialHoardOpeningYearRangeStart }};
  74.           maxOpeningYear = {{ initialHoardOpeningYearRangeEnd }};
  75.           minArchaeologyContextDate = {{ initialHoardArchaeologyContextDateRangeStart }};
  76.           maxArchaeologyContextDate = {{ initialHoardArchaeologyContextDateRangeEnd }};
  77.           minCoinCount = {{ initialHoardCoinCountMin }};
  78.           maxCoinCount = {{ initialHoardCoinCountMax }};
  79.           minCoinYear = {{ initialCoinYearRangeStart }};
  80.           maxCoinYear = {{ initialCoinYearRangeEnd }};
  81.         </script>
  82.         <script> var hoardPath = "/hoard/";  </script>
  83.     
  84.         <script type="text/javascript">
  85.               //add dropdown values to javascript
  86.               options = {};
  87.               options.hoardTypes = [{% for i in queryOptions.hoardTypes %}["{{i}}", {{i.id}}]{% if not loop.last %},{% endif %}{% endfor %}];
  88.               options.countries = [['', ''], {% for i in queryOptions.countries %}["{{i}}", {{i.id}}]{% if not loop.last %},{% endif %}{% endfor %}];
  89.               options.provinces = [['', ''], {% for i in queryOptions.provinces %}["{{i}}", {{i.id}}]{% if not loop.last %},{% endif %}{% endfor %}];
  90.               options.ancientPlaces = [['', ''], {% for i in queryOptions.ancientPlaces %}["{{i}}", {{i.id}}]{% if not loop.last %},{% endif %}{% endfor %}];
  91.               options.findSpotLocationDetails = [['', ''], {% for i in queryOptions.findSpotLocationDetails %}["{{i}}", {{i.id}}]{% if not loop.last %},{% endif %}{% endfor %}];
  92.               options.reigns = [['', ''], {% for i in queryOptions.reigns %}["{{i}}", {{i.id}}]{% if not loop.last %},{% endif %}{% endfor %}];
  93.               options.discoveryMethods = [['', ''], {% for i in queryOptions.discoveryMethods %}["{{i}}", {{i.id}}]{% if not loop.last %},{% endif %}{% endfor %}];
  94.               options.discoveryLandUses = [['', ''], {% for i in queryOptions.discoveryLandUses %}["{{i}}", {{i.id}}]{% if not loop.last %},{% endif %}{% endfor %}];
  95.               options.archaeologyRecoveryMethods = [['', ''], {% for i in queryOptions.archaeologyRecoveryMethods %}["{{i}}", {{i.id}}]{% if not loop.last %},{% endif %}{% endfor %}];
  96.               options.archaeologySiteContexts = [['', ''], {% for i in queryOptions.archaeologySiteContexts %}["{{i}}", {{i.id}}]{% if not loop.last %},{% endif %}{% endfor %}];
  97.               options.archaeologySiteContextDetails = [['', ''], {% for i in queryOptions.archaeologySiteContextDetails %}["{{i}}", {{i.id}}]{% if not loop.last %},{% endif %}{% endfor %}];
  98.               options.archaeologyPeriods = [['', ''], {% for i in queryOptions.archaeologyPeriods %}["{{i}}", {{i.id}}]{% if not loop.last %},{% endif %}{% endfor %}];
  99.               options.archaeologyContextNatures = [['', ''], {% for i in queryOptions.archaeologyContextNatures %}["{{i}}", {{i.id}}]{% if not loop.last %},{% endif %}{% endfor %}];
  100.               options.ratings = [['', ''], {% for i in queryOptions.ratings %}["{{i}}", {{i.id}}]{% if not loop.last %},{% endif %}{% endfor %}];
  101.               options.hideWhats = [['', ''], {% for i in queryOptions.hideWhats %}["{{i}}", {{i.id}}]{% if not loop.last %},{% endif %}{% endfor %}];
  102.               options.hideFroms = [['', ''], {% for i in queryOptions.hideFroms %}["{{i}}", {{i.id}}]{% if not loop.last %},{% endif %}{% endfor %}];
  103.             options.allHoardResults = [{% for i in allHoardResults %} {id: {{i.id}}, isEditable: {% if i.permission %}true{% else %}false{% endif %} } {% if not loop.last %},{% endif %}{% endfor %}];
  104.             options.allHoardsChart = [{% for i in allHoardsChart %} {{i.id}} {% if not loop.last %},{% endif %}{% endfor %}];
  105.               options.hoardsOverEditLimit = {% if hoardsOverEditLimit %}true{% else %}false{% endif %};
  106.               options.hoardsOverChartLimit = {% if hoardsOverChartLimit %}true{% else %}false{% endif %};
  107.               options.coinLevelData = [['', ''], {% for i in queryOptions.coinLevelDatas %}["{{i}}", {{i.id}}]{% if not loop.last %},{% endif %}{% endfor %}];
  108.               options.isLoggedIn = {% if is_authenticated %}true{% else %}false{% endif %};
  109.           </script>
  110.         <script type="text/javascript">
  111.             // add sortValues to javascript
  112.             sortOptions = {}
  113.               sortOptions.reigns = { {% for i in queryOptions.reigns %}  {{i.id}}: {{i.sortValue}}  {% if not loop.last %},{% endif %}{% endfor %} };
  114.             sortOptions.Period = { {% for i in queryOptions.period %}  '{{i.period}}': {{i.sortValue}}  {% if not loop.last %},{% endif %}{% endfor %} };
  115.             sortOptions.Reign = { {% for i in queryOptions.reigns %}  '{{i.reign}}': {{i.sortValue}}  {% if not loop.last %},{% endif %}{% endfor %} };
  116.             sortOptions.Person = { {% for i in queryOptions.persons %}  '{{i.person}}{% if i.title %} ({% endif %}{{i.title}}{% if i.title %}){% endif %}': {{i.sortValue}}  {% if not loop.last %},{% endif %}{% endfor %} };
  117.           </script>
  118.     <script type="text/javascript" src='/bundles/oxhoard/js/floating_scrollbar.js'></script>
  119.     <script type="text/javascript" src='/bundles/oxhoard/js/MultiEdit/Hoard/main.js'></script>
  120.     <script type="text/javascript" src="/bundles/oxhoard/js/libs/leaflet-draw/dist/leaflet.draw.js"></script>
  121.     {% embed 'import-libs/chart.js.html.twig' %}{% endembed %}
  122.     <script type="text/javascript" src="/bundles/oxhoard/js/hoard_visualisations.js"></script>
  123.     <script type="text/javascript" src="/bundles/oxhoard/js/hoard_group_visualisations.js"></script>
  124. {% endblock %}
  125. {% block stylesheets %}
  126.     {{ parent() }}
  127.       {% embed 'import-libs/select2.css.html.twig' %}{% endembed %}
  128.       {% embed 'import-libs/backgrid.css.html.twig' %}{% endembed %}
  129.       <link rel="stylesheet" href='/bundles/oxhoard/js/libs/backgrid-text-cell/backgrid-text-cell.css' />
  130.       {% embed 'import-libs/backgrid.css.html.twig' %}{% endembed %}
  131.       {% embed 'import-libs/queryBuilder.css.html.twig' %}{% endembed %}
  132.       
  133.          <script src="//cdnjs.cloudflare.com/ajax/libs/leaflet/1.0.3/leaflet.js"></script>
  134.          <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/leaflet/1.0.3/leaflet.css" />
  135.          <script src="//cdnjs.cloudflare.com/ajax/libs/leaflet.markercluster/1.4.1/leaflet.markercluster.js"></script>
  136.          <script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet.heat/0.2.0/leaflet-heat.js" integrity="sha256-65UqrlgGoRAnKfKRuriH3eeDrOhZgZo1SCenduc+SGo=" crossorigin="anonymous"></script>
  137.          <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet.markercluster/1.4.1/MarkerCluster.css" />
  138.          <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet.markercluster/1.4.1/MarkerCluster.Default.css" />
  139.          <script src='https://api.mapbox.com/mapbox.js/plugins/leaflet-fullscreen/v1.0.1/Leaflet.fullscreen.min.js'></script>
  140.          <link href='https://api.mapbox.com/mapbox.js/plugins/leaflet-fullscreen/v1.0.1/leaflet.fullscreen.css' rel='stylesheet' />
  141.          <script src="https://cdn.jsdelivr.net/npm/leaflet-easyprint@2.1.9/dist/bundle.min.js"></script>
  142.          <link rel="stylesheet" href="/bundles/oxhoard/js/libs/leaflet-draw/dist/leaflet.draw.css"/>
  143. {% endblock %}
  144. {% block body -%}
  145.     <!-- content -->
  146.     <div class="marginTop clearfix"></div>
  147.     <div id="content" class="container backgrid-table"> <!-- page content -->
  148.         {% if is_authorised_to_create or is_authorised_to_import %}
  149.         <div class="import-btns">
  150.             {% if is_authorised_to_create %}
  151.             <div class="edit-btn import-data">
  152.                 <a href="{{ path('hoard_new') }}"><h2>Add a new Hoard <span class="fa fa-chevron-right"></span></h2></a>
  153.             </div>
  154.             {% endif %}
  155.             {% if is_authorised_to_import %}
  156.             <div class="edit-btn import-data">
  157.                 <a href="{{ path('hoard_import') }}"><h2>Import Hoard Data <span class="fa fa-chevron-right"></span></h2></a>
  158.             </div>
  159.             <div class="edit-btn import-data">
  160.                 <a href="{{ path('coin_import') }}"><h2>Import Coin Data <span class="fa fa-chevron-right"></span></h2></a>
  161.             </div>
  162.             {% endif %}
  163.         </div>
  164.         {% endif %}
  165.         <div class="row marginTop">
  166.             <div class="col-md-12">
  167.                 {% embed '@OxHoardBundle/flash.html.twig' %}{% endembed %}
  168.                 <div id="tabs" class="tabs">
  169.                     <ul class='search-tabs'>
  170.                         <li><a href="#tabs-1">Search</a></li>
  171.                         <li><a href="#tabs-1b">Advanced search</a></li>
  172.                         <li><a href="#tabs-2">Map Results</a></li>
  173.                         <li><a href="#tabs-3">List Results<span class="badge">{{ pagination.getTotalItemCount }}</span></a></li>
  174.                         <li><a href="#tabs-4">Table of Results</a></li>
  175.                         <li><a href="#tabs-5">Result Visualisation</a></li>
  176.                         <li><a href="#tabs-6">Group Visualisation</a></li>
  177.                     </ul>
  178.                     <!-- search -->
  179.                     <div id="tabs-1">
  180.                         {%  if search_form is defined %}
  181.                             <div class="panel-group" id="simple-map-search-accordion">
  182.                                 <div class="panel panel-default">
  183.                                     <div class="panel-heading">
  184.                                         <h4 class="panel-title">
  185.                                             <a data-toggle="collapse" data-parent="#simple-map-search-accordion" href="#simple-map-search" aria-expanded="true" class="map-search-toggle">
  186.                                                 Map search       
  187.                                             </a>
  188.                                         </h4>
  189.                                     </div>
  190.                                     <div id="simple-map-search" class="panel-collapse collapse" aria-expanded="false">
  191.                                         <div class="panel-body">
  192.                                         <div>
  193.                                             Please click on the 'Draw a polygon' tool <img src="/bundles/oxhoard/img/rectangle-icon.png" width="13" height="13">, placed on the left hand side of the map, in order to select a geographical area on which to conduct a search.
  194.                                             You can then edit the layer you created with the 'edit' tool <img src="/bundles/oxhoard/img/edit-rectangle-icon.png" width="13" height="13">.
  195.                                         </div>
  196.                                         <div id="simple-map" class="search-map map-view large"></div>
  197.                                         </div>
  198.                                     </div>
  199.                                 </div>
  200.                             </div>
  201.                             {% embed "@OxHoardBundle/search/search.html.twig" %}
  202.                             {% endembed %}
  203.                         {% endif %}
  204.                     </div>
  205.                     <!-- advanced search -->
  206.                     <div id="tabs-1b">
  207.                         <div class="panel-group" id="advanced-map-search-accordion">
  208.                             <div class="panel panel-default">
  209.                                 <div class="panel-heading">
  210.                                     <h4 class="panel-title">
  211.                                         <a data-toggle="collapse" data-parent="#advanced-map-search-accordion" href="#advanced-map-search" aria-expanded="true" class="map-search-toggle">
  212.                                             Map search       
  213.                                         </a>
  214.                                     </h4>
  215.                                 </div>
  216.                                 <div id="advanced-map-search" class="panel-collapse collapse" aria-expanded="false">
  217.                                     <div class="panel-body">
  218.                                         <div>
  219.                                             Please click on the 'Draw a polygon' tool <img src="/bundles/oxhoard/img/rectangle-icon.png" width="13" height="13">, placed on the left hand side of the map, in order to select a geographical area on which to conduct a search.
  220.                                             You can then edit the layer you created with the 'edit' tool <img src="/bundles/oxhoard/img/edit-rectangle-icon.png" width="13" height="13">.
  221.                                         </div>
  222.                                         <div id="advanced-map" class="search-map map-view large"></div>
  223.                                     </div>
  224.                                 </div>
  225.                             </div>
  226.                         </div>
  227.                         {% embed "@OxHoardBundle/search/advancedSearch.html.twig" %}
  228.                         {% endembed %}
  229.                     </div>
  230.                     <!-- search results map view -->
  231.                     <div id="tabs-2">
  232.                         <div class="row">
  233.                             <div class="col-md-12">
  234.                                 <div id="map" class="map-view large">
  235.                                 </div>
  236.                                 <input id="toggle-cluster-results" type="checkbox" checked="checked"> Cluster results</input>
  237.                                 <div id="map-items-number-message" class="alert alert-info hidden"></div>
  238.                                 <div id="slider-range"></div>           
  239.                                 <p class="" style="margin-top: 5px">
  240.                                     <label for="year">Closing dates of Hoards:</label>
  241.                                     <input type="text" id="range" readonly style="border:0; color:#D69E40; font-weight:bold;">
  242.                                 </p>
  243.                                 <div class="panel-group hidden" id="no-co-ord-accordion">
  244.                                     <div class="panel panel-default">
  245.                                         <div class="panel-heading">
  246.                                             <h4 class="panel-title">
  247.                                                 <a data-toggle="collapse" data-parent="#no-co-ord-accordion" href="#no-co-ords" aria-expanded="true" class="">
  248.                                                     Results without coordinates<span class="counter"></span>       
  249.                                                 </a>
  250.                                             </h4>
  251.                                         </div>
  252.                                         <div id="no-co-ords" class="panel-collapse collapse" aria-expanded="false">
  253.                                             <div class="panel-body"></div>
  254.                                         </div>
  255.                                     </div>
  256.                                 </div>
  257.                             </div>
  258.                         </div>
  259.                     </div>
  260.                     <!-- search results list view -->
  261.                     <div id="tabs-3">
  262.                         {% if pagination is empty %}
  263.                             <div class="alert alert-info">No results found</div>
  264.                         {% else %}
  265.                         <div class="row">
  266.                             <div class="col-md-12">
  267.                                 {# total items count #}
  268.                                 <div class="count">
  269.                                     Retrieved {{ pagination.getTotalItemCount }} hoards
  270.                                 </div>
  271.                                 <!-- Sorting Controls -->
  272.                                 <h4>
  273.                                     {% set direction = pagination.getDirection() %}
  274.                                     {% for field in sort_fields %}
  275.                                         {% if (current_sort == field.key) %}Sorted by: {{field.label}} {{ direction }}.{% endif %}
  276.                                     {% endfor %}
  277.                                 </h4>
  278.                                 <div class="btn-group sort-results">
  279.                                     <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  280.                                         Sort By:
  281.                                         <span class="caret"></span>
  282.                                     </button>
  283.                                     <ul class="dropdown-menu">
  284.                                         {% for field in sort_fields %}
  285.                                             <li>{{ knp_pagination_sortable(pagination, field.label, field.key) }}</li>
  286.                                         {% endfor %}
  287.                                     </ul>
  288.                                 </div>
  289.                         <input type="hidden" name="sort" value="{{current_sort}}">
  290.                         <input type="hidden" name="direction" value="{{current_sort_direction}}">
  291.                         <div class="csvdownload">
  292.                             Download CSV:
  293.                             <a id="csv-download-link" href="/search"><button class="btn btn-default btn-xs">Hoards</button></a>
  294.                             <a id="csv-coin-download-link" href="/search"><button class="btn btn-default btn-xs">Coins</button></a>
  295.                         </div>
  296.                             {% if pagination.pageCount > 1 %}
  297.                                 <div class="navigation">
  298.                                     {{ knp_pagination_render(pagination) }}   of {{ pagination.pageCount }} pages
  299.                                     <span class="page-jump"></span><b>Jump to page </b><input class="pagenumber-input" type="number" style="width:50px;"><button class="pagenumber-jump btn btn-default">Go</button></span>
  300.                                 </div>
  301.                             {% endif %}
  302.                                  <!-- /Sorting Controls             -->
  303.                                 {% for hoard in pagination %}
  304.                                     {% set total = 0 %}
  305.                                     {% for coin in hoard.coins %}
  306.                                         {% set total = total + coin.quantity %}
  307.                                     {% endfor %}
  308.                                     <div class="hoardlistview hoardlistview-6col">
  309.                                         <h2><a href="{{ path('hoard_show', { 'id': hoard.id }) }}">{% if hoard.findSpotName %}{{ hoard.findSpotName }}{% else %}Untitled hoard{% endif %}</a></h2>
  310.                                         {% if hoard.isEditableByUser %}<a class="btn btn-default pull-right list-edit-button" href="{{ path('hoard_edit', { 'id':hoard.id }) }}">Edit</a>{% endif %}
  311.                                         <div class="datalabel">Date: </div><div class="data">{{ hoard.discoveryday1 }} {{ hoard.discoverymonth1 }} {{ hoard.discoveryyear1 }}</div>
  312.                                         <div class="datalabel">Size: </div><div class="data">{{ total }}</div>
  313.                                         <div class="datalabel">Terminal Year: </div><div class="data">{% if hoard.terminalYear1 %}{{ hoard.terminalYear1 }}{% if hoard.terminalYear2 %} - {{ hoard.terminalYear2 }}{% endif %}{% else %}-{% endif %}</div>
  314.                                         <div class="datalabel">Country: </div>
  315.                                         <div class="data">
  316.                                           {% for country in hoard.countries %}
  317.                                             {{ country }}{% if not loop.last %}, {% endif %}
  318.                                           {% endfor %}
  319.                                         </div>
  320.                                         <div class="datalabel">Summary: </div><div class="data">{{ hoard.comment }}</div>
  321.                                         <br>
  322.                                         {% if is_authenticated %}
  323.                                             {% if hoard.validatedByUser %}
  324.                                                 <i class="fa fa-check-circle "></i> The hoard level data have been validated by the contributor
  325.                                             {% else %}
  326.                                                 <i class="fa fa-times-circle "></i> The hoard level data have not yet been validated by the contributor
  327.                                             {% endif %}
  328.                                             {% if is_admin %}
  329.                                                 <br>
  330.                                                 {% if hoard.validatedByAdmin %}
  331.                                                     <i class="fa fa-check-circle "></i> The hoard level data have been validated by an administrator
  332.                                                 {% else %}
  333.                                                     <i class="fa fa-times-circle "></i> The hoard level data have not yet been validated by an administrator
  334.                                                 {% endif %}
  335.                                             {% endif %}
  336.                                             <br>
  337.                                             {% if hoard.coinDataValidatedByUser %}
  338.                                                 <i class="fa fa-check-circle "></i> The coin level data have been validated by the contributor
  339.                                             {% else %}
  340.                                                 <i class="fa fa-times-circle "></i> The coin level data have not yet been validated by the contributor
  341.                                             {% endif %}
  342.                                             {% if is_admin %}
  343.                                                 <br>
  344.                                                 {% if hoard.coinDataValidatedByAdmin %}
  345.                                                     <i class="fa fa-check-circle "></i> The coin level data have been validated by an administrator
  346.                                                 {% else %}
  347.                                                     <i class="fa fa-times-circle "></i> The coin level data have not yet been validated by an administrator
  348.                                                 {% endif %}
  349.                                             {% endif %}
  350.                                         {% else %}
  351.                                             {% if not hoard.coinDataValidatedByUser %}
  352.                                                 <i class="fa fa-times-circle "></i> The coin data of this hoard have not yet been validated and therefore are not yet visible.
  353.                                             {% endif %}
  354.                                         {% endif %}
  355.                                         <hr/>
  356.                                     </div>
  357.                                 {% endfor %}
  358.                             </div>
  359.                         </div>
  360.                         {# display navigation #}
  361.                         {% if pagination.pageCount > 1 %}
  362.                             <div class="navigation">
  363.                                 {{ knp_pagination_render(pagination) }}   of {{ pagination.pageCount }} pages
  364.                                 <span class="page-jump"></span><b>Jump to page </b><input class="pagenumber-input" type="number" style="width:50px;"><button class="pagenumber-jump btn btn-default">Go</button></span>
  365.                             </div>
  366.                         {% endif %}
  367.                     {% endif %}
  368.                     </div>
  369.                     <!-- edit results view -->
  370.                     <div id="tabs-4">
  371.                         <div class="row">
  372.                             <div class="col-md-12">
  373.                               <div class="container">
  374.                                   {% if is_admin %}
  375.                                     <h1>Hoards multi-edit</h1>
  376.                                   {% else %}
  377.                                     <h1>Hoards table view</h1>
  378.                                   {% endif %}
  379.                                 <div class="backgrid coin-loading-spinner">
  380.                                   Loading hoard data and preparing editing interface. This may take a while. Performance will be significantly better with smaller numbers of hoards.<br>
  381.                                   <img class="backgrid coin-loading-spinner" src="/bundles/oxhoard/img/ajax-loader.gif" alt="Loading" width="128" height="15" />
  382.                                 </div>
  383.                                 <div class="row">
  384.                                   <div class="grid-container"></div>
  385.                                   <div id="grid-buttons">
  386.                                     <a class="btn btn-default grid-save-hoards" href="#" data-url="{{ path('hoards_list_rest_update') }}" role="button">Save Hoards</a>
  387.                                     <span class="save-success alert alert-success">All changes were successfully saved</span>
  388.                                     <span class="save-error alert alert-danger">An error occured when trying to save the hoard data</span>
  389.                                   </div>
  390.                                 </div>
  391.                               </div>
  392.                             </div>
  393.                         </div>
  394.                     </div>
  395.                     <div id="tabs-5">
  396.                         <div class="row">
  397.                             <div class="col-md-12">
  398.                                 <div class="container">
  399.                                     <div class="header">
  400.                                         <h4 class="modal-title" id="charts-modal-label">Hoard search visualisation</h4>
  401.                                     </div>
  402.                                     <img id="search-hoards-chart-spinner" src="/bundles/oxhoard/img/ajax-loader.gif" alt="Loading" width="128" height="15" />
  403.                                     <div class="search-hoards-chart body hidden">
  404.                                         <div id="chart-error-message" class="alert alert-danger hidden">
  405.                                         </div>
  406.                                         <div id="chart-fields">
  407.                                             <div id="type-field" class="hoard-chart-field">
  408.                                                 <label for="chart-type">Chart type</label>
  409.                                                 <select class="dropdown" id="chart-type">
  410.                                                     <option value="found-by" selected="selected">Hoards found by decade</option>
  411.                                                     <option value="close-date">Hoards by closing date</option>
  412.                                                     <option disabled value="close-reign">Hoards by closing reign</option>
  413.                                                     <option value="site-type">Hoards by Site type</option>
  414.                                                     <option value="coin-data" disabled>Coins per date of minting</option>
  415.                                                 </select>
  416.                                             </div>
  417.                                             <div id="format-field" class="hoard-chart-field hide">
  418.                                                 <label for="chart-format">Chart format</label>
  419.                                                 <select class="dropdown" id="chart-format">
  420.                                                     <option value="bar" selected="selected">Bar</option>
  421.                                                     <option value="pie">Pie</option>
  422.                                                 </select>
  423.                                             </div>
  424.                                             {# <div id="reign-field" class="hoard-chart-field hide">
  425.                                                 <label for="chart-reign">By</label>
  426.                                                 <select class="dropdown" id="chart-reign">
  427.                                                     <option value="overall" selected="selected">Overall</option>
  428.                                                     <option value="reign">Reign</option>
  429.                                                 </select>
  430.                                             </div> #}
  431.                                             <div id="timescale-field" class="hoard-chart-field hide">
  432.                                                 <label for="chart-timescale">Timescale</label>
  433.                                                 <select class="dropdown" id="chart-timescale">
  434.                                                     <option value="25" selected="selected">25 years</option>
  435.                                                     <option value="10">10 years</option>
  436.                                                     <option value="5">5 years</option>
  437.                                                     <option value="1">1 years</option>
  438.                                                 </select>
  439.                                             </div>
  440.                                         </div>
  441.                                         <div id="coin-data-description" class="hide">
  442.                                             This histogram shows the entire content of all hoards returned by your search. For histograms restricted to coins filtered according to given criteria (e.g. Reign, Person, Denomination, etc.), please run the search again by selecting ‘Search coins’ on the search page, instead of ‘Search hoards’.
  443.                                         </div>
  444.                                         <div id="chart-sample-size" class="hidden">Size of the sample: <span class="sample"></span></div>
  445.                                         <div id="show-legend" class="hidden">
  446.                                             <fieldset>
  447.                                                 <input type="checkbox" id="show-legend-checkbox" checked/>
  448.                                                 <label for="show-legend-checkbox">Show legend</label>
  449.                                             </fieldset>
  450.                                         </div>
  451.                                         <div id="chart-container" style="height: 70vh">
  452.                                             <canvas id="hoard-chart"></canvas>
  453.                                         </div>
  454.                                         <div id="chart-pie-percentages" class="hidden">
  455.                                             <fieldset>
  456.                                                 <input type="radio" id="numbers" name="pie-numbers-percentages" value="numbers" checked/>
  457.                                                 <label for="numbers">Numbers</label>
  458.                                                 <input type="radio" id="percentages" name="pie-numbers-percentages" value="percentages"/>
  459.                                                 <label for="percentages">Percentages</label>
  460.                                             </fieldset>
  461.                                         </div>
  462.                                         <div class="panel-group hid-den" id="uncertain-chart-accordion">
  463.                                             <div class="panel panel-default">
  464.                                                 <div class="panel-heading">
  465.                                                     <h4 class="panel-title">
  466.                                                         <a data-toggle="collapse" data-parent="#uncertain-chart-accordion" href="#uncertain-charts" aria-expanded="true" class="">
  467.                                                             Uncertain results<span class="counter"></span>       
  468.                                                         </a>
  469.                                                     </h4>
  470.                                                 </div>
  471.                                                 <div id="uncertain-charts" class="panel-collapse collapse" aria-expanded="false">
  472.                                                     <div class="panel-body"></div>
  473.                                                 </div>
  474.                                             </div>
  475.                                         </div>
  476.                                         <div><a href="/content/visualisation-principles" class="visualisation-principles">Visualisation principles</a></div>
  477.                                     </div>
  478.                                 </div>
  479.                             </div>
  480.                         </div>
  481.                     </div>
  482.                     <div id="tabs-6">
  483.                         <div class="row">
  484.                             <div class="col-md-12">
  485.                                 <div class="container">
  486.                                     <div class="header">
  487.                                         <h4 class="modal-title" id="charts-modal-label">Hoard group visualisation</h4>
  488.                                     </div>
  489.                                     <img id="chart-group-spinner" src="/bundles/oxhoard/img/ajax-loader.gif" alt="Loading" width="128" height="15" />
  490.                                     <div class="chart-group body hidden">
  491.                                         <div id="chart-group-error-message" class="alert alert-danger hidden">
  492.                                         </div>
  493.                                         <div id="chart-group-fields">
  494.                                             <label for="chart-group-type">Chart type </label>
  495.                                             <select class="dropdown" id="chart-group-type">
  496.                                                 <option value="bar" selected="selected">Bar</option>
  497.                                                 <option value="pie">Pie</option>
  498.                                             </select>
  499.                                             <label for="chart-group-attribute">Coins per </label>
  500.                                             <select class="dropdown" id="chart-group-attribute">
  501.                                                 <option value="Period" selected="selected">Period</option>
  502.                                                 <option value="Reign">Reign</option>
  503.                                                 <option value="Person">Person</option>
  504.                                                 <option value="Mint">Mint</option>
  505.                                                 <option value="Denomination">Denomination</option>
  506.                                                 <option value="Material">Material</option>
  507.                                             </select>
  508.                                             <span id="chart-group-stacked-container">
  509.                                                 <label for="chart-group-stacked">Stacked per</label>
  510.                                                 <select class="dropdown" id="chart-group-stacked">
  511.                                                     <option value="" selected="selected"> - </option>
  512.                                                     <option value="Period" disabled>Period</option>
  513.                                                     <option value="Reign">Reign</option>
  514.                                                     <option value="Person">Person</option>
  515.                                                     <option value="Mint">Mint</option>
  516.                                                     <option value="Denomination">Denomination</option>
  517.                                                     <option value="Material">Material</option>
  518.                                                 </select>
  519.                                             </span>
  520.                                             <span id="chart-group-reign-container" style="display: none;">
  521.                                                 <label for="chart-group-reign"> for reign </label>
  522.                                                 <select class="dropdown" id="chart-group-reign">
  523.                                                 </select>
  524.                                             </span>
  525.                                         </div>
  526.                                         <div id="chart-group-description">
  527.                                             This histogram shows the entire content of all hoards returned by your search.
  528.                                         </div>
  529.                                         <div id="exclude-uncertain">
  530.                                             <fieldset>
  531.                                                 <input type="checkbox" id="exclude-uncertain-checkbox"/>
  532.                                                 <label for="exclude-uncertain-checkbox">Exclude columns showing uncertain entries</label>
  533.                                             </fieldset>
  534.                                         </div>
  535.                                         <div id="show-search-group-legend">
  536.                                             <fieldset>
  537.                                                 <input type="checkbox" id="show-search-group-legend-checkbox" checked/>
  538.                                                 <label for="show-search-group-legend-checkbox">Show legend</label>
  539.                                             </fieldset>
  540.                                         </div>
  541.                                         <div id="chart-group-sample-size" class="hidden">Size of the sample: <span class="sample"></span></div>
  542.                                         <div id="chart-group-container" style="height: 70vh">
  543.                                             <canvas id="hoard-group-chart"></canvas>
  544.                                         </div>
  545.                                         <div><a href="/content/visualisation-principles" class="visualisation-principles">Visualisation principles</a></div>
  546.                                     </div>
  547.                                 </div>
  548.                             </div>
  549.                         </div>
  550.                     </div>
  551.                 </div>
  552.             </div>
  553.         </div>
  554.         {% if is_authenticated %}
  555.         {% else %}
  556.         <div class="row">
  557.             <div class="col-lg-12">
  558.                 <div class="disclaimers">
  559.                     <p>Results displayed include only those hoards validated by their contributor.</p>
  560.                 </div>
  561.             </div>
  562.         </div>
  563.         {% endif %}
  564.     </div><!-- end page container -->
  565. {% endblock %}