Difference between revisions of "Template:Gacha preview infobox"

From Tokyo Afterschool Summoners
Jump to navigation Jump to search
Line 39: Line 39:
     padding: 0px 7px 0px 7px;
     padding: 0px 7px 0px 7px;
}
}
}}{{#vardefine:gacha subobj|
}}{{#vardefine:Gacha subobj|
  {{#ask:
  {{#ask:
   [[Has game context::Gacha]]
   [[Has game context::Gacha]]
Line 49: Line 49:
   |searchlabel=
   |searchlabel=
  }}
  }}
}}{{#if:{{#var:gacha subobj}}|<table id="gacha{{#gachanumber}}" class="preview-infobox">
}}{{#if:{{#var:Gacha subobj}}|<table id="Gacha{{#Gachanumber}}" class="preview-infobox">
<tr>
<tr>
   <th colspan="2">[[{{#var:gacha subobj}}|{{{en name|{{{jp name|???}}}}}}]]</th>
   <th colspan="2">[[{{#var:Gacha subobj}}|{{{en name|{{{jp name|???}}}}}}]]</th>
</tr>
</tr>
<tr>
<tr>
   <td colspan="2">{{#vardefine:banner image array|{{#show:{{#var:gacha subobj}}|?Has banner image}}}}{{#vardefine:banner image loop|{{#ifeq:{{{banners|1}}}|0|999|{{{banners|1}}}}}}}{{#while:|{{#var:banner image loop}}|
   <td colspan="2">{{#vardefine:banner image array|{{#show:{{#var:Gacha subobj}}|?Has banner image}}}}{{#vardefine:banner image loop|{{#ifeq:{{{banners|1}}}|0|999|{{{banners|1}}}}}}}{{#while:|{{#var:banner image loop}}|
<div class="banner-image">{{Direct Linked Image|src={{filepath:{{#sub:{{#var:banner image array}}|0|{{#pos:{{#var:banner image array}}|;}}}}}}|href={{#show:{{#var:gacha subobj}}|?Has news link}}}}</div>
<div class="banner-image">{{Direct Linked Image|src={{filepath:{{#sub:{{#var:banner image array}}|0|{{#pos:{{#var:banner image array}}|;}}}}}}|href={{#show:{{#var:Gacha subobj}}|?Has news link}}}}<!--<a href="{{#show:{{#var:Gacha subobj}}|?Has news link}}"><img class="banner-image" src="{{filepath:{{#sub:{{#var:banner image array}}|0|{{#pos:{{#var:banner image array}}|;}}}}}}"></img></a>--></div>
{{#if:{{#pos:{{#var:banner image array}}|;}}|{{#vardefine:banner image loop|{{#expr:{{#var:banner image loop}}-1}}}}|{{#vardefine:banner image loop|}}}}
{{#if:{{#pos:{{#var:banner image array}}|;}}|{{#vardefine:banner image loop|{{#expr:{{#var:banner image loop}}-1}}}}|{{#vardefine:banner image loop|}}}}
{{#vardefine:banner image array|{{#sub:{{#var:banner image array}}|{{#expr:{{#pos:{{#var:banner image array}}|;}}+1}}}}}}
{{#vardefine:banner image array|{{#sub:{{#var:banner image array}}|{{#expr:{{#pos:{{#var:banner image array}}|;}}+1}}}}}}
Line 61: Line 61:
   </td>
   </td>
</tr>
</tr>
{{#vardefine:duration array|{{#show:{{#var:gacha subobj}}|?Has duration date}}}}{{#if:{{#var:duration array|}}|
{{#vardefine:duration array|{{#show:{{#var:Gacha subobj}}|?Has duration date}}}}{{#if:{{#var:duration array|}}|
<tr>
<tr>
   <th colspan="2">Durations</th>
   <th colspan="2">Durations</th>
</tr>
</tr>
{{#vardefine:duration loop|1}}{{#while:|{{#var:duration loop}}|
{{#vardefine:duration loop|1
}}{{#while:|{{#var:duration loop}}|
{{#vardefine:duration array piece|
{{#vardefine:duration array piece|
   {{#sub:{{#var:duration array}}|0|{{#pos:{{#var:duration array}}|;}}}}
   {{#sub:{{#var:duration array}}|0|{{#pos:{{#var:duration array}}|;}}}}
Line 86: Line 87:
   }}{{#vardefine:duration array piece end|
   }}{{#vardefine:duration array piece end|
     {{#explode:{{#var:duration array piece}}|->|1}}
     {{#explode:{{#var:duration array piece}}|->|1}}
   }}{{#if:{{#var:duration array piece start|}}||{{#vardefine:duration array piece start|{{#time:c|December 2nd, 2018}}}}
   }}{{#if:{{#var:duration array piece start|}}||{{#vardefine:duration array piece start|{{#time:c|December 2nd, 2016}}}}
   }}{{#if:{{#var:duration array piece end|}}||{{#vardefine:duration array piece end|{{#time:c|December 31st, 3000}}}}
   }}{{#if:{{#var:duration array piece end|}}||{{#vardefine:duration array piece end|{{#time:c|December 31st, 3000}}}}
   }}
   }}
Line 104: Line 105:
}}}}
}}}}
</table>
</table>
}}{{#ifeq:{{PAGENAME}}|Main Page|{{#if:{{#varexists:main page seo}}||{{#vardefine:main page seo|{{{en name|{{{jp name|???}}}}}}}}{{#seo:
}}</includeonly><noinclude>
|description=A wiki for Tokyo Afterschool Summoners&#10;Current Gacha: {{#var:main page seo}}{{#varexists:duration primary|&#10;From {{#var:duration primary}}.}}
}}}}}}</includeonly><noinclude>
== Description ==
== Description ==
This template displays.
This template displays a gacha's information through an infobox.
== Usage ==
== Usage ==
<pre>{{Gacha preview infobox
<pre>{{Gacha preview infobox

Revision as of 03:24, 15 July 2018

Description

This template displays a gacha's information through an infobox.

Usage

{{Gacha preview infobox
| en name = 
| jp name =
| banners = 
| floats =
}}

Parameters

en name
English name of gacha
jp name
Japanese name of gacha (optional if en name is provided; required if not).
banners
Number of banners to show; defaults to 1. Provide 0 to show all.
floats
Determines if it should float to the right; only "true" enables it.

Examples

{{Gacha preview infobox
| en name = Honorless Great Summer Festival Struggle
| banners = 2
}}
Honorless Great Summer Festival Struggle
Durations
Duration From July 05, 2018 at 09:00 until August 05, 2018 at 14:59