jenkins-bot has submitted this change and it was merged.
Change subject: Add a link to the experimental recommend tool
......................................................................
Add a link to the experimental recommend tool
Image from Pau Giner.
Bug: T112720
Change-Id: I41a92b8decf8f47a2c0dd074c493c3674ee5080c
---
M extension.json
M i18n/en.json
M i18n/qqq.json
M modules/dashboard/ext.cx.suggestionlist.js
A modules/dashboard/images/lightbulb-b.png
A modules/dashboard/images/lightbulb-b.svg
M modules/dashboard/styles/ext.cx.lists.common.less
7 files changed, 61 insertions(+), 3 deletions(-)
Approvals:
Nikerabbit: Looks good to me, approved
jenkins-bot: Verified
diff --git a/extension.json b/extension.json
index b227821..fedea55 100644
--- a/extension.json
+++ b/extension.json
@@ -835,6 +835,7 @@
"cx-suggestionlist-expand",
"cx-suggestionlist-featured",
"cx-suggestionlist-refresh",
+
"cx-suggestionlist-empty-desc-recommend-link-text",
"cx-suggestionlist-view-source-page"
]
},
diff --git a/i18n/en.json b/i18n/en.json
index 04730ba..5ba3d9b 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -110,8 +110,9 @@
"cx-translation-filter-suggested-translations": "Suggestions",
"cx-suggestionlist-favorite": "For later",
"cx-suggestionlist-title": "More suggestions",
- "cx-suggestionlist-empty-title": "Sorry, no pages to suggest",
- "cx-suggestionlist-empty-desc": "You can pick any topic of your choice
when starting a new translation",
+ "cx-suggestionlist-empty-title": "No suggestions for now",
+ "cx-suggestionlist-empty-desc": "We found no suggestions. You can check
later or find relevant pages using our recommendation tool (experimental).",
+ "cx-suggestionlist-empty-desc-recommend-link-text": "View suggestions
(experimental)",
"cx-suggestionlist-featured": "Featured",
"cx-suggestionlist-view-source-page": "View source page",
"cx-translation-filter-from-any-language": "From any language",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 41cc389..17b9f62 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -117,6 +117,7 @@
"cx-suggestionlist-title": "Title for the translation suggestions",
"cx-suggestionlist-empty-title": "Title text shown when there is no
translation suggestions by the current user",
"cx-suggestionlist-empty-desc": "A brief description shown when there
is no translation suggestions by current user",
+ "cx-suggestionlist-empty-desc-recommend-link-text": "The link text to
the [http://recommend.wmflabs.org/ experimental recommend.wmflabs tool].",
"cx-suggestionlist-featured": "A type of a suggested page to
translate\n{{Identical|Featured}}",
"cx-suggestionlist-view-source-page": "Tooltip text in for source
language label for every suggestion item displayed.",
"cx-translation-filter-from-any-language": "Shown in translation filter
in Content Translation dashboard. Selects source language as any language.",
diff --git a/modules/dashboard/ext.cx.suggestionlist.js
b/modules/dashboard/ext.cx.suggestionlist.js
index fd00424..e2607cd 100644
--- a/modules/dashboard/ext.cx.suggestionlist.js
+++ b/modules/dashboard/ext.cx.suggestionlist.js
@@ -594,31 +594,47 @@
};
CXSuggestionList.prototype.showEmptySuggestionList = function () {
- var $img, $title, $desc, listId = emptyListName;
+ var $img, $title, $desc,
+ listId = emptyListName;
if ( !this.lists[ listId ] ) {
this.lists[ listId ] = {
name: listId
};
+
$img = $( '<div>' )
.addClass( 'cx-suggestionlist-empty__img' );
+
$title = $( '<div>' )
.addClass( 'cx-suggestionlist-empty__title' )
.text( mw.msg( 'cx-suggestionlist-empty-title'
) );
+
$desc = $( '<div>' )
.addClass( 'cx-suggestionlist-empty__desc' )
.text( mw.msg( 'cx-suggestionlist-empty-desc' )
);
+
this.lists[ listId ].$list = $( '<div>' )
.addClass( 'cx-suggestionlist-empty' )
.append( $img, $title, $desc );
+
+ $desc.after( $( '<div>' )
+ .addClass( 'cx-suggestionlist-empty__recommend'
)
+ .append( $( '<a>' )
+ .text( mw.msg(
'cx-suggestionlist-empty-desc-recommend-link-text' ) )
+ .prop( 'href',
'http://recommend.wmflabs.org' )
+ )
+ );
+
this.$container.append( this.lists[ listId ].$list );
}
+
// Hide all other lists, if any.
$.each( this.lists, function ( index, list ) {
if ( list.$list ) {
list.$list.hide();
}
} );
+
this.lists[ listId ].$list.show();
};
diff --git a/modules/dashboard/images/lightbulb-b.png
b/modules/dashboard/images/lightbulb-b.png
new file mode 100644
index 0000000..151177c
--- /dev/null
+++ b/modules/dashboard/images/lightbulb-b.png
Binary files differ
diff --git a/modules/dashboard/images/lightbulb-b.svg
b/modules/dashboard/images/lightbulb-b.svg
new file mode 100644
index 0000000..c11e62b
--- /dev/null
+++ b/modules/dashboard/images/lightbulb-b.svg
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ version="1.1"
+ width="100%"
+ height="100%"
+ viewBox="0 0 40 40"
+ id="Layer_1"
+ xml:space="preserve"><metadata
+ id="metadata9"><rdf:RDF><cc:Work
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage"
/><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
+ id="defs7" /><path
+ d="m 17.2,34.9 c -0.6,0 -0.9,0.8 -0.5,1.2 0.9,0.8 1.6,1.5 2.2,1.5 h 2.2 c
0.6,0 1.2,-0.6 2.1,-1.5 0.5,-0.4 0.2,-1.2 -0.5,-1.2 H 17.2 z M 24,33.2 h -7.9 c
-0.8,0 -1.4,-0.6 -1.4,-1.4 0,-0.8 0.6,-1.4 1.4,-1.4 H 24 c 0.8,0 1.4,0.6
1.4,1.4 0,0.8 -0.6,1.4 -1.4,1.4 z m -8,-4.5 c -0.7,0 -1.3,-0.5 -1.4,-1.2 0,-0.1
-0.3,-1.6 -1.9,-3.9 C 12.5,23.3 12.2,22.9 12,22.6 10.3,20.2 8.6,17.7 8.6,13.4
8.6,10.8 9.7,8.1 11.5,6 13.6,3.7 16.6,2.4 20,2.4 c 0.8,0 1.4,0.6 1.4,1.4 0,0.8
-0.6,1.4 -1.4,1.4 -3.2,0 -5.2,1.5 -6.3,2.7 -1.4,1.5 -2.2,3.6 -2.2,5.6 0,3.5
1.4,5.4 2.9,7.6 0.2,0.3 0.5,0.7 0.7,1 2,2.9 2.3,4.8 2.3,5 0.1,0.8 -0.4,1.4
-1.2,1.6 -0.1,0 -0.1,0 -0.2,0 z m 8,0 c -0.1,0 -0.1,0 -0.2,0 -0.8,-0.1
-1.3,-0.8 -1.2,-1.6 0,-0.2 0.4,-2.1 2.3,-5 0.2,-0.3 0.5,-0.7 0.7,-1 1.6,-2.2
2.9,-4.2 2.9,-7.6 0,-1.9 -0.9,-4 -2.3,-5.6 C 24.6,6.2 22.4,5.2 20,5.2 19.2,5.2
18.6,4.6 18.6,3.8 18.6,3 19.2,2.4 20,2.4 c 6.8,0 11.4,5.7 11.4,11 0,4.3
-1.7,6.8 -3.4,9.2 -0.2,0.3 -0.5,0.7 -0.7,1 -1.6,2.4 -1.9,3.9 -1.9,3.9 -0.1,0.7
-0.7,1.2 -1.4,1.2 z"
+ id="path3"
+ style="fill:#999999;fill-opacity:1" /></svg>
\ No newline at end of file
diff --git a/modules/dashboard/styles/ext.cx.lists.common.less
b/modules/dashboard/styles/ext.cx.lists.common.less
index 1dc8312..72a5a31 100644
--- a/modules/dashboard/styles/ext.cx.lists.common.less
+++ b/modules/dashboard/styles/ext.cx.lists.common.less
@@ -48,6 +48,23 @@
margin-top: 20px;
font-size: normal;
}
+
+ &__recommend {
+ margin-top: 20px;
+ font-size: normal;
+ font-weight: bold;
+
+ a,
+ a:visited {
+ text-decoration: none;
+ color: inherit;
+ .background-image-svg('../images/lightbulb-b.svg',
'../images/lightbulb-b.png');
+ background-position: left center;
+ background-repeat: no-repeat;
+ background-size: 20px;
+ padding-left: 22px;
+ }
+ }
}
.cx-tlitem__languages,
--
To view, visit https://gerrit.wikimedia.org/r/248852
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I41a92b8decf8f47a2c0dd074c493c3674ee5080c
Gerrit-PatchSet: 9
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Amire80 <[email protected]>
Gerrit-Reviewer: Amire80 <[email protected]>
Gerrit-Reviewer: Nikerabbit <[email protected]>
Gerrit-Reviewer: Pginer <[email protected]>
Gerrit-Reviewer: Santhosh <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits