{% extends "dashboard_base.html" %} {% block title %}{{ t("admin-page-title") }} — calrs{% endblock %} {% block dashboard_content %}

{{ t("admin-heading") }}

{% if error_message %}
{{ t("admin-action-refused") }} {{ error_message }}
{% endif %}

{{ t("admin-logo") }}

{{ t("admin-logo-help") }}

{% if has_logo %}
{{ t('admin-logo') }}
{% endif %}
{% if has_logo %}
{% endif %}
{{ t("admin-company-link-help") }}

{{ t("admin-theme") }}

{{ t("admin-theme-help") }}

{% set themes = [ {"id": "default", "label": t("admin-theme-default"), "desc": t("admin-theme-default-desc"), "colors": ["#2563eb", "#eff6ff", "#f4f4f5", "#18181b"]}, {"id": "nord", "label": "Nord", "desc": t("admin-theme-nord-desc"), "colors": ["#5e81ac", "#e8eef5", "#eceff4", "#2e3440"]}, {"id": "dracula", "label": "Dracula", "desc": t("admin-theme-dracula-desc"), "colors": ["#bd93f9", "#f3eefe", "#f0edf5", "#282a36"]}, {"id": "gruvbox", "label": "Gruvbox", "desc": t("admin-theme-gruvbox-desc"), "colors": ["#d65d0e", "#fabd2f", "#f9f5d7", "#282828"]}, {"id": "solarized", "label": "Solarized", "desc": t("admin-theme-solarized-desc"), "colors": ["#268bd2", "#859900", "#fdf6e3", "#002b36"]}, {"id": "tokyo-night", "label": "Tokyo Night", "desc": t("admin-theme-tokyo-desc"), "colors": ["#7a5af5", "#7aa2f7", "#f0f0f5", "#1a1b26"]}, {"id": "vates", "label": "Vates", "desc": "Rouge & Bleu Spatial", "colors": ["#be1621", "#ef7f18", "#1a1b38", "#2ca878"]}, {"id": "custom", "label": t("admin-theme-custom"), "desc": t("admin-theme-custom-desc"), "colors": []} ] %} {% for t in themes %} {% endfor %}
{{ t("admin-custom-colors") }}

{{ t("admin-users", count=user_count) }}

{% if users %}
{% for u in users %}
{{ u.name }} {{ u.email }} {% if u.role == "admin" %}{{ t("admin-badge-admin") }}{% endif %} {% if not u.enabled %}{{ t("admin-badge-disabled") }}{% endif %} {{ u.auth_provider }}
{% if u.groups %}
{% for g in u.groups %} {{ g }} {% endfor %}
{% endif %}
{% if u.id != current_user_id %} {% else %}
{{ t("team-form-you") }}
{% endif %}
{% endfor %}
{% else %}

{{ t("admin-no-users") }}

{% endif %}

{{ t("admin-groups", count=group_count) }}

{% if groups %}
{% for g in groups %} {% endfor %}
{{ t("admin-group-name") }} {{ t("team-form-members") }}
{{ g.name }} {% if g.members %}
{% for m in g.members %}
5 %} class="group-member-extra" data-group="{{ g.id }}" style="display: none; align-items: center; gap: 0.5rem;"{% else %} style="display: flex; align-items: center; gap: 0.5rem;"{% endif %}> {{ m.name }}
{% endfor %} {% if g.members | length > 5 %} {% endif %}
{% else %} {{ g.member_count }} {% endif %}
{% else %}

{{ t("admin-no-groups") }}

{% endif %}

{{ t("admin-auth-settings") }}

{{ t("admin-system-settings") }}

{{ t("admin-system-settings-help") | safe }}

{{ t("admin-base-url-help") }} {% if base_url_from_env %}{{ t("admin-unset-env") }}{% endif %}
{{ t("admin-private-hosts-help") }} {% if allow_private_hosts_from_env %}{{ t("admin-unset-env") }}{% endif %}

{{ t("admin-oidc-settings") }}

