| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- {% extends "base.html" %}
- {% block title %}{% if action == 'add' %}Add Person{% else %}Edit {{ person.name }}{% endif %} - astro-mcp{% endblock %}
- {% block content %}
- <h1>{% if action == 'add' %}Add Person{% else %}Edit {{ person.name }}{% endif %}</h1>
- <div class="toolbar">
- {% if action == 'edit' %}
- <a href="/dashboard/persons/{{ person.id }}" class="btn btn-ghost">← Back</a>
- {% else %}
- <a href="/dashboard/persons" class="btn btn-ghost">← Back</a>
- {% endif %}
- </div>
- <form method="post"
- {% if action == 'add' %}
- action="/dashboard/persons"
- {% else %}
- action="/dashboard/persons/{{ person.id }}"
- {% endif %}
- >
- <div class="card">
- <h2>Identity</h2>
- <div class="form-row">
- <div class="form-group">
- <label for="name">Full Name *</label>
- <input type="text" id="name" name="name" required
- value="{{ person.name if person else '' }}">
- </div>
- <div class="form-group">
- <label for="nickname">Nickname</label>
- <input type="text" id="nickname" name="nickname"
- value="{{ person.nickname if person else '' }}">
- <div class="form-hint">Short name for quick lookup</div>
- </div>
- </div>
- <div class="form-group">
- <label for="description">Description</label>
- <input type="text" id="description" name="description"
- value="{{ person.description if person else '' }}"
- placeholder="e.g. My sister, Client A, Famous person...">
- </div>
- <div class="form-row">
- <div class="form-group">
- <label for="gender">Gender</label>
- <select id="gender" name="gender">
- <option value="" {% if not person or not person.gender %}selected{% endif %}>—</option>
- <option value="male" {% if person and person.gender == 'male' %}selected{% endif %}>male</option>
- <option value="female" {% if person and person.gender == 'female' %}selected{% endif %}>female</option>
- <option value="other" {% if person and person.gender == 'other' %}selected{% endif %}>other</option>
- </select>
- </div>
- <div class="form-group">
- <label for="alive">Status</label>
- <select id="alive" name="alive">
- <option value="true" {% if not person or person.alive %}selected{% endif %}>Alive</option>
- <option value="false" {% if person and not person.alive %}selected{% endif %}>Deceased</option>
- </select>
- </div>
- <div class="form-group">
- <label for="private">Visibility</label>
- <select id="private" name="private">
- <option value="false" {% if not person or not person.private %}selected{% endif %}>Visible</option>
- <option value="true" {% if person and person.private %}selected{% endif %}>Private</option>
- </select>
- </div>
- </div>
- </div>
- <div class="card">
- <h2>Birth Data *</h2>
- <div class="form-row">
- <div class="form-group">
- <label for="birth_datetime">Birth Datetime *</label>
- <input type="text" id="birth_datetime" name="birth_datetime" required
- value="{{ person.birth_datetime if person else '' }}"
- placeholder="2000-01-01T12:00:00+01:00">
- <div class="form-hint">ISO 8601 with timezone, e.g. 2000-01-01T12:00:00+01:00</div>
- </div>
- <div class="form-group">
- <label for="birthplace">Birthplace</label>
- <input type="text" id="birthplace" name="birthplace"
- value="{{ person.birthplace if person else '' }}"
- placeholder="e.g. Graz, Austria">
- </div>
- </div>
- <div class="form-row">
- <div class="form-group">
- <label for="latitude">Latitude *</label>
- <input type="number" id="latitude" name="latitude" step="any" required
- value="{{ person.latitude if person else '' }}"
- placeholder="47.07">
- </div>
- <div class="form-group">
- <label for="longitude">Longitude *</label>
- <input type="number" id="longitude" name="longitude" step="any" required
- value="{{ person.longitude if person else '' }}"
- placeholder="15.42">
- </div>
- <div class="form-group">
- <label for="elevation">Elevation (m)</label>
- <input type="number" id="elevation" name="elevation" step="any"
- value="{{ person.elevation if person else '0' }}">
- </div>
- </div>
- <div class="form-row">
- <div class="form-group">
- <label for="tz">Timezone</label>
- <input type="text" id="tz" name="tz"
- value="{{ person.timezone if person else '' }}"
- placeholder="e.g. Europe/Vienna">
- <div class="form-hint">IANA timezone name</div>
- </div>
- <div class="form-group">
- <label for="birth_time_known">Birth Time Known?</label>
- <select id="birth_time_known" name="birth_time_known">
- <option value="true" {% if not person or person.birth_time_known %}selected{% endif %}>Yes, accurate</option>
- <option value="false" {% if person and not person.birth_time_known %}selected{% endif %}>Unknown / approximate</option>
- </select>
- </div>
- </div>
- </div>
- <div class="card">
- <h2>Notes</h2>
- <div class="form-group">
- <textarea id="notes" name="notes"
- placeholder="Freeform notes about this person..."
- >{{ person.notes if person else '' }}</textarea>
- </div>
- </div>
- <div class="form-actions">
- <button type="submit" class="btn btn-primary">
- {% if action == 'add' %}Add Person{% else %}Save Changes{% endif %}
- </button>
- {% if action == 'edit' %}
- <a href="/dashboard/persons/{{ person.id }}" class="btn btn-ghost">Cancel</a>
- {% else %}
- <a href="/dashboard/persons" class="btn btn-ghost">Cancel</a>
- {% endif %}
- </div>
- </form>
- {% endblock %}
|