Skip to content

Commit

Permalink
Merge branch 'main' into support-postponed-in-match2
Browse files Browse the repository at this point in the history
  • Loading branch information
hjpalpha authored Dec 16, 2024
2 parents 8ba75ea + 24b82f1 commit f920bb0
Show file tree
Hide file tree
Showing 116 changed files with 3,318 additions and 1,156 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/deploy test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ jobs:
- name: Personal Lua Deploy
if: steps.changed-files.outputs.any_changed == 'true'
env:
WIKI_USER: ${{ secrets.LP_USER }}
WIKI_PASSWORD: ${{ secrets.LP_PASSWORD }}
WIKI_USER: ${{ secrets.LP_BOTUSER }}
WIKI_PASSWORD: ${{ secrets.LP_BOTPASSWORD }}
WIKI_UA_EMAIL: ${{ secrets.LP_UA_EMAIL }}
WIKI_BASE_URL: ${{ secrets.LP_BASE_URL }}
LUA_DEV_ENV_NAME: "/dev/${{ github.event.inputs.luadevenv }}"
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@ jobs:
- name: Resource Deploy
if: steps.res-changed-files.outputs.any_changed == 'true'
env:
WIKI_USER: ${{ secrets.LP_USER }}
WIKI_PASSWORD: ${{ secrets.LP_PASSWORD }}
WIKI_USER: ${{ secrets.LP_BOTUSER }}
WIKI_PASSWORD: ${{ secrets.LP_BOTPASSWORD }}
WIKI_UA_EMAIL: ${{ secrets.LP_UA_EMAIL }}
WIKI_BASE_URL: ${{ secrets.LP_BASE_URL }}
run: bash scripts/deploy_res.sh "${{ steps.res-changed-files.outputs.all_changed_files }}"

- name: Lua Deploy
if: steps.lua-changed-files.outputs.any_changed == 'true'
env:
WIKI_USER: ${{ secrets.LP_USER }}
WIKI_PASSWORD: ${{ secrets.LP_PASSWORD }}
WIKI_USER: ${{ secrets.LP_BOTUSER }}
WIKI_PASSWORD: ${{ secrets.LP_BOTPASSWORD }}
WIKI_UA_EMAIL: ${{ secrets.LP_UA_EMAIL }}
WIKI_BASE_URL: ${{ secrets.LP_BASE_URL }}
run: bash scripts/deploy.sh "${{ steps.lua-changed-files.outputs.all_changed_files }}"
Expand All @@ -69,8 +69,8 @@ jobs:
- name: Deploy Old Dev
if: steps.changed-files.outputs.any_changed == 'true'
env:
WIKI_USER: ${{ secrets.DEV_WIKI_USER }}
WIKI_PASSWORD: ${{ secrets.DEV_WIKI_PASSWORD }}
WIKI_USER: ${{ secrets.DEV_WIKI_BOTUSER }}
WIKI_PASSWORD: ${{ secrets.DEV_WIKI_BOTPASSWORD }}
WIKI_UA_EMAIL: ${{ secrets.DEV_WIKI_UA_EMAIL }}
WIKI_BASE_URL: ${{ secrets.DEV_WIKI_BASE_URL }}
DEV_WIKI_BASIC_AUTH: ${{ secrets.DEV_WIKI_BASIC_AUTH }}
Expand All @@ -79,8 +79,8 @@ jobs:
- name: Deploy New Dev
if: steps.changed-files.outputs.any_changed == 'true'
env:
WIKI_USER: ${{ secrets.DEV_WIKI_USER }}
WIKI_PASSWORD: ${{ secrets.DEV_WIKI_PASSWORD }}
WIKI_USER: ${{ secrets.DEV_WIKI_BOTUSER }}
WIKI_PASSWORD: ${{ secrets.DEV_WIKI_BOTPASSWORD }}
WIKI_UA_EMAIL: ${{ secrets.DEV_WIKI_UA_EMAIL }}
WIKI_BASE_URL: ${{ secrets.DEV_WIKI_BASE_URL2 }}
DEV_WIKI_BASIC_AUTH: ${{ secrets.DEV_WIKI_BASIC_AUTH }}
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/scheduled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ jobs:

- name: Resource Deploy
env:
WIKI_USER: ${{ secrets.LP_USER }}
WIKI_PASSWORD: ${{ secrets.LP_PASSWORD }}
WIKI_USER: ${{ secrets.LP_BOTUSER }}
WIKI_PASSWORD: ${{ secrets.LP_BOTPASSWORD }}
WIKI_UA_EMAIL: ${{ secrets.LP_UA_EMAIL }}
WIKI_BASE_URL: ${{ secrets.LP_BASE_URL }}
run: bash scripts/deploy_res.sh

- name: Lua Deploy
env:
WIKI_USER: ${{ secrets.LP_USER }}
WIKI_PASSWORD: ${{ secrets.LP_PASSWORD }}
WIKI_USER: ${{ secrets.LP_BOTUSER }}
WIKI_PASSWORD: ${{ secrets.LP_BOTPASSWORD }}
WIKI_UA_EMAIL: ${{ secrets.LP_UA_EMAIL }}
WIKI_BASE_URL: ${{ secrets.LP_BASE_URL }}
run: bash scripts/deploy.sh
Expand All @@ -42,17 +42,17 @@ jobs:

