Matthias Mullie has uploaded a new change for review.

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


Change subject: WIP - UI improvements
......................................................................

WIP - UI improvements

Change-Id: I977c2a4acbdc2135ed548da1c0c2005b99aa4871
---
M ArticleFeedbackv5.i18n.php
M ArticleFeedbackv5.model.php
M ArticleFeedbackv5.php
M ArticleFeedbackv5.render.php
M SpecialArticleFeedbackv5.php
M SpecialArticleFeedbackv5Watchlist.php
M modules/ext.articleFeedbackv5/ext.articleFeedbackv5.dashboard.css
D modules/ext.articleFeedbackv5/images/large-negative.png
D modules/ext.articleFeedbackv5/images/large-positive.png
M modules/jquery.articleFeedbackv5/images/negative.png
M modules/jquery.articleFeedbackv5/images/positive.png
M modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.css
M modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.js
13 files changed, 71 insertions(+), 121 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ArticleFeedbackv5 
refs/changes/56/59156/1

diff --git a/ArticleFeedbackv5.i18n.php b/ArticleFeedbackv5.i18n.php
index 184c5c8..5a49294 100644
--- a/ArticleFeedbackv5.i18n.php
+++ b/ArticleFeedbackv5.i18n.php
@@ -139,8 +139,7 @@
        'articlefeedbackv5-special-filter-label-before' => 'Showing:',
        'articlefeedbackv5-special-filter-label-after' => '',
        'articlefeedbackv5-special-filter-select-more' => 'More filters',
-       'articlefeedbackv5-special-showing' => '{{PLURAL:$4|$3 featured 
comment|$3 featured comments}} (of $1)',
-       'articlefeedbackv5-special-central-showing' => '{{PLURAL:$4|$3 featured 
comment|$3 featured comments}} from all pages (of $1)',
+       'articlefeedbackv5-special-count-total' => '{{PLURAL:$1|1 post|$1 
posts}}',
        'articlefeedbackv5-special-watchlist-showing' => 'Feedback for pages 
watched by [[$1|$2]]',
        'articlefeedbackv5-special-central-watchlist-link' => '[[$1|Feedback 
from my watched pages]]',
        'articlefeedbackv5-special-watchlist-central-link' => '[[$1|View 
feedback from all pages]]',
@@ -282,9 +281,6 @@
        'articlefeedbackv5-desc' => 'Article feedback',
        'articlefeedbackv5-comment-more' => 'More',
        'articlefeedbackv5-comment-empty' => 'No text was entered',
-       'articlefeedbackv5-header-message' => 'Please promote good feedback and 
help improve this page. $1',
-       'articlefeedbackv5-header-message-link-text' => 'Learn more',
-       'articlefeedbackv5-beta-label' => 'BETA',
        'articlefeedbackv5-unsupported-message' => 'Sorry, your browser is not 
supported by this prototype. To see this page, please use a different browser.',
        'articlefeedbackv5-page-disabled' => 'Article Feedback page not enabled 
for this page.',
        'articlefeedbackv5-no-feedback' => "There is no feedback for the filter 
you selected. To change your filter, try one of the options above (e.g.: 
'Featured' or 'Unreviewed').",
@@ -299,10 +295,10 @@
        'articlefeedbackv5-special-goback' => 'View feedback page',
        'articlefeedbackv5-special-central-goback' => 'See more feedback from 
other pages',
        'articlefeedbackv5-permalink-info-title' => 'Info about this post',
-       'articlefeedbackv5-permalink-info-subtitle' => '(#$1)',
-       'articlefeedbackv5-permalink-written-by-editor' => 'Written by a 
registered user <span>using feedback form $1</span>',
-       'articlefeedbackv5-permalink-written-by-reader' => 'Written by an 
anonymous user <span>using feedback form $1</span>',
-       'articlefeedbackv5-permalink-info-revision-link' => 'See old version',
+       'articlefeedbackv5-permalink-info-post-id' => 'Post #$1',
+       'articlefeedbackv5-permalink-written-by-editor' => 'Written by a 
registered user',
+       'articlefeedbackv5-permalink-written-by-reader' => 'Written by an 
anonymous user',
+       'articlefeedbackv5-permalink-info-revision-link' => 'See old version of 
this article',
        'articlefeedbackv5-permalink-info-posted' => 'Posted on $1 at $2',
        'articlefeedbackv5-permalink-info-stats-title-length' => 'Length',
        'articlefeedbackv5-permalink-info-length-words' => '{{PLURAL:$1|$1 
