add( new Label( "destination", routeSpecification.destination()
.get()
.getString() ).add( new CorrectColor( isMisrouted ) ) );
add( new Label( "deadline", Model.of( routeSpecification.arrivalDeadline().get() ) ) );
add( new Label( "routingStatus", routingStatus.toString() ).add( new ErrorColor( isMisrouted ) ) );
add( new LinkPanel( "changeDestination", ChangeDestinationPage.class, trackingId, "Change destination" ) );
if( transportStatus.equals( CLAIMED ) )
{
// Can't re-route claimed cargo
add( new Label( "routingAction" ) );
add( new DeliveryFragment( delivery ) );
add( new ItineraryFragment( cargoModel, routingStatus ) );
}
else if( routingStatus.equals( NOT_ROUTED ) )
{
add( new LinkPanel( "routingAction", RouteCargoPage.class, trackingId, "Route" ) );
add( new Label( "delivery" ) );
add( new Label( "itinerary" ) );
}
else
{
add( new LinkPanel( "routingAction", ReRouteCargoPage.class, trackingId, "Re-route" ) );
add( new DeliveryFragment( delivery ) );
add( new ItineraryFragment( cargoModel, routingStatus ) );
}
if( delivery.lastHandlingEvent().get() == null )