exercise_tree, exercise_type list modifications
This commit is contained in:
parent
78761b816a
commit
6b82bdbf59
@ -33,7 +33,7 @@ class TranslationInline(admin.TabularInline):
|
||||
|
||||
|
||||
class ExerciseTypeAdmin(admin.ModelAdmin):
|
||||
list_display = ('name_colored', 'active')
|
||||
list_display = ('exercise_type_id', 'tree', 'name_colored', 'active')
|
||||
search_fields = ['name']
|
||||
|
||||
def name_colored(self, obj):
|
||||
@ -60,7 +60,7 @@ class TranslationTreeInline(admin.TabularInline):
|
||||
|
||||
|
||||
class ExerciseTreeAdmin(admin.ModelAdmin):
|
||||
list_display = ('name_colored', 'active')
|
||||
list_display = ('tree_id', 'name_colored', 'parent_id', 'active')
|
||||
search_fields = ['name']
|
||||
|
||||
fields = ["name", "parent_id", "image_url", "active", "get_image_preview"]
|
||||
@ -76,7 +76,10 @@ class ExerciseTreeAdmin(admin.ModelAdmin):
|
||||
|
||||
def name_colored(self, obj):
|
||||
if obj.active:
|
||||
color_code = '7bc863'
|
||||
if obj.image_url != "":
|
||||
color_code = '7bc863'
|
||||
else:
|
||||
color_code = 'f2cdb3'
|
||||
else:
|
||||
color_code = 'C20000'
|
||||
html = '<span style="color: #{};">{}</span>˓→'.format(color_code, obj.name)
|
||||
|
Loading…
Reference in New Issue
Block a user