word|$1 words}}',
@@ -632,7 +628,7 @@
 
        /* Activity Pane phrases */
        'articlefeedbackv5-activity-pane-header' => 'Activity Log',
-       'articlefeedbackv5-activity-feedback-info' => 'Feedback Post #$1 by $2',
+       'articlefeedbackv5-activity-feedback-info' => 'Feedback by $2',
        'articlefeedbackv5-activity-feedback-date' => 'Posted on $1',
        'articlefeedbackv5-activity-permalink' => 'permalink',
        'articlefeedbackv5-activity-item-request' => '$1 requested oversight on 
$4 at $5 $2',
@@ -884,16 +880,8 @@
        'articlefeedbackv5-special-filter-label-before' => 'Place to put a 
label before the filter options',
        'articlefeedbackv5-special-filter-label-after' => '{{notranslate}}',
        'articlefeedbackv5-special-filter-select-more' => 'Default text for the 
more-filters select box',
-       'articlefeedbackv5-special-showing' => 'Text to show how many feedback 
posts have been posted to this article. Parameters:
-* $1 is the total number of posts, wrapped inside html,
-* $2 is the plural support for $1,
-* $3 is the number of posts in the "featured" filter (= posts marked as 
helpful/useful), wrapped inside html,
-* $4 is the plural support for $3.',
-       'articlefeedbackv5-special-central-showing' => 'Text to show how many 
feedback posts have been posted across the wiki. Parameters:
-* $1 is the total number of posts, wrapped inside html,
-* $2 is the plural support for $1,
-* $3 is the number of posts in the "featured" filter (= posts marked as 
helpful/useful), wrapped inside html,
-* $4 is the plural support for $3.',
+       'articlefeedbackv5-special-count-total' => 'Text to show how many 
feedback posts have been posted. Parameters:
+* $1 is the total number of posts (incl. plural support).',
        'articlefeedbackv5-special-watchlist-showing' => "Text to show we're at 
the page containing feedback on watchlisted articles. Parameters:
 * $1 - a link to the user page
 * $2 - a username",
@@ -1165,10 +1153,6 @@
        'articlefeedbackv5-comment-more' => 'Label for the button to expand the 
truncated comment on feedback.
 {{Identical|More}}',
        'articlefeedbackv5-comment-empty' => 'Text to be displayed instead of 
the feedback comment in case there was no comment',
-       'articlefeedbackv5-header-message' => 'A message to be displayed on the 
special page, encouraging users to behave well. Parameters:
-* $1 is a link to read more about this.',
-       'articlefeedbackv5-header-message-link-text' => 'The link text to be 
displayed (at $1 on articlefeedbackv5-header-message-text)',
-       'articlefeedbackv5-beta-label' => 'A label to be displayed on the 
special page, warning users that this extension is still in beta.',
        'articlefeedbackv5-unsupported-message' => 'A message to be displayed 
on the special page, when a visitor with an unsupported browser visits.',
        'articlefeedbackv5-page-disabled' => 'A message to be displayed on the 
article feedback page when AFT is not enabled for that page',
        'articlefeedbackv5-no-feedback' => 'A message to be displayed on the 
article feedback page when there is no feedback yet for a certain filter.',
@@ -1195,8 +1179,8 @@
        'articlefeedbackv5-special-goback' => 'Link to take a user from a 
feedback permalink back to the listing of all feedback for that page.',
        'articlefeedbackv5-special-central-goback' => 'Link to take a user from 
a single-page feedback listing back to the listing of all feedback.',
        'articlefeedbackv5-permalink-info-title' => 'Permalink info block, 
title of the right column, containing meta-information, e.g., post date',
-       'articlefeedbackv5-permalink-info-subtitle' => '{{Optional}}
-Permalink info block, subtitle of the right column, containing 
meta-information, e.g., post date: $1 is the feedback id',
+       'articlefeedbackv5-permalink-info-post-id' => 'Displays the unique 
feedback id. Parameters:
+* $1 is the feedback id',
        'articlefeedbackv5-permalink-written-by-editor' => 'Permalink info 
block, written-by line for registered users: $1 is the experimental option',
        'articlefeedbackv5-permalink-written-by-reader' => 'Permalink info 
block, written-by line for anonymous users: $1 is the experimental option',
        'articlefeedbackv5-permalink-info-revision-link' => 'Permalink info 
