|
| 1 | +{% extends "sponsors/manage/_base.html" %} |
| 2 | + |
| 3 | +{% block page_title %}Sponsors | Sponsor Management{% endblock %} |
| 4 | + |
| 5 | +{% with active_tab="more" %} |
| 6 | + |
| 7 | +{% block manage_breadcrumbs %} |
| 8 | +<div class="manage-crumbs"> |
| 9 | + <a href="{% url 'manage_dashboard' %}">Dashboard</a> |
| 10 | + <span class="sep">/</span> |
| 11 | + <span class="current">Sponsors</span> |
| 12 | +</div> |
| 13 | +{% endblock %} |
| 14 | + |
| 15 | +{% block topbar_actions %} |
| 16 | + <a href="{% url 'manage_sponsor_create' %}" class="btn btn-sm btn-primary">+ New Sponsor</a> |
| 17 | +{% endblock %} |
| 18 | + |
| 19 | +{% block manage_content %} |
| 20 | + <!-- Search bar --> |
| 21 | + <div class="manage-filter-bar" style="padding:12px 20px;"> |
| 22 | + <form method="get" style="display:flex;gap:10px;align-items:flex-end;flex-wrap:wrap;"> |
| 23 | + <div class="filter-field"> |
| 24 | + <input type="text" name="search" placeholder="Search by name..." value="{{ filter_search }}" style="width:240px;" autofocus> |
| 25 | + </div> |
| 26 | + <div class="filter-actions"> |
| 27 | + <button type="submit" class="btn btn-sm btn-secondary">Search</button> |
| 28 | + {% if filter_search %} |
| 29 | + <a href="{% url 'manage_sponsors' %}" class="btn btn-sm btn-secondary">Clear</a> |
| 30 | + {% endif %} |
| 31 | + </div> |
| 32 | + <div style="margin-left:auto;font-size:12px;color:#777;"> |
| 33 | + {{ page_obj.paginator.count }} sponsor{{ page_obj.paginator.count|pluralize }} |
| 34 | + </div> |
| 35 | + </form> |
| 36 | + </div> |
| 37 | + |
| 38 | + {% if sponsors %} |
| 39 | + <table class="manage-table"> |
| 40 | + <thead> |
| 41 | + <tr> |
| 42 | + <th>Company</th> |
| 43 | + <th>Location</th> |
| 44 | + <th style="text-align:center;">Contacts</th> |
| 45 | + <th style="text-align:center;">Sponsorships</th> |
| 46 | + <th>Website</th> |
| 47 | + <th style="width:140px;text-align:right;">Actions</th> |
| 48 | + </tr> |
| 49 | + </thead> |
| 50 | + <tbody> |
| 51 | + {% for sponsor in sponsors %} |
| 52 | + <tr> |
| 53 | + <td> |
| 54 | + <a href="{% url 'manage_sponsor_edit' sponsor.pk %}" style="font-weight:600;color:#1a1a2e;text-decoration:none;"> |
| 55 | + {{ sponsor.name }} |
| 56 | + </a> |
| 57 | + </td> |
| 58 | + <td style="font-size:12px;color:#777;"> |
| 59 | + {% if sponsor.city %}{{ sponsor.city }}{% endif %}{% if sponsor.city and sponsor.country %}, {% endif %}{% if sponsor.country %}{{ sponsor.country }}{% endif %} |
| 60 | + </td> |
| 61 | + <td style="text-align:center;"> |
| 62 | + {% if sponsor.contact_count %} |
| 63 | + <span class="tag tag-blue" style="font-size:10px;">{{ sponsor.contact_count }}</span> |
| 64 | + {% else %} |
| 65 | + <span style="color:#ccc;">—</span> |
| 66 | + {% endif %} |
| 67 | + </td> |
| 68 | + <td style="text-align:center;"> |
| 69 | + {% if sponsor.sponsorship_count %} |
| 70 | + <a href="{% url 'manage_sponsorships' %}?search={{ sponsor.name|urlencode }}" class="tag tag-green" style="font-size:10px;text-decoration:none;">{{ sponsor.sponsorship_count }}</a> |
| 71 | + {% else %} |
| 72 | + <span style="color:#ccc;">—</span> |
| 73 | + {% endif %} |
| 74 | + </td> |
| 75 | + <td style="font-size:12px;"> |
| 76 | + {% if sponsor.landing_page_url %} |
| 77 | + <a href="{{ sponsor.landing_page_url }}" target="_blank" style="color:#3776ab;text-decoration:none;">{{ sponsor.landing_page_url|truncatechars:30 }}</a> |
| 78 | + {% else %} |
| 79 | + <span style="color:#ccc;">—</span> |
| 80 | + {% endif %} |
| 81 | + </td> |
| 82 | + <td style="text-align:right;"> |
| 83 | + <a href="{% url 'manage_sponsor_edit' sponsor.pk %}" style="font-size:12px;color:#3776ab;text-decoration:none;margin-right:8px;">Edit</a> |
| 84 | + <a href="{% url 'manage_composer' %}?new=1&sponsor_id={{ sponsor.pk }}" style="font-size:12px;color:#3776ab;text-decoration:none;">+ Sponsorship</a> |
| 85 | + </td> |
| 86 | + </tr> |
| 87 | + {% endfor %} |
| 88 | + </tbody> |
| 89 | + </table> |
| 90 | + |
| 91 | + {% if is_paginated %} |
| 92 | + <div style="display:flex;justify-content:center;gap:4px;margin-top:20px;"> |
| 93 | + {% if page_obj.has_previous %} |
| 94 | + <a href="?page={{ page_obj.previous_page_number }}{% if filter_search %}&search={{ filter_search }}{% endif %}" class="btn btn-sm btn-secondary">← Prev</a> |
| 95 | + {% endif %} |
| 96 | + <span style="padding:6px 12px;font-size:13px;color:#555;">{{ page_obj.number }} / {{ page_obj.paginator.num_pages }}</span> |
| 97 | + {% if page_obj.has_next %} |
| 98 | + <a href="?page={{ page_obj.next_page_number }}{% if filter_search %}&search={{ filter_search }}{% endif %}" class="btn btn-sm btn-secondary">Next →</a> |
| 99 | + {% endif %} |
| 100 | + </div> |
| 101 | + {% endif %} |
| 102 | + |
| 103 | + {% else %} |
| 104 | + <div class="empty-state"> |
| 105 | + <div class="empty-icon">🏢</div> |
| 106 | + <p>{% if filter_search %}No sponsors match "{{ filter_search }}"{% else %}No sponsors found{% endif %}</p> |
| 107 | + </div> |
| 108 | + {% endif %} |
| 109 | +{% endblock %} |
| 110 | + |
| 111 | +{% endwith %} |
0 commit comments