Differenze tra le versioni di "Modulo:Abillist"

Using box predefinite styles and responsive utilities
(Roman numbers in generations)
(Using box predefinite styles and responsive utilities)
 
local abillib = require('Modulo:Wikilib/abils')
local box = require('Modulo:Box')
local css = require('Modulo:Css')
local links = require('Modulo:Links')
local ms = require('Modulo:MiniSprite')
local oop = require('Modulo:Wikilib/oop')
local boxresp = require('Modulo:BoxResp')
local tab = require('Modulo:Wikilib/tables') -- luacheck: no unused
local txt = require('Modulo:Wikilib/strings') -- luacheck: no unused
--]]
local Entry = oop.makeClass(list.PokeSortableEntry)
 
Entry.printTypeBox = function(type, typesCount)
local height = 100 / typesCount
local width = 70 / typesCount
return box.boxTipoLua(
string.fu(type),
'-5 inline-block text-center min-width-xl-100 min-width-xs-' .. width,
string.interp('padding: 0 0.5ex; margin: 0 0.2ex 0.2ex 0; height: ${height}%;',
{height = height})
)
end
 
--[[
-- Wikicode for a list entry: Pokémon mini sprite, name, types and abilities.
Entry.__tostring = function(this)
local typesCount = this.type1 == this.type2 and 1 or 2
 
return string.interp([=[| class="min-width-xs-20" | ${static}
| class="min-width-xs-80" | [[${name}|<span style="color: #000;">${name}</span>]]${form}
| class="width-xl-20 width-xs-100" style="padding: 1ex 0.8ex; font-size: 90%;" | ${type1}${type2types}
| class="min-width-xs-33" | <div class="visible-xs text-small">Prima abilit&agrave;</div>${abil1}${abilEv}
| class="min-width-xs-33" | <div class="visible-xs text-small">Seconda abilit&agrave;</div>${abil2}
(this.formAbbr == 'base' and '' or this.formAbbr or '')),
name = this.name,
form = this.formsData and this.formsData.blacklinks[this.formAbbr] or '',
types = resp.twoTypeBoxesLua(this.type1, this.type2, {'thin'}),
and this.formsData.blacklinks[this.formAbbr]
or '',
type1 = Entry.printTypeBox(this.type1, typesCount),
type2 = typesCount == 1 and ''
or Entry.printTypeBox(this.type2, typesCount),
abil1 = Entry.printAbil(this.ability1),
abilEv = Entry.printAbil(this.abilitye, true),