Difference between revisions of "Template:Progress bar"

From EVEmu Wiki
Jump to navigation Jump to search
Crucible_Project_Status>Pete Hines Right Hand
 
Wikipedia_Templates>Born2bgratis
(Grays from the [https://design.wikimedia.org/style-guide/visual-style_colors.html Wikimedia palette] and a green that’s analogous to Green50)
Line 12: Line 12:
 
   </p>
 
   </p>
 
}}
 
}}
<p style="border:{{{border|1px solid rgb(41, 38, 38)}}}; padding:{{{padding|1px}}}; overflow:hidden;">
+
<p style="border:{{{border|1px solid #c8ccd1}}}; padding:{{{padding|1px}}}; overflow:hidden;">
 
   <span style="
 
   <span style="
 
     width: {{#expr: {{{1|<noinclude>2</noinclude>0}}} / {{{total|100}}} * 100}}%;
 
     width: {{#expr: {{{1|<noinclude>2</noinclude>0}}} / {{{total|100}}} * 100}}%;
     height: {{{height|10}}}px;
+
     height: {{{height|2}}}px;
     background:{{{color1|#5FDB00}}};
+
     background:{{{color1|#00af32}}};
 
     float:left;
 
     float:left;
 
     ">&nbsp;</span>
 
     ">&nbsp;</span>
 
   <span style="
 
   <span style="
 
     width:{{#expr: 100 - {{{1|<noinclude>2</noinclude>0}}} / {{{total|100}}} * 100}}%;
 
     width:{{#expr: 100 - {{{1|<noinclude>2</noinclude>0}}} / {{{total|100}}} * 100}}%;
     height:{{{height|10}}}px;
+
     height:{{{height|2}}}px;
     background:{{{color2|#3a3a3a}}};
+
     background:{{{color2|#eaecf0}}};
 
     float:left;
 
     float:left;
 
     ">&nbsp;</span>
 
     ">&nbsp;</span>
 
</p>
 
</p>
 
</div><noinclude>{{Documentation}}</noinclude>
 
</div><noinclude>{{Documentation}}</noinclude>

Revision as of 14:04, 26 June 2019

{{#ifeq: yes | yes

|

{{#expr: ( 20 / 100) * 100 round 1}}% completed (estimate)

}}

   

<templatestyles src="Module:Documentation/styles.css"></templatestyles>

Template documentation[view] [edit] [history] [purge]

{{#ifeq:progress bar |doc

    | 

{{#ifeq:show |show

         | Template:Mbox
        }}{{#if: |
         |   {{#ifexist:Template:Progress bar
                  | [[Category:{{#switch:Template |Template=Template |Module=Module |User=User |#default=Wikipedia}} documentation pages]]
                  |
                 }}
        }}
    | 
   }}

{{#switch:

|editnotice = Template:Editnotice
|#default =

}}{{#ifeq: Progress bar | Progress bar | }}

Usage

{{Progress bar|value}}

This template draws a progress bar. By default, the value to supply as the parameter is the percent, from 0 to 100 (e.g. 1 would mean 1%, .1 would be 0.1%). The text label of the progress bar will always be rounded to the nearest tenth of a percent (rounding up if the hundreds digit is 5; e.g. 50.15 would round to 50.2%). If a value isn't specified or is invalid, the bar displays 0%. Values greater than 100% will display incorrectly, although the text label will be correct.

Optional parameters

  • height = height of the progress bar in pixels; defaults to 2
  • width = width of the progress bar; defaults to 75%
  • text = message to display after %; defaults to: completed (estimate)
  • total = amount to use as the denominator (instead of 100), allows the template to compute the percentage on the fly
  • header = no (or any value other than "yes", which is the default) suppresses the display of the percentage on the top line

Examples

Default configuration

{{Progress bar|5}} :

{{#ifeq: yes | yes

|

{{#expr: ( 5 / 100) * 100 round 1}}% completed (estimate)

}}

   

With custom header text

{{Progress bar|5|text=done}} :

{{#ifeq: yes | yes

|

{{#expr: ( 5 / 100) * 100 round 1}}% done

}}

   

Without header text

{{Progress bar|80|header=no|text=does not display here}} :

{{#ifeq: no | yes

|

{{#expr: ( 80 / 100) * 100 round 1}}% does not display here

}}

   

Custom height and width

{{Progress bar|80|height=4|width=50%}} :

{{#ifeq: yes | yes

|

{{#expr: ( 80 / 100) * 100 round 1}}% completed (estimate)

}}

   

Custom total

{{Progress bar|5|total=5}} :

{{#ifeq: yes | yes

|

{{#expr: ( 5 / 5) * 100 round 1}}% completed (estimate)

}}

   

Script error: No such module "Navbox".

{{#if:{{#ifeq:Script error: No such module "String".|sandbox|1}}{{#ifeq:Progress bar|doc|1}}Script error: No such module "String".|| }}