{% extends "admin_base.html" %}
{% block extra_head %}{{ super() }}
<link rel="stylesheet" href="{{ static_url('/static/css/profile.css') }}">
{% endblock %}
{% block admin_content %}
<div class="admin-toolbar">
    <h2>Notification defaults</h2>
</div>
<div class="notif-prefs" data-admin-notif>
    <div class="notif-prefs-intro">
        <p>These are the platform-wide defaults applied to every user who has not customized a notification on their own profile. Changing a default does not override a user's explicit choice.</p>
    </div>
    <table class="notif-prefs-table">
        <thead>
            <tr>
                <th>Notification</th>
                <th class="notif-prefs-col">In-app</th>
                <th class="notif-prefs-col">Push</th>
            </tr>
        </thead>
        <tbody>
            {% for pref in notification_defaults %}
            <tr>
                <td>
                    <span class="notif-prefs-label">{{ pref.label }}</span>
                    <span class="notif-prefs-desc">{{ pref.description }}</span>
                </td>
                <td class="notif-prefs-col">
                    <label class="notif-switch">
                        <input type="checkbox" data-notif-toggle data-type="{{ pref.key }}" data-channel="in_app" {% if pref.in_app %}checked{% endif %}>
                        <span class="notif-switch-track"></span>
                    </label>
                </td>
                <td class="notif-prefs-col">
                    <label class="notif-switch">
                        <input type="checkbox" data-notif-toggle data-type="{{ pref.key }}" data-channel="push" {% if pref.push %}checked{% endif %}>
                        <span class="notif-switch-track"></span>
                    </label>
                </td>
            </tr>
            {% endfor %}
        </tbody>
    </table>
</div>
{% endblock %}
