From: Florian Date: Thu, 24 Mar 2016 17:52:25 +0000 (+0100) Subject: Show time left until block expiry in BlockListPager X-Git-Tag: 1.31.0-rc.0~7420^2 X-Git-Url: https://git.heureux-cyclage.org/?a=commitdiff_plain;h=96d6dc23432a278478c2cfec05e9f83a53890264;p=lhc%2Fweb%2Fwiklou.git Show time left until block expiry in BlockListPager Bug: T130441 Change-Id: I1729b49ebb631a597bb88655b37dd45746e4d646 --- diff --git a/includes/specials/pagers/BlockListPager.php b/includes/specials/pagers/BlockListPager.php index 8857907712..cfaf5c5f52 100644 --- a/includes/specials/pagers/BlockListPager.php +++ b/includes/specials/pagers/BlockListPager.php @@ -140,6 +140,22 @@ class BlockListPager extends TablePager { $language->pipeList( $links ) )->escaped() ); } + if ( $value !== 'infinity' ) { + $timestamp = new MWTimestamp( $value ); + $formatted .= '
' . $this->msg( + 'ipb-blocklist-duration-left', + $language->formatDuration( + $timestamp->getTimestamp() - time(), + // reasonable output + [ + 'minutes', + 'hours', + 'days', + 'years', + ] + ) + )->escaped(); + } break; case 'ipb_by': diff --git a/languages/i18n/en.json b/languages/i18n/en.json index 949fd55925..c26d2a9f6d 100644 --- a/languages/i18n/en.json +++ b/languages/i18n/en.json @@ -2328,6 +2328,7 @@ "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", diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json index 0367bb7781..e7df244070 100644 --- a/languages/i18n/qqq.json +++ b/languages/i18n/qqq.json @@ -2504,6 +2504,7 @@ "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",