# illustrations/urls.py
from django.contrib import admin
from django.urls import path
from django.contrib.auth import views as auth_views

from core import views as core_views
from core import views_user_features as feat_views  # NEW

urlpatterns = [
    # Core app
    path("", core_views.search_page, name="search"),
    path("search/", core_views.search_page, name="search"),

    path("entry/new/", core_views.entry_add, name="entry_add"),
    path("entry/<int:entry_id>/", core_views.entry_view, name="entry_view"),
    path("entry/<int:entry_id>/edit/", core_views.entry_edit, name="entry_edit"),
    path("entry/<int:entry_id>/delete/", core_views.entry_delete, name="entry_delete"),

    path("nav/next/", core_views.nav_next, name="nav_next"),
    path("nav/prev/", core_views.nav_prev, name="nav_prev"),

    path("stats/", core_views.stats_page, name="stats"),

    # Tools already in your project
    path("tools/normalize-scripture/", core_views.normalize_scripture, name="normalize_scripture"),
    path("tools/normalize-source/", core_views.normalize_source, name="normalize_source"),
    path("tools/normalize-subjects/", core_views.normalize_subjects, name="normalize_subjects"),

    # Export/Import/etc (keep what you use)
    path("export/", core_views.export_csv, name="export_csv"),
    # path("import/", core_views.import_wizard, name="import_wizard"),  # if you expose it

    # Auth
    path("login/", core_views.login_view, name="login"),
    path("logout/", auth_views.LogoutView.as_view(next_page="/login/"), name="logout"),

    # --- NEW: per-user features APIs ---
    path("api/set-font-size/", feat_views.api_set_font_size, name="api_set_font_size"),
    path("api/get-prefs/", feat_views.api_get_prefs, name="api_get_prefs"),
    path("api/log-search/", feat_views.api_log_search, name="api_log_search"),
    path("api/get-search-history/", feat_views.api_get_search_history, name="api_get_search_history"),
    path("api/log-view/<int:entry_id>/", feat_views.api_log_view, name="api_log_view"),
    path("api/get-recent-views/", feat_views.api_get_recent_views, name="api_get_recent_views"),
    path("settings/", core_views.settings_home, name="settings_home"),
]