BO 1.25 App Texts + picture
This commit is contained in:
parent
925c35f329
commit
3bef573f82
@ -13,11 +13,11 @@ class TranslationAppTextInline(admin.TabularInline):
|
|||||||
|
|
||||||
class AppTextAdmin(admin.ModelAdmin):
|
class AppTextAdmin(admin.ModelAdmin):
|
||||||
list_display = ('text_key','checked')
|
list_display = ('text_key','checked')
|
||||||
fields = ('text_key','screenshot_url', 'checked')
|
fields = ('text_key','screenshot_url', 'checked', "get_image_preview")
|
||||||
readonly_fields = ("get_image_preview",)
|
readonly_fields = ("get_image_preview",)
|
||||||
|
|
||||||
def get_image_preview(self, obj):
|
def get_image_preview(self, obj):
|
||||||
screenshot_url = '/media/' + str(obj.url)
|
screenshot_url = '/media/' + str(obj.screenshot_url)
|
||||||
if obj.pk:
|
if obj.pk:
|
||||||
return format_html('<img src="{url}" title="{url}" width="30%" height="30%"/> ' \
|
return format_html('<img src="{url}" title="{url}" width="30%" height="30%"/> ' \
|
||||||
.format(url=screenshot_url))
|
.format(url=screenshot_url))
|
||||||
|
Loading…
Reference in New Issue
Block a user