Template:ProgressBar: Difference between revisions

Template page
(We can't use it without the extension, so added the message.)
No edit summary
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly>
<includeonly>{| style="width:{{#if:{{{width|}}}|{{{width|}}}|50%}}; margin: 0 auto; background: transparent; display:table;"
{| style="width:{{#if:{{{width|}}}|{{{width|}}}|50%}}; margin: 0 auto; background: transparent"
| style="text-align:center;" |{{#if:{{{task|}}}|{{{task|}}}:&nbsp;}}{{big|'''{{formatnum:{{#if:{{{1|}}}|{{#expr:100*{{{1}}}/{{{2|{{{total|100}}}}}}round 1}}|0}}}}%'''}} complete
| style="text-align:center;" |{{#if:{{{task|}}}|{{{task|}}}:&nbsp;}}{{big|'''{{formatnum:{{#if:{{{1|}}}|{{#expr:100*{{{1}}}/{{{2|{{{total|100}}}}}}round 1}}|0}}}}%'''}} complete
|-
|-
|
|
{|style="border:1px solid grey; height:10px; width:100%; border-spacing: 1px;"
{|style="border:1px solid grey; height:10px; width:100%; border-spacing: 1px; display: table;"
{{#ifeq:{{#if:{{{1|}}}|{{{1}}}|0}}|0| | {{!}}style="background: #5FDB00; width: {{#ifexpr:({{#if:{{{1|}}}|{{#expr:100*{{{1}}}/{{{2|{{{total|100}}}}}}}}|0}}<1)|1%|{{#if:{{{1|}}}|{{#expr:100*{{{1}}}/{{{2|{{{total|100}}}}}}round 1}}|0}}%}}"{{!}} }}
{{#ifeq:{{#if:{{{1|}}}|{{{1}}}|0}}|0| | {{!}}style="background: #5FDB00; width: {{#ifexpr:({{#if:{{{1|}}}|{{#expr:100*{{{1}}}/{{{2|{{{total|100}}}}}}}}|0}}<1)|1%|{{#if:{{{1|}}}|{{#expr:100*{{{1}}}/{{{2|{{{total|100}}}}}}round 1}}|0}}%}}"{{!}} }}
{{#ifeq:{{#if:{{{1|}}}|{{#expr:100*{{{1}}}/{{{2|{{{total|100}}}}}}}}|0}}|100|| {{!}}style="background: #E2E2E2;" {{!}} }}
{{#ifeq:{{#if:{{{1|}}}|{{#expr:100*{{{1}}}/{{{2|{{{total|100}}}}}}}}|0}}|100|| {{!}}style="background: #E2E2E2;" {{!}} }}
Line 12: Line 11:
<noinclude>
<noinclude>
==Usage==
==Usage==
Can't use at the moment as it requires the [https://www.mediawiki.org/wiki/Help:Extension:ParserFunctions Parser Functions extension]
<nowiki>{{ProgressBar|50}}</nowiki>
{{ProgressBar|50}}
<nowiki>{{ProgressBar|4|9}}</nowiki>
{{ProgressBar|4|9}}
<nowiki>{{ProgressBar|400|400}}</nowiki>
{{ProgressBar|400|400}}


Explained on [https://www.mediawiki.org/wiki/Template:Progression MediaWiki].
Explained on [https://www.mediawiki.org/wiki/Template:Progression MediaWiki].
</noinclude>
</noinclude>

Latest revision as of 17:16, 7 April 2021


Usage

{{ProgressBar|50}}

50% complete


{{ProgressBar|4|9}}

44.4% complete


{{ProgressBar|400|400}}

100% complete


Explained on MediaWiki.