import wagtail_factories

from vbv_lernwelt.learnpath.models import (
    Circle,
    LearningContent,
    LearningPath,
    LearningSequence,
    LearningUnit,
    Topic,
)
from vbv_lernwelt.learnpath.models_learning_unit_content import (
    AssignmentBlock,
    BookBlock,
    DocumentBlock,
    ExerciseBlock,
    LearningModuleBlock,
    MediaLibraryBlock,
    OnlineTrainingBlock,
    PlaceholderBlock,
    ResourceBlock,
    TestBlock,
    VideoBlock,
)


class LearningPathFactory(wagtail_factories.PageFactory):
    title = "Versicherungsvermittler/-in"

    class Meta:
        model = LearningPath


class TopicFactory(wagtail_factories.PageFactory):
    title = "Gewinnen von Kunden"
    is_visible = True

    class Meta:
        model = Topic


class VideoBlockFactory(wagtail_factories.StructBlockFactory):
    url = "https://www.youtube.com/embed/qhPIfxS2hvI"
    description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam"

    class Meta:
        model = VideoBlock


class AssignmentBlockFactory(wagtail_factories.StructBlockFactory):
    description = "Beispiel Auftrag"

    class Meta:
        model = AssignmentBlock


class BookBlockFactory(wagtail_factories.StructBlockFactory):
    description = "Beispiel Buch"

    class Meta:
        model = BookBlock


class DocumentBlockFactory(wagtail_factories.StructBlockFactory):
    description = "Beispiel Dokument"

    class Meta:
        model = DocumentBlock


class PlaceholderBlockFactory(wagtail_factories.StructBlockFactory):
    description = "Platzhalter"

    class Meta:
        model = PlaceholderBlock


class ExerciseBlockFactory(wagtail_factories.StructBlockFactory):
    description = "Beispiel Übung"

    class Meta:
        model = ExerciseBlock


class LearningModuleBlockFactory(wagtail_factories.StructBlockFactory):
    description = "Beispiel Lernmodul"

    class Meta:
        model = LearningModuleBlock


class ResourceBlockFactory(wagtail_factories.StructBlockFactory):
    description = "Beispiel Hilfsmittel"

    class Meta:
        model = ResourceBlock


class OnlineTrainingBlockFactory(wagtail_factories.StructBlockFactory):
    url = "https://s3.eu-central-1.amazonaws.com/myvbv-wbt.iterativ.ch/rise_cmi5_test_export/scormcontent/index.html"
    description = "Beispiel Rise Modul"

    class Meta:
        model = OnlineTrainingBlock


class TestBlockFactory(wagtail_factories.StructBlockFactory):
    description = "Beispiel Test"

    class Meta:
        model = TestBlock


class MediaLibraryBlockFactory(wagtail_factories.StructBlockFactory):
    description = "Sie erreichen die Mediathek mit einem Klick auf den unteren Link"

    class Meta:
        model = MediaLibraryBlock


class CircleFactory(wagtail_factories.PageFactory):
    title = "Analyse"
    description = """
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor.
Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes,
nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu,
pretium quis, sem. Nulla consequat massa quis enim. Donec.
    """.strip()
    job_situation_description = (
        "Du triffst in diesem Circle auf die folgenden berufstypischen Handlungsfelder:"
    )
    job_situations = [("job_situation", f"Job Situation {x + 1}") for x in range(7)]
    goal_description = (
        "In diesem Circle baust du deine Handlungskompetenzen für diese Themen aus:",
    )
    goals = [
        ("goal", f"... hier ein Beispieltext für ein Ziel {x + 1}") for x in range(3)
    ]

    class Meta:
        model = Circle


class LearningSequenceFactory(wagtail_factories.PageFactory):
    title = "Anwenden"
    icon = "it-icon-ls-apply"

    class Meta:
        model = LearningSequence


class LearningUnitFactory(wagtail_factories.PageFactory):
    title = "Fahrzeug"

    class Meta:
        model = LearningUnit


class LearningContentFactory(wagtail_factories.PageFactory):
    title = "Platzhalter Inhalt"
    contents = [("placeholder", PlaceholderBlockFactory())]
    minutes = 15

    class Meta:
        model = LearningContent
