-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[16.0][ADD] web_widget_progressbar_color #2989
base: 16.0
Are you sure you want to change the base?
Conversation
112b45b
to
9289bc8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very Nice !
Thanks !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice.
<xpath expr="//div[@t-attf-class]" position="attributes"> | ||
<attribute | ||
name="t-attf-class" | ||
add="{{ (state.currentValue > 40 and state.currentValue <= 70) ? 'o_progress_warning' : state.currentValue > 70 ? 'o_progress_danger' : ''}}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add="{{ (state.currentValue > 40 and state.currentValue <= 70) ? 'o_progress_warning' : state.currentValue > 70 ? 'o_progress_danger' : ''}}" | |
add="{{ (state.currentValue > 40 * state.maxValue/100 and state.currentValue <= 70 * state.maxValue/100) ? 'o_progress_warning' : state.currentValue > 70 * state.maxValue/100 ? 'o_progress_danger' : ''}}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not making a gradient progressbar instead ? Then you don't have to configure the thresholds
Could you develop ? |
Something like applying always this class:
|
The result: This is not the expecting result |
@legalsylvain @pedrobaeza @jbaudoux I will change the imlpementaiton to this (need a little bit tweaking) as this is our needs: |
I think also changing the module name to |
Hi @rousseldenis : looks nice ! A "matter of taste" remarks :
However, just a suggestion. If you think it's better like that, let's move on. |
The current implementation is to reflect the "occupation" which means that the less is better, the more is worse. I'll try to add an option to the widget to allow the |
Allows to reverse the gradient rendering
7ea0cf5
to
966916a
Compare
Now: So both options are supported. The normal rendering is red to green. Inverse mode, green to red. |
Thanks ! It looks like there is a little offset when 100 is displayed. |
Rendering example: