Santhosh has uploaded a new change for review.

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

Change subject: Make stats table target languages as links to translations 
using cx
......................................................................

Make stats table target languages as links to translations using cx

Links point to Special:RecentChanges?tagfilter=contenttranslation in
target wikis

Change-Id: I5314c5c6b1480047c5e7489ba5d59465459dd9a2
---
M modules/stats/ext.cx.stats.js
M modules/stats/styles/ext.cx.stats.less
2 files changed, 14 insertions(+), 2 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation 
refs/changes/49/190149/1

diff --git a/modules/stats/ext.cx.stats.js b/modules/stats/ext.cx.stats.js
index e65c2f2..e2557e7 100644
--- a/modules/stats/ext.cx.stats.js
+++ b/modules/stats/ext.cx.stats.js
@@ -51,7 +51,12 @@
                                        continue;
                                }
                                if ( i === 0 ) {
-                                       table[ 0 ][ j ] = languages[ j - 1 ];
+                                       table[ 0 ][ j ] = $( '<a>' )
+                                               .attr( {
+                                                       target: '_blank',
+                                                       href: '//' + languages[ 
j - 1 ] + 
'.wikipedia.org/wiki/Special:RecentChanges?tagfilter=contenttranslation'
+                                               } )
+                                               .text( languages[ j - 1 ] );
                                        continue;
                                }
                                if ( j === 0 ) {
@@ -102,7 +107,11 @@
                        $row = $( '<tr>' );
                        for ( j = 0; j < table.length; j++ ) {
                                value = table[ i ][ j ];
-                               $td = $( '<td>' ).text( value === 0 ? '' : 
mw.language.convertNumber( value ) );
+                               if ( value instanceof jQuery ) {
+                                       $td = $( '<td>' ).append( value );
+                               } else {
+                                       $td = $( '<td>' ).text( value === 0 ? 
'' : mw.language.convertNumber( value ) );
+                               }
                                if ( i > 0 && j > 0 && i < table.length - 1 && 
j <
                                        table.length - 1 && value > 0 ) {
                                        $td.addClass( 'cx-stat-color-' + 
parseInt( value / division ) );
diff --git a/modules/stats/styles/ext.cx.stats.less 
b/modules/stats/styles/ext.cx.stats.less
index e8e8237..b304b52 100644
--- a/modules/stats/styles/ext.cx.stats.less
+++ b/modules/stats/styles/ext.cx.stats.less
@@ -13,6 +13,9 @@
        thead {
                font-weight: 700;
                background-color: #eee;
+               a {
+                       color: #252525;
+               }
        }
        .cx-stat-color-0 {
                background-color: #E8F5E9;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5314c5c6b1480047c5e7489ba5d59465459dd9a2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Santhosh <[email protected]>

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

Reply via email to