|
|
@ -32,6 +32,7 @@ class QuizQuestionInline(StackedInline): |
|
|
@admin.register(Course) |
|
|
@admin.register(Course) |
|
|
class CourseAdmin(ModelAdmin): |
|
|
class CourseAdmin(ModelAdmin): |
|
|
list_display = ('title', 'category', 'language', 'level', 'instructor_name', 'is_published', 'is_featured', 'created_at') |
|
|
list_display = ('title', 'category', 'language', 'level', 'instructor_name', 'is_published', 'is_featured', 'created_at') |
|
|
|
|
|
list_display_links = ('title', 'category', 'instructor_name') |
|
|
list_filter = ('category', 'language', 'level', 'is_published', 'is_featured') |
|
|
list_filter = ('category', 'language', 'level', 'is_published', 'is_featured') |
|
|
search_fields = ('title', 'description', 'instructor_name', 'organization_name') |
|
|
search_fields = ('title', 'description', 'instructor_name', 'organization_name') |
|
|
prepopulated_fields = {'slug': ('title',)} |
|
|
prepopulated_fields = {'slug': ('title',)} |
|
|
@ -41,6 +42,7 @@ class CourseAdmin(ModelAdmin): |
|
|
@admin.register(CourseModule) |
|
|
@admin.register(CourseModule) |
|
|
class CourseModuleAdmin(ModelAdmin): |
|
|
class CourseModuleAdmin(ModelAdmin): |
|
|
list_display = ('title', 'course', 'order', 'created_at') |
|
|
list_display = ('title', 'course', 'order', 'created_at') |
|
|
|
|
|
list_display_links = ('title', 'course') |
|
|
list_filter = ('course',) |
|
|
list_filter = ('course',) |
|
|
search_fields = ('title', 'description', 'course__title') |
|
|
search_fields = ('title', 'description', 'course__title') |
|
|
inlines = [LessonInline] |
|
|
inlines = [LessonInline] |
|
|
@ -49,6 +51,7 @@ class CourseModuleAdmin(ModelAdmin): |
|
|
@admin.register(Lesson) |
|
|
@admin.register(Lesson) |
|
|
class LessonAdmin(ModelAdmin): |
|
|
class LessonAdmin(ModelAdmin): |
|
|
list_display = ('title', 'module', 'lesson_type', 'duration_minutes', 'order', 'is_preview') |
|
|
list_display = ('title', 'module', 'lesson_type', 'duration_minutes', 'order', 'is_preview') |
|
|
|
|
|
list_display_links = ('title', 'module') |
|
|
list_filter = ('lesson_type', 'is_preview', 'module__course') |
|
|
list_filter = ('lesson_type', 'is_preview', 'module__course') |
|
|
search_fields = ('title', 'content', 'module__title', 'module__course__title') |
|
|
search_fields = ('title', 'content', 'module__title', 'module__course__title') |
|
|
inlines = [QuizQuestionInline] |
|
|
inlines = [QuizQuestionInline] |
|
|
@ -57,6 +60,7 @@ class LessonAdmin(ModelAdmin): |
|
|
@admin.register(QuizQuestion) |
|
|
@admin.register(QuizQuestion) |
|
|
class QuizQuestionAdmin(ModelAdmin): |
|
|
class QuizQuestionAdmin(ModelAdmin): |
|
|
list_display = ('question_text', 'lesson', 'correct_option_index', 'order') |
|
|
list_display = ('question_text', 'lesson', 'correct_option_index', 'order') |
|
|
|
|
|
list_display_links = ('question_text', 'lesson') |
|
|
list_filter = ('lesson__module__course',) |
|
|
list_filter = ('lesson__module__course',) |
|
|
search_fields = ('question_text', 'explanation', 'lesson__title') |
|
|
search_fields = ('question_text', 'explanation', 'lesson__title') |
|
|
|
|
|
|
|
|
@ -64,6 +68,7 @@ class QuizQuestionAdmin(ModelAdmin): |
|
|
@admin.register(CourseEnrollment) |
|
|
@admin.register(CourseEnrollment) |
|
|
class CourseEnrollmentAdmin(ModelAdmin): |
|
|
class CourseEnrollmentAdmin(ModelAdmin): |
|
|
list_display = ('user', 'course', 'progress_percentage', 'enrolled_at', 'completed_at') |
|
|
list_display = ('user', 'course', 'progress_percentage', 'enrolled_at', 'completed_at') |
|
|
|
|
|
list_display_links = ('user', 'course') |
|
|
list_filter = ('course', 'progress_percentage') |
|
|
list_filter = ('course', 'progress_percentage') |
|
|
search_fields = ('user__email', 'user__fullname', 'course__title') |
|
|
search_fields = ('user__email', 'user__fullname', 'course__title') |
|
|
|
|
|
|
|
|
@ -71,6 +76,7 @@ class CourseEnrollmentAdmin(ModelAdmin): |
|
|
@admin.register(LessonProgress) |
|
|
@admin.register(LessonProgress) |
|
|
class LessonProgressAdmin(ModelAdmin): |
|
|
class LessonProgressAdmin(ModelAdmin): |
|
|
list_display = ('user', 'lesson', 'is_completed', 'quiz_score', 'completed_at') |
|
|
list_display = ('user', 'lesson', 'is_completed', 'quiz_score', 'completed_at') |
|
|
|
|
|
list_display_links = ('user', 'lesson') |
|
|
list_filter = ('is_completed', 'lesson__module__course') |
|
|
list_filter = ('is_completed', 'lesson__module__course') |
|
|
search_fields = ('user__email', 'user__fullname', 'lesson__title') |
|
|
search_fields = ('user__email', 'user__fullname', 'lesson__title') |
|
|
|
|
|
|
|
|
@ -78,6 +84,7 @@ class LessonProgressAdmin(ModelAdmin): |
|
|
@admin.register(DigitalCertificate) |
|
|
@admin.register(DigitalCertificate) |
|
|
class DigitalCertificateAdmin(ModelAdmin): |
|
|
class DigitalCertificateAdmin(ModelAdmin): |
|
|
list_display = ('certificate_code', 'user', 'course', 'issue_date', 'final_score', 'is_revoked') |
|
|
list_display = ('certificate_code', 'user', 'course', 'issue_date', 'final_score', 'is_revoked') |
|
|
|
|
|
list_display_links = ('certificate_code', 'user', 'course') |
|
|
list_filter = ('is_revoked', 'issue_date', 'course') |
|
|
list_filter = ('is_revoked', 'issue_date', 'course') |
|
|
search_fields = ('certificate_code', 'user__email', 'user__fullname', 'course__title') |
|
|
search_fields = ('certificate_code', 'user__email', 'user__fullname', 'course__title') |
|
|
readonly_fields = ('uuid', 'created_at') |
|
|
readonly_fields = ('uuid', 'created_at') |