Files
westfarn 531d97f3fc
Unit Tests / test (push) Successful in 5s
Admin paid indicator, CSV year filter, and payment email search (#30) (#31)
## Summary
Closes #30.

- Green check (“Paid this year”) on membership list, person list, and person inline when `Payments.email` matches `MembershipPerson.email` (case-insensitive) for the current calendar year. Also matches via the payment’s person FK.
- CSV downloads for payments, memberships by person, and memberships by address prompt for a year (default current year, or All years). Payments filter by payment date; memberships filter by record created year. Changelists also get a year sidebar filter.
- Payments admin remains searchable by email.

## Test plan
- [ ] `uv run python manage.py test`
- [ ] In admin, open Memberships / Membership people and confirm a green check when a same-year payment email matches, and a red X otherwise
- [ ] Select memberships → Download CSV by member/address → pick a year → confirm only that year is in the file
- [ ] Select payments → Download payments CSV → pick a year → confirm filter
- [ ] On Payments, search by email and filter by year

Reviewed-on: #31
2026-09-03 13:51:09 -07:00

30 lines
1.1 KiB
HTML

{% extends "admin/base_site.html" %}
{% load i18n %}
{% block content %}
<form action="" method="post">{% csrf_token %}
<p>{{ help_text }}</p>
<fieldset class="module aligned">
<div class="form-row">
<label for="id_year">Year:</label>
<select name="year" id="id_year">
<option value="all">All years</option>
{% for year in years %}
<option value="{{ year }}"{% if year == default_year %} selected{% endif %}>{{ year }}</option>
{% endfor %}
</select>
</div>
</fieldset>
{% for selected_id in selected_ids %}
<input type="hidden" name="_selected_action" value="{{ selected_id }}">
{% endfor %}
<input type="hidden" name="action" value="{{ action_name }}">
<input type="hidden" name="select_across" value="{{ select_across }}">
<input type="hidden" name="index" value="{{ index }}">
<div class="submit-row">
<input type="submit" name="apply" class="default" value="Download CSV">
<a href="{{ changelist_url }}" class="button cancel-link">{% translate "Cancel" %}</a>
</div>
</form>
{% endblock %}