<% content_for :title, @trip.name %>

<%= @trip.name %>

<%= human_date(@trip.started_at) %> - <%= human_date(@trip.ended_at) %>

<%= trip_duration(@trip) %>

Distance
<%= @trip.distance_in_unit('km').round %>
kilometers traveled
Duration
<%= (((@trip.ended_at - @trip.started_at) / 86400).round) %>
days
Countries
<%= @trip.visited_countries.count %>
countries visited

Trip Route

<% if @coordinates.present? %>
<% else %>

Route data not yet calculated

<% end %>
<% if @trip.visited_countries.any? %>

Countries Visited

<% @trip.visited_countries.sort.each do |country| %>
<%= country %>
<% end %>
<% end %> <% if @trip.share_notes? && @trip.notes.present? %>

About This Trip

<%= @trip.notes.body %>
<% end %> <% if @trip.share_photos? && @photo_previews.any? %>

Photos

<% @photo_previews.first(8).each do |photo| %>
Trip photo
<% end %>
<% if @photo_previews.count > 8 %>

+<%= @photo_previews.count - 8 %> more photos

<% end %>
<% end %>
Powered by <%= link_to "Dawarich", "https://dawarich.app", class: "link link-primary", target: "_blank" %>, your personal memories mapper.