Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 17 additions & 9 deletions lua/wikis/commons/TournamentsListing/CardList.lua
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ function BaseTournamentsListing:build()
self.cachedData = {rank = 1, prize = 0, skippedRanks = self.config.offset}

return TableWidgets.Table{
classes = 'tournaments-listing',
columns = self:buildColumnDefinitions(),
children = {
TableWidgets.TableHeader{
Expand All @@ -202,7 +203,10 @@ function BaseTournamentsListing:buildColumnDefinitions()
config.showTier and {align = 'left'} or nil, -- Tier
config.showGameIcon and {align = 'center'} or nil, -- Game
{align = 'left'}, -- Icon
{align = 'left'}, -- Tournament
{ -- Tournament
align = 'left',
classes = {'column__tournament'},
},
config.showOrganizer and {align = 'left'} or nil, -- Organizer
{align = 'left'}, -- Date
{ -- Prizepool
Expand All @@ -212,10 +216,19 @@ function BaseTournamentsListing:buildColumnDefinitions()
{align = 'left'}, -- Location
{align = 'right'}, -- Participants
config.showQualifierColumnOverWinnerRunnerup
and {align = 'left'} -- Qualified
and { -- Qualified
align = 'left',
classes = {'column__qualified'},
}
or WidgetUtil.collect(
{align = 'left'}, -- Winner
{align = 'left'} -- Runner-up
{ -- Winner
align = 'left',
classes = {'column__placement'},
},
{ -- Runner-up
align = 'left',
classes = {'column__placement'},
}
)
)
end
Expand Down Expand Up @@ -350,11 +363,6 @@ end
---@return Widget
function BaseTournamentsListing:_buildParticipants(opponents)
return HtmlWidgets.Div{
css = {
display = 'inline-grid',
['grid-template-columns'] = 'repeat( auto-fit, minmax( 150px, 1fr ) )',
['min-width'] = '15vw'
},
children = Array.map(opponents, function (opponent)
return OpponentDisplay.BlockOpponent{opponent = opponent}
end)
Expand Down
27 changes: 27 additions & 0 deletions stylesheets/commons/Table2.scss
Original file line number Diff line number Diff line change
Expand Up @@ -280,3 +280,30 @@ $table2-cell-padding-x: 0.75rem;
}
}
}

// TournamentsListing variant (Module:TournamentsListing/CardList)
.tournaments-listing {
width: 100%;

.column {
&__tournament {
width: 100%;
min-width: 15rem;
max-width: 0;
overflow: hidden;
text-overflow: ellipsis;
}

&__placement > div {
display: inline-grid;
grid-template-columns: repeat( auto-fit, minmax( 150px, 1fr ) );
min-width: 12vw;
}

&__qualified > div {
display: inline-grid;
grid-template-columns: repeat( auto-fit, minmax( 150px, 1fr ) );
min-width: 20vw;
}
}
}
Loading