Bsitu has uploaded a new change for review.

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

Change subject: Do not show board watch star in a topoic page
......................................................................

Do not show board watch star in a topoic page

bug: 69764
Change-Id: Iaef72e32c9cb638756707b93fba25c2227ac7194
---
M handlebars/compiled/flow_block_topic_moderate_post.handlebars.php
M handlebars/compiled/flow_block_topic_moderate_topic.handlebars.php
M handlebars/compiled/flow_board.handlebars.php
M handlebars/compiled/flow_board_watch_link.handlebars.php
M handlebars/compiled/flow_post.handlebars.php
M handlebars/flow_board_watch_link.handlebars
M includes/View.php
7 files changed, 53 insertions(+), 46 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/97/155597/1

diff --git a/handlebars/compiled/flow_block_topic_moderate_post.handlebars.php 
b/handlebars/compiled/flow_block_topic_moderate_post.handlebars.php
index c43abce..8274f4d 100644
--- a/handlebars/compiled/flow_block_topic_moderate_post.handlebars.php
+++ b/handlebars/compiled/flow_block_topic_moderate_post.handlebars.php
@@ -85,10 +85,10 @@
                        '.LCRun3::wi($cx, ((is_array($in) && 
isset($in['creator'])) ? $in['creator'] : null), $in, function($cx, $in) 
{return '
                                <span class="flow-author">
        '.((LCRun3::ifvar($cx, ((is_array($in) && isset($in['links'])) ? 
$in['links'] : null))) ? '
-               '.((LCRun3::ifvar($cx, ((is_array($in['links']) && 
isset($in['links']['contribs'])) ? $in['links']['contribs'] : null))) ? '
-                       <a 
href="'.htmlentities(((is_array($in['links']['contribs']) && 
isset($in['links']['contribs']['url'])) ? $in['links']['contribs']['url'] : 
null), ENT_QUOTES, 'UTF-8').'"
-                          '.((!LCRun3::ifvar($cx, ((is_array($in) && 
isset($in['name'])) ? $in['name'] : null))) ? 
'title="'.htmlentities(((is_array($in['links']['contribs']) && 
isset($in['links']['contribs']['title'])) ? $in['links']['contribs']['title'] : 
null), ENT_QUOTES, 'UTF-8').'"' : '').'
-                          class="'.((!LCRun3::ifvar($cx, 
((is_array($in['links']['contribs']) && 
isset($in['links']['contribs']['exists'])) ? $in['links']['contribs']['exists'] 
: null))) ? 'new ' : '').'mw-userlink">
+               '.((LCRun3::ifvar($cx, ((is_array($in['links']) && 
isset($in['links']['userpage'])) ? $in['links']['userpage'] : null))) ? '
+                       <a 
href="'.htmlentities(((is_array($in['links']['userpage']) && 
isset($in['links']['userpage']['url'])) ? $in['links']['userpage']['url'] : 
null), ENT_QUOTES, 'UTF-8').'"
+                          '.((!LCRun3::ifvar($cx, ((is_array($in) && 
isset($in['name'])) ? $in['name'] : null))) ? 
'title="'.htmlentities(((is_array($in['links']['userpage']) && 
isset($in['links']['userpage']['title'])) ? $in['links']['userpage']['title'] : 
null), ENT_QUOTES, 'UTF-8').'"' : '').'
+                          class="'.((!LCRun3::ifvar($cx, 
((is_array($in['links']['userpage']) && 
isset($in['links']['userpage']['exists'])) ? $in['links']['userpage']['exists'] 
: null))) ? 'new ' : '').'mw-userlink">
                ' : '').'
                        '.((LCRun3::ifvar($cx, ((is_array($in) && 
isset($in['name'])) ? $in['name'] : null))) ? '
                                '.htmlentities(((is_array($in) && 
isset($in['name'])) ? $in['name'] : null), ENT_QUOTES, 'UTF-8').'' : '
diff --git a/handlebars/compiled/flow_block_topic_moderate_topic.handlebars.php 
b/handlebars/compiled/flow_block_topic_moderate_topic.handlebars.php
index 471f187..748eba5 100644
--- a/handlebars/compiled/flow_block_topic_moderate_topic.handlebars.php
+++ b/handlebars/compiled/flow_block_topic_moderate_topic.handlebars.php
@@ -85,10 +85,10 @@
                        '.LCRun3::wi($cx, ((is_array($in) && 
