Template:CompositionBar: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
<div class="composition-bar-wrapper" style=" | <div class="composition-bar-wrapper" style=" | ||
{{#if:{{{width|}}}|width:{{{width}}};|width:100px;}} | {{#if:{{{width|}}}|width:{{{width}}};|width:100px;}} | ||
{{#if:{{{float|}}}|float:{{{float}}};}} | {{#if:{{{float|}}}|float:{{{float}}};}} | ||
margin-left:auto; margin-right:0; /* Default align right */ | margin-left:auto; margin-right:0; /* Default align right */ | ||
border:{{{5|{{{border_style|1px solid gray}}}}}}; | border:{{{5|{{{border_style|1px solid gray}}}}}}; | ||
"> | "> | ||
<div class="composition-bar-fill" style=" | <div class="composition-bar-fill" style=" | ||
width:{{#expr: ({{{1|{{{amount|0}}}}} / {{{2|{{{total|100}}}}}}) * 100 round 0}}%; | width:{{#expr: ({{{1|{{{amount|0}}}}} / {{{2|{{{total|100}}}}}}) * 100 round 0}}%; | ||
background-color:{{{3|{{{color|#4CAF50}}}}}}; | background-color:{{{3|{{{color|#4CAF50}}}}}}; | ||
color:{{{text_color|white}}}; | color:{{{text_color|white}}}; | ||
"> | "> | ||
<span class="segment-label"> | <span class="segment-label"> | ||
{{#ifeq:{{{per|no}}}|yes | {{#ifeq:{{{per|no}}}|yes | ||
|{{{1|{{{amount|0}}}}}}/{{{2|{{{total|100}}}}}} | |{{{1|{{{amount|0}}}}}}/{{{2|{{{total|100}}}}}} | ||
|{{#expr: ({{{1|{{{amount|0}}}}} / {{{2|{{{total|100}}}}}}) * 100 round 0}}% | |{{#expr: ({{{1|{{{amount|0}}}}} / {{{2|{{{total|100}}}}}}) * 100 round 0}}% | ||
}} | }} | ||
</span> | </span> | ||
</div> | |||
</div> | |||