Show time left until block expiry in BlockListPager
authorFlorian <florian.schmidt.stargatewissen@gmail.com>
Thu, 24 Mar 2016 17:52:25 +0000 (18:52 +0100)
committerSiebrand <siebrand@kitano.nl>
Sat, 2 Apr 2016 11:55:27 +0000 (11:55 +0000)
Bug: T130441
Change-Id: I1729b49ebb631a597bb88655b37dd45746e4d646

includes/specials/pagers/BlockListPager.php
languages/i18n/en.json
languages/i18n/qqq.json

index 8857907..cfaf5c5 100644 (file)
@@ -140,6 +140,22 @@ class BlockListPager extends TablePager {
                                                                $language->pipeList( $links ) )->escaped()
                                                );
                                }
+                               if ( $value !== 'infinity' ) {
+                                       $timestamp = new MWTimestamp( $value );
+                                       $formatted .= '<br />' . $this->msg(
+                                               'ipb-blocklist-duration-left',
+                                               $language->formatDuration(
+                                                       $timestamp->getTimestamp() - time(),
+                                                       // reasonable output
+                                                       [
+                                                               'minutes',
+                                                               'hours',
+                                                               'days',
+                                                               'years',
+                                                       ]
+                                               )
+                                       )->escaped();
+                               }
                                break;
 
                        case 'ipb_by':
index 949fd55..c26d2a9 100644 (file)
        "ipb-unblock": "Unblock a username or IP address",
        "ipb-blocklist": "View existing blocks",
        "ipb-blocklist-contribs": "Contributions for {{GENDER:$1|$1}}",
+       "ipb-blocklist-duration-left": "$1 left",
        "unblockip": "Unblock user",
        "unblockiptext": "Use the form below to restore write access to a previously blocked IP address or username.",
        "ipusubmit": "Remove this block",
index 0367bb7..e7df244 100644 (file)
        "ipb-unblock": "Used as page title in [[Special:Block]], if the target user is not specified.\n\nSee also:\n* {{msg-mw|Ipb-unblock-addr}}",
        "ipb-blocklist": "Used as link text in [[Special:Block]].\n\nThe link points to Specil:BlockList.",
        "ipb-blocklist-contribs": "Used in [[Special:Block]].\n* $1 - target username",
+       "ipb-blocklist-duration-left": "Used on [[Special:BlockList]] to show the remaining time (years, months, days, hours, minutes) until the block expires.\n$1 - The duration left",
        "unblockip": "Used as legend for the form in [[Special:Unblock]].",
        "unblockiptext": "Used in the {{msg-mw|Unblockip}} form on [[Special:Unblock]].",
        "ipusubmit": "Used as button text on [{{canonicalurl:Special:BlockList|action=unblock}} Special:BlockList?action=unblock]. To see the message:\n* Go to [[Special:BlockList]]\n* Click \"unblock\" for any block (but you can only see \"unblock\" if you have administrator rights)\n* It is now the button below the form",