{% 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]) %} {% set _ = clean_parts.append(parts[i]) %} {% else %} {% set _ = clean_parts.append(parts[i]) %} {% endif %} {% endfor %} {% set clean_text = clean_parts|join('') %} {% endif %} {% if keywords %}
{% for keyword in keywords %} {{ keyword }} {% 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 %}
{% endif %}

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

-
Distance (km)
-
Elevation (m)
-
Max Elevation (m)
-
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 %}
{% 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 %}