{{ t("admin-status") }} {% if oidc_enabled %}{{ t("admin-status-enabled") }}{% else %}{{ t("admin-status-disabled") }}{% endif %} {% if oidc_issuer_url %}· {{ t("admin-issuer") }} {{ oidc_issuer_url }}{% endif %} {% if oidc_client_id %}· {{ t("admin-client-id") }} {{ oidc_client_id }}{% endif %}

{{ t("admin-google") }}

{{ t("admin-status") }} {% if google_oauth2_configured %}{{ t("admin-status-configured") }}{% else %}{{ t("admin-status-not-configured") }}{% endif %} {% if google_oauth2_client_id %}· {{ t("admin-client-id") }} {{ google_oauth2_client_id }}{% endif %}

{{ t("admin-google-help", redirect_uri='' ~ (base_url | escape) ~ '/dashboard/sources/google/callback') | safe }}

{{ t("admin-captcha") }}

{{ t("admin-status") }} {% if captcha_configured %}{{ t("admin-status-enabled") }}{% else %}{{ t("admin-status-disabled") }}{% endif %} {% if captcha_instance_url %}· {{ t("admin-instance") }} {{ captcha_instance_url }}{% endif %}
{{ t("admin-widget-url-help") }}

{{ t("admin-captcha-disable-help") }}

{{ t("admin-resources") }}

{{ t("admin-resources-help") }}

{% if resource_notice %}

{{ resource_notice }}

{% endif %} {% if resource_error %}

{{ resource_error }}

{% endif %} {% if resources %}
{% for r in resources %}
{{ r.name }}
{{ r.feed_url }}
{{ t("admin-resource-stats", events=r.event_count, attached=r.attached_count) }} · {{ t("sources-last-sync") }} {% if r.last_synced_at %}{{ r.last_synced_at }}{% else %}{{ t("admin-never") }}{% endif %}{% if r.last_sync_error %} {{ t("admin-resource-sync-failed", error=r.last_sync_error) }}{% endif %}
{% if r.write_configured %}{{ t("admin-writeback-enabled", via=r.write_via) }}{% else %}{{ t("admin-writeback-readonly") }}{% endif %}
{{ t("admin-teams-allowed") }} {% if r.allowed_team_names %}{{ r.allowed_team_names }}{% else %}{{ t("admin-teams-allowed-none") }}{% endif %}
{% if r.write_configured %}
{% endif %}
{{ t("sources-edit") }}
{{ t("admin-caldav-url-help") }}
{% if resource_teams_all %} {% set allowed_padded = "," ~ r.allowed_team_ids ~ "," %}
{% for t in resource_teams_all %} {% endfor %}
{{ t("admin-resource-teams-help") }} {% else %} {{ t("admin-no-teams") }} {% endif %}
{% endfor %}
{% endif %}

{{ t("admin-add-resource") }}

{{ t("admin-feed-url-help") }}
{{ t("admin-name-help") }}
{{ t("admin-caldav-url-help") }}
{% if resource_teams_all %}
{% for t in resource_teams_all %} {% endfor %}
{{ t("admin-resource-teams-help") }} {% else %} {{ t("admin-no-teams") }} {% endif %}

{{ t("admin-jitsi") }}

{{ t("admin-status") }} {% if jitsi_configured %}{{ t("admin-status-enabled") }}{% else %}{{ t("admin-status-disabled") }}{% endif %} {% if jitsi_base_url %}· {{ t("admin-base-url") }}: {{ jitsi_base_url }}{% endif %}

{{ t("admin-jitsi-help") }}

{{ t("admin-jitsi-display-name-help") }}
{{ t("admin-room-pattern-help", default='' ~ (jitsi_default_pattern | escape) ~ '') | safe }}

{{ t("admin-jitsi-disable-help") }}

{{ t("admin-meeting-webhook") }}

{{ t("admin-status") }} {% if meeting_webhook_configured %}{{ t("admin-status-enabled") }}{% else %}{{ t("admin-status-disabled") }}{% endif %} {% if meeting_webhook_url %}· URL: {{ meeting_webhook_url }}{% endif %}

{{ t("admin-meeting-webhook-help") | safe }}

{{ t("admin-webhook-display-name-help") }}
{{ t("admin-auth-hmac-help") | safe }}

{{ t("admin-webhook-disable-help") }}

{{ t("admin-smtp") }}