isset($in['creator'])) ? $in['creator'] : null), $in, function($cx, $in) 
{return '
                                <span class="flow-author">
        '.((LCRun3::ifvar($cx, ((is_array($in) && isset($in['links'])) ? 
$in['links'] : null))) ? '
-               '.((LCRun3::ifvar($cx, ((is_array($in['links']) && 
isset($in['links']['contribs'])) ? $in['links']['contribs'] : null))) ? '
-                       <a 
href="'.htmlentities(((is_array($in['links']['contribs']) && 
isset($in['links']['contribs']['url'])) ? $in['links']['contribs']['url'] : 
null), ENT_QUOTES, 'UTF-8').'"
-                          '.((!LCRun3::ifvar($cx, ((is_array($in) && 
isset($in['name'])) ? $in['name'] : null))) ? 
'title="'.htmlentities(((is_array($in['links']['contribs']) && 
isset($in['links']['contribs']['title'])) ? $in['links']['contribs']['title'] : 
null), ENT_QUOTES, 'UTF-8').'"' : '').'
-                          class="'.((!LCRun3::ifvar($cx, 
((is_array($in['links']['contribs']) && 
isset($in['links']['contribs']['exists'])) ? $in['links']['contribs']['exists'] 
: null))) ? 'new ' : '').'mw-userlink">
+               '.((LCRun3::ifvar($cx, ((is_array($in['links']) && 
isset($in['links']['userpage'])) ? $in['links']['userpage'] : null))) ? '
+                       <a 
href="'.htmlentities(((is_array($in['links']['userpage']) && 
isset($in['links']['userpage']['url'])) ? $in['links']['userpage']['url'] : 
null), ENT_QUOTES, 'UTF-8').'"
+                          '.((!LCRun3::ifvar($cx, ((is_array($in) && 
isset($in['name'])) ? $in['name'] : null))) ? 
'title="'.htmlentities(((is_array($in['links']['userpage']) && 
isset($in['links']['userpage']['title'])) ? $in['links']['userpage']['title'] : 
null), ENT_QUOTES, 'UTF-8').'"' : '').'
+                          class="'.((!LCRun3::ifvar($cx, 
((is_array($in['links']['userpage']) && 
isset($in['links']['userpage']['exists'])) ? $in['links']['userpage']['exists'] 
: null))) ? 'new ' : '').'mw-userlink">
                ' : '').'
                        '.((LCRun3::ifvar($cx, ((is_array($in) && 
isset($in['name'])) ? $in['name'] : null))) ? '
                                '.htmlentities(((is_array($in) && 
isset($in['name'])) ? $in['name'] : null), ENT_QUOTES, 'UTF-8').'' : '
diff --git a/handlebars/compiled/flow_board.handlebars.php 
b/handlebars/compiled/flow_board.handlebars.php
index 6cf49dd..fcdc1aa 100644
--- a/handlebars/compiled/flow_board.handlebars.php
+++ b/handlebars/compiled/flow_board.handlebars.php
@@ -20,8 +20,9 @@
     );
     return '<div class="flow-component" data-flow-component="board" 
data-flow-id="'.htmlentities(((is_array($in) && isset($in['workflow'])) ? 
$in['workflow'] : null), ENT_QUOTES, 'UTF-8').'">
        '.((LCRun3::ifvar($cx, ((is_array($in) && isset($in['watchable'])) ? 
$in['watchable'] : null))) ? '
-       <div class="flow-board-watch-link flow-watch-link">
-               <div class="flow-error-container">
+       '.((LCRun3::ifvar($cx, ((is_array($in) && isset($in['isBoardPage'])) ? 
$in['isBoardPage'] : null))) ? '
+               <div class="flow-board-watch-link flow-watch-link">
+                       <div class="flow-error-container">
 '.((LCRun3::ifvar($cx, ((is_array($cx['scopes'][0]) && 
