jenkins-bot has submitted this change and it was merged.
Change subject: Add the "view page" link
......................................................................
Add the "view page" link
Change-Id: I7e14c14a685909174d863bcb6db3a234f51a7cbd
---
M Resources.php
M i18n/en.json
M i18n/qqq.json
M modules/source/ext.cx.source.js
M tests/browser/features/step_definitions/special_content_translation_steps.rb
M tests/browser/features/support/pages/content_translation_page.rb
6 files changed, 16 insertions(+), 8 deletions(-)
Approvals:
KartikMistry: Looks good to me, approved
jenkins-bot: Verified
diff --git a/Resources.php b/Resources.php
index 50c1748..c10a664 100644
--- a/Resources.php
+++ b/Resources.php
@@ -53,6 +53,7 @@
'mediawiki.Uri',
),
'messages' => array(
+ 'cx-source-view-page',
'cx-source-loading'
),
) + $resourcePaths;
diff --git a/i18n/en.json b/i18n/en.json
index 43bc9ca..ef0d463 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -10,6 +10,7 @@
"cx-desc": "A tool that allows editors to translate pages from one
language to another with the help of machine translation and other translation
aids",
"cx-header-progressbar-text": "$1% translated",
"cx-header-translation-center": "Translation center",
+ "cx-source-view-page": "[$1 view page]",
"cx-publish-page": "Page published at [$1 $2]",
"cx-publish-page-error": "Error while saving page.",
"cx-publish-button": "Publish translation",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index b23136b..49f7927 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -11,6 +11,7 @@
"cx-desc":
"{{desc|name=ContentTranslation|url=http://www.mediawiki.org/wiki/Extension:ContentTranslation}}",
"cx-header-progressbar-text": "Text to be shown with the progress bar in
[[Special:ContentTranslation]]. $1 is translation progress in percentage.",
"cx-header-translation-center": "Text for translation center title.",
+ "cx-source-view-page": "A link that points to the source page under the
heading of the source article. $1 is the source article title.",
"cx-publish-page": "Link of the page to be publish.",
"cx-publish-page-error": "Error message to display when page saving
fails.",
"cx-publish-button": "Publish button text in
[[Special:ContentTranslation]].",
diff --git a/modules/source/ext.cx.source.js b/modules/source/ext.cx.source.js
index fb6d4b7..617bfe9 100644
--- a/modules/source/ext.cx.source.js
+++ b/modules/source/ext.cx.source.js
@@ -52,7 +52,13 @@
.append(
$( '<span>' )
.addClass(
'cx-column__language-label' )
- .text( $.uls.data.getAutonym(
contentLanguage ) )
+ .text( $.uls.data.getAutonym(
contentLanguage ) ),
+ $( '<span>' )
+ .addClass(
'cx-column__sub-heading__view-page' )
+ .html( ' ' + mw.message(
+ 'cx-source-view-page',
+ mw.util.getUrl(
this.page )
+ ).parse() )
)
);
diff --git
a/tests/browser/features/step_definitions/special_content_translation_steps.rb
b/tests/browser/features/step_definitions/special_content_translation_steps.rb
index 9ee2c41..4913f81 100644
---
a/tests/browser/features/step_definitions/special_content_translation_steps.rb
+++
b/tests/browser/features/step_definitions/special_content_translation_steps.rb
@@ -28,7 +28,8 @@
end
Then(/^I see a "(.*?)" link that points to the page "(.*?)" on the same
wiki$/) do |link_name, page_title|
- pending # express the regexp above with the code you wish you had
+ page_title_in_url = page_title.gsub(" ", "_")
+ on(ContentTranslationPage).view_page.attribute_value("href").should
match(/#{page_title_in_url}$/)
end
Then(/^I see a "Publish Translation" button$/) do
@@ -115,9 +116,4 @@
# The .style method returns the computed value in px,
# but we need the specified CSS value, so we chech it manually
on(ContentTranslationPage).progress_bar_element.attribute("style").should
match(/width: #{width};/)
-end
-
-Then(/^the "view page" link points to the page "(.+?)" on the same wiki$/) do
|source_page|
- source_page_in_url = source_page.gsub(" ", "_")
- on(ContentTranslationPage).view_page_element.attribute("href").should
match(/#{source_page_in_url}$/)
end
diff --git a/tests/browser/features/support/pages/content_translation_page.rb
b/tests/browser/features/support/pages/content_translation_page.rb
index eb2030a..0116555 100644
--- a/tests/browser/features/support/pages/content_translation_page.rb
+++ b/tests/browser/features/support/pages/content_translation_page.rb
@@ -4,7 +4,6 @@
page_url URL.url("Special:ContentTranslation?<%=params[:extra]%>")
a(:user_name, class: "cx-header__user-details__user-name")
- a(:view_page, class: "view-page")
button(:publish_translation, class: "cx-header__publish")
@@ -45,4 +44,8 @@
def translation_editor
content("translation")
end
+
+ def view_page
+ column("source").span(class:
"cx-column__sub-heading__view-page").a
+ end
end
--
To view, visit https://gerrit.wikimedia.org/r/108020
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I7e14c14a685909174d863bcb6db3a234f51a7cbd
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Amire80 <[email protected]>
Gerrit-Reviewer: KartikMistry <[email protected]>
Gerrit-Reviewer: Nikerabbit <[email protected]>
Gerrit-Reviewer: Santhosh <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits