From dabd4fbace106af1f98e477b6184015bdaf5b5db Mon Sep 17 00:00:00 2001 From: salle Date: Tue, 3 Oct 2023 14:22:40 +0200 Subject: [PATCH 1/4] Update squad.lua Removing title row from most tables as they almost always live under section headings with a synonymous name. --- components/squad/commons/squad.lua | 40 ++++++++++++++---------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/components/squad/commons/squad.lua b/components/squad/commons/squad.lua index 51733dfbc01..76be400671a 100644 --- a/components/squad/commons/squad.lua +++ b/components/squad/commons/squad.lua @@ -49,31 +49,29 @@ end function Squad:title() local defaultTitle - if self.type == Squad.TYPE_FORMER then - defaultTitle = 'Former Squad' - elseif self.type == Squad.TYPE_INACTIVE then - defaultTitle = 'Inactive Squad' - else - defaultTitle = 'Active Squad' + if self.type == Squad.TYPE_INACTIVE then + defaultTitle = 'Inactive Players' end local titleText = String.isEmpty(self.args.title) and defaultTitle or self.args.title - local titleContainer = mw.html.create('tr') - - local titleRow = mw.html.create('th') - titleRow:addClass('large-only') - :attr('colspan', '1') - :wikitext(titleText) - - local titleRow2 = mw.html.create('th') - titleRow2:addClass('large-only') - :attr('colspan', '10') - :addClass('roster-title-row2-border') - :wikitext(titleText) - - titleContainer:node(titleRow):node(titleRow2) - self.content:node(titleContainer) + if String.isNotEmpty(titleText) then + local titleContainer = mw.html.create('tr') + + local titleRow = mw.html.create('th') + titleRow:addClass('large-only') + :attr('colspan', '1') + :wikitext(titleText) + + local titleRow2 = mw.html.create('th') + titleRow2:addClass('large-only') + :attr('colspan', '10') + :addClass('roster-title-row2-border') + :wikitext(titleText) + + titleContainer:node(titleRow):node(titleRow2) + self.content:node(titleContainer) + end return self end From 8fc06c253c2b883fcfc96ef6e2fcafcd28be67cb Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Thu, 26 Oct 2023 19:24:42 +0200 Subject: [PATCH 2/4] Update components/squad/commons/squad.lua --- components/squad/commons/squad.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/squad/commons/squad.lua b/components/squad/commons/squad.lua index 76be400671a..82019690afc 100644 --- a/components/squad/commons/squad.lua +++ b/components/squad/commons/squad.lua @@ -53,7 +53,7 @@ function Squad:title() defaultTitle = 'Inactive Players' end - local titleText = String.isEmpty(self.args.title) and defaultTitle or self.args.title + local titleText = Logic.emptyOr(self.args.title, defaultTitle) if String.isNotEmpty(titleText) then local titleContainer = mw.html.create('tr') From f3efd60826e55b6b6e143a48d1e3db23b5544126 Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Thu, 26 Oct 2023 19:25:13 +0200 Subject: [PATCH 3/4] white space --- components/squad/commons/squad.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/squad/commons/squad.lua b/components/squad/commons/squad.lua index 82019690afc..377d0761e7e 100644 --- a/components/squad/commons/squad.lua +++ b/components/squad/commons/squad.lua @@ -57,18 +57,18 @@ function Squad:title() if String.isNotEmpty(titleText) then local titleContainer = mw.html.create('tr') - + local titleRow = mw.html.create('th') titleRow:addClass('large-only') :attr('colspan', '1') :wikitext(titleText) - + local titleRow2 = mw.html.create('th') titleRow2:addClass('large-only') :attr('colspan', '10') :addClass('roster-title-row2-border') :wikitext(titleText) - + titleContainer:node(titleRow):node(titleRow2) self.content:node(titleContainer) end From 839f4c9877b08cc8f051c78f56a64018d54fcc25 Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Thu, 26 Oct 2023 19:26:27 +0200 Subject: [PATCH 4/4] Update squad.lua --- components/squad/commons/squad.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/components/squad/commons/squad.lua b/components/squad/commons/squad.lua index 377d0761e7e..b9d98cc8ad0 100644 --- a/components/squad/commons/squad.lua +++ b/components/squad/commons/squad.lua @@ -8,6 +8,7 @@ local Class = require('Module:Class') local Arguments = require('Module:Arguments') +local Logic = require('Module:Logic') local String = require('Module:StringUtils') local Squad = Class.new()