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