Files
sneakyklaus/src/templates/admin/exchange_detail.html
Phil Skentelbery 6e8a7186cf fix: use absolute paths for database to ensure persistence
Critical bug fix: Path(__file__).parent.parent returns a relative path,
causing the database to be created in different locations depending on
the working directory. This caused data loss on container restarts.

Changes:
- Add .resolve() to BASE_DIR in src/config.py and migrations/env.py
- Fix admin dashboard showing 0 for participant count (was hardcoded)
- Fix exchange detail page to show actual participant list
- Add startup diagnostics to entrypoint.sh for troubleshooting

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 20:37:11 -07:00

87 lines
3.2 KiB
HTML

{% extends "layouts/base.html" %}
{% block title %}{{ exchange.name }}{% endblock %}
{% block content %}
<div class="container">
<h1>{{ exchange.name }}</h1>
<div class="exchange-details">
<div class="detail-section">
<h2>Details</h2>
<dl>
<dt>State</dt>
<dd><span class="badge badge-{{ exchange.state }}">{{ exchange.state }}</span></dd>
<dt>Description</dt>
<dd>{{ exchange.description or "No description" }}</dd>
<dt>Budget</dt>
<dd>{{ exchange.budget }}</dd>
<dt>Max Participants</dt>
<dd>{{ exchange.max_participants }}</dd>
<dt>Registration Close Date</dt>
<dd>{{ exchange.registration_close_date.strftime('%Y-%m-%d %H:%M') }} {{ exchange.timezone }}</dd>
<dt>Exchange Date</dt>
<dd>{{ exchange.exchange_date.strftime('%Y-%m-%d %H:%M') }} {{ exchange.timezone }}</dd>
<dt>Registration Link</dt>
<dd>
<code id="registration-link">{{ url_for('participant.register', slug=exchange.slug, _external=True) }}</code>
<button type="button" onclick="copyToClipboard()">Copy</button>
</dd>
</dl>
</div>
<div class="detail-section">
<h2>Participants ({{ exchange.participants|selectattr('withdrawn_at', 'none')|list|length }} / {{ exchange.max_participants }})</h2>
{% set active_participants = exchange.participants|selectattr('withdrawn_at', 'none')|list %}
{% if active_participants %}
<table>
<thead>
<tr>
<th>Name</th>
<th>Email</th>
<th>Registered</th>
</tr>
</thead>
<tbody>
{% for participant in active_participants|sort(attribute='name') %}
<tr>
<td>{{ participant.name }}</td>
<td>{{ participant.email }}</td>
<td>{{ participant.created_at.strftime('%Y-%m-%d %H:%M') }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>No participants yet.</p>
{% endif %}
</div>
<div class="actions">
{% if exchange.state == 'draft' %}
<form method="POST" action="{{ url_for('admin.open_registration', exchange_id=exchange.id) }}" style="display: inline;">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button type="submit" class="btn btn-primary">Open Registration</button>
</form>
{% endif %}
<a href="{{ url_for('admin.dashboard') }}" class="btn btn-secondary">Back to Dashboard</a>
</div>
</div>
</div>
<script>
function copyToClipboard() {
const link = document.getElementById('registration-link').textContent;
navigator.clipboard.writeText(link).then(() => {
alert('Link copied to clipboard!');
});
}
</script>
{% endblock %}