{% extends "base.html" %} {% block title %}AI Story Generator - Travel Records{% endblock %} {% block content %}

✨ AI Travel Story Generator

Transform your travel records into engaging narratives

{% if not ai_available %} {% endif %} {% if not user_records %} {% else %}
{{ form.hidden_tag() }}
{{ form.story_type.label(class="form-label") }} {{ form.story_type(class="form-control" + (" is-invalid" if form.story_type.errors else "")) }} {% if form.story_type.errors %}
{% for error in form.story_type.errors %} {{ error }} {% endfor %}
{% endif %}
Choose the style and tone for your story
{{ form.max_records.label(class="form-label") }} {{ form.max_records(class="form-control") }}
Limit the number of trips to include
{{ form.date_from.label(class="form-label") }} {{ form.date_from(class="form-control") }}
Optional: Start date for trip selection
{{ form.date_to.label(class="form-label") }} {{ form.date_to(class="form-control") }}
Optional: End date for trip selection
{{ form.selected_records.label(class="form-label") }} {{ form.selected_records(class="form-control", style="height: 200px;") }}
Optional: Select specific trips to include in your story. Hold Ctrl (Cmd on Mac) to select multiple trips. Leave empty to use date range or all recent trips.
{{ form.custom_prompt.label(class="form-label") }} {{ form.custom_prompt(class="form-control" + (" is-invalid" if form.custom_prompt.errors else "")) }} {% if form.custom_prompt.errors %}
{% for error in form.custom_prompt.errors %} {{ error }} {% endfor %}
{% endif %}
{{ form.submit(class="btn btn-primary" + (" disabled" if not ai_available else ""), disabled=not ai_available) }}
{% if suggestions and ai_available %}
💡 Story Ideas Based on Your Travels
{% for suggestion in suggestions %}

{{ suggestion }}

{% endfor %}
{% endif %}
📝 Your Recent Travel Records
{% for record in user_records[:6] %}
{{ record.city }}, {{ record.country }}

{{ record.departure_date.strftime('%B %d, %Y') }} {% if record.return_date %} - {{ record.return_date.strftime('%B %d, %Y') }}{% endif %}

{{ record.purpose.title() }}

{% if ai_available %} {% endif %}
{% endfor %}
{% if user_records|length > 6 %}

Showing {{ user_records[:6]|length }} of {{ user_records|length }} total records. View all records

{% endif %}
{% endif %}
{% if ai_available %} {% endif %} {% endblock %}