jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/363234 )

Change subject: Adjust translation headers in the dashboard
......................................................................


Adjust translation headers in the dashboard

Provide all different lists (suggestions, ongoing translations
and published articles) with a header that is part of the same
piece of paper as the content displayed

Bug: T160398
Change-Id: I6df7293869594003a0e6917e7df24e7a2a61e03d
---
M extension.json
M i18n/en.json
M i18n/qqq.json
M modules/dashboard/ext.cx.suggestionlist.js
M modules/dashboard/ext.cx.translationlist.js
M modules/dashboard/styles/ext.cx.dashboard.less
M modules/dashboard/styles/ext.cx.lists.common.less
M modules/dashboard/styles/ext.cx.suggestionlist.less
8 files changed, 49 insertions(+), 22 deletions(-)

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



diff --git a/extension.json b/extension.json
index 146c57b..c2904b8 100644
--- a/extension.json
+++ b/extension.json
@@ -940,6 +940,8 @@
                                "cx-translation-status-draft",
                                "cx-translation-status-deleted",
                                "cx-translation-status-published",
+                               "cx-translation-label-draft",
+                               "cx-translation-label-published",
                                "cx-draft-discard-confirmation-message",
                                "cx-draft-cancel-button-label",
                                "cx-draft-discard-button-label",
diff --git a/i18n/en.json b/i18n/en.json
index 8da33c1..46fc5a4 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -109,7 +109,7 @@
        "cx-translation-filter-draft-translations": "In progress",
        "cx-translation-filter-suggested-translations": "Suggestions",
        "cx-suggestionlist-favorite": "For later",
-       "cx-suggestionlist-title": "More suggestions",
+       "cx-suggestionlist-title": "Suggested pages",
        "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)",
@@ -136,6 +136,8 @@
        "cx-translation-status-draft": "In progress",
        "cx-translation-status-published": "Published",
        "cx-translation-status-deleted": "Deleted",
+       "cx-translation-label-draft": "Translations in progress",
+       "cx-translation-label-published": "Published translations",
        "cx-translation-already-in-progress": "This is an ongoing translation 
{{GENDER:$2|by}} $1.",
        "cx-translation-already-in-progress-collaborate": "Please make sure you 
coordinate with the {{GENDER:$1|user}} who translated the current translation.",
        "cx-publishing-dialog-publish-draft-button": "Publish as draft",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 8bc55a7..e90172a 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -145,6 +145,8 @@
        "cx-translation-status-draft": "In progress status label for the 
translation in the Content Translation dashboard. This means that the 
translation is stored internally as a draft, accessible only to the user who 
started it, and not published as a wiki page.",
        "cx-translation-status-published": "Published status label for the 
translation in the Content Translation dashboard.\n{{Identical|Published}}",
        "cx-translation-status-deleted": "Deleted status label for the 
translation in the Content Translation dashboard.\n{{Identical|Deleted}}",
+       "cx-translation-label-draft": "Label in header for list of draft 
translations in the Content Translation dashboard",
+       "cx-translation-label-published": "Label in header for list of 
published translations in the Content Translation dashboard",
        "cx-translation-already-in-progress": "Message shown when a second 
translator tries to translate the same page between same languages. 
\n\nParameters:\n* $1 - User name of first translator\n* $2 - Gender of the 
first translator",
        "cx-translation-already-in-progress-collaborate": "A message to 
collaborate with other translator. Shown when there is translation 
conflict.\n\nParameters:\n* $1 - Gender of the first translator",
        "cx-publishing-dialog-publish-draft-button": "Button label for 