isset($cx['scopes'][0]['errors'])) ? $cx['scopes'][0]['errors'] : null))) ? '
        <div class="flow-errors errorbox">
                <ul>
@@ -33,14 +34,15 @@
 ' : '').'
 </div>
 
-
-               <a href="'.((LCRun3::ifvar($cx, ((is_array($in) && 
isset($in['isWatched'])) ? $in['isWatched'] : null))) ? 
''.htmlentities(((is_array($in['links']['unwatch-board']) && 
isset($in['links']['unwatch-board']['url'])) ? 
$in['links']['unwatch-board']['url'] : null), ENT_QUOTES, 'UTF-8').'' : 
''.htmlentities(((is_array($in['links']['watch-board']) && 
isset($in['links']['watch-board']['url'])) ? $in['links']['watch-board']['url'] 
: null), ENT_QUOTES, 'UTF-8').'').'"
-                  class="mw-ui-constructive
-                  '.((LCRun3::ifvar($cx, ((is_array($in) && 
isset($in['isWatched'])) ? $in['isWatched'] : null))) ? 
'flow-watch-link-unwatch' : 'mw-ui-quiet flow-watch-link-watch').'"
-                  data-flow-api-handler="watchItem"
-                  data-flow-api-target="< .flow-topic-watchlist"
-                  data-flow-api-method="POST">'.htmlentities(((is_array($in) 
&& isset($in['null'])) ? $in['null'] : null), ENT_QUOTES, 'UTF-8').'<span 
class="wikiglyph wikiglyph-star"></span>'.htmlentities(((is_array($in) && 
isset($in['null'])) ? $in['null'] : null), ENT_QUOTES, 
'UTF-8').''.htmlentities(((is_array($in) && isset($in['null'])) ? $in['null'] : 
null), ENT_QUOTES, 'UTF-8').'<span class="wikiglyph 
wikiglyph-unstar"></span>'.htmlentities(((is_array($in) && isset($in['null'])) 
? $in['null'] : null), ENT_QUOTES, 'UTF-8').'</a>
-       </div>
+       
+                       <a href="'.((LCRun3::ifvar($cx, ((is_array($in) && 
isset($in['isWatched'])) ? $in['isWatched'] : null))) ? 
''.htmlentities(((is_array($in['links']['unwatch-board']) && 
isset($in['links']['unwatch-board']['url'])) ? 
$in['links']['unwatch-board']['url'] : null), ENT_QUOTES, 'UTF-8').'' : 
''.htmlentities(((is_array($in['links']['watch-board']) && 
isset($in['links']['watch-board']['url'])) ? $in['links']['watch-board']['url'] 
: null), ENT_QUOTES, 'UTF-8').'').'"
+                          class="mw-ui-constructive
+                          '.((LCRun3::ifvar($cx, ((is_array($in) && 
isset($in['isWatched'])) ? $in['isWatched'] : null))) ? 
'flow-watch-link-unwatch' : 'mw-ui-quiet flow-watch-link-watch').'"
+                          data-flow-api-handler="watchItem"
+                          data-flow-api-target="< .flow-topic-watchlist"
+                          
data-flow-api-method="POST">'.htmlentities(((is_array($in) && 
isset($in['null'])) ? $in['null'] : null), ENT_QUOTES, 'UTF-8').'<span 
class="wikiglyph wikiglyph-star"></span>'.htmlentities(((is_array($in) && 
isset($in['null'])) ? $in['null'] : null), ENT_QUOTES, 
'UTF-8').''.htmlentities(((is_array($in) && isset($in['null'])) ? $in['null'] : 
null), ENT_QUOTES, 'UTF-8').'<span class="wikiglyph 
wikiglyph-unstar"></span>'.htmlentities(((is_array($in) && isset($in['null'])) 
? $in['null'] : null), ENT_QUOTES, 'UTF-8').'</a>
+               </div>
+       ' : '').'
 ' : '').'
 
        '.LCRun3::sec($cx, ((is_array($in) && isset($in['blocks'])) ? 
