feat(pages.py): add per-lesson repo fields
This commit is contained in:
@@ -164,6 +164,15 @@ class CourseModulePage(Page):
|
||||
|
||||
class ModuleLessonPage(Page):
|
||||
body = RichTextField(blank=True)
|
||||
create_gitea_repo = models.BooleanField(
|
||||
default=False,
|
||||
help_text="If enabled, a Gitea repository will be automatically created for this module when the module is published.",
|
||||
)
|
||||
gitea_repo_url = models.URLField(
|
||||
null=True,
|
||||
blank=True,
|
||||
help_text="URL of the Gitea repository for this lesson (auto-generated if 'create_gitea_repo' is enabled)",
|
||||
)
|
||||
|
||||
@property
|
||||
def module(self):
|
||||
@@ -180,7 +189,15 @@ class ModuleLessonPage(Page):
|
||||
return f"{module.full_title} - {self.title}"
|
||||
return self.title
|
||||
|
||||
content_panels = Page.content_panels + ["body"]
|
||||
content_panels = Page.content_panels + [
|
||||
FieldPanel("body"),
|
||||
FieldPanel("create_gitea_repo"),
|
||||
FieldPanel(
|
||||
"gitea_repo_url",
|
||||
read_only=True,
|
||||
heading="Gitea Repository URL (auto-generated if 'create_gitea_repo' is enabled)",
|
||||
),
|
||||
]
|
||||
parent_page_types = ["home.CourseModulePage"]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user