2

我正在开发 FITMAN Smart-Factory 试用版 5 演示 ( http://www.fitman-fi.eu/ ),我需要自定义 WireCloud 徽标图标以将它们更改为工厂图标。

有没有关于如何做到这一点的文档?

4

2 回答 2

1

目前最好的方法是使用 STATICFILES_DIRS 和 STATICFILES_FINDERS 设置来覆盖当前主题中的某些文件。例如,如果您使用默认配置,则可以将以下行添加到您的 settings.py 文件中:

STATICFILES_FINDERS = ('django.contrib.staticfiles.finders.FileSystemFinder',) + STATICFILES_FINDERS
STATICFILES_DIRS = (path.join(BASEDIR, 'static'),)

考虑到 FileSystemFinder 应该是 STATICFILES_FINDERS 设置的第一个值,所以像这样的东西STATICFILES_FINDERS += ('django.contrib.staticfiles.finders.FileSystemFinder',)不起作用。

更新 settings.py 后,您必须在 setting.py 所在的同一位置创建一个静态文件夹。在此文件夹中创建的每个文件都将覆盖 WireCloud 提供的文件。就您而言,有趣的文件是:

  • 用于wirecloud.defaulttheme 的images/wirecloud_logo.png 和用于wirecloud.fiwaretheme 和wirecloud.oiltheme 的images/header-logo.png。
  • css/wirecloud_core.css 如果您需要更改与徽标相关的任何 CSS 规则。

您可以从实例根目录下的静态文件夹(即默认收集静态文件的地方)获取文件的原始版本。如果要更新任何被覆盖的文件,则需要运行 collectstatic 命令:

$ python manage.py collectstatic

例子

如果您在 /opt/wirecloud_instance 有一个 WireCloud 实例,您可以运行以下命令:

$ cd /opt/wirecloud_instance
$ <your_editor_of_choice> wirecloud_instance/settings.py
# Change the STATICFILES_FINDERS and STATICFILES_DIRS settings and close the editor
$ mkdir -p wirecloud_instance/static/images
$ cp <your_logo> wirecloud_instance/static/images/wirecloud_logo.png
$ python manage.py collectstatic
于 2014-10-16T10:05:19.877 回答
0

您应该检查 {WC 安装目录}/static/images/

我认为您可能想要更改的是 header-logo.png

于 2014-10-15T07:26:25.920 回答