$in['blocks'] : null), $in, true, function($cx, $in) {return '
diff --git a/handlebars/compiled/flow_board_watch_link.handlebars.php 
b/handlebars/compiled/flow_board_watch_link.handlebars.php
index 5ae2ae2..ed25f7d 100644
--- a/handlebars/compiled/flow_board_watch_link.handlebars.php
+++ b/handlebars/compiled/flow_board_watch_link.handlebars.php
@@ -18,8 +18,9 @@
 
     );
     return ''.((LCRun3::ifvar($cx, ((is_array($in) && isset($in['watchable'])) 
? $in['watchable'] : null))) ? '
-       <div class="flow-board-watch-link flow-watch-link">
-               <div class="flow-error-container">
+       '.((LCRun3::ifvar($cx, ((is_array($in) && isset($in['isBoardPage'])) ? 
$in['isBoardPage'] : null))) ? '
+               <div class="flow-board-watch-link flow-watch-link">
+                       <div class="flow-error-container">
 '.((LCRun3::ifvar($cx, ((is_array($cx['scopes'][0]) && 
isset($cx['scopes'][0]['errors'])) ? $cx['scopes'][0]['errors'] : null))) ? '
        <div class="flow-errors errorbox">
                <ul>
@@ -31,14 +32,15 @@
 ' : '').'
 </div>
 
-
-               <a href="'.((LCRun3::ifvar($cx, ((is_array($in) && 
isset($in['isWatched'])) ? $in['isWatched'] : null))) ? 
''.htmlentities(((is_array($in['links']['unwatch-board']) && 
isset($in['links']['unwatch-board']['url'])) ? 
$in['links']['unwatch-board']['url'] : null), ENT_QUOTES, 'UTF-8').'' : 
''.htmlentities(((is_array($in['links']['watch-board']) && 
isset($in['links']['watch-board']['url'])) ? $in['links']['watch-board']['url'] 
: null), ENT_QUOTES, 'UTF-8').'').'"
-                  class="mw-ui-constructive
-                  '.((LCRun3::ifvar($cx, ((is_array($in) && 
isset($in['isWatched'])) ? $in['isWatched'] : null))) ? 
'flow-watch-link-unwatch' : 'mw-ui-quiet flow-watch-link-watch').'"
-                  data-flow-api-handler="watchItem"
-                  data-flow-api-target="< .flow-topic-watchlist"
-                  data-flow-api-method="POST">'.htmlentities(((is_array($in) 
&& isset($in['null'])) ? $in['null'] : null), ENT_QUOTES, 'UTF-8').'<span 
class="wikiglyph wikiglyph-star"></span>'.htmlentities(((is_array($in) && 
isset($in['null'])) ? $in['null'] : null), ENT_QUOTES, 
'UTF-8').''.htmlentities(((is_array($in) && isset($in['null'])) ? $in['null'] : 
null), ENT_QUOTES, 'UTF-8').'<span class="wikiglyph 
wikiglyph-unstar"></span>'.htmlentities(((is_array($in) && isset($in['null'])) 
? $in['null'] : null), ENT_QUOTES, 'UTF-8').'</a>
-       </div>
+       
+                       <a href="'.((LCRun3::ifvar($cx, ((is_array($in) && 
isset($in['isWatched'])) ? $in['isWatched'] : null))) ? 
''.htmlentities(((is_array($in['links']['unwatch-board']) && 
isset($in['links']['unwatch-board']['url'])) ? 
$in['links']['unwatch-board']['url'] : null), ENT_QUOTES, 'UTF-8').'' : 
''.htmlentities(((is_array($in['links']['watch-board']) && 
isset($in['links']['watch-board']['url'])) ? $in['links']['watch-board']['url'] 
: null), ENT_QUOTES, 'UTF-8').'').'"
+                          class="mw-ui-constructive
+                          '.((LCRun3::ifvar($cx, ((is_array($in) && 
isset($in['isWatched'])) ? $in['isWatched'] : null))) ? 
'flow-watch-link-unwatch' : 'mw-ui-quiet flow-watch-link-watch').'"
+                          data-flow-api-handler="watchItem"
+                          data-flow-api-target="< .flow-topic-watchlist"
+                          
data-flow-api-method="POST">'.htmlentities(((is_array($in) && 
isset($in['null'])) ? $in['null'] : null), ENT_QUOTES, 'UTF-8').'<span 
class="wikiglyph wikiglyph-star"></span>'.htmlentities(((is_array($in) && 
isset($in['null'])) ? $in['null'] : null), ENT_QUOTES, 
'UTF-8').''.htmlentities(((is_array($in) && isset($in['null'])) ? $in['null'] : 
null), ENT_QUOTES, 'UTF-8').'<span class="wikiglyph 
wikiglyph-unstar"></span>'.htmlentities(((is_array($in) && isset($in['null'])) 
? $in['null'] : null), ENT_QUOTES, 'UTF-8').'</a>
+               </div>
+       ' : '').'
 ' : '').'
 ';
 }
