MarkTraceur has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/203889

Change subject: Align the form bits together a bit better
......................................................................

Align the form bits together a bit better

While I was in aligning the privacy policy link with the rest of
the text, I also removed an unsightly bunch of whitespace and made
the messages a little more compact.

Bug: T69051
Change-Id: I734f578a2ecbc38c1061bc26cbe9960a0494a05c
---
M frontend/specialpages/SpecialMWOAuth.php
M i18n/en.json
2 files changed, 18 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OAuth 
refs/changes/89/203889/1

diff --git a/frontend/specialpages/SpecialMWOAuth.php 
b/frontend/specialpages/SpecialMWOAuth.php
index 63dffcc..53e41a4 100644
--- a/frontend/specialpages/SpecialMWOAuth.php
+++ b/frontend/specialpages/SpecialMWOAuth.php
@@ -353,7 +353,11 @@
                        $params[] = $grantsText;
                }
                $form->addHeaderText( $this->msg( $msgKey, $params 
)->parseAsBlock() );
-               $form->addHeaderText( $this->msg( 'mwoauth-form-legal' 
)->text() );
+
+               $legaltext = $this->msg( 'mwoauth-form-legal' )->text();
+               if ( !empty( $legaltext ) ) {
+                       $form->addHeaderText( $legaltext );
+               }
 
                $form->suppressDefaultSubmit();
                $form->addButton( 'cancel',
@@ -364,7 +368,7 @@
                        array( 'class' => 'mw-mwoauth-authorize-button 
mw-ui-button mw-ui-constructive' ) );
 
                $privacyMessage = MWOAuthUtils::getSiteMessage( 
'mwoauth-form-privacypolicy-link' );
-               $form->addFooterText( wfMessage( $privacyMessage )->parse() );
+               $form->addHeaderText( wfMessage( $privacyMessage )->parse() );
 
                $out = $this->getOutput();
                $out->enableOOUI();
@@ -388,17 +392,22 @@
         * @return string Wikitext
         */
        private function getGrantsWikiText( $grants ) {
-               $s = '';
+               $parts = array();
                foreach ( MWOAuthUtils::getGrantGroups( $grants ) as $group => 
$grants ) {
                        if ( $group === 'hidden' ) {
                                continue; // implicitly granted
                        }
-                       $s .= "*<span 
class=\"mw-mwoauth-authorize-form-grantgroup\">" .
-                               wfMessage( "mwoauth-grant-group-$group" 
)->text() . "</span>\n";
-                       $s .= ":" . $this->getLanguage()->semicolonList(
-                               array_map( 
'MediaWiki\Extensions\OAuth\MWOAuthUtils::grantName', $grants ) ) . "\n";
+                       $parts[] = "*<span 
class=\"mw-mwoauth-authorize-form-grantgroup\">" .
+                               wfMessage( "mwoauth-grant-group-$group" 
)->text() . "</span>\n" .
+                               ":" . $this->getLanguage()->semicolonList(
+                                       array_map(
+                                               
'MediaWiki\Extensions\OAuth\MWOAuthUtils::grantName',
+                                               $grants
+                                       )
+                               );
                }
-               return "$s\n";
+
+               return implode( $parts, "\n" );
        }
 
        /**
diff --git a/i18n/en.json b/i18n/en.json
index da808a5..45147a2 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -207,7 +207,7 @@
        "mwoauth-form-description-allwikis-nogrants": "Hi $1,\n\n'''$2''' would 
like to have basic access on your behalf on all projects of this site.",
        "mwoauth-form-description-onewiki-nogrants": "Hi $1,\n\n'''$2''' would 
like to have basic access on your behalf on ''$4''.",
        "mwoauth-form-legal": "",
-       "mwoauth-form-privacypolicy-link": "[[{{ns:Project}}:Privacy 
policy|Privacy Policy]]",
+       "mwoauth-form-privacypolicy-link": "* [[{{ns:Project}}:Privacy 
policy|Privacy Policy]]",
        "mwoauth-form-button-approve": "Allow",
        "mwoauth-form-button-cancel": "Cancel",
        "mwoauth-error": "Application Connection Error",

-- 
To view, visit https://gerrit.wikimedia.org/r/203889
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I734f578a2ecbc38c1061bc26cbe9960a0494a05c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OAuth
Gerrit-Branch: master
Gerrit-Owner: MarkTraceur <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to