happy-se-life / kanban

Kanban plugin for redmine
https://it-managers-life.hatenablog.com/entry/2019/03/24/112052
MIT License
121 stars 38 forks source link

question: using colors #21

Closed rg-software closed 4 years ago

rg-software commented 4 years ago

Hi, I am sorry, but I can't figure out how to use colors like shown in your screenshot. All my cards are blue when created, and I don't really understand how to turn them yellow, for example. Please advise!

Also, am I right that priority information is not shown on the card? In "kanban view" I can't see task priorities anymore.

happy-se-life commented 4 years ago

@rg-software Hello,

The color of the card is determined by the priority of the issue.

rg-software commented 4 years ago

OK, thank you very much!

rg-software commented 4 years ago

Well, sorry again -- actually no :( I am sure I have a card with priority 4 (I checked the database, "issues" table, and can confirm that priority_id is 4), however, the card is still blue. Can I check something else?

happy-se-life commented 4 years ago

@rg-software Hello,

I am sorry for late reply. I tried various things, but could not reproduce the problem.

The cause code is this. In kanban/app/views/kanban/index.html.erb, Line 216-217. <% if issue.priority_id >= 3 then %> my-issue-card-high-priority <% elsif issue.priority_id == 2 %> my-issue-card <% else %> my-issue-card-low-priority <% end %>"> Would you please try this code? instead of the above. <% if issue.priority_id.to_i >= 3 then %> my-issue-card-high-priority <% elsif issue.priority_id.to_i == 2 %> my-issue-card <% else %> my-issue-card-low-priority <% end %>"> best regards,

rg-software commented 4 years ago

Well, after a fair bit of debugging I found out that your original code is okay, and the problem is actually in CSS. In my case, the colors are being overriden by the theme selected (application.css file). Specifically, it contains an element div #content with background-color marked with !important, so it's really hard to beat it.

Same applies to main color of the card text (in my case it is white, which is hard to read on yellow). This is due to .context-menu-selection a rules in context-menu.css

So eventually I could make the cards look okay by modifying your css files as follows: kanban.zip

You may say it is due to my poorly designed theme, but I am actually surprised you don't have this issue. I tried several built-in themes (Circle, Classic, Alternate), and it never helped.

Anyway, please take it into account, and thank you.