templates/location/show.html.twig line 1

Open in your IDE?
  1. {% extends 'content_base.html.twig' %}
  2. {% block title %}{{'location.showlocation'|trans}} {{ location.name }}{% endblock %}
  3. {% block stylesheets %}
  4.     {{ parent() }}
  5.     <link rel="stylesheet" href="https://unpkg.com/leaflet@1.6.0/dist/leaflet.css"
  6.           integrity="sha512-xwE/Az9zrjBIphAcBb3F6JVqxf46+CDLwfLMHloNu6KEQCAWi6HcDUbeOfBIptF7tcCzusKFjFw2yuvEpDL9wQ=="
  7.           crossorigin=""/>
  8.     <link rel="stylesheet" href="{{ asset('css/map.css') }}">
  9. {% endblock %}
  10. {% block content_body %}
  11.     {% set refTypes = {
  12.         test : 'test',
  13.     } %}
  14.     <div id="show-location" class="container">
  15.         <div class="row">
  16.             <div class="col-sm-6 table-responsive">
  17.                 <table class="table table-striped table-hover">
  18.                     <tr>
  19.                         <td class="col-2">
  20.                             {% if is_granted('ROLE_EDIT_ENTITY') %}
  21.                                 <a href="{{ path('location_edit', {id: location.id}) }}" class="btn btn-primary">
  22.                                     Edit <span class="fa fa-pencil-square"></span>
  23.                                 </a>
  24.                             {% endif %}
  25.                         </td>
  26.                         <td class="col-8"></td>
  27.                         <td class="col-2"></td>
  28.                     </tr>
  29.                     <tr>
  30.                         <td>
  31.                             <img class="show-article-icon" src="{{  location.image|imagine_filter('squared_thumbnail_medium')  }}">
  32.                         </td>
  33.                         <td colspan="2">
  34.                             <h1>
  35.                                 {{ location.name }}
  36.                             </h1>
  37.                             {% if location.todayKnownAs is defined and location.todayKnownAs is not null %}
  38.                                 <br>{{ 'location.todaysname'|trans}}: {{ location.todayKnownAs }}
  39.                             {% endif %}
  40.                         </td>
  41.                     </tr>
  42.                     <tr>
  43.                         <td>
  44.                             {{ ('location.'~location.type)|trans }}
  45.                         </td>
  46.                         <td colspan="2">
  47.                             Lat: {{  location.lat }} <br>
  48.                             Lon: {{location.lon }}
  49.                         </td>
  50.                     </tr>
  51.                     <tr>
  52.                         <td colspan="3">
  53.                             {{location.description | raw}}
  54.                         </td>
  55.                     </tr>
  56.                     {% set refIndex = 0 %}
  57.                     {% for key, value in refTypes %}
  58.                         <div id="{{ refIndex }}">
  59.                             {% for locationreference in location.referenceList(key) %}
  60.                                 <tr>
  61.                                     <td colspan="2">
  62.                                         <i class="pr-3 fa fa-external-link"></i>
  63.                                         <div class="comment-container d-inline-block pl-3 align-top">
  64.                                             <a href="{{ locationreference.reference.generateBibleServerUrl }}",
  65.                                                onclick="window.open('{{ locationreference.reference.generateBibleServerUrl }}',
  66.                                                        'newwindow',
  67.                                                        'width=400,height=250');
  68.                                                        return false;"
  69.                                             > {{ locationreference.reference }}
  70.                                             </a>
  71.                                         </div>
  72.                                     </td>
  73.                                     <td>
  74.                                         {{ value }}
  75.                                     </td>
  76.                                 </tr>
  77.                             {% else %}
  78.                             {% endfor %}
  79.                         </div>
  80.                         {% set refIndex = refIndex +1 %}
  81.                     {% endfor %}
  82.                 </table>
  83.             </div>
  84.             <div class="col-sm-6">
  85.                 <div id="mapid"></div>
  86.             </div>
  87.         </div>
  88.     </div>
  89. {% endblock %}
  90. {% block javascripts %}
  91.     <div id="code-location">
  92.         {{ parent() }}
  93.         <script src="https://unpkg.com/leaflet@1.6.0/dist/leaflet.js"
  94.                 integrity="sha512-gZwIG9x3wUXg2hdXF6+rVkLF/0Vi9U8D2Ntg4Ga5I5BZpVkVxlJWbSQtXPSiUTtC0TjtGOmxa1AJPuV0CPthew=="
  95.                 crossorigin=""></script>
  96.         <script type="text/javascript">
  97.             var map = L.map('mapid').setView([{{location.lat}}, {{location.lon}}], 8);
  98.             mapLink =
  99.                 '<a href="http://openstreetmap.org">OpenStreetMap</a>';
  100.             L.tileLayer(
  101.                 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
  102.                     attribution: '&copy; ' + mapLink + ' Contributors',
  103.                     maxZoom: 18,
  104.                 }).addTo(map);
  105.             var marker = new L.marker([{{location.lat}}, {{location.lon}}])
  106.                     .addTo(map);
  107.         </script>
  108.     </div>
  109. {% endblock %}