增加管理员中的django-filer预览/缩略图图像

问题描述 投票:3回答:2

由django-filer(或easy_thumbnails?)生成的图像非常小,以至于我很难识别预览图像。如何在管理员概述中增加预览/缩略图大小?

enter image description here

django django-admin thumbnails django-filer
2个回答
2
投票

遗憾的是,无法配置管理员在当前版本(2017年3月1日发布的1.2.7)中显示的缩略图的大小。

作为临时解决方法,您可以覆盖项目中的https://github.com/divio/django-filer/blob/1.2.7/filer/templates/admin/filer/folder/directory_table.html模板,并用file.icons.48替换file.icons.64的所有出现。如果你想要一个不同的大小,你还必须设置FILER_ADMIN_ICON_SIZES设置(它默认为('16', '32', '48', '64')

这有一个缺点,你必须检查是否需要为每个新版本的django-filer更改被覆盖的模板。

添加此功能的拉取请求将非常受欢迎。


0
投票

在Django Filer 1.3.0(2017-11-02)中:

如果将alle file.icons.48更改为file.icons.64,则仅更改加载图像的大小。

要更改图像的显示大小,您需要更改https://github.com/divio/django-filer/blob/develop/filer/static/filer/css/admin_filer.css

.filebrowser .navigator-table .column-icon{width:25px;padding-top:0 !important;padding-bottom:0 !important}

.filebrowser .navigator-table .column-icon img{width:25px;height:auto}

相应地为48px或64px。

© www.soinside.com 2019 - 2024. All rights reserved.