publishing options dialog. Used if extension is not configured to publish to 
User namespace.",
diff --git a/modules/dashboard/ext.cx.suggestionlist.js 
b/modules/dashboard/ext.cx.suggestionlist.js
index d375a49..f5012c1 100644
--- a/modules/dashboard/ext.cx.suggestionlist.js
+++ b/modules/dashboard/ext.cx.suggestionlist.js
@@ -76,14 +76,19 @@
        }
 
        CXSuggestionList.prototype.init = function () {
+               var $listHeaderContainer;
+
                this.seed = parseInt( Math.random() * 10000, 10 );
                this.$personalCollection = $( '<div>' ).addClass( 
'cx-suggestionlist__personal' );
-               this.$publicCollectionContainer = $( '<div>' )
-                       .addClass( 'cx-suggestionlist__public' )
-                       .append( $( '<h2>' )
+               $listHeaderContainer = $( '<div>' )
+                       .addClass( 'cx-suggestionlist__header' )
+                       .append( $( '<span>' )
                                .text( mw.msg( 'cx-suggestionlist-title' ) )
                                .addClass( 'cx-suggestionlist__public-title' )
                        );
+               this.$publicCollectionContainer = $( '<div>' )
+                       .addClass( 'cx-suggestionlist__public' )
+                       .append( $listHeaderContainer );
                this.$publicCollection = $( '<div>' )
                        .addClass( 'cx-suggestionlist__public-items' );
                this.$publicCollectionContainer.append( this.$publicCollection 
).hide();
@@ -405,9 +410,13 @@
                                .attr( 'data-listid', listId )
                                .addClass( 'cx-suggestionlist 
cx-suggestionlist-type-' + list.type );
 
-                       if ( list.type !== listTypes.TYPE_FEATURED && list.type 
!== listTypes.TYPE_PERSONALIZED ) {
+                       if ( list.type === listTypes.TYPE_FAVORITE ) {
                                // No need to show heading for misc fallback 
suggestions shown at the end.
-                               $listHeading = $( '<h2>' ).text( 
list.displayName );
+                               $listHeading = $( '<div>' )
+                                       .addClass( 'cx-suggestionlist__header' )
+                                       .append( $( '<span>' )
+                                               .text( mw.msg( 
'cx-suggestionlist-favorite' ) )
+                                       );
                                list.$list.append( $listHeading );
                        }
                        if ( list.type === listTypes.TYPE_FAVORITE ) {
diff --git a/modules/dashboard/ext.cx.translationlist.js 
b/modules/dashboard/ext.cx.translationlist.js
index 8d5b099..8e7d27a 100644
--- a/modules/dashboard/ext.cx.translationlist.js
+++ b/modules/dashboard/ext.cx.translationlist.js
@@ -30,8 +30,8 @@
 
                this.$sourceLanguageFilter = null;
                this.$targetLanguageFilter = null;
-               this.$header = null;
                this.$selectedActionMenu = null;
+               this.$headerContainer = null;
                this.$confirmationDialog = null;
                this.active = false;
                this.promise = null;
@@ -84,6 +84,11 @@
        };
 
        CXTranslationList.prototype.init = function () {
+               this.$headerContainer = $( '<div>' )
+                       .addClass( 'cx-translationlist__header' )
+                       .append( $( '<span>' )
+                               .text( mw.msg( 'cx-translation-label-' + 
this.type ) )
+                       );
                this.$translationsList = $( '<div>' )
                        .addClass( 'cx-translationlist' );
                this.$container.append( this.$translationsList, 
this.$emptyTranslationsList );
@@ -105,6 +110,7 @@
                                self.$translationsList.append( 
self.$emptyTranslationsList );
                                return;
                        }
+                       self.$translationsList.prepend( self.$headerContainer );
                        self.translations = self.translations.concat( 
translations );
                        self.renderTranslations( translations );
                } ).fail( function () {
diff --git a/modules/dashboard/styles/ext.cx.dashboard.less 
b/modules/dashboard/styles/ext.cx.dashboard.less
index 66e9731..fb80da5 100644
--- a/modules/dashboard/styles/ext.cx.dashboard.less
+++ b/modules/dashboard/styles/ext.cx.dashboard.less
@@ -2,7 +2,7 @@
 @import 'mediawiki.mixins';
 
 body {
-       background-color: #eaecf0;
+       background-color: @colorGray14;
 }
 
 .cx-cta {
@@ -12,7 +12,7 @@
        padding: 20px 0;
        float: left;
        font-size: 16px;
-       background-color: #eaecf0;
+       background-color: @colorGray14;
        z-index: 100;
 
        &__new-translation:before {
@@ -117,7 +117,7 @@
        .mw-ui-two-thirds;
 
        padding: 0 10px 0 0;
-       background-color: #eaecf0;
+       background-color: @colorGray14;
 }
 
 .translation-source-language-filter,
@@ -133,13 +133,13 @@
 .translation-filter {
        .mw-ui-one-whole;
 
-       background-color: #eaecf0;
+       background-color: @colorGray14;
        padding: 0;
 
        .cx-filters {
                .mw-ui-one-half;
                float: left;
-               border-radius: 2px;
+               border-radius: @borderRadius;
                overflow: hidden;
                padding: 0;
 
@@ -169,7 +169,7 @@
                .mw-ui-one-half;
                float: right;
                border: 1px solid #9d9d9d;
-               border-radius: 2px;
+               border-radius: @borderRadius;
                background: #fff;
                padding: 0;
 
diff --git a/modules/dashboard/styles/ext.cx.lists.common.less 
b/modules/dashboard/styles/ext.cx.lists.common.less
index 5ca5b98..8defdb1 100644
--- a/modules/dashboard/styles/ext.cx.lists.common.less
+++ b/modules/dashboard/styles/ext.cx.lists.common.less
@@ -5,8 +5,7 @@
        .mw-ui-one-whole;
        padding: 16px;
        background-color: #fff;
-       border: 1px solid #ddd;
-       border-bottom: 0;
+       border-top: 1px solid #ddd;
        cursor: pointer;
 
        &:hover {
@@ -19,11 +18,24 @@
        }
 
        &:last-child {
-               border: 1px solid #ddd;
+               border-top: 1px solid #ddd;
        }
        transition: 1s ease;
 }
 
+.cx-suggestionlist__header,
+.cx-translationlist__header {
+       padding: 24px 16px;
+       background-color: #fff;
+       color: @colorGray5;
+       font-size: 1.125em;
+       line-height: 1em;
+       font-weight: bold;
+       display: flex;
+       align-items: center;
+       justify-content: space-between;
+}
+
 .cx-translationlist-empty,
 .cx-suggestionlist-empty {
        .mw-ui-item;
diff --git a/modules/dashboard/styles/ext.cx.suggestionlist.less 
b/modules/dashboard/styles/ext.cx.suggestionlist.less
index 859dea7..2d16104 100644
--- a/modules/dashboard/styles/ext.cx.suggestionlist.less
+++ b/modules/dashboard/styles/ext.cx.suggestionlist.less
@@ -9,12 +9,6 @@
        margin: 0 0 10px 0;
 }
 
-.cx-suggestionlist h2,
-.cx-suggestionlist__public-title {
-       .mw-ui-one-whole;
-       border-bottom: 0;
-}
-
 .cx-suggestionlist__public {
        .mw-ui-item;
        padding: 0;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6df7293869594003a0e6917e7df24e7a2a61e03d
Gerrit-PatchSet: 11
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Petar.petkovic <[email protected]>
Gerrit-Reviewer: KartikMistry <[email protected]>
Gerrit-Reviewer: Nikerabbit <[email protected]>
Gerrit-Reviewer: Petar.petkovic <[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

Reply via email to