block, text for the link to the revision of the article to which the feedback 
was posted',
diff --git a/ArticleFeedbackv5.model.php b/ArticleFeedbackv5.model.php
index ea8ce42..2f4525e 100644
--- a/ArticleFeedbackv5.model.php
+++ b/ArticleFeedbackv5.model.php
@@ -195,7 +195,7 @@
 
        /**
         * Update the amount of people who marked "yes" to the question if they
-        * found what the were looking for
+        * found what they were looking for.
         */
        public function updateCountFound() {
                $oldRating = 0;
diff --git a/ArticleFeedbackv5.php b/ArticleFeedbackv5.php
index 069159c..9e92687 100644
--- a/ArticleFeedbackv5.php
+++ b/ArticleFeedbackv5.php
@@ -865,8 +865,6 @@
                'articlefeedbackv5-noteflyover-unoversight-help-link',
 
                'articlefeedbackv5-activity-pane-header',
-
-               'articlefeedbackv5-beta-label',
        ),
        'dependencies' => array(
                'mediawiki.util',
diff --git a/ArticleFeedbackv5.render.php b/ArticleFeedbackv5.render.php
index d9fa4d4..0b5b820 100644
--- a/ArticleFeedbackv5.render.php
+++ b/ArticleFeedbackv5.render.php
@@ -1104,6 +1104,13 @@
                                Html::rawElement(
                                        'p',
                                        array(),
+                                       wfMessage( 
'articlefeedbackv5-permalink-info-post-id' )
+                                               ->params( $record->aft_id )
+                                               ->escaped()
+                               ) .
+                               Html::rawElement(
+                                       'p',
+                                       array(),
                                        // Give grep a chance to find the 
usages:
                                        // 
articlefeedbackv5-permalink-written-by-reader, 
articlefeedbackv5-permalink-written-by-editor
                                        wfMessage( 
'articlefeedbackv5-permalink-written-by-' . ( $record->aft_user == 0 ? 'reader' 
: 'editor' ) )
@@ -1279,14 +1286,7 @@
                                        Html::rawElement(
                                                'h4',
                                                array(),
-                                               wfMessage( 
'articlefeedbackv5-permalink-info-title' )->escaped() .
-                                               Html::rawElement(
-                                                       'span',
-                                                       array(),
-                                                       wfMessage( 
'articlefeedbackv5-permalink-info-subtitle' )
-                                                               ->params( 
$record->aft_id )
-                                                               ->escaped()
-                                               )
+                                               wfMessage( 
'articlefeedbackv5-permalink-info-title' )->escaped()
                                        ) .
                                        $metadata .
                                        $stats
diff --git a/SpecialArticleFeedbackv5.php b/SpecialArticleFeedbackv5.php
index eb13f8a..2f60e3d 100644
--- a/SpecialArticleFeedbackv5.php
+++ b/SpecialArticleFeedbackv5.php
@@ -137,10 +137,7 @@
                                $this->filters[] = $filter;
                        }
                }
-               $this->sorts = array( 'relevance-DESC', 'relevance-ASC', 
'age-DESC', 'age-ASC' );
-               if ( $this->isAllowed( 'aft-editor' ) ) {
-                       array_push( $this->sorts, 'helpful-DESC', 'helpful-ASC' 
);
-               }
+               $this->sorts = array( 'relevance-DESC', 'relevance-ASC', 
'age-DESC', 'age-ASC', 'helpful-DESC', 'helpful-ASC' );
 
                // don't display archived list unless specifically "enabled" 
(if cronjob
                // is not running, it would simply not work)
@@ -219,13 +216,6 @@
                $out->addJsConfigVars( 'afFilterCount', $filterCount );
                $out->addJsConfigVars( 'afOffset', $records ? 
$records->nextOffset() : 0 );
                $out->addJsConfigVars( 'afShowMore', $records ? 
$records->hasMore() : false );
-
-               /*
-                * @todo: this is a test; something's wrong with the totals on 
some pages,
-                * let's see what the result of this one is.
-                */
-               $unreviewedCount = ArticleFeedbackv5Model::getCount( 
'unreviewed', $this->pageId );
-               $out->addJsConfigVars( 'afUnreviewedCount', $unreviewedCount );
        }
 
        /**
@@ -320,17 +310,6 @@
         */
        protected function buildListHeader() {
                return
-                       Html::rawElement(
-                               'p',
-                               array( 'id' => 
'articlefeedbackv5-header-message' ),
-                               $this->msg( 'articlefeedbackv5-header-message' 
)->rawParams(
-                                       Html::rawElement(
-                                               'a',
-                                               array( 'href' => 
$this->getHelpLink().'#Feedback_page' ),
-                                               $this->msg( 
'articlefeedbackv5-header-message-link-text' )->escaped() . ' &raquo;'
-                                       )
-                               )->text()
-                       ) .
                        $this->buildSummary() .
                        Html::element( 'div', array( 'class' => 'float-clear' ) 
);
        }
