Skip to content

Commit

Permalink
wikiConfig(ia): add entirePageAppendBottom
Browse files Browse the repository at this point in the history
  • Loading branch information
ChlodAlejandro committed Sep 4, 2024
1 parent 88de635 commit 7eb28d0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions i18n/settings/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@
"deputy.setting.wiki.ia.hideTemplate.description": "Wikitext to hide offending content with. On the English Wikipedia, this is a usage of {{Template:copyvio}}. Other wikis may have an equivalent template. This should go hand in hand with \"{{int:deputy.setting.wiki.ia.hideTemplateBottom.name}}\", as they are used as a pair.",
"deputy.setting.wiki.ia.hideTemplateBottom.name": "Content hiding wikitext (bottom)",
"deputy.setting.wiki.ia.hideTemplateBottom.description": "Placed at the end of hidden content to hide only part of a page. On the English Wikipedia, this is {{Template:copyvio/bottom}}. Other wikis may have an equivalent template.",
"deputy.setting.wiki.ia.entirePageAppendBottom.name": "Append content hiding wikitext (bottom) when hiding an entire page",
"deputy.setting.wiki.ia.entirePageAppendBottom.description": "If enabled, the content hiding wikitext (bottom) will be appended to the end of the page when hiding the entire page. This avoids the \"missing end tag\" lint error, if the template is properly formatted.",
"deputy.setting.wiki.ia.responses.name": "Responses",
"deputy.setting.wiki.ia.responses.description": "Quick responses for copyright problems listings. Used by clerks to resolve specific listings or provide more information about the progress of a given listing."
}
5 changes: 4 additions & 1 deletion src/config/WikiConfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,10 @@ export default class WikiConfiguration extends ConfigurationBase {
defaultValue: copyvioBottom,
displayOptions: { type: 'code' }
} ),
entirePageAppendBottom: new Setting<boolean, boolean>( {
defaultValue: true,
displayOptions: { type: 'checkbox' }
} ),
responses: new Setting<CopyrightProblemsResponse[], CopyrightProblemsResponse[]>( {
...Setting.basicSerializers,
defaultValue: null,
Expand All @@ -367,7 +371,6 @@ export default class WikiConfiguration extends ConfigurationBase {
public outdated = false;

/**
*
* @param sourcePage
* @param serializedData
* @param editable Whether the configuration is editable by the current user or not.
Expand Down
3 changes: 3 additions & 0 deletions src/modules/ia/ui/SinglePageWorkflowDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,9 @@ function initSinglePageWorkflowDialog() {

if ( this.data.entirePage ) {
finalPageContent = copyvioWikitext + '\n' + this.wikitext;
if ( wikiConfig.entirePageAppendBottom.get() ) {
finalPageContent += '\n' + wikiConfig.hideTemplateBottom.get();
}
} else {
finalPageContent =
this.wikitext.slice( 0, this.data.startOffset ) +
Expand Down

0 comments on commit 7eb28d0

Please sign in to comment.