from django.urls import path

from vuln_demo.apps.vulnerabilities.levels.level5 import answer_file, funny_cat_image, htaccess_file, path_index

from .levels.level4 import db_leak
from .views import level_completed_view, level_hint_view, level_view, vulnerabilities_index

urlpatterns = [
    path("", vulnerabilities_index, name="vulnerabilities"),
    path("level/<int:level_num>", level_view, name="vulnerabilities/level"),
    path("level/<int:level_num>/hint/<int:hint_num>", level_hint_view, name="vulnerabilities/level/hint"),
    path("level/<int:level_num>/completed", level_completed_view, name="vulnerabilities/level/completed"),
    # level-specific URLs
    path("level/4/db_leak", db_leak, name="vulnerabilities/level4/db_leak"),
    path("level/5/static", path_index, name="vulnerabilities/level5/path_index_static"),
    path("level/5/static/config", path_index, name="vulnerabilities/level5/path_index_static_config"),
    path("level/5/static/images", path_index, name="vulnerabilities/level5/path_index_static_images"),
    path("level/5/static/config/.htaccess", htaccess_file, name="vulnerabilities/level5/path_index_htaccess"),
    path("level/5/static/config/password.txt", answer_file, name="vulnerabilities/level5/path_index_password"),
    path(
        "level/5/static/images/funny_cat.jpg",
        funny_cat_image,
        name="vulnerabilities/level5/path_index_static_images_funny_cat",
    ),
]
