{% extends "base.html" %} {% block title %}{{ post.title }} - Moto Adventure{% endblock %} {% block head %} {% endblock %} {% block content %}
{% set cover_image = post.images.filter_by(is_cover=True).first() %} {% if cover_image %}
{{ post.title }}
{% endif %} {% if current_user.is_authenticated and (current_user.id == post.author_id or current_user.is_admin) %}
{% if post.published %} Published {% else %} Pending Review {% endif %}
{% endif %}
{% for i in range(post.difficulty) %} {% endfor %} {{ post.get_difficulty_label() }}

{{ post.title }}

{% if post.subtitle %}

{{ post.subtitle }}

{% endif %}
{{ post.author.nickname[0].upper() }}

{{ post.author.nickname }}

Published on {{ post.created_at.strftime('%B %d, %Y') }}

{{ post.get_like_count() }} likes {{ post.comments.count() }} comments

Adventure Story

Follow the journey step by step

{% set content_sections = post.content.split('\n\n') %} {% set section_images = post.images.filter_by(is_cover=False).all() %} {% set images_per_section = (section_images|length / (content_sections|length))|round|int if content_sections|length > 0 else 0 %} {% for section in content_sections %} {% if section.strip() %}
{% set section_text = section.strip() %} {% set keywords = [] %} {% set clean_text = section_text %} {% if '**' in section_text %} {% set parts = section_text.split('**') %} {% set clean_parts = [] %} {% for i in range(parts|length) %} {% if i % 2 == 1 %} {% set _ = keywords.append(parts[i].strip()) %} {% else %} {% set _ = clean_parts.append(parts[i]) %} {% endif %} {% endfor %} {% set clean_text = clean_parts|join(' ')|trim %} {% endif %} {% if '
' in clean_text %} {% set text_parts = clean_text.split('
') %} {% set first_part = text_parts[0].strip() %} {% if first_part and first_part|length < 100 and ' ' in first_part %} {% set potential_keywords = first_part.split() %} {% if potential_keywords|length <= 5 %} {% for kw in potential_keywords %} {% if kw.strip() %} {% set _ = keywords.append(kw.strip()) %} {% endif %} {% endfor %} {% set remaining_parts = text_parts[1:] %} {% set clean_text = remaining_parts|join('
')|trim %} {% endif %} {% endif %} {% endif %} {% set clean_text = clean_text.replace('


', '

').replace('

', '

').strip() %} {% if keywords %}
{% for keyword in keywords %} {% if keyword.strip() %} {{ keyword.strip() }} {% endif %} {% endfor %}
{% endif %}
{{ clean_text | safe | nl2br }}
{% if section_images %} {% set start_idx = loop.index0 * images_per_section %} {% set end_idx = start_idx + images_per_section %} {% set current_section_images = section_images[start_idx:end_idx] %} {% if current_section_images %}
{% for image in current_section_images %}
{{ image.description or image.original_name }}
{% if image.description %}
{{ image.description }}
{% endif %}
{% endfor %}
{% endif %} {% endif %}
{% endif %} {% endfor %}

Community Discussion

Share your thoughts and experiences ({{ comments|length }})

{% if current_user.is_authenticated %}
{{ form.hidden_tag() }}
{{ form.content.label(class="block text-sm font-medium text-gray-700 mb-2") }} {{ form.content(class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent", rows="4", placeholder="Share your thoughts about this adventure...") }}
{% else %}

Login or create an account to join the discussion.

{% endif %}
{% for comment in comments %}

{{ comment.author.nickname }}

{{ comment.created_at.strftime('%B %d, %Y at %I:%M %p') }}

{{ comment.content }}

{% endfor %} {% if comments|length == 0 %}
No comments yet

Be the first to share your thoughts about this adventure!

{% endif %}
{% if post.gpx_files.count() > 0 %}

Route Map

GPS track and statistics

{% set gpx_file = post.gpx_files.first() %}
{{ gpx_file.total_distance if gpx_file and gpx_file.total_distance > 0 else '-' }}
Distance (km)
{{ gpx_file.elevation_gain|int if gpx_file and gpx_file.elevation_gain > 0 else '-' }}
Elevation Gain (m)
{{ gpx_file.max_elevation|int if gpx_file and gpx_file.max_elevation > 0 else '-' }}
Max Elevation (m)
{{ gpx_file.total_points if gpx_file and gpx_file.total_points > 0 else '-' }}
Track Points
{% for gpx_file in post.gpx_files %} {% if current_user.is_authenticated %} Download GPX ({{ "%.1f"|format(gpx_file.size / 1024) }} KB) {% else %} Login to Download GPX {% endif %} {% endfor %} {% if current_user.is_authenticated %} {% endif %}

Interactive Route Map

Explore the full route

Loading Interactive Map...
If map doesn't load, please refresh the page
Loading route...
{% endif %}

Adventure Info

Trip details

Difficulty
{% for i in range(post.difficulty) %} {% endfor %} {% for i in range(5 - post.difficulty) %} {% endfor %}
Published {{ post.created_at.strftime('%B %d, %Y') }}
Author {{ post.author.nickname }}
{% if post.images.count() > 0 %}
Photos {{ post.images.count() }}
{% endif %} {% if post.gpx_files.count() > 0 %}
GPS Files {{ post.gpx_files.count() }}
{% endif %}
{% if post.images.count() > 0 %}

Photo Gallery

{{ post.images.count() }} photos

{% for image in post.images %}
{{ image.description or image.original_name }} {% if image.is_cover %}
{% endif %}
{% endfor %}
{% if post.images.count() > 4 %}
Click any photo to view gallery
{% endif %}
{% endif %}
{% endblock %} {% block scripts %} {% endblock %}