Commit be68cbd0 authored by Matheus Miranda's avatar Matheus Miranda
Browse files

Add CourseTrack admin

parent b3de967e
......@@ -7,8 +7,8 @@ from .videos.models import Video
from .models import (
Course, Lesson, Unit, CourseProfessor, CourseStudent,
StudentProgress, Class,
ProfessorMessage,
CourseAuthor,
ProfessorMessage, CourseAuthor,
CourseCategory, CourseTrack,
)
from .course_material.models import CourseMaterial, File
......@@ -36,6 +36,14 @@ class CourseAdmin(admin.ModelAdmin):
]
@admin.register(CourseTrack)
class CourseTrackAdmin(admin.ModelAdmin):
list_display = ('name', 'home_position')
filter_horizontal = [
'courses',
]
class UnitInline(admin.TabularInline):
model = Unit
fields = ('title', 'video', 'position',)
......@@ -151,3 +159,5 @@ class ClassroomAdmin(admin.ModelAdmin):
'group__name',
'assistants__name',
)
admin.site.register(CourseCategory)
......@@ -35,10 +35,15 @@ class CourseCategory(models.Model):
color = models.CharField(_("color"), max_length=7, blank=True,
help_text=_("Title color in hex format (i.e: #1aafd0)."))
class Meta:
verbose_name = _('Course Category')
verbose_name_plural = _('Course Categories')
def __str__(self):
return self.name
class Course(models.Model):
STATES = (
('draft', _('Draft')),
......@@ -343,6 +348,10 @@ class CourseTrack(models.Model):
verbose_name='courses',
blank=True,
)
home_position = models.IntegerField(
null=True,
blank=True,
)
class Meta:
verbose_name = _('Course Track')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment