Skip to content

feat: add player tournament appearances#7071

Open
ElectricalBoy wants to merge 38 commits intomainfrom
player-tournament-apperaances
Open

feat: add player tournament appearances#7071
ElectricalBoy wants to merge 38 commits intomainfrom
player-tournament-apperaances

Conversation

@ElectricalBoy
Copy link
Collaborator

Summary

This PR adds Module:PlayerTournamentAppearances to this repository.

How did you test this change?

preview with dev

Copy link
Collaborator

@hjpalpha hjpalpha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do i assume correctly that the args are named as they are for them being already used?
(they do not follow a scheme, some all lower, some snake case etc pp)

Copy link
Collaborator

@hjpalpha hjpalpha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should likely use widgets instead of mw.html stuff (e.g. in row function)

@ElectricalBoy
Copy link
Collaborator Author

do i assume correctly that the args are named as they are for them being already used?

yes, see ca001ac...8c5104f

Copy link
Collaborator

@hjpalpha hjpalpha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shit to check on phone hence just the question
do we display the link to query form even if it comed from query?

@ElectricalBoy
Copy link
Collaborator Author

do we display the link to query form even if it comed from query?

short answer: no

form silently passes query=true to args which is then parsed & stored in self.config

self.config = {
showPlacementInsteadOfTeam = Logic.readBool(args.showPlacementInsteadOfTeam),
limit = tonumber(args.limit),
isFormQuery = Logic.readBool(args.query),
restrictToPlayersParticipatingIn = args.playerspage,
restrictToFirstPrizePool = Logic.readBool(args.restrictToFirstPrizePool),
}

@ElectricalBoy
Copy link
Collaborator Author

should likely use widgets instead of mw.html stuff (e.g. in row function)

actually the row function is the only remaining use of mw.html in the new version

if self.config.showPlacementInsteadOfTeam then
-- Default to empty string to use data-sort-value
Placement._placement{parent = cell, placement = (result or {}).placement or ''}

and we actually need mw.html there until we refactor Placement._placement

---Takes parent mw html object and childs a placement.
---Expected args fields are `parent` and `placement`.
---@param args {placement: string|integer?, parent: Html, text: string?}
function Placement._placement(args)
if not (type(args) == 'table' and type(args.parent) == 'table') then
return
end
local raw = Placement.raw(args.placement or '')
args.parent:css('text-align', 'center')
:attr('data-sort-value', raw.sort)
:addClass(raw.backgroundClass)
:tag('b')
:addClass(not raw.blackText and 'placement-text' or nil)
:wikitext(raw.display .. (Logic.isNotEmpty(args.text) and (' ' .. args.text) or ''))
end

@Rathoz
Copy link
Collaborator

Rathoz commented Feb 24, 2026

Want to change it to the new table design?

@ElectricalBoy ElectricalBoy force-pushed the player-tournament-apperaances branch from cac081e to 822e297 Compare February 25, 2026 00:57
@Rathoz Rathoz requested a review from mbergen February 25, 2026 11:29
@ElectricalBoy ElectricalBoy force-pushed the player-tournament-apperaances branch from e8fa56f to eb5f326 Compare February 25, 2026 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants