templates/modules/search-widget/journey/result.html.twig line 1

Open in your IDE?
  1. {% if (isPdfPrint is defined and isPdfPrint == true and printMode is defined) %}
  2. <div class="print-map">
  3. <button type="button" class="print-button is-Button is-Button_Search is-full-width">{{ 'journey.print' | trans }}</button>
  4. <label class="is-CheckboxLabel">
  5. <input type="checkbox" class="is-Checkbox print-with-map" checked>
  6. <i class="is-Icon is-Icon-com-checkbox" aria-hidden="true"><i class="is-path1"></i><i class="is-path2"></i><i class="is-path3"></i></i>
  7. <span>{{ 'journey.print_with_map'|trans }}</span>
  8. </label>
  9. </div>
  10. <div class="is-MapWrapper">
  11. {% if mapImageBase64 is defined and mapImageBase64 is not empty %}
  12. <img id="is-Map-Print" class="is-Map" src="data:image/png;base64,{{ mapImageBase64 }}" alt="" aria-hidden="true">
  13. {% else %}
  14. <div id="is-Map" class="is-Map" aria-hidden="true"></div>
  15. <div id="is-Map-Print" class="is-Map" aria-hidden="true"></div>
  16. {% endif %}
  17. </div>
  18. <div class="is-LabelInInput is-First" id="is-Journey-Departure-LabelInInput">
  19. <div class="is-LabelInInput-LabelWrapper">
  20. <label class="is-LabelInInput-Label" for="is-Journey-Departure">{{ 'journey.departure' | trans }}</label>
  21. </div>
  22. <div class="is-LabelInInput-InputWrapper">
  23. <input value="{{ departurePlace.value }}" id="is-Journey-Departure-Disabled" name="start" type="text" class="is-LabelInInput-Input" autocomplete="off" disabled/>
  24. </div>
  25. </div>
  26. <div class="is-Stages" id="is-Journey-Stage" {% if via is not defined or via|length == 0 %}style="display: none;"{% endif %}>
  27. {% if via is defined and via|length > 0 %}
  28. {% for index, step in via %}
  29. {% if step.id is defined and step.value is defined %}
  30. <div class="is-LabelInInput" id="is-Stage-LabelInInput-{{ loop.index0 }}" >
  31. <div class="is-LabelInInput-LabelWrapper">
  32. <label class="is-LabelInInput-Label" for="is-Stage-Input-{{ loop.index0 }}">{{ 'map.popup.step-via' | trans }}</label>
  33. </div>
  34. <div class="is-LabelInInput-InputWrapper">
  35. <input autocomplete="off" required="true" type="text" name="stage[]" id="is-Stage-Input-{{ loop.index0 }}-Disable" class="is-LabelInInput-Input is-via-input" data-latlon="{{ step.latlon }}" data-id="{{ step.id }}" value="{{ step.value }}" placeholder="{{ 'journey.departure_placeholder' | trans }}" disabled/>
  36. </div>
  37. </div>
  38. {% endif %}
  39. {% endfor %}
  40. {% endif %}
  41. </div>
  42. <div class="is-LabelInInput is-Last" id="is-Journey-Arrival-LabelInInput">
  43. <div class="is-LabelInInput-LabelWrapper">
  44. <label class="is-LabelInInput-Label" for="is-Journey-Arrival">{{ 'journey.arrival' | trans }}</label>
  45. </div>
  46. <div class="is-LabelInInput-InputWrapper">
  47. <input value="{{ arrivalPlace.value }}" id="is-Journey-Arrival-Disable" name="end" type="text" class="is-LabelInInput-Input" placeholder="{{ 'journey.arrival_placeholder' | trans }}" autocomplete="off" disabled/>
  48. </div>
  49. </div>
  50. {% endif %}
  51. {% if validator.error is defined and validator.error == 1 %}
  52. <div class="is-Result-Error">
  53. <i class="is-Icon is-Icon-Error is-Icon-sim-error-result" aria-hidden="true"><i class="is-path1"></i><i class="is-path2"></i><i class="is-path3"></i></i>
  54. <div class="is-Result-Error-Description">
  55. <ul class=is-Result-Error-List>
  56. {% for error in validator.errors %}
  57. <li class="is-Result-Error-List-Item">
  58. {{ error.message | trans }}
  59. </li>
  60. {% endfor %}
  61. </ul>
  62. </div>
  63. </div>
  64. {% endif %}
  65. {% if isXmlHttpMode is not defined or (isXmlHttpMode is defined and true == isXmlHttpMode) %}
  66. {% if tripPlanner is defined %}
  67. {% if tripPlanner[mode].journeycount is defined and tripPlanner[mode].journeycount > 0 %}
  68. <div class="is-Mode-hiddenValues is-hide">
  69. <span class="is-Mode-Value">
  70. {% if tripPlanner[mode].totalTimeValue is not empty %}
  71. {{ tripPlanner[mode].totalTimeValue|raw }}
  72. {% endif %}
  73. </span>
  74. <span class="is-Mode-ButtonLabel">
  75. {{ ('mode.' ~ mode|lower)|trans }} : {{ 'journey.itineraries_found_new_format' | trans({'count': tripPlanner[mode].journeycount}) }}.
  76. {{ 'journey.minimum_duration'|trans }} : {% if tripPlanner[mode].totalTimeValue is not empty %}{{ tripPlanner[mode].totalTimeValue|raw }}{% endif %}.
  77. </span>
  78. </div>
  79. {% endif %}
  80. {% endif %}
  81. {% endif %}
  82. {% if tripPlanner is defined and tripPlanner[mode] is defined and tripPlanner[mode] is not empty %}
  83. {% if tripPlanner[mode]['errors'] is defined and tripPlanner[mode]['errors'] is not empty %}
  84. <div class="is-Result-Error">
  85. <i class="is-Icon is-Icon-Error is-Icon-sim-error-result" aria-hidden="true"><i class="is-path1"></i><i class="is-path2"></i><i class="is-path3"></i></i>
  86. <div class="is-Result-Error-Description">
  87. <ul class=is-Result-Error-List>
  88. {% for error in tripPlanner[mode]['errors'] %}
  89. {% if error.message is defined and error.message is not empty %}
  90. {% set errorMessages = error.message|split('<BR>') %}
  91. <li class="is-Result-Error-List-Item">
  92. {% for message in errorMessages %}
  93. {% if loop.index == 1 and errorMessages|length > 1 %}
  94. <strong class="is-Bold">{{ message | raw }}</strong>
  95. {% else %}
  96. {{ message | raw }}
  97. {% endif %}
  98. {% endfor %}
  99. </li>
  100. {% endif %}
  101. {% endfor %}
  102. </ul>
  103. </div>
  104. </div>
  105. {% endif %}
  106. {% if tripPlanner[mode]['groups']['errors'] is defined and tripPlanner[mode]['groups']['errors'] is not empty %}
  107. <ul class="is-Journey-Result-Errors">
  108. {% for errors in tripPlanner[mode]['groups']['errors'] %}
  109. <li class="is-Journey-Result-Errors-Item">
  110. <i class="is-Icon is-Icon-com-notice" aria-hidden="true"></i>
  111. <span class="is-Journey-Result-Errors-Description">{{ errors.message | raw }}</span>
  112. </li>
  113. {% endfor %}
  114. </ul>
  115. {% endif %}
  116. {% if tripPlanner[mode]['groups'] is defined and tripPlanner[mode]['groups'] is not empty %}
  117. <div class="is-Journey-Results-List" role="list" aria-live="polite">
  118. <div class="is-Journey-Roadmap-Header is-Result-Header is-hide" role="listitem">
  119. <button class="is-Journey-Results-BackButton is-Result-Header-BackButton" title="{{ 'journey.back_to_results'|trans }}" tabindex="0">
  120. <i class="is-Icon is-Icon-com-chevron-left-thick" aria-hidden="true"></i>
  121. </button>
  122. {% if isWidget is defined and true == isWidget %}
  123. <div class="is-Journey-Roadmap-H1 is-Widget-H2">{{ 'journey.roadmap'|trans }}</div>
  124. {% else %}
  125. <h2 class="is-Journey-Roadmap-H1 is-Widget-H2">{{ 'journey.roadmap'|trans }}</h2>
  126. {% endif %}
  127. {% if true == enable_html_to_pdf_button_on_instance %}
  128. <div class="is-dropdown is-Result-Header-OptionsButtonGroup">
  129. <a class="is-dropdown-toggle is-Schedule-OptionsButton is-Result-Header-OptionsButton" data-toggle="is-dropdown" id="is-LineDirection-Timesheet-OptionsButton_{{ mode }}" title="{{ 'schedule.more_options'|trans }}" role="button" aria-haspopup="true" aria-expanded="true" tabindex="0">
  130. <i class="is-Icon is-Icon-com-dots-three-horizontal" aria-hidden="true"></i>
  131. </a>
  132. <ul class="is-dropdown-menu is-dropdown-menu-right" aria-labelledby="is-LineDirection-Timesheet-OptionsButton_{{ mode }}">
  133. <li id="is-JourneyResult-Download-{{ mode }}">
  134. <a class="is-JourneyResult-link" href="{% if journeyResultPdfDownloadUrl is defined %}{{ journeyResultPdfDownloadUrl }}{% endif %}" target="_blank">{{ 'journey.pdf_download'|trans }}</a>
  135. </li>
  136. </ul>
  137. </div>
  138. {% elseif (widgetContext is not defined or widgetContext is empty or "false" == widgetContext) and (enable_result_options_button is defined and enable_result_options_button == true) %}
  139. <div class="is-dropdown is-Result-Header-OptionsButtonGroup">
  140. <a class="is-dropdown-toggle is-Schedule-OptionsButton is-Result-Header-OptionsButton" data-toggle="is-dropdown" id="is-LineDirection-Timesheet-OptionsButton_{{ mode }}" title="{{ 'schedule.more_options'|trans }}" role="button" aria-haspopup="true" aria-expanded="true" tabindex="0">
  141. <i class="is-Icon is-Icon-com-dots-three-horizontal" aria-hidden="true"></i>
  142. </a>
  143. <ul class="is-dropdown-menu is-dropdown-menu-right" aria-labelledby="is-LineDirection-Timesheet-OptionsButton_{{ mode }}">
  144. {% if account_module is defined and account_module is not empty and 'TRANSPORT' == mode %}
  145. <li>
  146. <a
  147. {% if is_granted('IS_AUTHENTICATED_REMEMBERED') %}
  148. class="is-AddSubscriptionAlert is-Journey-AddMultipleLinesToFavoritesButton is-Favorite-Item-Button"
  149. data-token="{{ csrf_token('favorite_add_multiple_lines') }}"
  150. {% else %}
  151. class="is-Favorite-Item-Button {% if login_mode == 'kas' %} is-trigger-kas-login{% else %} is-ShowLoginModalButton {% endif %}"
  152. data-redirect-to-same="true"
  153. data-action="addToFavorites"
  154. data-favorite-type="MULTIPLE_LINES"
  155. {% endif %}
  156. data-refresh-reverse-token="false"
  157. data-context="MULTIPLE_LINES"
  158. role="button"
  159. tabindex="0"
  160. >
  161. {{ 'place.favorite.action.subscribe_alert'|trans }}
  162. </a>
  163. </li>
  164. {% endif %}
  165. {% if enable_give_feedback is defined and enable_give_feedback == true %}
  166. <li>
  167. <a class="is-Journey-FeedBack" tabindex="0" role="button">{{ 'journey.roadmap_contact' | trans }}</a>
  168. </li>
  169. {% endif %}
  170. <li id="is-JourneyResult-Print-{{ mode }}">
  171. <a href="{% if journeyResultPrintUrl is defined %}{{ journeyResultPrintUrl }}{% endif %}" target="_blank">{{ 'journey.print'|trans }}</a>
  172. </li>
  173. <li id="is-JourneyResult-Download-{{ mode }}">
  174. <a href="{% if journeyResultPdfDownloadUrl is defined %}{{ journeyResultPdfDownloadUrl }}{% endif %}" target="_blank">{{ 'journey.pdf_download'|trans }}</a>
  175. </li>
  176. <li id="is-JourneyResult-AddToCalendar-{{ mode }}">
  177. <a class="is-AddToCalendarButton" tabindex="0" role="button">{{ 'user.add_to_my_calendar'|trans }}</a>
  178. </li>
  179. </ul>
  180. </div>
  181. {% endif %}
  182. </div>
  183. {% set index = 0 %}
  184. {% for tripByGroup in tripPlanner[mode]['groups'] %}
  185. {% if tripByGroup['display'] is defined and true == tripByGroup['display'] and tripByGroup['name'] is defined and tripByGroup['name'] is not empty %}
  186. <h3 class="is-Widget-H3 is-Widget-H3_WithLatMargins">{{ tripByGroup['name'] }}</h3>
  187. {% endif %}
  188. {% if tripByGroup['errors'] is defined and tripByGroup['errors'] is not empty %}
  189. <ul class="is-Journey-Result-Errors is-pl-30 is-pr-30">
  190. {% for errors in tripByGroup['errors'] %}
  191. <li class="is-Journey-Result-Errors-Item">
  192. <i class="is-Icon is-Icon-com-notice" aria-hidden="true"></i>
  193. <span class="is-Journey-Result-Errors-Description">{{ errors.message | raw }}</span>
  194. </li>
  195. {% endfor %}
  196. </ul>
  197. {% endif %}
  198. {% if tripByGroup['results']['journeys'] is defined and tripByGroup['results']['journeys'] is not empty %}
  199. {% for journey in tripByGroup['results']['journeys'] %}
  200. {% set index = index + 1 %}
  201. {% if (isPdfPrint is defined and isPdfPrint == true and printIndex is defined and index == printIndex) or isPdfPrint is not defined %}
  202. {% set vars = { 'journey': journey, 'mode': mode} %}
  203. {% if journey.paths is defined and journey.paths is not empty %}
  204. {% for path in journey.paths %}
  205. {% if true == path.displayHeaderMode and path.mode is defined and 'BIKESHARING' == path.mode %}
  206. <h4 class="is-Widget-H4 is-Widget-H4_WithLatMargins">{{ 'mode.bikesharing' | trans }}</h4>
  207. {% endif %}
  208. {% endfor %}
  209. {% endif %}
  210. {% if mode != 'PRIVATETAXI' %}
  211. <div class="is-Journey-Result {% if tripPlanner[mode]['estimatedResults'] %}is-Journey-EstimatedResult{% endif %}" id="is-Journey-Result-{{ mode }}-{{ index }}"
  212. data-mode="{{ mode }}" data-journey-id="{{ journey.id }}"
  213. role="listitem">
  214. <div class="is-Journey-Result-Header" id="is-Journey-Result-Heading-{{ mode }}-{{ index }}"
  215. aria-labelledby="is-Journey-Result-{{ mode }}-{{ index }}-Summary">
  216. {% if true == displayAvoidDisruptions and journey['hasCriticalDisruption'] is defined and true == journey['hasCriticalDisruption'] %}
  217. <div class="is-Journey-CalculateWithoutDisruption is-hide">
  218. <a class="is-Journey-CalculateWithoutDisruption-Link">
  219. <i class="is-Icon is-Icon-sim-refresh" aria-hidden="true"></i>
  220. {{ 'journey.calculate_trip_without_disruption' | trans }}
  221. </a>
  222. </div>
  223. {% endif %}
  224. {% if false == tripPlanner[mode]['estimatedResults'] %}
  225. <div class="is-Journey-Result-Header-ExpandButton {% if (isPdfPrint is defined and isPdfPrint == true and printMode is defined) %}is-disabled{% endif %}"
  226. href="#is-Journey-Roadmap-{{ mode }}-{{ index }}"
  227. role="button" aria-controls="is-Journey-Roadmap-{{ mode }}-{{ index }}"
  228. aria-expanded="false" tabindex="0"
  229. data-print-mode="{{ mode }}"
  230. data-print-index="{{ index }}"
  231. data-totaltime="{{ journey.totaltime }}"
  232. tabindex="0"
  233. >
  234. {% include 'modules/search-widget/journey/result-header.html.twig' with vars %}
  235. </div>
  236. {% else %}
  237. <div class="is-Journey-Result-Header-ExpandButton {% if (isPdfPrint is defined and isPdfPrint == true and printMode is defined) %}is-disabled{% endif %}" href="#is-Journey-Result-{{ journey.id}}-Preview" role="button" aria-controls="is-Journey-Result-{{ journey.id }}-Preview" aria-expanded="false" data-print-mode="{{ mode }}" data-print-index="{{ index }}" data-totaltime="{{ journey.totaltime }}">
  238. {% include 'modules/search-widget/journey/result-header-estimated.html.twig' with vars %}
  239. </div>
  240. {% endif %}
  241. </div>
  242. <div class="is-Journey-Roadmap {% if isPdfPrint is not defined or isPdfPrint is defined and isPdfPrint == false %}is-hide{% endif %}" id="is-Journey-Roadmap-{{ mode }}-{{ index }}">
  243. {% if journey.rideSharingInfos is defined and journey.rideSharingInfos is not empty %}
  244. <div class="is-RideSharingInfos">
  245. <div class="is-RideSharingInfos-Seats">
  246. <span class="is-RideSharingInfos">Places</span>
  247. <span>{{ journey.rideSharingInfos.seats }}</span>
  248. </div>
  249. <div class="is-RideSharingInfos-BookingLink">
  250. <a class="is-Button is-Button_Secondary"
  251. href="{{ journey.rideSharingInfos.link }}"
  252. target="_blank">{{ 'bookOn' | trans }}
  253. <img class="is-Result-Modes-OperatorLogo" src="{{ journey.operatorLogo }}"
  254. alt="{{ journey.operatorName }}"/>
  255. </a>
  256. </div>
  257. </div>
  258. {% endif %}
  259. {% include 'modules/search-widget/journey/result-body.html.twig' with vars %}
  260. </div>
  261. {% if mode == 'TRANSPORT' %}
  262. <input type="hidden" name="linesFavorites" value="{{ journey.linesFavorites }}">
  263. {% endif %}
  264. </div>
  265. {% else %}
  266. {% include 'modules/search-widget/journey/result-rides.html.twig' with vars %}
  267. {% endif %}
  268. {% endif %}
  269. {% endfor %}
  270. {% if mode == 'TRANSPORT' and tripByGroup['results']['nextStartDate'] is defined and tripByGroup['results']['previousArrivalDate'] is defined and isPdfPrint is not defined %}
  271. <div class="is-LeaveArrive-Area" role="listitem">
  272. <button class="is-LeaveArrive-Button is-LeaveArrive-Button_Prev" onclick="JourneyManager.changeJourneyDate('{{ tripByGroup['results']['previousArrivalDate'] }}', 'ARRIVE_AT')">{{ 'journey.arrive_sooner'|trans }}</button>
  273. <button class="is-LeaveArrive-Button is-LeaveArrive-Button_Next" onclick="JourneyManager.changeJourneyDate('{{ tripByGroup['results']['nextStartDate'] }}', 'LEAVE_AT')">{{ 'journey.leave_later'|trans }}</button>
  274. </div>
  275. {% endif %}
  276. {% endif %}
  277. {% endfor %}
  278. </div>
  279. {% endif %}
  280. {% elseif validator.error is defined and validator.error != 1 %}
  281. <div class="is-Result-Error">
  282. <i class="is-Icon is-Icon-Error is-Icon-sim-error-result" aria-hidden="true"><i class="is-path1"></i><i class="is-path2"></i><i class="is-path3"></i></i>
  283. <div class="is-Result-Error-Description">
  284. <p>
  285. <strong class="is-Bold">{{ 'itinerary.not_available' | trans }}</strong>
  286. {{ 'try_later' | trans }}
  287. </p>
  288. </div>
  289. </div>
  290. {% endif %}