EBernhardson has uploaded a new change for review.

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

Change subject: Repair individual post collapse in Topic namespace
......................................................................

Repair individual post collapse in Topic namespace

The code that disabled collapsing topics in the Topic namespace also
ended up stopping moderated posts from being collapsed.  Adjust the
code so it only prevents collapsing the topic.

Change-Id: I133bfaf0ed22bb1e8d3ba7b0b461ca8f0d5de389
---
M handlebars/compiled/flow_block_topic.handlebars.php
M handlebars/compiled/flow_block_topic_moderate_post.handlebars.php
M handlebars/compiled/flow_block_topic_moderate_topic.handlebars.php
M handlebars/flow_block_topic.handlebars
M modules/new/styles/board/collapser.less
5 files changed, 18 insertions(+), 10 deletions(-)


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

diff --git a/handlebars/compiled/flow_block_topic.handlebars.php 
b/handlebars/compiled/flow_block_topic.handlebars.php
index a549144..37823c7 100644
--- a/handlebars/compiled/flow_block_topic.handlebars.php
+++ b/handlebars/compiled/flow_block_topic.handlebars.php
@@ -30,7 +30,7 @@
         'sp_vars' => Array(),
 
     );
-    return '<div class="flow-board flow-disable-collapse">
+    return '<div class="flow-board flow-disable-topic-collapse">
        <div class="flow-topics">
                '.'
                '.LCRun3::sec($cx, ((is_array($in) && isset($in['roots'])) ? 
$in['roots'] : null), $in, true, function($cx, $in) {return '
diff --git a/handlebars/compiled/flow_block_topic_moderate_post.handlebars.php 
b/handlebars/compiled/flow_block_topic_moderate_post.handlebars.php
index 23cd539..a1a1de6 100644
--- a/handlebars/compiled/flow_block_topic_moderate_post.handlebars.php
+++ b/handlebars/compiled/flow_block_topic_moderate_post.handlebars.php
@@ -50,11 +50,16 @@
 
        <input type="hidden" name="wpEditToken" 
value="'.htmlentities(((is_array($cx['scopes'][0]) && 
isset($cx['scopes'][0]['editToken'])) ? $cx['scopes'][0]['editToken'] : null), 
ENT_QUOTES, 'UTF-8').'" />
        <textarea name="topic_reason"
+                 required
+                 data-flow-expandable="true"
+                 class="mw-ui-input"
+                 data-role="content"
                  placeholder="'.LCRun3::ch($cx, 'l10n', 
Array(Array(LCRun3::ch($cx, 'concat', 
Array(Array('flow-moderation-placeholder-',((is_array($cx['scopes'][0]['submitted'])
 && isset($cx['scopes'][0]['submitted']['moderationState'])) ? 
$cx['scopes'][0]['submitted']['moderationState'] : null),'-post'),Array()), 
'raw')),Array()), 'encq').'">'.((LCRun3::ifvar($cx, 
((is_array($cx['scopes'][0]['submitted']) && 
isset($cx['scopes'][0]['submitted']['reason'])) ? 
$cx['scopes'][0]['submitted']['reason'] : null))) ? 
''.htmlentities(((is_array($cx['scopes'][0]['submitted']) && 
isset($cx['scopes'][0]['submitted']['reason'])) ? 
$cx['scopes'][0]['submitted']['reason'] : null), ENT_QUOTES, 'UTF-8').'' : 
'').'</textarea>
        <div class="flow-form-actions flow-form-collapsible">
                <button data-flow-interactive-handler="apiRequest"
                        data-flow-api-handler="moderatePost"
-                       class="mw-ui-button 
mw-ui-constructive">'.LCRun3::ch($cx, 'l10n', Array(Array(LCRun3::ch($cx, 
'concat', 
Array(Array('flow-moderation-confirm-',((is_array($cx['scopes'][0]['submitted'])
 && isset($cx['scopes'][0]['submitted']['moderationState'])) ? 
$cx['scopes'][0]['submitted']['moderationState'] : null),'-post'),Array()), 
'raw')),Array()), 'encq').'</button>
+                       class="mw-ui-button mw-ui-constructive"
+                       data-role="submit">'.LCRun3::ch($cx, 'l10n', 
Array(Array(LCRun3::ch($cx, 'concat', 
Array(Array('flow-moderation-confirm-',((is_array($cx['scopes'][0]['submitted'])
 && isset($cx['scopes'][0]['submitted']['moderationState'])) ? 
$cx['scopes'][0]['submitted']['moderationState'] : null),'-post'),Array()), 
'raw')),Array()), 'encq').'</button>
                <a data-flow-interactive-handler="cancelForm"
                   class="mw-ui-button mw-ui-destructive mw-ui-quiet"
                   href="'.htmlentities(((is_array($in['links']['topic']) && 