- name: Deploy Old Dev
env:
WIKI_USER: ${{ secrets.DEV_WIKI_USER }}
WIKI_PASSWORD: ${{ secrets.DEV_WIKI_PASSWORD }}
WIKI_USER: ${{ secrets.DEV_WIKI_BOTUSER }}
WIKI_PASSWORD: ${{ secrets.DEV_WIKI_BOTPASSWORD }}
WIKI_UA_EMAIL: ${{ secrets.DEV_WIKI_UA_EMAIL }}
WIKI_BASE_URL: ${{ secrets.DEV_WIKI_BASE_URL }}
DEV_WIKI_BASIC_AUTH: ${{ secrets.DEV_WIKI_BASIC_AUTH }}
run: bash scripts/deploy.sh

- name: Deploy New Dev
env:
WIKI_USER: ${{ secrets.DEV_WIKI_USER }}
WIKI_PASSWORD: ${{ secrets.DEV_WIKI_PASSWORD }}
WIKI_USER: ${{ secrets.DEV_WIKI_BOTUSER }}
WIKI_PASSWORD: ${{ secrets.DEV_WIKI_BOTPASSWORD }}
WIKI_UA_EMAIL: ${{ secrets.DEV_WIKI_UA_EMAIL }}
WIKI_BASE_URL: ${{ secrets.DEV_WIKI_BASE_URL2 }}
DEV_WIKI_BASIC_AUTH: ${{ secrets.DEV_WIKI_BASIC_AUTH }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
--

local Class = require('Module:Class')
local Logic = require('Module:Logic')
local Lua = require('Module:Lua')
local Variables = require('Module:Variables')

Expand Down Expand Up @@ -38,6 +39,12 @@ function CustomHiddenDataBox.addCustomVariables(args, queryResult)
Variables.varDefine('tournament_icon_dark', Variables.varDefault('tournament_icondark'))
Variables.varDefine('tournament_parent_page', Variables.varDefault('tournament_parent'))

Variables.varDefine('headtohead', tostring(Logic.readBool(Logic.emptyOr(
args.headtohead,
Variables.varDefault('headtohead'),
(queryResult.extradata or {}).headtohead
))))

BasicHiddenDataBox.checkAndAssign('tournament_patch', args.patch, queryResult.patch)
end

Expand Down
4 changes: 4 additions & 0 deletions components/infobox/wikis/dota2/infobox_league_custom.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
local Array = require('Module:Array')
local Class = require('Module:Class')
local Game = require('Module:Game')
local Logic = require('Module:Logic')
local Lua = require('Module:Lua')
local String = require('Module:StringUtils')
local Variables = require('Module:Variables')
Expand Down Expand Up @@ -86,18 +87,21 @@ end
function CustomLeague:addToLpdb(lpdbData, args)
lpdbData.extradata.individual = String.isNotEmpty(args.player_number) and 'true' or ''
lpdbData.extradata.dpcpoints = String.isNotEmpty(args.points) or ''
lpdbData.extradata.headtohead = self.data.headtohead

return lpdbData
end

---@param args table
function CustomLeague:customParseArguments(args)
self.data.publishertier = (self.publisherTier or {}).name
self.data.headtohead = tostring(Logic.readBool(args.headtohead))
end

---@param args table
function CustomLeague:defineCustomPageVariables(args)
-- Custom Vars
Variables.varDefine('headtohead', self.data.headtohead)
Variables.varDefine('tournament_pro_circuit_points', args.points or '')
local isIndividual = String.isNotEmpty(args.individual) or String.isNotEmpty(args.player_number)
Variables.varDefine('tournament_individual', isIndividual and 'true' or '')
Expand Down
58 changes: 58 additions & 0 deletions components/main_page/commons/main_page_layout.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
-- @Liquipedia
-- wiki=commons
-- page=Module:MainPageLayout
--
-- Please see https://github.com/Liquipedia/Lua-Modules to contribute
--

local Arguments = require('Module:Arguments')
local Array = require('Module:Array')
local Grid = require('Module:Grid')
local Lua = require('Module:Lua')
local Template = require('Module:Template')

local Layouts = Lua.import('Module:MainPageLayout/data')

local MainPageLayout = {}

function MainPageLayout.make(frame)
local args = Arguments.getArgs(frame)

local layout = Layouts[args.layout or 'main']
return table.concat(MainPageLayout._makeCells(layout))
end

function MainPageLayout._makeCells(cells)
local frame = mw.getCurrentFrame()
local output = {}

table.insert(output, Grid._start_grid{})
for _, column in ipairs(cells) do
local cellContent = {}
for _, item in ipairs(column.children) do
local content = {}
if item.content then
if item.content.noPanel then
table.insert(content, frame:preprocess(item.content.body))
else
table.insert(content, Template.safeExpand(frame, 'panel', {
['body'] = frame:preprocess(item.content.body),
['box-id'] = item.content.boxid,
['padding'] = tostring(item.content.padding),
['heading'] = item.content.heading,
}))
end
end
if item.children then
Array.extendWith(content, MainPageLayout._makeCells(item.children))
end
table.insert(cellContent, tostring(Grid._cell{table.concat(content), ['order-xs'] = item.mobileOrder}))
end
table.insert(output, tostring(Grid._cell{table.concat(cellContent), lg = column.size, xs = 'ignore', sm = 'ignore'}))
end
table.insert(output, Grid._end_grid{})
return output
end

return MainPageLayout
Loading

0 comments on commit f920bb0

Please sign in to comment.