Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ local Array = require('Module:Array')
local Class = require('Module:Class')
local Countdown = require('Module:Countdown')
local DateExt = require('Module:Date/Ext')
local String = require('Module:StringUtils')
local Icon = require('Module:Icon')
local LeagueIcon = require('Module:LeagueIcon')
local Logic = require('Module:Logic')
local Lua = require('Module:Lua')
local Page = require('Module:Page')
local String = require('Module:StringUtils')
local Table = require('Module:Table')
local Timezone = require('Module:Timezone')
local VodLink = require('Module:VodLink')
Expand Down Expand Up @@ -234,10 +236,12 @@ local Details = Class.new(

---@return Html
function Details:create()
local matchPageIcon = self:_matchPageIcon()
local td = mw.html.create('td')
:addClass('match-filler')
:node(mw.html.create('span')
:node(self:countdown())
:node(mw.html.create('div')
:addClass(matchPageIcon and 'has-matchpage' or nil)
:node(self:countdown(matchPageIcon))
:node(self:tournament())
)

Expand All @@ -254,8 +258,21 @@ function Details:create()
return self.root:node(td)
end

---@return string?
function Details:_matchPageIcon()
local matchPage = (self.match.match2bracketdata or {}).matchpage
if Logic.isEmpty(matchPage) then return end

local display = mw.html.create('div')
:addClass('btn btn-secondary')
:wikitext(Icon.makeIcon{iconName = 'matchpopup'})

return Page.makeInternalLink(tostring(display), matchPage)
end

---@param matchPageIcon string?
---@return Html
function Details:countdown()
function Details:countdown(matchPageIcon)
local match = self.match

local dateString
Expand Down Expand Up @@ -283,7 +300,10 @@ function Details:countdown()
countdownDisplay:node(VodLink.display{vod = match.vod})
end

return countdownDisplay
return mw.html.create('div')
:addClass('match-countdown-wrapper')
:node(countdownDisplay)
:node(matchPageIcon)
end

---@return Html?
Expand All @@ -309,16 +329,14 @@ function Details:tournament()
)

return mw.html.create('div')
:addClass('tournament')
:node(mw.html.create('span')
:css('float', 'right')
:node(icon)
)
:addClass('tournament-flex')
:node(mw.html.create('div')
:addClass('tournament-text')
:addClass('tournament-text-flex')
:wikitext('[[' .. match.pagename .. '|' .. displayName .. ']]  ')
)

:node(mw.html.create('span')
:node(icon)
)
end

---Display class for matches shown within a match ticker
Expand Down
41 changes: 41 additions & 0 deletions stylesheets/commons/Mainpage.less
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,15 @@ table.infobox_matches_content {
white-space: nowrap;
}

.infobox_matches_content .tournament-flex {
width: min( calc( 50% + 20px ), 185px );
display: flex;
}

.infobox_matches_content .has-matchpage .tournament-flex {
width: min( calc( 50% - 20px ), 185px );
}

.infobox_matches_content .tournament-text {
overflow: hidden;
text-overflow: ellipsis;
Expand All @@ -359,6 +368,16 @@ table.infobox_matches_content {
float: right;
}

.infobox_matches_content .tournament-text-flex {
overflow: hidden;
text-overflow: ellipsis;
width: 100%;
font-size: 11px;
height: 16px;
margin: auto;
text-align: center;
}

.infobox_matches_content a.hasStream {
background-position: right;
padding-left: 0;
Expand All @@ -373,6 +392,11 @@ table.infobox_matches_content {
}
}

.infobox_matches_content td.match-filler > div {
display: flex;
justify-content: space-between;
}

.infobox_matches_content:last-child {
margin-bottom: 0;
}
Expand All @@ -394,6 +418,23 @@ span.countdown.match-countdown-countdown {
font-size: 11px;
}

div.match-countdown-wrapper {
display: flex;
gap: 5px;
align-items: center;
width: calc( 50% - 20px );
justify-content: space-between;
}

.infobox_matches_content .has-matchpage div.match-countdown-wrapper {
width: calc( 50% + 20px );
}

.infobox_matches_content .has-matchpage .match-countdown-wrapper .btn-secondary {
min-height: 1.5rem;
padding: 0 0.75rem;
}

/* result gradients for match boxes */
table.infobox_matches_content.winner-left,
.background-gradient-winner-left {
Expand Down