-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(mainpage): new Hearthstone main page (#5336)
* feat(mainpage): Set up Hearthstone main page * Update Banner.less * Create filter_buttons_config.lua * Update main_page_layout_data.lua * Update components/main_page/wikis/hearthstone/main_page_layout_data.lua Co-authored-by: Rikard Blixt <[email protected]> * Update components/main_page/wikis/hearthstone/main_page_layout_data.lua Co-authored-by: Rikard Blixt <[email protected]> --------- Co-authored-by: Rikard Blixt <[email protected]>
- Loading branch information
Showing
3 changed files
with
229 additions
and
0 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
components/filter_buttons/wikis/hearthstone/filter_buttons_config.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
-- @Liquipedia | ||
-- wiki=hearthstone | ||
-- page=Module:FilterButtons/Config | ||
-- | ||
-- Please see https://github.com/Liquipedia/Lua-Modules to contribute | ||
-- | ||
|
||
local Tier = require('Module:Tier/Utils') | ||
local Config = {} | ||
|
||
Config.categories = { | ||
{ | ||
name = 'liquipediatier', | ||
property = 'liquipediaTier', | ||
load = function(category) | ||
category.items = {} | ||
for _, tier in Tier.iterate('tiers') do | ||
table.insert(category.items, tier.value) | ||
end | ||
end, | ||
defaultItems = {'1', '2', '3', '4'}, | ||
transform = function(tier) | ||
return Tier.toName(tier) | ||
end, | ||
}, | ||
} | ||
|
||
return Config |
194 changes: 194 additions & 0 deletions
194
components/main_page/wikis/hearthstone/main_page_layout_data.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,194 @@ | ||
--- | ||
-- @Liquipedia | ||
-- wiki=hearthstone | ||
-- page=Module:MainPageLayout/data | ||
-- | ||
-- Please see https://github.com/Liquipedia/Lua-Modules to contribute | ||
-- | ||
|
||
local CONTENT = { | ||
usefulArticles = { | ||
heading = 'Useful Articles', | ||
body = '{{Liquipedia:Useful Articles}}', | ||
padding = true, | ||
boxid = 1503, | ||
}, | ||
wantToHelp = { | ||
heading = 'Want To Help?', | ||
body = '{{Liquipedia:Want_to_help}}', | ||
padding = true, | ||
boxid = 1504, | ||
}, | ||
transfers = { | ||
heading = 'Transfers', | ||
body = '{{Transfer List|limit=15}}\n<div style{{=}}"display:block; text-align:center; padding:0.5em;">\n' .. | ||
'<div style{{=}}"display:inline; float:left; font-style:italic;">\'\'[[#Top|Back to top]]\'\'</div>\n' .. | ||
'<div style{{=}}"display:inline; float:right;" class="plainlinks smalledit">' .. | ||
'[[{{FULLURL:Player Transfers/{{CURRENTYEAR}}/1st_Quarter|action=edit}} edit]]</div>\n' .. | ||
'<div style{{=}}"white-space:nowrap; display:inline; margin:0 10px font-size:15px; font-style:italic;">' .. | ||
'[[Portal:Transfers|See more transfers]]<span style="font-style:normal; padding:0 5px;">•</span>' .. | ||
'[[Transfer query]]<span style{{=}}"font-style:normal; padding:0 5px;">•</span>' .. | ||
'[[lpcommons:Special:RunQuery/Transfer|Input Form]]' .. | ||
'<span style="font-style:normal; padding:0 5px;">•</span>' .. | ||
'[[Portal:Rumours|Rumours]]</center></div>\n</div>', | ||
boxid = 1509, | ||
}, | ||
thisDay = { | ||
heading = 'This day in Hearthstone <small id="this-day-date" style = "margin-left: 5px">' .. | ||
'({{#time:F}} {{Ordinal|{{#time:j}}}})</small>', | ||
body = '{{Liquipedia:This day}}', | ||
padding = true, | ||
boxid = 1510, | ||
}, | ||
specialEvents = { | ||
noPanel = true, | ||
body = '{{Liquipedia:Special Event}}', | ||
}, | ||
filterButtons = { | ||
noPanel = true, | ||
body = '<div style{{=}}"width:100%;margin-bottom:8px;">' .. | ||
'{{#invoke:Lua|invoke|module=FilterButtons|fn=getFromConfig}}</div>', | ||
}, | ||
matches = { | ||
heading = 'Matches', | ||
body = '{{#invoke:Lua|invoke|module=Widget/Factory|fn=fromTemplate|widget=Match/Ticker/Container}}' .. | ||
'<div style{{=}}"white-space:nowrap; display: block; margin:0 10px; ' .. | ||
'font-size:15px; font-style:italic; text-align:center;">[[Liquipedia:Matches|See more matches]]</div>', | ||
padding = true, | ||
boxid = 1507, | ||
}, | ||
tournaments = { | ||
heading = 'Tournaments', | ||
body = '{{#invoke:Lua|invoke|module=Widget/Factory|fn=fromTemplate|widget=Tournaments/Ticker' .. | ||
'|upcomingDays=30|completedDays=20}}', | ||
padding = true, | ||
boxid = 1508, | ||
}, | ||
} | ||
|
||
return { | ||
banner = { | ||
lightmode = 'Hearthstone_full logo.png', | ||
darkmode = 'Hearthstone_full logo.png', | ||
}, | ||
metadesc = 'The Hearthstone esports wiki covering everything from players, teams and transfers, ' .. | ||
'to tournaments and results, heroes, and cards.', | ||
title = 'Hearthstone', | ||
navigation = { | ||
{ | ||
file = 'Team Ukraine 2017 Hearthstone Global Games .jpg', | ||
title = 'Teams', | ||
link = 'Portal:Teams', | ||
count = { | ||
method = 'LPDB', | ||
table = 'team', | ||
}, | ||
}, | ||
{ | ||
file = 'Hunterace World Championship 2019.jpg', | ||
title = 'Players', | ||
link = 'Portal:Players', | ||
count = { | ||
method = 'LPDB', | ||
table = 'player', | ||
}, | ||
}, | ||
{ | ||
file = 'Masters Tour 2020 Arlington Trophy.jpg', | ||
title = 'Tournaments', | ||
link = 'Portal:Tournaments', | ||
count = { | ||
method = 'LPDB', | ||
table = 'tournament', | ||
}, | ||
}, | ||
{ | ||
file = 'Casie and Surrender Grandmasters 2019 Finals.jpg', | ||
title = 'Transfers', | ||
link = 'Portal:Transfers', | ||
count = { | ||
method = 'LPDB', | ||
table = 'transfer', | ||
}, | ||
}, | ||
{ | ||
file = 'Masters Tour 2020 Statistics.jpg', | ||
title = 'Statistics', | ||
link = 'Portal:Statistics', | ||
}, | ||
{ | ||
file = 'Icon_Class_HS_Shaman.png', | ||
title = 'Classes', | ||
link = 'Classes', | ||
count = { | ||
method = 'CATEGORY', | ||
category = 'Classes', | ||
} | ||
}, | ||
}, | ||
layouts = { | ||
main = { | ||
{ -- Left | ||
size = 6, | ||
children = { | ||
{ | ||
mobileOrder = 1, | ||
content = CONTENT.specialEvents, | ||
}, | ||
{ | ||
mobileOrder = 3, | ||
content = CONTENT.transfers, | ||
}, | ||
{ | ||
mobileOrder = 6, | ||
content = CONTENT.wantToHelp, | ||
}, | ||
} | ||
}, | ||
{ -- Right | ||
size = 6, | ||
children = { | ||
{ | ||
mobileOrder = 2, | ||
children = { | ||
{ | ||
children = { | ||
{ | ||
noPanel = true, | ||
content = CONTENT.filterButtons, | ||
}, | ||
}, | ||
}, | ||
{ | ||
size = 6, | ||
children = { | ||
{ | ||
noPanel = true, | ||
content = CONTENT.matches, | ||
}, | ||
}, | ||
}, | ||
{ | ||
size = 6, | ||
children = { | ||
{ | ||
noPanel = true, | ||
content = CONTENT.tournaments, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
{ | ||
mobileOrder = 5, | ||
content = CONTENT.thisDay, | ||
}, | ||
{ | ||
mobileOrder = 4, | ||
content = CONTENT.usefulArticles, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters