Trip Sharing Settings

<%= form_with model: trip, url: trip_path(trip), method: :patch, data: { turbo: false } do |f| %> <% if trip.sharing_enabled? %>
<% if trip.sharing_expired? %>

Link Expired

This share link has expired and is no longer accessible

<% else %>

Sharing Active

This trip is publicly accessible via the link below

<% end %>
Share this link with others to give them access to your trip
<%= link_to shared_trip_path(trip.sharing_uuid), target: '_blank', class: 'btn btn-outline btn-primary gap-2' do %> View Public Page <% end %>

What's being shared:

<% if trip.share_notes? %> <% else %> <% end %> Trip notes
<% if trip.share_photos? %> <% else %> <% end %> Photos
Always included: Trip name, dates, route map, distance, and countries visited

Privacy Protection

• Only selected information is shared
• Personal information and account details are never included
• You can disable sharing at any time
<%= submit_tag "Disable Sharing", name: 'trip[sharing][enabled]', value: '0', class: "btn btn-error", data: { turbo_confirm: "Are you sure you want to disable sharing for this trip?" } %>
<% else %>

Generate a public link to share this trip with friends, family, or on social media.

Choose what to share:

<%= select_tag 'trip[sharing][expiration]', options_for_select([ ['1 hour', '1h'], ['12 hours', '12h'], ['24 hours', '24h'], ['Never (permanent)', 'permanent'] ], '24h'), class: 'select select-bordered w-full' %>
Choose how long the sharing link will remain active
Always included: Trip name, dates, route map, distance, and countries visited

Privacy Protection

• Only selected information will be shared
• Personal information and account details are never included
• You can disable sharing at any time
<%= hidden_field_tag 'trip[sharing][enabled]', '1' %>
<%= submit_tag "Enable Sharing", class: "btn btn-primary" %>
<% end %> <% end %>