Difference between revisions of "Template:Specs-Card"

From War Thunder Wiki
Jump to: navigation, search
Line 1: Line 1:
<includeonly>{{#ifexpr: ({{#unit: {{{code}}} | тип }} = 1) or ({{#unit: {{{code}}} | тип }} = 4) or ({{#unit: {{{code}}} | тип }} = 2)
+
<includeonly>{{#if: {{#unit: {{{code}}} | название }} |<!--
|<!--
 
NEW
 
-->
 
{{#if: {{#unit: {{{code}}} | название }} |<!--
 
 
  -->{{#vardefine: me | {{{code}}} }}<!--
 
  -->{{#vardefine: me | {{{code}}} }}<!--
 
  -->{{#switch: {{#unit: {{#var:me}} | тип }}  
 
  -->{{#switch: {{#unit: {{#var:me}} | тип }}  
Line 210: Line 206:
 
[[ru:{{#unit:{{#var:me}}|статья|англ}}]]
 
[[ru:{{#unit:{{#var:me}}|статья|англ}}]]
 
|[[Category:Non-working Specs-Card]]
 
|[[Category:Non-working Specs-Card]]
}}__TOC____NOTITLE__
+
}}__TOC____NOTITLE__</includeonly><noinclude>
|<!--
 
OLD
 
-->{{#if: {{#unit: {{{code}}} | название }} |<!--
 
-->{{#vardefine: me | {{{code}}} }}<!--
 
-->{{#switch: {{#unit: {{#var:me}} | тип }}
 
    | 1 = {{#vardefine: type | Aviation }}{{#vardefine: typeM | aircraft }}
 
    | 2 = {{#vardefine: type | Ground vehicles }}{{#vardefine: typeM | ground vehicles }}
 
    | 3 = {{#vardefine: type | Fleet }}{{#vardefine: typeM | ships }}
 
    | 4 = {{#vardefine: type | Helicopters }}{{#vardefine: typeM | helicopters }}
 
    }}<!--
 
-->{{#vardefine: country |
 
    {{#switch: {{#unit: {{#var:me}} | страна }}
 
      | Great Britain = Britain
 
      | #default = {{#unit: {{#var:me}} | страна }}
 
      }}
 
    }}<!--
 
-->{{#vardefine: rank |
 
    {{#switch: {{#unit: {{#var: me }} | ранг | значение }}
 
      | 1 = First
 
      | 2 = Second
 
      | 3 = Third
 
      | 4 = Fourth
 
      | 5 = Fifth
 
      | 6 = Sixth
 
      | 7 = Seventh
 
      }}
 
    }}<!--
 
--><div class="ttx"><!--
 
--><div class="ttx-title"><!--
 
-->{{#if: {{{display_name|}}}<!--
 
  -->|{{DISPLAYTITLE:{{{display_name}}}}}[[Category:Changed visible name]]<!--
 
-->}}<!--
 
-->{{#if: {{{name|}}}<!--
 
  -->|{{{name}}}[[Category:Changed name in the card]]<!--
 
  -->|{{#unit: {{#var:me}} | название}}<!--
 
-->}}</div><!--
 
--><div class="ttx-image">{{#unit: {{#var: me }} | картинка }}<!--
 
  -->{{#if: {{FILEPATH:{{{cockpit|}}}}} |<!--
 
      --><div class="ttx-cockpit" data-image="{{FILEPATH:{{{cockpit|}}}}}"><span>Cockpit</span></div><!--
 
      -->[[Category:With cockpit]]<!--
 
  -->}}<!--
 
--></div><!--
 
-->{{#if: {{{store|}}} |<!--
 
    --><div class="ttx-buy"><div data-title="https://store.gaijin.net/story.php?id={{{store|}}}&partner=Wiki&partner_val=mufby3bs" class="ttx-buy-button">BUY</div></div><!--
 
    -->[[Category:With buy button]]__NOBANNER__<!--
 
-->}}<!--
 
-->{{#if: {{{market|}}} |<!--
 
    --><div class="ttx-marketplace"><div data-title="https://trade.gaijin.net/?n={{{market|}}}&viewitem=&a=1067" class="ttx-marketplace-button">FIND ON MARKETPLACE</div></div><!--
 
    -->[[Category:With marketplace button]]__NOBANNER__<!--
 
-->}}<!--
 
--><div class="ttx-info"><!--
 
  --><div class="ttx-flag">[[File:{{#var: country }} flag.png|44px|link=:Category:{{#var: country }} {{#var: typeM }}]]</div><!--
 
  --><span class="ttx-country">[[:Category:{{#var: country }} {{#var: typeM }}|{{#var: country }}]]</span><!--
 
  --><span class="ttx-rank">[[:Category:{{#var: rank }} rank {{#var: typeM }}|{{#unit: {{#var: me }} | ранг }} Rank]]</span><!--
 
--></div><!--
 
--><div class="ttx-switch-mode"><div class="ttx-switch-mode-button" id="ttx-ab-button">AB</div><div class="ttx-switch-mode-button" id="ttx-rb-button">RB</div><div class="ttx-switch-mode-button" id="ttx-sb-button">SB</div></div><!--
 
--><div class="ttx-table"><!--
 
--><div class="ttx-table-line ttx-table-head">General characteristics</div><!--
 
--><div class="ttx-table-line ttx-switch-size"><div id="ttx-short" class="ttx-switch-size-button"><span class="ttx-switch-size-text">Brief</span></div><div id="ttx-detail" class="ttx-switch-size-button"><span class="ttx-switch-size-text">Detailed</span></div></div><!--
 
--><div class="ttx-table-line"><span class="ttx-sb ttx-value">{{#unit: {{#var: me }} | бр | сб }}</span><span class="ttx-unvisible ttx-value">/</span><span class="ttx-rb ttx-value">{{#unit: {{#var: me }} | бр | рб }}</span><span class="ttx-unvisible ttx-value">/</span><span class="ttx-ab ttx-value">{{#unit: {{#var: me }} | бр | аб }}</span><span class="ttx-name">{{Annotation|BR|Battle ratings}}</span></div><!--
 
--><div class="ttx-table-line"><span class="ttx-value"><!--
 
-->[[Category:{{#var: type }}]]<!--
 
-->[[Category:{{#var: country }} {{#var: typeM }}]]<!--
 
-->[[Category:{{#var: rank }} rank {{#var: typeM }}]]<!--
 
-->{{#vardefine: i | 1 }}<!--
 
  -->{{#while:
 
      |{{#if: {{#unit: {{#var: me }} | класс | {{#var: i }} }} | true }}
 
      |{{#switch: {{#unit: {{#var: me }} | класс | {{#var: i }} | код }}
 
        | type_missile_tank = <div>[[:Category:ATGM vehicles|ATGM vehicle]][[Category:ATGM vehicles]]</div>
 
        | type_spaa = <div>[[:Category:Anti-aircraft vehicles|SPAA]][[Category:Anti-aircraft vehicles]]</div>
 
        | type_tank_destroyer = <div>[[:Category:Tank destroyers|Tank destroyer]][[Category:Tank destroyers]]</div>
 
        | type_medium_tank = <div>[[:Category:Medium tanks|Medium tank]][[Category:Medium tanks]]</div>
 
        | type_light_tank = <div>[[:Category:Light tanks|Light tank]][[Category:Light tanks]]</div>
 
        | type_heavy_tank = <div>[[:Category:Heavy tanks|Heavy tank]][[Category:Heavy tanks]]</div>
 
        | type_aa_fighter = <div>[[:Category:Air Defence fighters|Air Defence fighter]][[Category:Air Defence fighters]]</div>
 
        | type_bomber = <div>[[:Category:Bombers|Bomber]][[Category:Bombers]]</div>
 
        | type_frontline_bomber = <div>[[:Category:Frontline bombers|Frontline bomber]][[Category:Frontline bombers]]</div>
 
        | type_medium_bomber = <div>[[:Category:Medium bombers|Medium bomber]][[Category:Medium bombers]]</div>
 
        | type_fighter = <div>[[:Category:Fighters|Fighter]][[Category:Fighters]]</div>
 
        | type_naval_fighter = <div>[[:Category:Naval fighters|Naval fighter]][[Category:Naval fighters]]</div>
 
        | type_light_fighter = <div>[[:Category:Light fighters|Light fighter]][[Category:Light fighters]]</div>
 
        | type_interceptor = <div>[[:Category:Interceptors|Interceptor]][[Category:Interceptors]]</div>
 
        | type_heavy_fighter = <div>[[:Category:Twin-engine fighters|Twin-engine fighter]][[Category:Twin-engine fighters]]</div>
 
        | type_strike_fighter = <div>[[:Category:Strike fighters|Strike fighter]][[Category:Strike fighters]]</div>
 
        | type_torpedo = <div>[[:Category:Torpedo bombers|Torpedo bomber]][[Category:Torpedo bombers]]</div>
 
        | type_assault = <div>[[:Category:Attackers|Attacker]][[Category:Attackers]]</div>
 
        | type_naval_aircraft = <div>[[:Category:Naval aircraft|Naval aircraft]][[Category:Naval aircraft]]</div>
 
        | type_biplane = <div>[[:Category:Biplanes|Biplane]][[Category:Biplanes]]</div>
 
        | type_jet_fighter = <div>[[:Category:Jet fighters|Jet fighter]][[Category:Jet fighters]]</div>
 
        | type_heavy_bomber = <div>[[:Category:Heavy bombers|Heavy bomber]][[Category:Heavy bombers]]</div>
 
        | type_longrange_bomber = <div>[[:Category:Long Range bombers|Long Range bomber]][[Category:Long Range bombers]]</div>
 
        | type_dive_bomber = <div>[[:Category:Dive bombers|Dive bomber]][[Category:Dive bombers]]</div>
 
        | type_naval_bomber = <div>[[:Category:Naval bombers|Naval bomber]][[Category:Naval bombers]]</div>
 
        | type_light_bomber = <div>[[:Category:Light bombers|Light bomber]][[Category:Light bombers]]</div>
 
        | type_jet_bomber = <div>[[:Category:Jet bombers|Jet bomber]][[Category:Jet bombers]]</div>
 
        | type_hydroplane = <div>[[:Category:Hydroplanes|Hydroplane]][[Category:Hydroplanes]]</div>
 
        | type_flying_boat = <div>[[:Category:Flying boats|Flying boat]][[Category:Flying boats]]</div>
 
        | type_attack_helicopter = <div>[[:Category:Attack helicopters|Attack helicopter]][[Category:Attack helicopters]]</div>
 
        | type_boat = <div>[[:Category:Boats|Boat]][[Category:Boats]]</div>
 
        | type_missile_boat = <div>[[:Category:Fast attack crafts|Fast attack craft]][[Category:Fast attack crafts]]</div>
 
        | type_heavy_boat = <div>[[:Category:Heavy boats|Heavy boat]][[Category:Heavy boats]]</div>
 
        | type_gun_boat = <div>[[:Category:Motor gun boats|Motor gun boat]][[Category:Motor gun boats]]</div>
 
        | type_torpedo_boat = <div>[[:Category:Motor torpedo boats|Motor torpedo boat]][[Category:Motor torpedo boats]]</div>
 
        | type_small_submarine_chaser = <div>[[:Category:Small sub-chasers|Small sub-chaser]][[Category:Small sub-chasers]]</div>
 
        | type_submarine_chaser = <div>[[:Category:Sub-chasers|Sub-chaser]][[Category:Sub-chasers]]</div>
 
        | type_armored_submarine_chaser = <div>[[:Category:Armored sub-chasers|Armored sub-chaser]][[Category:Armored sub-chasers]]</div>
 
        | type_armored_boat = <div>[[:Category:Armored gun boats|Armored gun boat]][[Category:Armored gun boats]]</div>
 
        | type_hydrofoil_torpedo_boat = <div>[[:Category:Hydrofoil torpedo boats|Hydrofoil torpedo boat]][[Category:Hydrofoil torpedo boats]]</div>
 
        | type_destroyer = <div>[[:Category:Destroyers|Destroyer]][[Category:Destroyers]]</div>
 
        | type_light_cruiser = <div>[[:Category:Light cruisers|Light cruiser]][[Category:Light cruisers]]</div>
 
        | type_heavy_cruiser = <div>[[:Category:Heavy cruisers|Heavy cruiser]][[Category:Heavy cruisers]]</div>
 
        | type_barge = <div>[[:Category:Barges|Barge]][[Category:Barges]]</div>
 
        | type_naval_aa_ferry = <div>[[:Category:Anti-air ferrys|Anti-air ferry]][[Category:Anti-air ferrys]]</div>
 
        | type_naval_ferry_barge = <div>[[:Category:Naval ferry barges|Naval ferry barge]][[Category:Naval ferry barges]]</div>
 
        | type_minesweeper = <div>[[:Category:Minesweepers|Minesweeper]][[Category:Minesweepers]]</div>
 
        | type_minelayer = <div>[[:Category:Minelayers|Minelayer]][[Category:Minelayers]]</div>
 
        | type_frigate = <div>[[:Category:Frigates|Frigate]][[Category:Frigates]]</div>
 
        | type_torpedo_gun_boat = <div>[[:Category:Motor torpedo gun boats|Motor torpedo gun boat]][[Category:Motor torpedo gun boats]]</div>
 
        | type_heavy_gun_boat = <div>[[:Category:Gunboats|Gunboat]][[Category:Gunboats]]</div>
 
        | type_utility_helicopter = <div>[[:Category:Utility helicopters|Utility helicopter]][[Category:Utility helicopters]]</div>
 
      }}{{#vardefine: i | {{#expr: {{#var: i }} + 1 }} }}<!--
 
  -->}}</span><span class="ttx-name">Class</span></div><!--
 
--><div class="ttx-table-line"><span class="ttx-value">{{#unit: {{#var: me }} | экипаж | количество }} {{#ifexpr: {{#unit: {{#var: me }} | экипаж | количество }} = 1 | person | people }}</span><span class="ttx-name">Crew</span></div><!--
 
-->{{#switch: {{#var: type }}
 
    |Aviation={{Specs-Card-Aviation}}
 
    |Ground vehicles={{Specs-Card-Tank}}
 
    |Fleet={{Specs-Card-Fleet}}
 
    |Helicopters={{Specs-Card-Helicopter}}
 
    }}<!--
 
--><div class="ttx-table-line ttx-table-head">Economy</div><!--
 
  -->{{#ifeq: {{#unit: {{#var: me }} | премиумная }} | 1
 
      |<div class="ttx-table-line"><span class="ttx-value">[[:Category:Premium {{#var: typeM }}|Premium]]</span><span class="ttx-name">Type</span></div><!--
 
      -->[[Category:Premium {{#var: typeM }}]]
 
    }}<!--
 
  -->{{#ifeq: {{#unit: {{#var: me }} | полковая }} | 1
 
      |<div class="ttx-table-line"><span class="ttx-value">[[:Category:Squadron {{#var: typeM }}|Squadron]]</span><span class="ttx-name">Type</span></div><!--
 
      -->[[Category:Squadron {{#var: typeM }}]]
 
    }}<!--
 
  -->{{#ifeq: {{#unit: {{#var: me }} | акционная }} | 0
 
      |{{#ifeq: {{#unit: {{#var: me }} | цена | валюта }} | S
 
        |<div class="ttx-table-line"><span class="ttx-value"><!--
 
      -->{{#ifeq: {{#unit: {{#var: me }} | исследование | значение }} | 0
 
          |free
 
          |{{#unit:{{#var:me}}|исследование}} {{Rp}}<!--
 
      -->}}</span><span class="ttx-name">Research</span></div><!--
 
      --><div class="ttx-table-line"><span class="ttx-value"><!--
 
      -->{{#ifeq: {{#unit: {{#var: me }} | цена | значение }} | 0
 
          |free
 
          |{{#unit: {{#var: me }} | цена }} {{Sl}}
 
        }}</span><span class="ttx-name">Purchase</span></div>
 
        |<div class="ttx-table-line"><span class="ttx-value">{{#unit: {{#var: me }} | цена }} {{Ge}}</span><span class="ttx-name">Purchase</span></div><!--
 
    -->}}
 
    |<div class="ttx-table-line"><span class="ttx-value">[[:Category:Gift {{#var: typeM }}|Bundle or Gift]]</span><span class="ttx-name">Purchase</span></div><!--
 
  -->[[Category:Gift {{#var: typeM }}]]
 
    }}<!--
 
--><div class="ttx-table-line"><!--
 
  -->{{#ifeq:{{#unit: {{#var: me }} | ремонт | рб | макс | значение }} | 0
 
      |<span class="ttx-value">free</span>
 
      |<span class="ttx-value">{{Sl}}</span><span class="ttx-sb ttx-value">{{#ifexpr: ( {{#unit: {{#var: me }} | ремонт | сб | мин | значение }} != {{#unit: {{#var: me }} | ремонт | сб | макс | значение }} ) |{{Annotation|{{#unit: {{#var: me }} | ремонт | сб | мин }} / {{#unit: {{#var: me }} | ремонт | сб | макс }}|minimum / maximum}}|{{#unit: {{#var: me }} | ремонт | сб | макс }}}}</span><span class="ttx-unvisible ttx-value">/</span><!--
 
    --><span class="ttx-rb ttx-value">{{#ifexpr:( {{#unit: {{#var: me }} | ремонт | рб | мин | значение }} != {{#unit: {{#var: me }} | ремонт | рб | макс | значение }} )|{{Annotation|{{#unit: {{#var: me }} | ремонт | рб | мин }} / {{#unit: {{#var: me }} | ремонт | рб | макс }}|minimum / maximum}}|{{#unit: {{#var: me }} | ремонт | рб | макс }}}}</span><span class="ttx-unvisible ttx-value">/</span><!--
 
    --><span class="ttx-ab ttx-value">{{#ifexpr:( {{#unit: {{#var: me }} | ремонт | аб | мин | значение }} != {{#unit: {{#var: me }} | ремонт | аб | макс | значение }} )|{{Annotation|{{#unit: {{#var: me }} | ремонт | аб | мин }} / {{#unit: {{#var: me }} | ремонт | аб | макс }}|minimum / maximum}}|{{#unit: {{#var: me }} | ремонт | аб | макс }}}}</span><!--
 
  -->}}<span class="ttx-name">Repair</span></div><!--
 
--><div class="ttx-table-line ttx-table-collapse"><span class="ttx-value">{{#if: {{#unit: {{#var: me }} | экипаж | базовая | значение }} | {{#unit: {{#var: me }} | экипаж | базовая }} {{Sl}} | free }}</span><span class="ttx-name">Crew training</span></div><!--
 
--><div class="ttx-table-line ttx-table-collapse"><span class="ttx-value">{{#unit: {{#var: me }} | экипаж | эксперты }} {{Sl}}</span><span class="ttx-name">Experts</span></div><!--
 
--><div class="ttx-table-line ttx-table-collapse"><span class="ttx-value">{{#unit: {{#var: me }} | экипаж | асы }} {{Ge}}</span><span class="ttx-name">Aces</span></div><!--
 
--><div class="ttx-table-line"><span class="ttx-value">{{#unit: {{#var: me }} | коэф_опыт }}<!--
 
  -->{{#ifeq: {{#unit: {{#var: me }} | премиумная }} | 1 |&nbsp;× 2 [[File:Talisman.png|18px|class=ttx-img-talisman|link=]] }}<!--
 
--> % {{Rp}}</span><span class="ttx-name">Reward for battle</span></div><!--
 
--><div class="ttx-table-line"><!--
 
  --><span class="ttx-value ttx-sb">{{#unit: {{#var: me }} | коэф_львы | сб }}{{#ifeq: {{#unit: {{#var: me }} | премиумная }} | 1 |&nbsp;× 2 [[File:Talisman.png|18px|class=ttx-img-talisman|link=]] }} % {{Sl}}</span><!--
 
  --><span class="ttx-value ttx-rb">{{#unit: {{#var: me }} | коэф_львы | рб }}{{#ifeq: {{#unit: {{#var: me }} | премиумная }} | 1 |&nbsp;× 2 [[File:Talisman.png|18px|class=ttx-img-talisman|link=]] }} % {{Sl}}</span><!--
 
  --><span class="ttx-value ttx-ab">{{#unit: {{#var: me }} | коэф_львы | аб }}{{#ifeq: {{#unit: {{#var: me }} | премиумная }} | 1 |&nbsp;× 2 [[File:Talisman.png|18px|class=ttx-img-talisman|link=]] }} % {{Sl}}</span><!--
 
--><span class="ttx-name"></span></div><!--
 
--></div></div><!--
 
-->[[ru:{{#unit:{{#var:me}}|статья|ру}}]]
 
|[[Category:Non-working Specs-Card]]
 
}}}}</includeonly><noinclude>
 
 
{{doc}}
 
{{doc}}
 
[[Category:Specs]]
 
[[Category:Specs]]
 
</noinclude>
 
</noinclude>

Revision as of 11:44, 29 December 2020

Description

This template is used to create specification cards for vehicles. This template is required for Template:Specs to function properly.

Usage

{{Specs-Card
|code=
|images=
|store=
|market=
|cockpit=
|title_name=
|card_name=
}}

Parameters

  • code - the code of the desired vehicle (required).
  • images - the images to display on the spec card. Template:Specs-Card-Image should be used here.
  • store - the store code of the vehicle (optional).
  • market - the name of the vehicle on Gaijin Marketplace (optional).
  • cockpit - the name of the 3D cockpit image uploaded to the wiki (optional).
  • title_name - Changes the display title of the page and adds page to Category:Changed visible name (optional).
  • card_name - Changes the name displayed on the stat card and adds page to Category:Changed name in the card (optional).