Santhosh has uploaded a new change for review.

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

Change subject: Dashboard: Open the published URL when clicked on a published 
translation
......................................................................

Dashboard: Open the published URL when clicked on a published translation

Bug: T78136
Change-Id: Ibb3d0e852b8d83c1b225ccd86a85de06f06bbe93
---
M modules/dashboard/ext.cx.translationlist.js
1 file changed, 21 insertions(+), 11 deletions(-)


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

diff --git a/modules/dashboard/ext.cx.translationlist.js 
b/modules/dashboard/ext.cx.translationlist.js
index ff1fb8f..0b96e1f 100644
--- a/modules/dashboard/ext.cx.translationlist.js
+++ b/modules/dashboard/ext.cx.translationlist.js
@@ -160,17 +160,27 @@
                        $imageBlock.append( $image, $progressbar );
                        this.showTitleImage( translation );
 
-                       $translationLink = $( '<a>' )
-                               .addClass( 'source-title' )
-                               .attr( {
-                                       href: new mw.Uri().extend( {
-                                               from: 
translation.sourceLanguage,
-                                               to: translation.targetLanguage,
-                                               page: translation.sourceTitle,
-                                               targettitle: 
translation.targetTitle,
-                                               draft: translation.status === 
'draft' ? translation.id : undefined
-                                       } ).toString()
-                               } ).text( translation.sourceTitle );
+                       if ( translation.status === 'draft' ) {
+                               $translationLink = $( '<a>' )
+                                       .addClass( 'source-title' )
+                                       .attr( {
+                                               href: new mw.Uri().extend( {
+                                                       from: 
translation.sourceLanguage,
+                                                       to: 
translation.targetLanguage,
+                                                       page: 
translation.sourceTitle,
+                                                       targettitle: 
translation.targetTitle,
+                                                       draft: 
translation.status === 'draft' ? translation.id : undefined
+                                               } ).toString()
+                                       } ).text( translation.sourceTitle );
+                       }
+                       if ( translation.status === 'published' ) {
+                               $translationLink = $( '<a>' )
+                                       .addClass( 'source-title' )
+                                       .attr( {
+                                               href: translation.targetURL
+                                       } )
+                                       .text( translation.sourceTitle );
+                       }
                        $sourceLanguage = $( '<div>' )
                                .addClass( 'source-language' )
                                .text( $.uls.data.getAutonym( 
translation.sourceLanguage ) );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibb3d0e852b8d83c1b225ccd86a85de06f06bbe93
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Santhosh <santhosh.thottin...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to