@@ -367,27 +346,12 @@
                }
 
                // Showing {count} posts
-               $filterCount = ArticleFeedbackv5Model::getCount( 'featured', 
$this->pageId );
                $totalCount = ArticleFeedbackv5Model::getCount( '*', 
$this->pageId );
                $count =
                        Html::rawElement(
                                'div',
                                array( 'id' => 
'articleFeedbackv5-showing-count-wrap' ),
-                               $this->msg(
-                                       $this->pageId ? 
'articlefeedbackv5-special-showing' : 
'articlefeedbackv5-special-central-showing',
-                                       Html::element(
-                                               'span',
-                                               array( 'id' => 
'articleFeedbackv5-feedback-count-total' ),
-                                               $totalCount // this figure will 
be filled out through JS
-                                       ),
-                                       $totalCount,
-                                       Html::element(
-                                               'span',
-                                               array( 'id' => 
'articleFeedbackv5-feedback-count-filter' ),
-                                               $filterCount // this figure 
will be filled out through JS
-                                       ),
-                                       $filterCount
-                               )->text() .
+                               $this->msg( 
'articlefeedbackv5-special-count-total', $totalCount )->text() .
                                $watchlistLink
                        );
 
@@ -396,10 +360,19 @@
                if ( $this->pageId ) {
                        $found = ArticleFeedbackv5Model::getCountFound( 
$this->pageId ) / ( $totalCount ?: 1 ) * 100;
                        if ( $found ) {
-                               $class = $found >= 50 ? 'positive' : 'negative';
+                               if ( $found > 50 ) {
+                                       $class = 'positive';
+                               } elseif ( $found < 50 ) {
+                                       $class = 'negative';
+                               } else {
+                                       $class = 'neutral';
+                               }
                                $span = Html::rawElement(
                                        'span',
-                                       array( 'class' => "stat-marker $class" 
),
+                                       array(
+                                               'class' => "stat-marker $class",
+//                                             'title' => '' // @todo: "Based 
on X posts (featured + unreviewed + no action needed)
+                                       ),
                                        $this->msg( 'percent', round( $found ) 
)->escaped()
                                );
 
diff --git a/SpecialArticleFeedbackv5Watchlist.php 
b/SpecialArticleFeedbackv5Watchlist.php
index 9cbf3ad..4e51a01 100644
--- a/SpecialArticleFeedbackv5Watchlist.php
+++ b/SpecialArticleFeedbackv5Watchlist.php
@@ -75,6 +75,8 @@
        protected function buildSummary() {
                $user = $this->getUser();
 
+               // @todo: need to update this one too...
+
                // Showing {count} posts
                return
                        Html::rawElement(
diff --git a/modules/ext.articleFeedbackv5/ext.articleFeedbackv5.dashboard.css 
b/modules/ext.articleFeedbackv5/ext.articleFeedbackv5.dashboard.css
index 6164f2e..64a316b 100644
--- a/modules/ext.articleFeedbackv5/ext.articleFeedbackv5.dashboard.css
+++ b/modules/ext.articleFeedbackv5/ext.articleFeedbackv5.dashboard.css
@@ -18,19 +18,9 @@
        height: 1.5em;
 }
 
-/** Notices **/
-#articlefeedbackv5-header-message {
-       color: #444;
-}
-#articleFeedbackv5-beta-label {
-       float: right;
-       font-size: 0.5em;
-       color: #444;
-}
-
 /** Header section **/
 #articleFeedbackv5-header-wrap {
-       margin: 0 0 10px;
+       margin: 0 0 30px;
 }
 #articleFeedbackv5-header-wrap:after {
        clear: both;
@@ -47,47 +37,54 @@
 }
 #articleFeedbackv5-showing-count-wrap,
 #articleFeedbackv5-special-watchlist-showing-wrap {
-       display: inline-block;
-       /* IE7 inline-block hack */
-       zoom: 1;
-       *display: inline;
-       margin: 15px 50px 5px 0;
-       line-height: 28px;
-}
-#articleFeedbackv5-showing-count-wrap {
-       font-size: 1.4em;
-}
-#articleFeedbackv5-special-watchlist-showing-wrap {
        font-size: 1.2em;
