templates/utils/search-results.html.twig line 1

Open in your IDE?
  1. <div class="mb-20 d-flex align-items-start justify-content-between gap-10 tablet-flex-column">
  2. <div class="flex-grow-1 w-100">
  3. {% for id, partner in partners %}
  4. <div class="partner-card" id="partner-{{ partner.id }}">
  5. <div style="flex: 0 0 33%;">
  6. <a href="{{ partner.isPractitioner ? path('default_praticien_fiche', {"slug": partner.slug}) : path('default_checkout_identification', {"partner": partner.id}) }}">
  7. <div class="d-flex align-items-center gap-5">
  8. <div class="avatar"><img src="{{ partner.avatar ? documents_avatar_directory~partner.avatar : asset('assets/media/avatars/blank.png') }}" /></div>
  9. <div>
  10. <div class="text-primary fw-bold">{{ partner.lastName }}, {{ partner.firstName }}</div>
  11. <div>{{ partner.specialitiesString }}</div>
  12. </div>
  13. </div>
  14. </a>
  15. {% if partner.allowTeleconsultation %}
  16. <div class="mt-5 d-flex gap-3 mobile-display-none">
  17. <div>
  18. <svg xmlns="http://www.w3.org/2000/svg" width="22.076" height="14.776" viewBox="0 0 22.076 14.776">
  19. <g id="Icon_feather-video" data-name="Icon feather-video" transform="translate(-0.5 -6.5)">
  20. <path id="Tracé_192" data-name="Tracé 192" d="M30.388,10.5,24,15.063l6.388,4.563Z" transform="translate(-8.812 -1.175)" fill="none" stroke="#186d7c" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
  21. <path id="Tracé_193" data-name="Tracé 193" d="M3.325,7.5H13.363a1.825,1.825,0,0,1,1.825,1.825v9.126a1.825,1.825,0,0,1-1.825,1.825H3.325A1.825,1.825,0,0,1,1.5,18.451V9.325A1.825,1.825,0,0,1,3.325,7.5Z" fill="none" stroke="#186d7c" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
  22. </g>
  23. </svg>
  24. </div>
  25. <div>
  26. Téléconsultation
  27. </div>
  28. </div>
  29. {% endif %}
  30. {% if partner.address %}
  31. <div class="mt-5">
  32. {{ partner.address }}<br/>
  33. {% if partner.address2 %}{{ partner.address2 }}<br/>{% endif %}
  34. {{ partner.zipCode }} {{ partner.city }}
  35. </div>
  36. {% endif %}
  37. {% if partner.secondaryLocations and partner.secondaryLocations|length > 0 %}
  38. {% set nbLocations = 0 %}
  39. {% for secondaryLocation in partner.secondaryLocations %}
  40. {% if secondaryLocation.active %}
  41. {% set nbLocations = nbLocations + 1 %}
  42. {% endif %}
  43. {% endfor %}
  44. {% if nbLocations > 0 %}
  45. <div class="text-primary fst-italic fs-7">Et {{ nbLocations }} autre{% if nbLocations > 1 %}s{% endif%} lieu{% if nbLocations > 1 %}x{% endif%}</div>
  46. {% endif %}
  47. {% endif %}
  48. {% if partner.isPractitioner and partner.lowestServiceDelivery %}
  49. <div class="mt-5 text-primary fw-bold mobile-display-none">
  50. À partir de {{ partner.lowestServiceDelivery.price }}€/h
  51. </div>
  52. {% endif %}
  53. </div>
  54. <div class="flex-grow-1 w-100">
  55. <div class="d-flex flex-column justify-content-between h-100">
  56. <div class="d-flex flex-wrap gap-4 mb-5">
  57. {% for need in partner.need %}
  58. <div class="partner-tag">{{ need.label }}</div>
  59. {% endfor %}
  60. </div>
  61. <div class="d-flex align-items-center justify-content-between">
  62. {% set noteValue = partner.noteValue %}
  63. {% if noteValue %}
  64. <div class="mt-2 d-flex gap-1">
  65. <svg xmlns="http://www.w3.org/2000/svg" width="18.709" height="17.841" viewBox="0 0 18.709 17.841">
  66. <defs>
  67. <linearGradient id="grad_star_1_{{ id }}">
  68. <stop offset="50%" stop-color="{{ noteValue and noteValue >= 0.5 ? '#ff6700' : '#E1E1E1' }}"/>
  69. <stop offset="50%" stop-color="{{ noteValue and noteValue >= 1 ? '#ff6700' : '#E1E1E1' }}"/>
  70. </linearGradient>
  71. </defs>
  72. <path id="Icon_feather-star" data-name="Icon feather-star" d="M11.854,3,14.59,8.543l6.118.894-4.427,4.312,1.045,6.092-5.472-2.878L6.382,19.841l1.045-6.092L3,9.437l6.118-.894Z" transform="translate(-2.5 -2.5)" fill="url(#grad_star_1_{{ id }})" stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/>
  73. </svg>
  74. <svg xmlns="http://www.w3.org/2000/svg" width="18.709" height="17.841" viewBox="0 0 18.709 17.841">
  75. <defs>
  76. <linearGradient id="grad_star_2_{{ id }}">
  77. <stop offset="50%" stop-color="{{ noteValue and noteValue >= 1.5 ? '#ff6700' : '#E1E1E1' }}"/>
  78. <stop offset="50%" stop-color="{{ noteValue and noteValue >= 2 ? '#ff6700' : '#E1E1E1' }}"/>
  79. </linearGradient>
  80. </defs>
  81. <path id="Icon_feather-star" data-name="Icon feather-star" d="M11.854,3,14.59,8.543l6.118.894-4.427,4.312,1.045,6.092-5.472-2.878L6.382,19.841l1.045-6.092L3,9.437l6.118-.894Z" transform="translate(-2.5 -2.5)" fill="url(#grad_star_2_{{ id }})" stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/>
  82. </svg>
  83. <svg xmlns="http://www.w3.org/2000/svg" width="18.709" height="17.841" viewBox="0 0 18.709 17.841">
  84. <defs>
  85. <linearGradient id="grad_star_3_{{ id }}">
  86. <stop offset="50%" stop-color="{{ noteValue and noteValue >= 2.5 ? '#ff6700' : '#E1E1E1' }}"/>
  87. <stop offset="50%" stop-color="{{ noteValue and noteValue >= 3 ? '#ff6700' : '#E1E1E1' }}"/>
  88. </linearGradient>
  89. </defs>
  90. <path id="Icon_feather-star" data-name="Icon feather-star" d="M11.854,3,14.59,8.543l6.118.894-4.427,4.312,1.045,6.092-5.472-2.878L6.382,19.841l1.045-6.092L3,9.437l6.118-.894Z" transform="translate(-2.5 -2.5)" fill="url(#grad_star_3_{{ id }})" stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/>
  91. </svg>
  92. <svg xmlns="http://www.w3.org/2000/svg" width="18.709" height="17.841" viewBox="0 0 18.709 17.841">
  93. <defs>
  94. <linearGradient id="grad_star_4_{{ id }}">
  95. <stop offset="50%" stop-color="{{ noteValue and noteValue >= 3.5 ? '#ff6700' : '#E1E1E1' }}"/>
  96. <stop offset="50%" stop-color="{{ noteValue and noteValue >= 4 ? '#ff6700' : '#E1E1E1' }}"/>
  97. </linearGradient>
  98. </defs>
  99. <path id="Icon_feather-star" data-name="Icon feather-star" d="M11.854,3,14.59,8.543l6.118.894-4.427,4.312,1.045,6.092-5.472-2.878L6.382,19.841l1.045-6.092L3,9.437l6.118-.894Z" transform="translate(-2.5 -2.5)" fill="url(#grad_star_4_{{ id }})" stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/>
  100. </svg>
  101. <svg xmlns="http://www.w3.org/2000/svg" width="18.709" height="17.841" viewBox="0 0 18.709 17.841">
  102. <defs>
  103. <linearGradient id="grad_star_5_{{ id }}">
  104. <stop offset="50%" stop-color="{{ noteValue and noteValue >= 4.5 ? '#ff6700' : '#E1E1E1' }}"/>
  105. <stop offset="50%" stop-color="{{ noteValue and noteValue >= 5 ? '#ff6700' : '#E1E1E1' }}"/>
  106. </linearGradient>
  107. </defs>
  108. <path id="Icon_feather-star" data-name="Icon feather-star" d="M11.854,3,14.59,8.543l6.118.894-4.427,4.312,1.045,6.092-5.472-2.878L6.382,19.841l1.045-6.092L3,9.437l6.118-.894Z" transform="translate(-2.5 -2.5)" fill="url(#grad_star_5_{{ id }})" stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/>
  109. </svg>
  110. <div class="ms-3">{{ partner.notes.count }} avis</div>
  111. </div>
  112. {% else %}
  113. <div></div>
  114. {% endif%}
  115. <div>
  116. <a href="{{ type is not defined or type != "coach" ? path('default_praticien_fiche', {"slug": partner.slug}) : path('default_checkout_identification', {"partner": partner.id, "coaching": 1}) }}">
  117. <button>Choisir ce {{ typeStr }}</button>
  118. </a>
  119. </div>
  120. </div>
  121. </div>
  122. </div>
  123. </div>
  124. {% endfor %}
  125. </div>
  126. <div style="flex: 0 0 30%;" class="w-100">
  127. <div class="position-sticky top-50">
  128. <div class="border-radius10" id="zv-map" style="height: 300px;width: 100%;"></div>
  129. <div class="mt-10">
  130. <label for="rangeLocalisation" class="form-label">Distance de recherche: <b><span id="rangeLocalisationValue">{{ rad ? rad : 5 }}</span> km</b></label>
  131. <input type="range" class="form-range" id="rangeLocalisation" min="5" max="50" value="{{ rad ? rad : 5 }}" />
  132. </div>
  133. </div>
  134. </div>
  135. </div>
  136. <script>
  137. var map = L.map('zv-map').setView({lon: 1.9, lat: 46.98}, 5);
  138. {% if partners and partners|length > 0 %}
  139. var bounds = [];
  140. {% for partner in partners %}
  141. {% if partner.addressCoordY and partner.addressCoordX %}
  142. bounds.push([{{ partner.addressCoordY }}, {{ partner.addressCoordX }}]);
  143. {% endif %}
  144. {% endfor %}
  145. map.fitBounds(bounds, {padding: [50, 50]});
  146. {% endif %}
  147. // add the OpenStreetMap tiles
  148. L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',{
  149. maxZoom: 19,
  150. attribution: 'OpenStreetMap'
  151. }).addTo(map);
  152. // show the scale bar on the lower left corner
  153. L.control.scale({imperial: true, metric: true}).addTo(map);
  154. // Icons
  155. var LeafIcon = L.Icon.extend({
  156. options: {
  157. iconSize: [19, 47],
  158. }
  159. });
  160. var markers = new L.MarkerClusterGroup({
  161. iconCreateFunction: function (cluster) {
  162. return L.divIcon({
  163. html: cluster.getChildCount(),
  164. className: 'cluster',
  165. iconSize: null
  166. });
  167. }
  168. });
  169. {% for partner in partners %}
  170. {% if partner.addressCoordY and partner.addressCoordX %}
  171. var markerTmp = L.marker([{{ partner.addressCoordY }}, {{ partner.addressCoordX }}]).on('click', function(e) {
  172. document.getElementById('partner-{{ partner.id }}').scrollIntoView();
  173. });
  174. markers.addLayer(markerTmp);
  175. {% endif %}
  176. {% endfor %}
  177. map.addLayer(markers);
  178. </script>
  179. <script>
  180. (function() {
  181. document.getElementById('rangeLocalisation').addEventListener("input", function(e) {
  182. document.getElementById('rangeLocalisationValue').innerText = e.target.value;
  183. });
  184. document.getElementById('rangeLocalisation').addEventListener("change", function(e) {
  185. location.href = URL_add_parameter(location.href, 'rad', e.target.value);
  186. });
  187. function URL_add_parameter(url, param, value){
  188. var hash = {};
  189. var parser = document.createElement('a');
  190. parser.href = url;
  191. var parameters = parser.search.split(/\?|&/);
  192. for(var i=0; i < parameters.length; i++) {
  193. if(!parameters[i])
  194. continue;
  195. var ary = parameters[i].split('=');
  196. hash[ary[0]] = ary[1];
  197. }
  198. hash[param] = value;
  199. var list = [];
  200. Object.keys(hash).forEach(function (key) {
  201. list.push(key + '=' + hash[key]);
  202. });
  203. parser.search = '?' + list.join('&');
  204. return parser.href;
  205. }
  206. })();
  207. </script>