Шаблон:Achievement box result format — различия между версиями
Материал из Guild Wars 2 wiki
Blood (обсуждение | вклад) (Новая страница: «<includeonly>{{#if:<!-- Hide new lines --> {{#vardefine:tier_count|0}} <!-- Set to zero --> {{#vardefine:tier_total|0}} <!-- Set to zero --> }}{{#arraymap:{{{9|}}…») |
Blood (обсуждение | вклад) |
||
Строка 2: | Строка 2: | ||
{{#vardefine:tier_count|0}} <!-- Set to zero --> | {{#vardefine:tier_count|0}} <!-- Set to zero --> | ||
{{#vardefine:tier_total|0}} <!-- Set to zero --> | {{#vardefine:tier_total|0}} <!-- Set to zero --> | ||
+ | {{#vardefine:tier_rewards_count|0}} <!-- Set to zero --> | ||
+ | {{#vardefine:objectives_count|0}} <!-- Set to zero --> | ||
}}{{#arraymap:{{{9|}}}|~|@@@| | }}{{#arraymap:{{{9|}}}|~|@@@| | ||
− | {{#vardefine:tier_count|{{#expr:{{#var:tier_count}} + 1}}}} | + | {{#vardefine:tier_count|{{#expr:{{#var:tier_count}} + 1}}}} <!-- Array size --> |
{{#vardefine:tier_total|{{#expr:{{#var:tier_total}}{{#if:{{#explode:@@@|;|1}}|+{{#replace:{{#explode:@@@|;|1}}|?|0}} }} }}}} <!-- Array sum --> | {{#vardefine:tier_total|{{#expr:{{#var:tier_total}}{{#if:{{#explode:@@@|;|1}}|+{{#replace:{{#explode:@@@|;|1}}|?|0}} }} }}}} <!-- Array sum --> | ||
− | |}} | + | |}}{{#arraymap:{{{18|}}}|~|@@@|{{#vardefine:tier_rewards_count|{{#expr:{{#var:tier_rewards_count}} + 1}}}} <!-- Array size --> |
− | |- class="line line-top achievement-row" | + | |}}{{#arraymap:{{{20|}}}|~|@@@|{{#vardefine:objectives_count|{{#expr:{{#var:objectives_count}} + 1}}}}|}} <!-- Array size --> |
− | ! style="text-align:left" | {{#ifeq:{{{3|}}}|repeatable | + | |- class="line line-top achievement-row" data-id="{{{16|}}}" id="achievement{{{16}}}" |
− | ! style="text-align: left" | {{#if:{{{10|}}}|[[{{{ | + | ! style="text-align:left; width: 44em;" | {{#ifeq: {{{source|}}} | Achievement box | {{Anchor|{{{2}}}}} }}{{#switch: {{{3|}}} |
− | ! style="text-align: right; vertical-align: top;" | {{#if: {{{15|}}} | {{mastery point|1|region={{{15}}}}} }} {{ap|{{#var:tier_total}}}} | + | | meta = [[File:Tournament Master (map icon).png|20px|link=|This is a meta achievement.]] |
+ | | repeatable = [[File:Tango repeatable event.png|20px|link=|This achievement is repeatable infinitely and does not contribute to a meta achievement.]] | ||
+ | | daily = | ||
+ | | daily meta = [[File:Tournament Master (map icon).png|20px|link=|This is a meta achievement.]] | ||
+ | | weekly = [[File:Talk back option tango.png|20px|link=|This achievement resets every week on Monday.]] | ||
+ | | weekly meta = [[File:Tournament Master (map icon).png|20px|link=|This is a meta achievement.]][[File:Talk back option tango.png|20px|link=|This achievement resets every week on Monday.]] | ||
+ | }}{{#if: {{{6|}}} | [[File:Chest icon.png|20px|link=|This achievement rewards items.]] | ||
+ | }}{{#if: {{{8|}}} | [[File:Title icon.png|20px|link=Title|This achievement rewards a title.]] | ||
+ | }}{{#ifeq: {{{17|}}} | true | [[File:Awakened suspicious (Forearmed Is Forewarned map icon).png|20px|link=List of hidden achievements|This achievement requires at least one completed objective to become visible.]]}} <!-- | ||
+ | -->{{#ifeq: {{{12}}} | {{{10}}} |<span style="font-weight:bold">{{{2}}}</span><!-- No individual achievement page -->|{{#ifeq: {{{12}}} | {{PAGENAME}} |<span style="font-weight:bold">{{{2}}}</span><!-- Don't link if used on the actual achievement page -->|[[{{#if:{{{21|}}}|{{{12}}}#{{{21}}}|{{{12|}}}}}{{!}}<span style="font-weight:bold">{{{2}}}</span>]]}}}} <!-- | ||
+ | -->{{#ifeq: {{lc: {{#show: {{{10}}} | ?Has achievement group }} }} | historical | (Historical) }} | ||
+ | ! class="line-left" style="text-align: left; width: 18.3em;" | {{#if: {{{10|}}} | [[{{{1}}}|{{#if: {{{23|}}} | {{{23}}} | {{{10}}}}}]] }} | ||
+ | ! style="text-align: right; vertical-align: top; width: 8.5em;" | {{#if: {{{15|}}} | {{mastery point|{{{22|1}}}|region={{{15}}}}} }} {{ap|{{#var:tier_total}}}} | ||
|- | |- | ||
− | | rowspan="{{#ifexpr:{{#var:tier_count|}}<7|{{#ifexpr:{{#var:tier_count|0}}<1|1|{{#var:tier_count}}}}|5}}" style=" | + | | rowspan="{{#ifexpr:{{#var:tier_count|}}<{{#ifeq:{{{expanded|}}}|true|100|7}}|{{#ifexpr:{{#var:tier_count|0}}<1|1|{{#var:tier_count}}}}|5}}" class="white" style="vertical-align: top; width: 44em;" | {{{4|}}}{{#if:{{{11|}}}| |
<span style="color: #686868; display: block;">''{{{11}}}''</span> | <span style="color: #686868; display: block;">''{{{11}}}''</span> | ||
+ | }}{{#if: <!--prerequisite-->{{{5|}}}<!--unlock-->{{{13|}}}<!--title-->{{{8|}}}<!--tier rewards-->{{{18|}}}<!--reward-->{{{6|}}}<!--collection-->{{{19|}}}<!--objectives-->{{{20|}}}| | ||
+ | <dl>{{#vardefine:close_dl|</dl>}} | ||
}}{{#if: {{{5|}}}| | }}{{#if: {{{5|}}}| | ||
− | + | <dd>'''Prerequisite:''' {{{5|}}}</dd> | |
}}{{#if: {{{13|}}}| | }}{{#if: {{{13|}}}| | ||
− | + | <dd>'''Unlock Item:''' {{item icon|{{{13}}}}}</dd> | |
− | }}{{#if:{{{8|}}}| | + | }}{{#if: {{{8|}}}| |
− | + | <dd>'''Title:''' [[File:Title icon.png|20px|link=Title]] {{{8}}}</dd> | |
− | }}{{#if:{{{6|}}}| | + | }}{{#if: {{{18|}}}|{{#ifexpr: {{#if: {{{reward|}}}|1|0}} AND {{#ifeq: {{{expanded|}}}|true|0|1}} AND {{#var:tier_rewards_count}} > 1 AND {{#if: {{#pos: {{{6|}}}|,}}|1|0}} <!-- disabled, where all tier rewards grant the same item, by checking for "," separator, might need "valuesep = ;" in the query and "{{#pos: {{{6|}}}|;}}" at some point --> | |
− | :'''Reward:''' {{#if:{{{7|}}}|{{#ifexpr:{{{7}}} > 1|{{{7}}} }}}}{{item icon|{{{6}}}}} | + | <!-- Branch for parameter "reward": expandable table, showing only the tiers matching the "reward" --> |
− | }}<!-- Here tiers starts --> | + | <dd><table style="width: 95%; border-spacing: 0px; border-style: hidden;" class="collapsible"> |
− | {{#ifexpr:{{#var:tier_count}}<7|{{#arraymap:{{{9|}}}|~|@@@|{{!}} style="width: | + | {{!}}- class="expandable" |
− | {{!}} style="width: | + | {{!}} colspan="3" style="padding:0;" {{!}} '''Rewards:''' <small style="float:right">Show all rewards</small> |
− | | 5 = {{!}} colspan="2" {{!}} | + | {{#arraymap: {{{18}}}|~|@@@| |
− | {{{!}} {{STDT|mech1}} class="expandable" style="width: 100%;" | + | {{!}}- {{#ifeq: {{{reward}}}|{{#explode: @@@|;|1}}|style="display:table-row"}} |
+ | {{!}} style="padding:0;border-style:hidden;" {{!}} <ul style="margin-top:0;margin-bottom:0;"><li>Tier</li></ul> | ||
+ | {{!}} style="text-align:right;padding:0 0.32em;border-style:hidden;" {{!}} {{#explode: @@@|;|0}}: | ||
+ | {{!}} style="width:99%;padding:0;border-style:hidden;" {{!}}  <span class="item-icon thumb-icon">[[{{#show:{{#vardefineecho:tier_rewards_item|{{#explode: @@@|;|1}}}}|?Has game icon|link=none|default=File:Skill.png}}|20px|bottom|link={{#var:tier_rewards_item}}]]</span> [[{{#var:tier_rewards_item}}|{{#show:{{#var:tier_rewards_item}}|?Has canonical name|default={{#var:tier_rewards_item}}}}]] {{plural: {{#explode: @@@|;|2}} ||({{#explode: @@@|;|2}})}} {{#vardefine:tier_rewards_counter|{{#expr:{{#var:tier_rewards_counter}} + 1}}}} | ||
+ | |\n}}</table></dd> | ||
+ | | {{#ifexpr: {{#var:tier_rewards_count}} < {{#ifeq:{{{expanded|}}}|true|100|7}} | ||
+ | |<!-- Branch for less than seven tier rewards: show everything --> | ||
+ | <dd><table style="width: 95%; border-spacing: 0px; border-style: hidden;"> | ||
+ | {{!}}- | ||
+ | {{!}} colspan="3" style="padding:0;" {{!}} '''Rewards:''' | ||
+ | {{#arraymap: {{{18}}}|~|@@@| | ||
+ | {{!}}- | ||
+ | {{!}} style="padding:0;border-style:hidden;" {{!}} <ul style="margin-top:0;margin-bottom:0;"><li>Tier</li></ul> | ||
+ | {{!}} style="text-align:right;padding:0 0.32em;border-style:hidden;" {{!}} {{#explode: @@@|;|0}}: | ||
+ | {{!}} style="width:99%;padding:0;border-style:hidden;" {{!}}  <span class="item-icon thumb-icon">[[{{#show:{{#vardefineecho:tier_rewards_item|{{#explode: @@@|;|1}}}}|?Has game icon|link=none|default=File:Skill.png}}|20px|bottom|link={{#var:tier_rewards_item}}]]</span> [[{{#var:tier_rewards_item}}|{{#show:{{#var:tier_rewards_item}}|?Has canonical name|default={{#var:tier_rewards_item}}}}]] {{plural: {{#explode: @@@|;|2}} ||({{#explode: @@@|;|2}})}} | ||
+ | |\n}}</table></dd> | ||
+ | |<!-- Branch for more than seven tier rewards: expandable table -->{{#vardefine:tier_rewards_counter|1}} | ||
+ | <dd><table style="width: 95%; border-spacing: 0px; border-style: hidden;" class="collapsible"> | ||
+ | {{!}}- class="expandable" | ||
+ | {{!}} colspan="3" style="padding:0;" {{!}} '''Rewards:''' <small style="float:right">Show all rewards</small> | ||
+ | {{#arraymap: {{{18}}}|~|@@@|{{#switch: {{#var:tier_rewards_counter}} | ||
+ | | 1 | 2 | 3 = | ||
+ | {{!}}- style="display:table-row" <!-- expandable table: always show the first three rows --> | ||
+ | | {{#var:tier_rewards_count}} = | ||
+ | {{!}}- class="collapse-reverse nomobile" <!-- expandable table: symbolize the collapsed part with "..." and show final tier reward --> | ||
+ | {{!}} colspan="2" style="text-align:right;padding:0 0.32em;" {{!}} '''...''' | ||
+ | {{!}}- style="display:table-row" | ||
+ | | #default = | ||
+ | {{!}}- }} | ||
+ | {{!}} style="padding:0;border-style:hidden;" {{!}} <ul style="margin-top:0;margin-bottom:0;"><li>Tier</li></ul> | ||
+ | {{!}} style="text-align:right;padding:0 0.32em;border-style:hidden;" {{!}} {{#explode: @@@|;|0}}: | ||
+ | {{!}} style="width:99%;padding:0;border-style:hidden;" {{!}}  <span class="item-icon thumb-icon">[[{{#show:{{#vardefineecho:tier_rewards_item|{{#explode: @@@|;|1}}}}|?Has game icon|link=none|default=File:Skill.png}}|20px|bottom|link={{#var:tier_rewards_item}}]]</span> [[{{#var:tier_rewards_item}}|{{#show:{{#var:tier_rewards_item}}|?Has canonical name|default={{#var:tier_rewards_item}}}}]] {{plural: {{#explode: @@@|;|2}} ||({{#explode: @@@|;|2}})}} {{#vardefine:tier_rewards_counter|{{#expr:{{#var:tier_rewards_counter}} + 1}}}} | ||
+ | |\n}}</table></dd> }} }} | ||
+ | |{{#if: {{{6|}}}| | ||
+ | <dd>'''Reward:''' {{#if:{{{7|}}}|{{#ifexpr:{{{7}}} > 1|{{{7}}} }}}}{{item icon|{{{6}}}}}</dd> | ||
+ | }}}}{{#if: <!--prerequisite-->{{{5|}}}<!--unlock-->{{{13|}}}<!--title-->{{{8|}}}<!--tier rewards-->{{{18|}}}<!--reward-->{{{6|}}}|{{#if: <!--collection-->{{#ifeq: {{{hide collection|}}}|true||{{{19|}}}}}<!--objectives-->{{{20|}}}| | ||
+ | <dd><hr style="margin: .5em 2.5em .5em 0; clear: both;"/></dd> | ||
+ | }}}}{{#ifeq: {{{hide collection|}}}|true||{{#if: {{{19|}}}|{{#vardefine: bit|0}} | ||
+ | <dd>'''Collection:'''</dd> | ||
+ | <dd><div style="max-width: 360px;">{{#arraymap: {{{19|}}}|~|@@@|{{#ask: [[@@@]] | ||
+ | | ? Has canonical name | ||
+ | | ? Has game icon | ||
+ | | ? Has game id | ||
+ | | ? Has collection hint | ||
+ | | ? Has game description | ||
+ | | format = template | ||
+ | | template = Achievement collection result format{{!}}id={{{16|}}} | ||
+ | | valuesep = ; | ||
+ | | link = none | ||
+ | | limit = 250 | ||
+ | }}|}}</div></dd>}}}}{{#if: {{{20|}}} | {{#ifexpr: {{#var:objectives_count}} < {{#ifeq:{{{expanded|}}}|true|100|7}} | ||
+ | | <!-- Branch for less than seven objectives: show everything --> | ||
+ | <dd><table style="width: 95%; margin-bottom: 0.75em; border-spacing: 0px; border-style: hidden;"> | ||
+ | {{!}}- | ||
+ | {{!}} style="padding:0;border-style: hidden;" {{!}} '''Objectives:''' | ||
+ | {{#arraymap: {{{20|}}}|~|@@@| | ||
+ | {{!}}- | ||
+ | {{!}} style="padding:0;border-style: hidden;" {{!}} <ul style="margin-top:0;margin-bottom:0;"><li>@@@</li></ul> | ||
+ | |\n}}</table></dd> | ||
+ | |<!-- Branch for seven or more objectives: expandable table -->{{#vardefine: objectives_counter|1}} | ||
+ | <dd><table style="width: 95%; margin-bottom: 0.75em; border-spacing: 0px; border-style: hidden;" class="collapsible"> | ||
+ | {{!}}- class="expandable" | ||
+ | {{!}} style="padding:0;border-style: hidden;" {{!}} '''Objectives:''' <small style="float:right">Show all objectives</small> | ||
+ | {{#arraymap: {{{20|}}}|~|@@@|{{#switch: {{#var:objectives_counter}} | ||
+ | | #default = | ||
+ | {{!}} style="padding:0;border-style: hidden;" {{!}} <ul style="margin-top:0;margin-bottom:0;"><li>@@@</li></ul> | ||
+ | | 1 | 2 | 3 = | ||
+ | {{!}}- style="display:table-row" <!-- expandable table: always show the first three rows --> | ||
+ | {{!}} style="padding:0;border-style: hidden;" {{!}} <ul style="margin-top:0;margin-bottom:0;"><li>@@@</li></ul> | ||
+ | | {{#var:objectives_count}} = | ||
+ | {{!}}- class="collapse-reverse nomobile" <!-- expandable table: symbolize the collapsed part with "..." and show final objective --> | ||
+ | {{!}} style="padding-left:1.6em;" {{!}} '''...''' | ||
+ | {{!}}- style="display:table-row" | ||
+ | {{!}} style="padding:0;border-style: hidden;" {{!}} <ul style="margin-top:0;margin-bottom:0;"><li>@@@</li></ul> | ||
+ | | #default = | ||
+ | {{!}}- | ||
+ | {{!}} style="padding:0;border-style: hidden;" {{!}} <ul style="margin-top:0;margin-bottom:0;"><li>@@@</li></ul> | ||
+ | }}{{#vardefine:objectives_counter|{{#expr:{{#var:objectives_counter}} + 1}}}} | ||
+ | |\n}}</table></dd> }} | ||
+ | }}{{#var:close_dl}}{{#vardefine:close_dl|<!--clear-->}}<!-- Here tiers starts -->{{#vardefine:tier_counter|1}}<!-- Fixed row color, starting with mech1 blue -->{{#vardefine:bgc|offwhite}} | ||
+ | {{#ifexpr:{{#var:tier_count}}<{{#ifeq:{{{expanded|}}}|true|100|7}}|{{#arraymap:{{{9|}}}|~|@@@|{{!}} style="width: 18.3em; vertical-align: top; {{#switch: {{#var:tier_counter}}|{{#var:tier_count}}=|#default=height:1em}}" class="{{#var:bgc}}" {{!}} {{#explode:@@@|;|0}}{{#vardefine:tier_counter|{{#expr:{{#var:tier_counter}} + 1}}}} | ||
+ | {{!}} style="width: 8.5em; text-align: right; vertical-align: top;" class="{{#var:bgc}}" {{!}} {{ap|{{#explode:@@@|;|1}}}}{{#ifeq: {{#var:bgc}}|white|{{#vardefine:bgc|offwhite}}|{{#vardefine:bgc|white}}}}| \n{{!}}-\n }}|{{#arraymap:{{{9|}}}|~|@@@|{{#switch: {{#var:tier_counter}} | ||
+ | | 5 = {{!}} colspan="2" style="vertical-align:top;" class="offwhite" {{!}} | ||
+ | {{{!}} {{STDT|mech1}} class="expandable" style="width: 100%; border-spacing: 0;" | ||
{{!}} colspan="2" {{!}} Show more tiers | {{!}} colspan="2" {{!}} Show more tiers | ||
{{!}}- | {{!}}- | ||
− | {{!}} style="min-width: | + | {{!}} style="min-width: 16.5em; max-width: 25em; vertical-align: top;" {{!}} {{#explode:@@@|;|0}} |
− | {{!}} style="width: | + | {{!}} style="width: 8em; text-align: right; vertical-align: top;" {{!}} {{ap|{{#explode:@@@|;|1}}}}{{#vardefine:tier_counter|{{#expr:{{#var:tier_counter}} + 1}}}} |
− | | {{#var:tier_count}} = {{!}} style="min-width: | + | | {{#var:tier_count}} = {{!}} style="min-width:16.5em; max-width: 25em; vertical-align: top;" {{!}} {{#explode:@@@|;|0}} |
− | {{!}} style="width: | + | {{!}} style="width: 8em; text-align: right; vertical-align: top;" {{!}} {{ap|{{#explode:@@@|;|1}}}}{{#vardefine:tier_counter|{{#expr:{{#var:tier_counter}} + 1}}}} |
{{!}}} | {{!}}} | ||
− | | #default = {{!}} style="min-width: | + | | #default = {{!}} style="min-width: 16.5em; max-width: 25em; vertical-align: top; height: 1em;" {{#ifexpr: {{#var:tier_counter}} < 5 | class="{{#var:bgc}}" }} {{!}} {{#explode:@@@|;|0}} |
− | {{!}} style="width: | + | {{!}} style="width: 8em; text-align: right; vertical-align: top;" {{#ifexpr: {{#var:tier_counter}} < 5 | class="{{#var:bgc}}" }} {{!}} {{ap|{{#explode:@@@|;|1}}}}{{#vardefine:tier_counter|{{#expr:{{#var:tier_counter}} + 1}}}} }}{{#ifeq: {{#var:bgc}}|white|{{#vardefine:bgc|offwhite}}|{{#vardefine:bgc|white}}}} | \n{{!}}-\n }} |
}}</includeonly><noinclude> | }}</includeonly><noinclude> | ||
− | |||
This is a semantic result template for use in {{tl|achievement list}} and {{tl|achievement box}}. This template mimics the design for {{tl|Achievement table row}}, while also displaying the achievement category. The input parameters generated by the semantic query are: | This is a semantic result template for use in {{tl|achievement list}} and {{tl|achievement box}}. This template mimics the design for {{tl|Achievement table row}}, while also displaying the achievement category. The input parameters generated by the semantic query are: | ||
#subobject | #subobject | ||
Строка 54: | Строка 152: | ||
#Gives mastery track region point | #Gives mastery track region point | ||
#Has game id | #Has game id | ||
+ | #Is hidden achievement | ||
+ | #Has achievement tier rewards | ||
+ | #Has achievement collection | ||
+ | #Has achievement objectives | ||
+ | #Has achievement page section | ||
+ | #Gives mastery track region point quantity | ||
+ | #Has achievement category.Has canonical name | ||
+ | |||
+ | ;expanded | ||
+ | :Whether to collapse multiple tiers or not. | ||
+ | ;source | ||
+ | :Specified by [[Template:Achievement box]]. If equal to "Achievement box", adds an anchor reference link for the achievement name. | ||
[[Category:Achievement formatting templates]] | [[Category:Achievement formatting templates]] | ||
[[Category:Semantic result templates]] | [[Category:Semantic result templates]] | ||
</noinclude> | </noinclude> |
Текущая версия на 22:10, 14 апреля 2021
This is a semantic result template for use in {{achievement list}} and {{achievement box}}. This template mimics the design for {{Achievement table row}}, while also displaying the achievement category. The input parameters generated by the semantic query are:
- subobject
- Has canonical name
- Has achievement type
- Has game description
- Has prerequisite
- Gives item
- Gives item quantity
- Gives title
- Has achievement tiers
- Has achievement category
- Has flavor text
- Has achievement page
- Has unlock item
- Has game icon
- Gives mastery track region point
- Has game id
- Is hidden achievement
- Has achievement tier rewards
- Has achievement collection
- Has achievement objectives
- Has achievement page section
- Gives mastery track region point quantity
- Has achievement category.Has canonical name
- expanded
- Whether to collapse multiple tiers or not.
- source
- Specified by Template:Achievement box. If equal to "Achievement box", adds an anchor reference link for the achievement name.