如何创建自己的Redmine主题¶
从 r818 版本之后,Redmine开始支持主题。
主题只能修改 stylesheets (application.css)。
创建一个新主题¶
在 public/themes 中新建一个目录。目录名将被作为主题名称。
例如:
public/themes/my_theme
创建您自定义的 application.css 文件并保存到 stylesheets 子目录中:
public/themes/my_theme/stylesheets/application.css
这是做了一些简单修改的自定义 stylesheet 的例子:
/* load the default Redmine stylesheet */
@import url(../../../stylesheets/application.css);
/* add a logo in the header */
#header {
background: #507AAA url(../images/logo.png) no-repeat 2px;
padding-left: 86px;
}
/* move the project menu to the right */
#main-menu {
left: auto;
right: 0px;
}
这个例子假定您已经有了 my_theme/images/logo.png 这个图片文件。
您可以 下载 此示例主题然后在它的基础上进行修改。将它解压到 public/themes 目录即可。
应用主题¶
打开 “管理 -> 配置” 页面,在主题下拉列表框中选择您新建的主题。保存设置。
随即Redmie应该开始使用您的自定义主题显示界面。
请注意当您新安装了一个主题后,可能需要重新启动程序后新主题才会在主题下拉列表框中出现。