Jump to navigation
Jump to search
m (Added supraunits parameter) |
m (Cleanup) |
||
Line 1: | Line 1: | ||
<includeonly><div class="progress_bar"><p style="width:{{#expr:100*({{{progress|1}}}/{{{total|}}})}}%" class="progress_bar_inner">{{#if:{{{units|}}}|{{#if:{{{ratio|}}}|{{#ifexpr:{{{progress|1}}}<1|{{#expr:{{{progress|1}}}*{{{ratio}}}}}{{{subunits|}}}|{{#ifexpr:{{{progress|1}}}>={{{ratio}}}|{{#expr:{{{progress|1}}}/{{{ratio}}}}}{{{supraunits|}}}|{{{progress|1}}}{{{units}}}}}}}|{{{progress|1}}}{{{units}}}}}|{{#expr:100*({{{progress|1}}}/{{{total|}}}) round 0}}%}}</p></div></includeonly><noinclude> | <includeonly><div class="progress_bar"><p style="width:{{#ifexpr:{{{progress|1}}}>={{{total|}}}|100|{{#expr:100*({{{progress|1}}}/{{{total|}}})}}}}%" class="progress_bar_inner">{{#if:{{{units|}}}|{{#if:{{{ratio|}}}|{{#ifexpr:{{{progress|1}}}<1|{{#expr:{{{progress|1}}}*{{{ratio}}}}}{{{subunits|}}}|{{#ifexpr:{{{progress|1}}}>={{{ratio}}}|{{#expr:{{{progress|1}}}/{{{ratio}}}}}{{{supraunits|}}}|{{{progress|1}}}{{{units}}}}}}}|{{{progress|1}}}{{{units}}}}}|{{#expr:100*({{{progress|1}}}/{{{total|}}}) round 0}}%}}</p></div></includeonly><noinclude> | ||
{{Progress bar/Documentation}} | {{Progress bar/Documentation}} | ||
[[Category:Templates|P]]</noinclude> | [[Category:Templates|P]]</noinclude> |
Revision as of 13:03, 27 October 2007
Usage
This template displays a colored progress bar, visualizing the parameters given.
- Main
- progress: the amount of progress made (numerator)
- total: the total progress allowable (denominator)
- units: the units to display (optional; it's displayed as a percentage if this parameter isn't passed)
- inner-text: custom override of the text to display (overrides units if both are used)
- Styles
- outer-color: color of the background of the bar (default is gray)
- outer-border: color of the border around the progress bar (default is black; use "none" to omit border)
- outer-style: extra styles for the outer progress bar
- inner-color: color of the inner progress bar (default is yellow-green)
- inner-font: color of the text inside
- inner-style: extra styles for the inner progress bar
Examples
Simple | With units |
---|---|
{{progress bar|progress=2|total=10}} |
{{progress bar|progress=2|total=10|units=cookies}} |
Custom text | Different styles |
{{progress bar |progress=2 |total=10 |inner-text=A couple cookies}} |
{{progress bar |progress=2 |total=10 |outer-color=white |outer-border=red |inner-color=black |inner-font=yellow}} |