Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
KDE PIM Add-ons
Commits
55c661a6
Commit
55c661a6
authored
Jul 26, 2022
by
Volker Krause
Browse files
Add support for boat/ferry reservations
parent
beb9a7e1
Pipeline
#209146
passed with stage
in 18 minutes and 14 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
plugins/messageviewer/bodypartformatter/itinerary/itinerarymemento.cpp
View file @
55c661a6
...
...
@@ -66,7 +66,8 @@ QVector<ItineraryMemento::TripData> ItineraryMemento::data()
if
(
m_data
.
isEmpty
()
&&
!
m_postProc
.
result
().
isEmpty
())
{
// filter out types we can't handle, but keep incomplete elements to see if we can complete them from the calendar
ExtractorValidator
validator
;
validator
.
setAcceptedTypes
<
BusReservation
,
validator
.
setAcceptedTypes
<
BoatReservation
,
BusReservation
,
EventReservation
,
FlightReservation
,
FoodEstablishmentReservation
,
...
...
plugins/messageviewer/bodypartformatter/itinerary/templates/boatreservation.html
0 → 100644
View file @
55c661a6
<table
style=
"width:100%;"
>
<tr>
<td
style=
"font-size:120%; width:33;"
>
{{ trip.departureBoatTerminal.name }}
{% with trip.departureBoatTerminal as location %}{% include "org.kde.messageviewer/itinerary/location.html" %}{% endwith %}
</td>
<td
style=
"font-size:120%; width:33%; text-align:center;"
>
{% if elem.reservations.0.reservation.reservationStatus == 1 %}
{% icon "dialog-cancel" sizesmallmedium _("Reservation canceled.") %}
{% else %}
→
{% endif %}
</td>
<td
style=
"font-size:120%; width:33%;"
>
{{ trip.arrivalBoatTerminal.name }}
{% with trip.arrivalBoatTerminal as location %}{% include "org.kde.messageviewer/itinerary/location.html" %}{% endwith %}
</td>
</tr>
<tr>
<td>
{{ trip.departureTime|formatDateTime }}
</td>
<td
style=
"white-space: nowrap; text-align:center;"
>
<!-- TODO boat name not yet available -->
</td>
<td>
{{ trip.arrivalTime|formatDateTime }}
</td>
</tr>
<tr><td
colspan=
"3"
>
<div
style=
"float:left"
>
{% if elem.reservations.0.ticketToken or elem.reservations.size > 1 %}
<a
href=
"x-kmail:/bodypart/0//semanticExpand?{{ forloop.counter0 }}"
>
{% if elem.state.expanded %}
<img
src=
"{{ style.collapseIcon }}"
style=
"margin-right: 4px;"
/>
{% else %}
<img
src=
"{{ style.expandIcon }}"
style=
"margin-right: 4px;"
/>
{% endif %}
</a>
{% endif %}
</div>
{% include "org.kde.messageviewer/itinerary/actions.html" %}
</td></tr>
</table>
{% if elem.state.expanded %}
{% for d in elem.reservations %}
{% with d.reservation as res %}
<div>
{% if res.underName.name %}
{{ res.underName.name }}
{% endif %}
{% if res.reservedTicket.name %}
({{ res.reservedTicket.name }})
{% endif %}
</div>
{% if d.ticketToken %}
<div
style=
"text-align:center;"
>
<div
style=
"background-color: #ffffff; display: inline-block; padding: 4px;"
>
<img
src=
"{{ d.ticketToken }}"
/>
</div>
</div>
{% endif %}
{% if elem.reservations.size > 1 %}
{% include "org.kde.messageviewer/itinerary/actions.html" %}
{% endif %}
{% endwith %}
{% endfor %}
{% endif %}
plugins/messageviewer/bodypartformatter/itinerary/templates/itinerary.html
View file @
55c661a6
...
...
@@ -45,6 +45,8 @@ a.itineraryButton:active {
{% include "org.kde.messageviewer/itinerary/trainreservation.html" %}
{% elif res.className == "BusReservation" %}
{% include "org.kde.messageviewer/itinerary/busreservation.html" %}
{% elif res.className == "BoatReservation" %}
{% include "org.kde.messageviewer/itinerary/boatreservation.html" %}
{% elif res.className == "EventReservation" %}
{% include "org.kde.messageviewer/itinerary/event.html" %}
{% elif res.className == "FoodEstablishmentReservation" %}
...
...
plugins/messageviewer/bodypartformatter/itinerary/templates/templates.qrc
View file @
55c661a6
...
...
@@ -11,5 +11,6 @@
<file>foodestablishmentreservation.html</file>
<file>rentalcarreservation.html</file>
<file>taxireservation.html</file>
<file>boatreservation.html</file>
</qresource>
</RCC>
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment