|
|
(5 intermediate revisions by the same user not shown) |
Line 1: |
Line 1: |
− | <includeonly>{{#ifeq:User|{{NAMESPACE}}|{{#if:{{#show:User:{{BASEPAGENAME}}|?Level}}|
| |
− | <span style="color:{{#iferror:{{#expr:0>={{{1|0}}}}}|green;">|{{#ifexpr:{{#show:User:{{BASEPAGENAME}}|?Level}}>={{{1|0}}}|green;">|maroon;">}}}}'''''(level {{{1|?}}}{{#if:{{{2|}}}|, </span>
| |
− | <span style="color:{{#iferror:{{#expr:0>={{{2}}}}}|green;">|{{#ifexpr:{{#show:User:{{BASEPAGENAME}}|?Level}}>={{{2}}}|green;">|maroon;">}}}}{{{2}}}{{#if:{{{3|}}}|, </span>
| |
− | <span style="color:{{#iferror:{{#expr:0>={{{3}}}}}|green;">|{{#ifexpr:{{#show:User:{{BASEPAGENAME}}|?Level}}>={{{3}}}|green;">|maroon;">}}}}{{{3}}}{{#if:{{{4|}}}|, </span>
| |
− | <span style="color:{{#iferror:{{#expr:0>={{{4}}}}}|green;">|{{#ifexpr:{{#show:User:{{BASEPAGENAME}}|?Level}}>={{{4}}}|green;">|maroon;">}}}}{{{4}}}{{#if:{{{5|}}}|, </span>
| |
− | <span style="color:{{#iferror:{{#expr:0>={{{5}}}}}|green;">|{{#ifexpr:{{#show:User:{{BASEPAGENAME}}|?Level}}>={{{5}}}|green;">|maroon;">}}}}{{{5}}}{{#if:{{{6|}}}|, </span>
| |
− | <span style="color:{{#iferror:{{#expr:0>={{{6}}}}}|green;">|{{#ifexpr:{{#show:User:{{BASEPAGENAME}}|?Level}}>={{{6}}}|green;">|maroon;">}}}}{{{6}}}{{#if:{{{7|}}}|, </span>
| |
− | <span style="color:{{#iferror:{{#expr:0>={{{7}}}}}|green;">|{{#ifexpr:{{#show:User:{{BASEPAGENAME}}|?Level}}>={{{7}}}|green;">|maroon;">}}}}{{{7}}}</span>
| |
− | <span style="color:{{#ifexpr:{{#show:User:{{BASEPAGENAME}}|?Level}}>={{{1|0}}}|green;">|maroon;">}})</span>|</span>
| |
− | <span style="color:{{#ifexpr:{{#show:User:{{BASEPAGENAME}}|?Level}}>={{{1|0}}}|green;">|maroon;">}})</span>}}|</span>
| |
− | <span style="color:{{#ifexpr:{{#show:User:{{BASEPAGENAME}}|?Level}}>={{{1|0}}}|green;">|maroon;">}})</span>}}|</span>
| |
− | <span style="color:{{#ifexpr:{{#show:User:{{BASEPAGENAME}}|?Level}}>={{{1|0}}}|green;">|maroon;">}})</span>}}|</span>
| |
− | <span style="color:{{#ifexpr:{{#show:User:{{BASEPAGENAME}}|?Level}}>={{{1|0}}}|green;">|maroon;">}})</span>}}|</span>
| |
− | <span style="color:{{#ifexpr:{{#show:User:{{BASEPAGENAME}}|?Level}}>={{{1|0}}}|green;">|maroon;">}})</span>}}|</span>
| |
− | <span style="color:{{#ifexpr:{{#show:User:{{BASEPAGENAME}}|?Level}}>={{{1|0}}}|green;">|maroon;">}})</span>}}'''''
| |
− | |''(level {{{1|?}}}{{#if:{{{2|}}}|, {{{2}}}{{#if:{{{3|}}}|, {{{3}}}{{#if:{{{4|}}}|, {{{4}}}{{#if:{{{5|}}}|, {{{5}}}{{#if:{{{6|}}}|, {{{6}}}{{#if:{{{7|}}}|, {{{7}}})|)}}|)}}|)}}|)}}|)}}|)}}''}}
| |
− | |''(level {{{1|?}}}{{#if:{{{2|}}}|, {{{2}}}{{#if:{{{3|}}}|, {{{3}}}{{#if:{{{4|}}}|, {{{4}}}{{#if:{{{5|}}}|, {{{5}}}{{#if:{{{6|}}}|, {{{6}}}{{#if:{{{7|}}}|, {{{7}}})|)}}|)}}|)}}|)}}|)}}|)}}''}}</includeonly><noinclude>
| |
| | | |
− | == Warning ==
| |
− | This is a '''monster''' template! View/edit the code at your own risk! :D
| |
− |
| |
− | I know it could be simplyfied by splitting it into two or more templates, but then there would be many templates whereas now there is only this one.
| |
− |
| |
− | == What it does? ==
| |
− | In the user namespace it hilights the level requirements of a building/test/skill/tech depending on whether you can learn it or not. Elsewhere it simply prints the level requirements in plain black.
| |
− |
| |
− | == Usage ==
| |
− | In order for this template to work, it has to know your level. This is achieved by declaring the '''Level''' property on your '''main''' page, like this:
| |
− | <pre>
| |
− | Avatar Name: whatever
| |
− | Level: [[level::21]]
| |
− | Residence: somewhere in Egypt
| |
− | </pre>
| |
− |
| |
− | Once you have this property, you can use this template on any of your pages. The template also supports multiple levels up to 7.
| |
− |
| |
− | <pre>
| |
− | {{Level|0}}
| |
− | {{Level|2|4|8}}
| |
− | </pre>
| |
− |
| |
− | </noinclude>
| |