{% if smtp_test_result == "sent" %}

✓ {{ t("admin-smtp-test-sent") }}

{% elif smtp_test_result == "error" %}

✗ {{ t("admin-smtp-test-failed") }}

{% endif %} {% if smtp_error %}

{{ t("admin-smtp-env-error") }} {{ smtp_error }}

{{ t("admin-smtp-env-error-help") | safe }}

{% elif smtp_from_env %}
{{ t("admin-smtp-env-managed") | safe }}
{{ t("admin-status") }} {{ t("admin-status-configured") }}{% if not smtp_enabled %} {{ t("admin-status-disabled-paren") }}{% endif %} {{ t("admin-via-environment") }}
{{ t("admin-smtp-host") }} {{ smtp_host }}:{{ smtp_port }} ({{ smtp_tls_mode }})
{{ t("admin-smtp-from") }} {% if smtp_from_name %}{{ smtp_from_name }} {% endif %}<{{ smtp_from_email }}>
{% else %}
{{ t("admin-status") }} {% if smtp_configured %}{{ t("admin-status-configured") }}{% if not smtp_enabled %} {{ t("admin-status-disabled-paren") }}{% endif %}{% else %}{{ t("admin-status-not-configured") }}{% endif %}

{{ t("admin-tls-none-warning") | safe }}

{% if smtp_configured %}
{% endif %}

{{ t("admin-smtp-env-help") | safe }}

{% endif %}

{{ t("admin-sms") }}

{{ t("admin-sms-help") }}

{% if sms_test_result == "sent" %}

✓ {{ sms_test_detail or t("admin-sms-test-sent") }}

{% elif sms_test_result == "checked" %}

✓ {{ sms_test_detail or t("admin-sms-test-checked") }}

{% elif sms_test_result == "error" %}

✗ {{ sms_test_detail or t("admin-sms-test-error") }}

{% endif %} {% if sms_trial_mode %}

{{ t("admin-sms-trial-warning") | safe }}

{% endif %} {% if sms_configured and not captcha_configured %}

{{ t("admin-sms-captcha-warning") }}

{% endif %} {% if sms_configured %}
{{ t("admin-sms-sent-today") }} {{ sms_sent_today }}{% if sms_daily_cap > 0 %} {{ t("admin-sms-of-cap", cap=sms_daily_cap) }}{% endif %}{% if sms_cost_currency %} · {{ sms_cost_today }} {{ sms_cost_currency }}{% endif %}
{% endif %} {% if sms_error %}

{{ t("admin-sms-config-error") }} {{ sms_error }}

{{ t("admin-sms-env-error-help") | safe }}

{% elif sms_from_env %}
{{ t("admin-sms-env-managed") | safe }}
{{ t("admin-status") }} {{ t("admin-status-configured") }} {{ t("admin-via-environment") }}
{{ t("admin-sms-gateway") }} {{ sms_provider }}
{% if sms_api_key %}
{{ t("admin-sms-account") }} {{ sms_api_key }}
{% endif %}
{{ t("admin-sms-sender") }} {{ sms_sender }}
{% else %}
{{ t("admin-status") }} {% if sms_configured %}{{ t("admin-status-configured") }}{% if not sms_enabled %} {{ t("admin-status-disabled-paren") }}{% endif %}{% else %}{{ t("admin-status-not-configured") }}{% endif %}
{# One block per gateway, all rendered from the provider registry and toggled client-side. The labels differ per gateway ("Account SID" vs "API token"), so adding a gateway in src/sms/factory.rs is enough. #} {% for p in sms_providers %}
{% if p.api_key_label %}
{% endif %}
{% if p.base_url_label %}
{% endif %} {% if p.docs_url %}

{{ t("admin-sms-docs", provider=p.label) }}

{% endif %}
{% endfor %}
{{ t("admin-sms-daily-cap-help") }}
{% if sms_configured %}
{% endif %}

{{ t("admin-sms-env-help") | safe }}

{% endif %} {# Instance policy, not gateway config, so it stays editable even when the environment block governs the gateway. #}
{{ t("admin-sms-allow-all-help") }}

{{ t("admin-sms-going-live") | safe }}

{% endblock dashboard_content %}