Template:Progression/doc: Difference between revisions

From Portals of Phereon Wiki
Content added Content deleted
portalsofphereon>Olaroll
No edit summary
portalsofphereon>Olaroll
No edit summary
Line 1: Line 1:
== Usage ==


==Syntax==
This template draws a progress bar using {{t|Progression}} and displays a statistics box. It differs from the original bar in that is designed for use in backlog category elimination drives; as articles are ''removed'' from the category specified, the percentage goes ''up'' based on the original population (e.g., at the start of the drive) and the goal.
:<tt>'''<nowiki>{{</nowiki>Progression|'''''percent'''''<nowiki>}}</nowiki>'''</tt>
The <tt>percent</tt> is a number between 0 and 100, without the trailing <tt>%</tt>.


:<tt>'''<nowiki>{{</nowiki>Progression|'''''param1'''''|'''''param2'''''<nowiki>}}</nowiki>'''</tt>
At the end of the drive, if the statistics are to be preserved as they are, one must first |substitute the template, then substitute the two PAGESINCATEGORY [https://www.mediawiki.org/wiki/Help:Magic_words magic words] within. Invisible comments have been added to the code to make this process easier.
Calculates the progression as a function of <tt>param1/param2</tt>


:<tt>'''<nowiki>{{</nowiki>Progression|'''''param1'''''|'''''param2'''''|task='''''param3'''''<nowiki>}}</nowiki>'''</tt>
==Parameters==
Calculates the progression as a function of <tt>param1/param2</tt>, and displays a task label on the bar.
;Full version:
<code><nowiki>{{Backlog progress bar|initial= |goal= |category= |unit= }}</nowiki></code>


=== Examples ===
;Required fields:
==== 1 parameter (percent) ====
*'''initial''': Initial backlog population (e.g., at the start of the drive)
<tt><nowiki>{{Progression|0}}</nowiki></tt> :
*'''category''': Backlog category, omitting the "Category:" prefix
{{Progression|0}}
;Optional fields:
*'''goal''': Target category population, defaults to "0"
*'''unit''': Unit used, defaults to "articles"


<tt><nowiki>{{Progression|0.5}}</nowiki></tt> :
=== See also ===
{{Progression|0.5}}
* {{t|Backlog progress bar}}

<tt><nowiki>{{Progression|1}}</nowiki></tt> :
{{Progression|1}}

<tt><nowiki>{{Progression|36.7}}</nowiki></tt> :
{{Progression|36.7}}

<tt><nowiki>{{Progression|100}}</nowiki></tt> :
{{Progression|100}}

==== 2 parameters ====
<tt><nowiki>{{Progression|0|250}}</nowiki></tt> :
{{Progression|0|250}}

<tt><nowiki>{{Progression|100|250}}</nowiki></tt> :
{{Progression|100|250}}

<tt><nowiki>{{Progression|200|300}}</nowiki></tt> :
{{Progression|200|300}}

<tt><nowiki>{{Progression|300|300}}</nowiki></tt> :
{{Progression|300|300}}

==== 3 parameters ====
<tt><nowiki>{{Progression|0|250|task=Sorting articles}}</nowiki></tt> :
{{Progression|0|250|task=Sorting articles}}

<tt><nowiki>{{Progression|100|250|task=Sorting articles}}</nowiki></tt> :
{{Progression|100|250|task=Sorting articles}}


<includeonly>[[Category:Templates|{{PAGENAME}}]]</includeonly><noinclude>[[Category:Template documentation|{{PAGENAME}}]]</noinclude>
<includeonly>[[Category:Templates|{{PAGENAME}}]]</includeonly><noinclude>[[Category:Template documentation|{{PAGENAME}}]]</noinclude>

Revision as of 04:45, 21 November 2019

Syntax

{{Progression|percent}}

The percent is a number between 0 and 100, without the trailing %.

{{Progression|param1|param2}}

Calculates the progression as a function of param1/param2

{{Progression|param1|param2|task=param3}}

Calculates the progression as a function of param1/param2, and displays a task label on the bar.

Examples

1 parameter (percent)

{{Progression|0}} :

0% complete

{{Progression|0.5}} :

0.5% complete

{{Progression|1}} :

1% complete

{{Progression|36.7}} :

36.7% complete

{{Progression|100}} :

100% complete

2 parameters

{{Progression|0|250}} :

0% complete

{{Progression|100|250}} :

40% complete

{{Progression|200|300}} :

66.7% complete

{{Progression|300|300}} :

100% complete

3 parameters

{{Progression|0|250|task=Sorting articles}} :

Sorting articles: 0% complete

{{Progression|100|250|task=Sorting articles}} :

Sorting articles: 40% complete