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