如何更改Redmine中任务进度条的颜色或代码位于何处?

How can I change the color of the progress bar of a task in Redmine or where is the code located?

我想更改任务进度条的颜色。我找到了甘特图页面的 .erb 源文件和计算 % 完成进度的 .rb 源代码,但它似乎不是要编辑的正确文件。

您实际上应该编辑位于:

的图像
your_redmine_root/public/images/task_late.png

其中 your_redmine_root 是您的 Redmine 物理安装位置,它取决于底层操作系统等...

因此 gannt 是从底层 RoR 应用程序生成的 html 代码的组合,您可以在 app/views/gantts/show.html.erb 中编辑该视图。 Javascript 来自 public/javascripts/gantt.js 和 CSS 风格(主题)的代码,如果您使用一些自定义主题或插件,实际上可能会有所不同,默认情况下安装它在 public/stylesheet/application.css

具体代码也可能因Redmine版本不同而不同,但你正在寻找

.task_late { background:#f66 url(../images/task_late.png); border: 1px solid #f66; }

在 Redmine 3.0 上是第 986 行。.task_late 是普通的 div,你可以随意设置它的 css 样式...

编辑完成后不要忘记重启Redmine,还要确保刷新浏览器的缓存。