diff --git a/handlebars/compiled/flow_post.handlebars.php 
b/handlebars/compiled/flow_post.handlebars.php
index fe831f7..e5b51bb 100644
--- a/handlebars/compiled/flow_post.handlebars.php
+++ b/handlebars/compiled/flow_post.handlebars.php
@@ -250,4 +250,4 @@
 ';}).'
 ';
 }
-?>
+?>
\ No newline at end of file
diff --git a/handlebars/flow_board_watch_link.handlebars 
b/handlebars/flow_board_watch_link.handlebars
index 065129a..69e2f5e 100644
--- a/handlebars/flow_board_watch_link.handlebars
+++ b/handlebars/flow_board_watch_link.handlebars
@@ -1,19 +1,21 @@
 {{#if watchable}}
-       <div class="flow-board-watch-link flow-watch-link">
-               {{> flow_errors}}
-
-               <a href="{{#if 
isWatched}}{{links.unwatch-board.url}}{{else}}{{links.watch-board.url}}{{/if}}"
-                  class="mw-ui-constructive
-                  {{#if isWatched~}}
-                  flow-watch-link-unwatch
-                  {{~else~}}
-                  mw-ui-quiet flow-watch-link-watch
-                  {{~/if~}}"
-                  data-flow-api-handler="watchItem"
-                  data-flow-api-target="< .flow-topic-watchlist"
-                  data-flow-api-method="POST">
-                       {{~null~}}<span class="wikiglyph 
wikiglyph-star"></span>{{~null~}}
-                       {{~null~}}<span class="wikiglyph 
wikiglyph-unstar"></span>{{~null~}}
-               </a>
-       </div>
+       {{#if  isBoardPage}}
+               <div class="flow-board-watch-link flow-watch-link">
+                       {{> flow_errors}}
+       
+                       <a href="{{#if 
isWatched}}{{links.unwatch-board.url}}{{else}}{{links.watch-board.url}}{{/if}}"
+                          class="mw-ui-constructive
+                          {{#if isWatched~}}
+                          flow-watch-link-unwatch
+                          {{~else~}}
+                          mw-ui-quiet flow-watch-link-watch
+                          {{~/if~}}"
+                          data-flow-api-handler="watchItem"
+                          data-flow-api-target="< .flow-topic-watchlist"
+                          data-flow-api-method="POST">
+                               {{~null~}}<span class="wikiglyph 
wikiglyph-star"></span>{{~null~}}
+                               {{~null~}}<span class="wikiglyph 
wikiglyph-unstar"></span>{{~null~}}
+                       </a>
+               </div>
+       {{/unless}}
 {{/if}}
diff --git a/includes/View.php b/includes/View.php
index 1c68274..4979ae4 100644
--- a/includes/View.php
+++ b/includes/View.php
@@ -110,6 +110,7 @@
                        'blocks' => array(),
                        'isWatched' => $user->isWatched( $title ),
                        'watchable' => !$user->isAnon(),
+                       'isBoardPage' => $title->getNamespace() !== NS_TOPIC,
                        'links' => array(
                                'watch-board' => array(
                                        'url' => $title->getLocalUrl( 
'action=watch' ),

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaef72e32c9cb638756707b93fba25c2227ac7194
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Bsitu <bs...@wikimedia.org>

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

Reply via email to