jenkins-bot has submitted this change and it was merged.

Change subject: Added "view table" link to "table was recreated" text
......................................................................


Added "view table" link to "table was recreated" text

Change-Id: Ib698897b97d426b1dd3396b589f7f43503fe7bf8
---
M Cargo.php
M extension.json
M libs/ext.cargo.recreatedata.js
M specials/CargoRecreateData.php
4 files changed, 11 insertions(+), 4 deletions(-)

Approvals:
  Yaron Koren: Checked; Looks good to me, approved
  jenkins-bot: Verified



diff --git a/Cargo.php b/Cargo.php
index cfde10d..bcdfbbe 100644
--- a/Cargo.php
+++ b/Cargo.php
@@ -180,7 +180,8 @@
                'dependencies' => 'mediawiki.jqueryMsg',
                'messages' => array(
                        'cargo-recreatedata-tablecreated',
-                       'cargo-recreatedata-success'
+                       'cargo-recreatedata-success',
+                       'cargo-cargotables-viewtablelink'
                ),
                'position' => 'bottom',
                'localBasePath' => __DIR__,
diff --git a/extension.json b/extension.json
index 5e8de13..7dfdc8f 100644
--- a/extension.json
+++ b/extension.json
@@ -118,7 +118,8 @@
                        "dependencies": "mediawiki.jqueryMsg",
                        "messages": [
                                "cargo-recreatedata-tablecreated",
-                               "cargo-recreatedata-success"
+                               "cargo-recreatedata-success",
+                               "cargo-cargotables-viewtablelink"
                        ],
                        "position": "bottom"
                },
diff --git a/libs/ext.cargo.recreatedata.js b/libs/ext.cargo.recreatedata.js
index 70f2d1c..51c3fcb 100644
--- a/libs/ext.cargo.recreatedata.js
+++ b/libs/ext.cargo.recreatedata.js
@@ -17,6 +17,7 @@
        var cargoScriptPath = dataDiv.attr("cargoscriptpath");
        var tableName = dataDiv.attr("tablename");
        var isDeclared = dataDiv.attr("isdeclared");
+       var viewTableURL = dataDiv.attr("viewtableurl");
        var templateData = jQuery.parseJSON( dataDiv.html() );
 
        var numTotalPages = 0;
@@ -66,7 +67,7 @@
                                        recreateData.createJobs( templateNum + 
1, 0, replaceOldRows );
                                } else {
                                        // We're done.
-                                       $("#recreateDataProgress").html( "<p>" 
+ mw.msg( 'cargo-recreatedata-success' ) + "</p>" );
+                                       $("#recreateDataProgress").html( "<p>" 
+ mw.msg( 'cargo-recreatedata-success' ) + "</p><p><a href=\"" + viewTableURL + 
"\">" + mw.msg( 'cargo-cargotables-viewtablelink' ) + "</a>.</p>" );
                                }
                        }
                });
diff --git a/specials/CargoRecreateData.php b/specials/CargoRecreateData.php
index cf82052..eaf8327 100644
--- a/specials/CargoRecreateData.php
+++ b/specials/CargoRecreateData.php
@@ -77,6 +77,9 @@
                        }
                }
 
+               $ct = SpecialPage::getTitleFor( 'CargoTables' );
+               $viewTableURL = $ct->getInternalURL() . '/' . $this->mTableName;
+
                // Store all the necesssary data on the page.
                $text = Html::element( 'div', array(
                                'hidden' => 'true',
@@ -90,7 +93,8 @@
                                'apiurl' => $wgScriptPath . "/api.php",
                                'cargoscriptpath' => $cgScriptPath,
                                'tablename' => $this->mTableName,
-                               'isdeclared' => $this->mIsDeclared
+                               'isdeclared' => $this->mIsDeclared,
+                               'viewtableurl' => $viewTableURL
                        ), json_encode( $templateData ) );
 
                // Simple form.

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib698897b97d426b1dd3396b589f7f43503fe7bf8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren <yaro...@gmail.com>
Gerrit-Reviewer: Yaron Koren <yaro...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to