Files
classifieds/app/templates/admin/sponsor_edit.html
T
2026-06-17 17:51:03 -04:00

76 lines
2.9 KiB
HTML

{% extends "base.html" %}
{% block title %}{{ _('Admin · %(t)s', t=_('Edit sponsor') if sponsor else _('New sponsor')) }}{% endblock %}
{% block content %}
{% include "admin/_nav.html" %}
<div class="card">
<h2>{{ _('Edit sponsor') if sponsor else _('New sponsor') }}</h2>
{% if error %}<p class="alert danger">{{ error }}</p>{% endif %}
<form method="post" class="settings-panel">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<div class="field">
<label>{{ _('Name') }} *</label>
<input class="input" name="name" required
value="{{ sponsor.name if sponsor else '' }}">
</div>
<div class="field">
<label>{{ _('URL') }} *</label>
<input class="input" name="url" required
value="{{ sponsor.url if sponsor else '' }}">
</div>
<div class="field">
<label>{{ _('Tagline') }}</label>
<input class="input" name="tagline"
value="{{ sponsor.tagline or '' if sponsor else '' }}">
</div>
<div class="field">
<label>{{ _('Logo path (relative under media/)') }}</label>
<input class="input" name="logo_path"
value="{{ sponsor.logo_path or '' if sponsor else '' }}"
placeholder="{{ _('e.g. sponsors/logo.png') }}">
</div>
<div class="field">
<label>{{ _('Tier') }}</label>
<select class="input" name="tier">
{% for t in ['directory', 'category'] %}
<option value="{{ t }}" {{ 'selected' if sponsor and sponsor.tier == t }}>{{ t }}</option>
{% endfor %}
</select>
</div>
<div class="field">
<label>{{ _('Category (for category-tier sponsors)') }}</label>
<select class="input" name="category_id">
<option value="">{{ _('None') }}</option>
{% for cat in categories %}
<option value="{{ cat.id }}"
{{ 'selected' if sponsor and sponsor.category_id == cat.id }}>
{{ cat.name }}
</option>
{% endfor %}
</select>
</div>
<div class="field">
<label>{{ _('Starts at (YYYY-MM-DD)') }}</label>
<input class="input" name="starts_at" type="date"
value="{{ sponsor.starts_at.strftime('%Y-%m-%d') if sponsor else '' }}">
</div>
<div class="field">
<label>{{ _('Ends at (YYYY-MM-DD)') }}</label>
<input class="input" name="ends_at" type="date"
value="{{ sponsor.ends_at.strftime('%Y-%m-%d') if sponsor else '' }}">
</div>
<div class="check">
<input type="checkbox" name="is_active" id="is_active"
{{ 'checked' if (not sponsor or sponsor.is_active) }}>
<label for="is_active">{{ _('Active') }}</label>
</div>
<div class="billing-actions">
<button class="btn" type="submit">{{ _('Save') }}</button>
<a class="btn ghost" href="{{ url_for('admin.admin_sponsors') }}">{{ _('Cancel') }}</a>
</div>
</form>
</div>
{% endblock %}