-}
-#articleFeedbackv5-feedback-count-total,
-#articleFeedbackv5-feedback-count-filter {
-       font-weight: bold;
+       line-height: 1.5em;
+       color: #444;
+
+       display: inline;
+
+       /* @embed */
+       background-image: url(images/feedback-post.png);
+       background-repeat: no-repeat;
+       background-position: left;
+       padding-left: 20px;
+
+       /* grayscale background image */
+       filter: url("data:image/svg+xml;utf8,<svg 
xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix 
type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 
0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale");
+       filter: grayscale(100%);
+       -webkit-filter: grayscale(100%);
+       -moz-filter: grayscale(100%);
+       -ms-filter: grayscale(100%);
+       -o-filter: grayscale(100%);
+       filter: gray;
 }
 #articleFeedbackv5-percent-found-wrap {
-       display: inline;
-       /* IE7 inline-block hack */
-       zoom: 1;
-       *display: inline;
-       font-size: 1.4em;
+       color: #444;
+       font-size: 1.2em;
        margin: 15px 0 5px 0;
        line-height: 28px;
+
+       display: inline;
 }
 #articleFeedbackv5-percent-found-wrap .stat-marker {
-       font-weight: bold;
-       padding: 11px 0 8px 40px;
+       margin-left: 30px;
+       padding: 11px 0 8px 25px;
+
+       background-size: 18px;
+       background-repeat: no-repeat;
+       background-position: left;
 }
 #articleFeedbackv5-percent-found-wrap .positive {
        /* @embed */
-       background-image: url(images/large-positive.png);
-       background-repeat: no-repeat;
-       background-position: left;
+       background-image: url(../jquery.articleFeedbackv5/images/positive.png);
 }
 #articleFeedbackv5-percent-found-wrap .negative {
        /* @embed */
-       background-image: url(images/large-negative.png);
-       background-repeat: no-repeat;
-       background-position: left;
+       background-image: url(../jquery.articleFeedbackv5/images/negative.png);
+}
+#articleFeedbackv5-percent-found-wrap .neutral {
+       /* @embed */
+       background-image: url(../jquery.articleFeedbackv5/images/neutral.png);
 }
 .aftv5-feedbackpage .aftv5-feedbackpage-comment-display-header {
        height: 40px;
diff --git a/modules/ext.articleFeedbackv5/images/large-negative.png 
b/modules/ext.articleFeedbackv5/images/large-negative.png
deleted file mode 100644
index 673b542..0000000
--- a/modules/ext.articleFeedbackv5/images/large-negative.png
+++ /dev/null
Binary files differ
diff --git a/modules/ext.articleFeedbackv5/images/large-positive.png 
b/modules/ext.articleFeedbackv5/images/large-positive.png
deleted file mode 100644
index f4b8856..0000000
--- a/modules/ext.articleFeedbackv5/images/large-positive.png
+++ /dev/null
Binary files differ
diff --git a/modules/jquery.articleFeedbackv5/images/negative.png 
b/modules/jquery.articleFeedbackv5/images/negative.png
index fb13bf8..673b542 100644
--- a/modules/jquery.articleFeedbackv5/images/negative.png
+++ b/modules/jquery.articleFeedbackv5/images/negative.png
Binary files differ
diff --git a/modules/jquery.articleFeedbackv5/images/positive.png 
b/modules/jquery.articleFeedbackv5/images/positive.png
index edcb4fd..f4b8856 100644
--- a/modules/jquery.articleFeedbackv5/images/positive.png
+++ b/modules/jquery.articleFeedbackv5/images/positive.png
Binary files differ
diff --git 
a/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.css 
b/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.css
index 856f185..fc9e5cb 100644
--- a/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.css
+++ b/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.css
@@ -71,6 +71,7 @@
 
 /** Comment block: icon **/
 .articleFeedbackv5-comment-wrap {
+       background-size: 22px;
        background-position: top left;
        background-repeat: no-repeat;
 }
diff --git 
a/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.js 
b/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.js
index 653d877..a74f7c7 100644
--- a/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.js
+++ b/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.js
@@ -292,11 +292,6 @@
                $.aftTrack.track( 'feedback_page-impression-' +
                        $.articleFeedbackv5special.referral + '-' +
                        $.articleFeedbackv5special.userType );
-
-               // Add BETA label next to the title
-               var label = $( '<p id="articleFeedbackv5-beta-label"></p>' );
-               label.text( mw.msg( 'articlefeedbackv5-beta-label' ) );
-               $( '#firstHeading' ).prepend( label );
        };
 
        // }}}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I977c2a4acbdc2135ed548da1c0c2005b99aa4871
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ArticleFeedbackv5
Gerrit-Branch: master
Gerrit-Owner: Matthias Mullie <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to