isset($in['links']['topic']['url'])) ? $in['links']['topic']['url'] : 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 19553cc..ee15105 100644
--- a/handlebars/compiled/flow_block_topic_moderate_topic.handlebars.php
+++ b/handlebars/compiled/flow_block_topic_moderate_topic.handlebars.php
@@ -51,16 +51,15 @@
        <input type="hidden" name="wpEditToken" 
value="'.htmlentities(((is_array($cx['scopes'][0]) && 
isset($cx['scopes'][0]['editToken'])) ? $cx['scopes'][0]['editToken'] : null), 
ENT_QUOTES, 'UTF-8').'" />
        <textarea name="topic_reason"
                  required
-                 data-flow-preview-template="flow_post"
                  data-flow-expandable="true"
                  class="mw-ui-input"
-                 type="text"
                  data-role="content"
                  placeholder="'.LCRun3::ch($cx, 'l10n', 
Array(Array(LCRun3::ch($cx, 'concat', 
Array(Array('flow-moderation-placeholder-',((is_array($cx['scopes'][0]['submitted'])
 && isset($cx['scopes'][0]['submitted']['moderationState'])) ? 
$cx['scopes'][0]['submitted']['moderationState'] : null),'-topic'),Array()), 
'raw')),Array()), 'encq').'">'.((LCRun3::ifvar($cx, 
((is_array($cx['scopes'][0]['submitted']) && 
isset($cx['scopes'][0]['submitted']['reason'])) ? 
$cx['scopes'][0]['submitted']['reason'] : null))) ? 
''.htmlentities(((is_array($cx['scopes'][0]['submitted']) && 
isset($cx['scopes'][0]['submitted']['reason'])) ? 
$cx['scopes'][0]['submitted']['reason'] : null), ENT_QUOTES, 'UTF-8').'' : 
'').'</textarea>
        <div class="flow-form-actions flow-form-collapsible">
                <button class="mw-ui-button mw-ui-constructive"
-                               data-flow-interactive-handler="apiRequest"
-                               
data-flow-api-handler="moderateTopic">'.LCRun3::ch($cx, 'l10n', 
Array(Array(LCRun3::ch($cx, 'concat', 
Array(Array('flow-moderation-confirm-',((is_array($cx['scopes'][0]['submitted'])
 && isset($cx['scopes'][0]['submitted']['moderationState'])) ? 
$cx['scopes'][0]['submitted']['moderationState'] : null),'-topic'),Array()), 
'raw')),Array()), 'encq').'</button>
+                       data-flow-interactive-handler="apiRequest"
+                       data-flow-api-handler="moderateTopic"
+                       data-role="submit">'.LCRun3::ch($cx, 'l10n', 
Array(Array(LCRun3::ch($cx, 'concat', 
Array(Array('flow-moderation-confirm-',((is_array($cx['scopes'][0]['submitted'])
 && isset($cx['scopes'][0]['submitted']['moderationState'])) ? 
$cx['scopes'][0]['submitted']['moderationState'] : null),'-topic'),Array()), 
'raw')),Array()), 'encq').'</button>
                <a class="mw-ui-button mw-ui-quiet mw-ui-destructive"
                   href="'.htmlentities(((is_array($in['links']['topic']) && 
isset($in['links']['topic']['url'])) ? $in['links']['topic']['url'] : null), 
ENT_QUOTES, 'UTF-8').'"
                   title="'.LCRun3::ch($cx, 'l10n', 
Array(Array('flow-cancel'),Array()), 'encq').'"
@@ -626,4 +625,4 @@
 </div>
 ';
 }
-?>
+?>
\ No newline at end of file
diff --git a/handlebars/flow_block_topic.handlebars 
b/handlebars/flow_block_topic.handlebars
index 598acfe..84353d1 100644
--- a/handlebars/flow_block_topic.handlebars
+++ b/handlebars/flow_block_topic.handlebars
@@ -1,4 +1,4 @@
-<div class="flow-board flow-disable-collapse">
+<div class="flow-board flow-disable-topic-collapse">
        <div class="flow-topics">
                {{!-- There is only one topic, but we use same api response 
structure --}}
                {{> flow_topiclist_loop}}
diff --git a/modules/new/styles/board/collapser.less 
b/modules/new/styles/board/collapser.less
index 57fc88e..7f7eebe 100644
--- a/modules/new/styles/board/collapser.less
+++ b/modules/new/styles/board/collapser.less
@@ -28,16 +28,20 @@
        }
 }
 
-.flow-board:not(.flow-disable-collapse) {
+.flow-board:not(.flow-disable-topic-collapse) {
        div.flow-element-collapsed {
                // topic hidden
                .flow-post,
                .flow-reply-form {
                        display: none;
                }
+       }
+}
 
+.flow-board {
+       .flow-post {
                // post hidden
-               .flow-post & {
+               div.flow-element-collapsed {
                        .flow-post-content,
                        .flow-post-meta {
                                display: none;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I133bfaf0ed22bb1e8d3ba7b0b461ca8f0d5de389
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: EBernhardson <[email protected]>

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

Reply via email to