Difference between revisions of "Template:Specs-Card"

From War Thunder Wiki
Jump to: navigation, search
Line 1: Line 1:
<includeonly>{{#if: {{#unit: {{{code}}} | название }} |<!--
+
<includeonly>{{#ifeq: {{#unit: {{{code}}} | тип }} | 1
 +
|<!--
 +
NEW
 +
-->
 +
{{#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
 +
      }}
 +
    }}<!--
 +
-->[[Category:{{#var: type }}]][[Category:{{#var: country }} {{#var: typeM }}]][[Category:{{#var: rank }} rank {{#var: typeM }}]]
 +
<div class="specs_card_main" data-code="{{#unit: {{#var: me }} | код }}">
 +
<div class="specs_card_mobile_info">
 +
<div class="general_info_name">{{#if: {{{card_name|}}}
 +
  |{{{card_name}}}[[Category:Changed name in the card]]
 +
  |{{#unit: {{#var:me}} | псевдоним}}
 +
}}</div>
 +
<div class="general_info_neighbors"><!--
 +
-->{{#if: {{#unit: {{#var: me }} | prev }} |<div class="prev">[[{{#unit: {{#unit: {{#var: me }} | prev }} | статья }}|{{#unit: {{#unit: {{#var: me }} | prev }} | псевдоним }}]]</div>}}<!--
 +
-->{{#if: {{#unit: {{#var: me }} | next }} |<div class="next">[[{{#unit: {{#unit: {{#var: me }} | next }} | статья }}|{{#unit: {{#unit: {{#var: me }} | next }} | псевдоним }}]]</div>}}<!--
 +
--></div>
 +
</div>
 +
<div class="specs_card_main_slider">
 +
<div class="specs_card_main_slider_container"></div>
 +
<div class="specs_card_main_slider_system"><!--
 +
-->{{#if: {{#unit: {{#var: me }} | картинка }} |
 +
  <div>{{#unit: {{#var: me }} | картинка }}</div>
 +
}}<!--
 +
-->{{#if: {{{images|}}} |
 +
  {{{images|}}}
 +
}}<!--
 +
-->{{#if: {{FILEPATH:{{{cockpit|}}}}} |
 +
  <div>360://{{#tag:nowiki|{{FILEPATH:{{{cockpit|}}}}}}}</div>
 +
  [[Category:With cockpit]]
 +
}}<!--
 +
--></div>
 +
</div>
 +
{{#if: {{{title_name|}}}
 +
  |{{DISPLAYTITLE:{{{title_name}}}}}[[Category:Changed visible name]]
 +
}}
 +
<div class="specs_card_main_info">
 +
<div class="general_info_name">{{#if: {{{card_name|}}}
 +
  |{{{card_name}}}
 +
  |{{#unit: {{#var:me}} | псевдоним}}
 +
}}</div>
 +
<div class="general_info_neighbors"><!--
 +
-->{{#if: {{#unit: {{#var: me }} | prev }} |<div class="prev">[[{{#unit: {{#unit: {{#var: me }} | prev }} | статья }}|{{#unit: {{#unit: {{#var: me }} | prev }} | псевдоним }}]]</div>}}<!--
 +
-->{{#if: {{#unit: {{#var: me }} | next }} |<div class="next">[[{{#unit: {{#unit: {{#var: me }} | next }} | статья }}|{{#unit: {{#unit: {{#var: me }} | next }} | псевдоним }}]]</div>}}<!--
 +
--></div>
 +
<div class="general_info">
 +
<div class="general_info_nation">[[File:{{#var: country }} flag.png|45px|link=:Category:{{#var: country }} {{#var: typeM }}]] [[:Category:{{#var: country }} {{#var: typeM }}|{{#var: country }}]]</div>
 +
<div class="general_info_rank">[[:Category:{{#var: rank }} rank {{#var: typeM }}|{{#unit: {{#var: me }} | ранг }} Rank]]</div>
 +
</div>
 +
<div class="general_info_2">
 +
<div class="general_info_br"><div class="desc">[[Battle ratings|Battle rating]]:</div>
 +
<table rules="all"><tr>
 +
<td>[[Arcade Battles|AB]]</td>
 +
<td>[[Realistic Battles|RB]]</td>
 +
<td>[[Simulator Battles|SB]]</td></tr>
 +
<tr>
 +
<td>{{#unit: {{#var: me }} | бр | аб }}</td>
 +
<td>{{#unit: {{#var: me }} | бр | рб }}</td>
 +
<td>{{#unit: {{#var: me }} | бр | сб }}</td>
 +
</tr></table>
 +
</div>
 +
 
 +
<div class="general_info_class"><span class="desc">Class:</span><!--
 +
-->{{#ifeq: {{#unit: {{#var: me }} | премиумная }} | 1
 +
  |<div class="premium">[[:Category:Premium {{#var: typeM }}|PREMIUM]]</div>
 +
  [[Category:Premium {{#var: typeM }}]]
 +
}}<!--
 +
-->{{#ifeq: {{#unit: {{#var: me }} | полковая }} | 1
 +
  |<div class="squadron">[[:Category:Squadron {{#var: typeM }}|SQUADRON]]</div>
 +
  [[Category:Squadron {{#var: typeM }}]]
 +
}}<!--
 +
-->{{#vardefine: i | 1 }}
 +
{{#while:
 +
  |{{#if: {{#unit: {{#var: me }} | класс | {{#var: i }} }} | true }}
 +
    |<div>{{#switch: {{#unit: {{#var: me }} | класс | {{#var: i }} | код }}
 +
        | type_missile_tank = [[:Category:ATGM vehicles|ATGM vehicle]][[Category:ATGM vehicles]]
 +
        | type_spaa = [[:Category:Anti-aircraft vehicles|SPAA]][[Category:Anti-aircraft vehicles]]
 +
        | type_tank_destroyer = [[:Category:Tank destroyers|Tank destroyer]][[Category:Tank destroyers]]
 +
        | type_medium_tank = [[:Category:Medium tanks|Medium tank]][[Category:Medium tanks]]
 +
        | type_light_tank = [[:Category:Light tanks|Light tank]][[Category:Light tanks]]
 +
        | type_heavy_tank = [[:Category:Heavy tanks|Heavy tank]][[Category:Heavy tanks]]
 +
        | type_aa_fighter = [[:Category:Air Defence fighters|Air Defence fighter]][[Category:Air Defence fighters]]
 +
        | type_bomber = [[:Category:Bombers|Bomber]][[Category:Bombers]]
 +
        | type_frontline_bomber = [[:Category:Frontline bombers|Frontline bomber]][[Category:Frontline bombers]]
 +
        | type_medium_bomber = [[:Category:Medium bombers|Medium bomber]][[Category:Medium bombers]]
 +
        | type_fighter = [[:Category:Fighters|Fighter]][[Category:Fighters]]
 +
        | type_naval_fighter = [[:Category:Naval fighters|Naval fighter]][[Category:Naval fighters]]
 +
        | type_light_fighter = [[:Category:Light fighters|Light fighter]][[Category:Light fighters]]
 +
        | type_interceptor = [[:Category:Interceptors|Interceptor]][[Category:Interceptors]]
 +
        | type_heavy_fighter = [[:Category:Twin-engine fighters|Twin-engine fighter]][[Category:Twin-engine fighters]]
 +
        | type_strike_fighter = [[:Category:Strike fighters|Strike fighter]][[Category:Strike fighters]]
 +
        | type_torpedo = [[:Category:Torpedo bombers|Torpedo bomber]][[Category:Torpedo bombers]]
 +
        | type_assault = [[:Category:Attackers|Attacker]][[Category:Attackers]]
 +
        | type_naval_aircraft = [[:Category:Naval aircraft|Naval aircraft]][[Category:Naval aircraft]]
 +
        | type_biplane = [[:Category:Biplanes|Biplane]][[Category:Biplanes]]
 +
        | type_jet_fighter = [[:Category:Jet fighters|Jet fighter]][[Category:Jet fighters]]
 +
        | type_heavy_bomber = [[:Category:Heavy bombers|Heavy bomber]][[Category:Heavy bombers]]
 +
        | type_longrange_bomber = [[:Category:Long Range bombers|Long Range bomber]][[Category:Long Range bombers]]
 +
        | type_dive_bomber = [[:Category:Dive bombers|Dive bomber]][[Category:Dive bombers]]
 +
        | type_naval_bomber = [[:Category:Naval bombers|Naval bomber]][[Category:Naval bombers]]
 +
        | type_light_bomber = [[:Category:Light bombers|Light bomber]][[Category:Light bombers]]
 +
        | type_jet_bomber = [[:Category:Jet bombers|Jet bomber]][[Category:Jet bombers]]
 +
        | type_hydroplane = [[:Category:Hydroplanes|Hydroplane]][[Category:Hydroplanes]]
 +
        | type_flying_boat = [[:Category:Flying boats|Flying boat]][[Category:Flying boats]]
 +
        | type_attack_helicopter = [[:Category:Attack helicopters|Attack helicopter]][[Category:Attack helicopters]]
 +
        | type_boat = [[:Category:Boats|Boat]][[Category:Boats]]
 +
        | type_missile_boat = [[:Category:Fast attack crafts|Fast attack craft]][[Category:Fast attack crafts]]
 +
        | type_heavy_boat = [[:Category:Heavy boats|Heavy boat]][[Category:Heavy boats]]
 +
        | type_gun_boat = [[:Category:Motor gun boats|Motor gun boat]][[Category:Motor gun boats]]
 +
        | type_torpedo_boat = [[:Category:Motor torpedo boats|Motor torpedo boat]][[Category:Motor torpedo boats]]
 +
        | type_small_submarine_chaser = [[:Category:Small sub-chasers|Small sub-chaser]][[Category:Small sub-chasers]]
 +
        | type_submarine_chaser = [[:Category:Sub-chasers|Sub-chaser]][[Category:Sub-chasers]]
 +
        | type_armored_submarine_chaser = [[:Category:Armored sub-chasers|Armored sub-chaser]][[Category:Armored sub-chasers]]
 +
        | type_armored_boat = [[:Category:Armored gun boats|Armored gun boat]][[Category:Armored gun boats]]
 +
        | type_hydrofoil_torpedo_boat = [[:Category:Hydrofoil torpedo boats|Hydrofoil torpedo boat]][[Category:Hydrofoil torpedo boats]]
 +
        | type_destroyer = [[:Category:Destroyers|Destroyer]][[Category:Destroyers]]
 +
        | type_light_cruiser = [[:Category:Light cruisers|Light cruiser]][[Category:Light cruisers]]
 +
        | type_heavy_cruiser = [[:Category:Heavy cruisers|Heavy cruiser]][[Category:Heavy cruisers]]
 +
        | type_barge = [[:Category:Barges|Barge]][[Category:Barges]]
 +
        | type_naval_aa_ferry = [[:Category:Anti-air ferrys|Anti-air ferry]][[Category:Anti-air ferrys]]
 +
        | type_naval_ferry_barge = [[:Category:Naval ferry barges|Naval ferry barge]][[Category:Naval ferry barges]]
 +
        | type_minesweeper = [[:Category:Minesweepers|Minesweeper]][[Category:Minesweepers]]
 +
        | type_minelayer = [[:Category:Minelayers|Minelayer]][[Category:Minelayers]]
 +
        | type_frigate = [[:Category:Frigates|Frigate]][[Category:Frigates]]
 +
        | type_torpedo_gun_boat = [[:Category:Motor torpedo gun boats|Motor torpedo gun boat]][[Category:Motor torpedo gun boats]]
 +
        | type_heavy_gun_boat = [[:Category:Gunboats|Gunboat]][[Category:Gunboats]]
 +
        | type_utility_helicopter = [[:Category:Utility helicopters|Utility helicopter]][[Category:Utility helicopters]]
 +
  }}</div>{{#vardefine: i | {{#expr: {{#var: i }} + 1 }} }}
 +
}}
 +
</div>
 +
</div>
 +
<div class="general_info_price">
 +
{{#ifeq: {{#unit: {{#var: me }} | акционная }} | 0<!--
 +
-->|<!--
 +
  -->{{#ifeq: {{#unit: {{#var: me }} | цена | валюта }} | S<!--
 +
    -->|<!--
 +
      --><div class="general_info_price_research"><!--
 +
      --><span class="desc">Research:</span><!--
 +
      --><span class="value"><!--
 +
      -->{{#ifeq: {{#unit: {{#var: me }} | исследование }} | 0<!--
 +
        -->|Free<!--
 +
        -->|{{#unit:{{#var:me}} |исследование | format=1 }} [[File:Specs-Card-Exp.png|14px|link=Очки исследования]]<!--
 +
      -->}}<!--
 +
      --></span></div><!--
 +
      --><div class="general_info_price_buy"><!--
 +
      --><span class="desc">Purchase:</span><!--
 +
      --><span class="value"><!--
 +
      -->{{#ifeq: {{#unit: {{#var: me }} | цена }} | 0<!--
 +
      -->|Free<!--
 +
      -->|{{#unit: {{#var: me }} | цена | format=1 }} [[File:Specs-Card-Lion.png|link=Серебряные львы]]<!--
 +
      -->}}<!--
 +
      --></span></div><!--
 +
    -->|<!--
 +
      --><div class="general_info_price_buy"><!--
 +
      --><span class="desc">Purchase:</span><!--
 +
      --><span class="value">{{#unit: {{#var: me }} | цена | format=1 }} [[File:Specs-Card-Eagle.png|link=Золотые орлы]]</span><!--
 +
      --></div>
 +
    }}<!--
 +
-->|<!--
 +
    --><div class="general_info_price_buy" style="width:100%;"><!--
 +
    --><span class="desc">Purchase:</span><!--
 +
    --><span class="value small">[[:Category:Gift {{#var: typeM }}|Bundle or Gift]]</span><!--
 +
    --></div><!--
 +
    -->[[Category:Gift {{#var: typeM }}]]
 +
}}
 +
</div>
 +
<div class="general_info_buttons">
 +
<div class="general_info_buttons_container">
 +
<!--<div class="general_info_compare_button" title="Сравнить"><span>Добавить в сравнение</span></div>-->
 +
<div class="general_info_game_button" title="Show in game"><span>Show in game</span></div><!--
 +
-->{{#if: {{{store|}}} |
 +
    __NOBANNER__
 +
    <div title="Buy" data-link="{{{store|}}}" class="general_info_buy_button"><span>STORE</span></div>
 +
    [[Category:With buy button]]
 +
}}<!--
 +
-->{{#if: {{{market|}}} |
 +
    __NOBANNER__
 +
    <div title="Buy" data-link="{{{market|}}}" class="general_info_market_button"><span>MARKET</span></div>
 +
    [[Category:With marketplace button]]
 +
}}<!--
 +
--></div>
 +
</div>
 +
<div class="general_info_message"></div>
 +
</div>
 +
</div>
 +
[[ru:{{#unit:{{#var:me}}|статья|англ}}]]
 +
|[[Category:Non-working Specs-Card]]
 +
}}__TOC____NOTITLE__
 +
|<!--
 +
OLD
 +
-->{{#if: {{#unit: {{{code}}} | название }} |<!--
 
  -->{{#vardefine: me | {{{code}}} }}<!--
 
  -->{{#vardefine: me | {{{code}}} }}<!--
 
  -->{{#switch: {{#unit: {{#var:me}} | тип }}  
 
  -->{{#switch: {{#unit: {{#var:me}} | тип }}  
Line 173: Line 386:
 
  -->[[ru:{{#unit:{{#var:me}}|статья|ру}}]]
 
  -->[[ru:{{#unit:{{#var:me}}|статья|ру}}]]
 
|[[Category:Non-working Specs-Card]]
 
|[[Category:Non-working Specs-Card]]
}}</includeonly><noinclude>
+
}}}}</includeonly><noinclude>
 
{{doc}}
 
{{doc}}
 
[[Category:Specs]]
 
[[Category:Specs]]
 
</noinclude>
 
</noinclude>

Revision as of 09:31, 24 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).