Matthias Mullie has uploaded a new change for review.
https://gerrit.wikimedia.org/r/102153
Change subject: Attribution for authors of moderated content
......................................................................
Attribution for authors of moderated content
This patch mainly focussed on posts.
User tool links etc are already added to title too, but that's about it. Will
need design to know how to display topic title.
Mingle: 421
Change-Id: I284f1f03bfb88cb0de38b5571d8b2e3ccbcf79a5
---
M Flow.i18n.php
M includes/Templating.php
M modules/discussion/styles/post.less
M modules/discussion/styles/topic.less
4 files changed, 92 insertions(+), 16 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow
refs/changes/53/102153/1
diff --git a/Flow.i18n.php b/Flow.i18n.php
index 99c6237..4ef3320 100644
--- a/Flow.i18n.php
+++ b/Flow.i18n.php
@@ -35,11 +35,17 @@
'flow-post-moderated-toggle-show' => '[Show]',
'flow-post-moderated-toggle-hide' => '[Hide]',
- 'flow-hide-content' => '{{GENDER:$1|Hidden}} by $1',
+ 'flow-hide-post-content' => 'This comment was {{GENDER:$1|hidden}} by
$2',
+ 'flow-hide-title-content' => '{{GENDER:$1|Hidden}} by $2',
+ 'flow-hide-header-content' => '{{GENDER:$1|Hidden}} by $2',
'flow-hide-usertext' => '$1',
- 'flow-delete-content' => '{{GENDER:$1|Deleted}} by $1',
+ 'flow-delete-post-content' => 'This comment was {{GENDER:$1|deleted}}
by $2',
+ 'flow-delete-title-content' => '{{GENDER:$1|Deleted}} by $2',
+ 'flow-delete-header-content' => '{{GENDER:$1|Deleted}} by $2',
'flow-delete-usertext' => '$1',
- 'flow-suppress-content' => '{{GENDER:$1|Suppressed}} by $1',
+ 'flow-suppress-post-content' => 'This comment was
{{GENDER:$1|suppressed}} by $2',
+ 'flow-suppress-title-content' => '{{GENDER:$1|Suppressed}} by $2',
+ 'flow-suppress-header-content' => '{{GENDER:$1|Suppressed}} by $2',
'flow-suppress-usertext' => "<em>Username suppressed</em>",
'flow-post-actions' => 'Actions',
'flow-topic-actions' => 'Actions',
@@ -308,28 +314,67 @@
'flow-header-empty' => 'Used as a placeholder text for headers which
have no content.',
'flow-post-moderated-toggle-show' => 'Text for link used to display a
moderated post',
'flow-post-moderated-toggle-hide' => 'Text for link used to hide a
moderated post',
- 'flow-hide-content' => 'Message to display instead of content when the
content has been hidden.
+ 'flow-hide-post-content' => 'Message to display instead of content when
the post has been hidden.
Parameters:
* $1 - username that hid the post, can be used for GENDER
+* $2 - user link and tool links for the user.
+{{Related|Flow-content}}',
+ 'flow-hide-title-content' => 'Message to display instead of content
when the title has been hidden.
+
+Parameters:
+* $1 - username that hid the title, can be used for GENDER
+* $2 - user link and tool links for the user.
+{{Related|Flow-content}}',
+ 'flow-hide-header-content' => 'Message to display instead of content
when the header has been hidden.
+
+Parameters:
+* $1 - username that hid the header, can be used for GENDER
+* $2 - user link and tool links for the user.
{{Related|Flow-content}}',
'flow-hide-usertext' => 'Used as username if the post was hidden.
Parameters:
* $1 - Username of the post creator. Can be used for GENDER',
- 'flow-delete-content' => 'Message to display instead of content when
the content has been deleted.
+ 'flow-delete-post-content' => 'Message to display instead of content
when the post has been deleted.
Parameters:
* $1 - username that deleted the post, can be used for GENDER
+* $2 - user link and tool links for the user.
+{{Related|Flow-content}}',
+ 'flow-delete-title-content' => 'Message to display instead of content
when the title has been deleted.
+
+Parameters:
+* $1 - username that deleted the title, can be used for GENDER
+* $2 - user link and tool links for the user.
+{{Related|Flow-content}}',
+ 'flow-delete-header-content' => 'Message to display instead of content
when the header has been deleted.
+
+Parameters:
+* $1 - username that deleted the header, can be used for GENDER
+* $2 - user link and tool links for the user.
{{Related|Flow-content}}',
'flow-delete-usertext' => 'Used as username if the post was deleted.
Parameters:
* $1 - Username of the post creator. Can be used for GENDER',
- 'flow-suppress-content' => 'Message to display instead of content when
the content has been suppressed.
+ 'flow-suppress-post-content' => 'Message to display instead of content
when the post has been suppressed.
Parameters:
* $1 - username that suppressed the post, can be used for GENDER
+* $2 - user link and tool links for the user.
+{{Related|Flow-content}}',
+ 'flow-suppress-title-content' => 'Message to display instead of content
when the title has been suppressed.
+
+Parameters:
+* $1 - username that suppressed the title, can be used for GENDER
+* $2 - user link and tool links for the user.
+{{Related|Flow-content}}',
+ 'flow-suppress-header-content' => 'Message to display instead of
content when the header has been suppressed.
+
+Parameters:
+* $1 - username that suppressed the header, can be used for GENDER
+* $2 - user link and tool links for the user.
{{Related|Flow-content}}',
'flow-suppress-usertext' => 'Used as username if the post was
suppressed.
diff --git a/includes/Templating.php b/includes/Templating.php
index 1e57d61..d61318e 100644
--- a/includes/Templating.php
+++ b/includes/Templating.php
@@ -340,13 +340,19 @@
* @return string
*/
public function getContent( AbstractRevision $revision, $format =
'html', User $permissionsUser = null ) {
- $state = $revision->getModerationState();
- $user = $revision->getModeratedByUserText();
-
- // Messages: flow-hide-content, flow-delete-content,
flow-suppress-content
- $message = wfMessage( "flow-$state-content", $user );
-
+ // if user isn't allowed to see content, display message to
tell it's been moderated
if ( !$revision->isAllowed( $permissionsUser ) ) {
+ $state = $revision->getModerationState();
+ $user = User::newFromId(
$revision->getModeratedByUserId() );
+
+ // get revision type to make more precise message
+ $type = $revision->getRevisionType();
+ if ( $type == 'post' && $revision->isTopicTitle() ) {
+ $type = 'title';
+ }
+
+ // Messages: flow-hide-content, flow-delete-content,
flow-suppress-content
+ $message = wfMessage( "flow-$state-$type-content",
$user, $this->getUserLinks( $revision, $user ) );
if ( $message->exists() ) {
return $message->text();
} else {
diff --git a/modules/discussion/styles/post.less
b/modules/discussion/styles/post.less
index e4ef5f5..f5d415f 100644
--- a/modules/discussion/styles/post.less
+++ b/modules/discussion/styles/post.less
@@ -191,15 +191,30 @@
.flow-post-moderated-message {
color: #aaa;
padding: 0;
- margin: 0 0 20px 0;
+ font-weight: bold;
a {
- color: #aaa;
text-decoration: none;
line-height: 18px;
&:hover {
- border-bottom: 1px solid #ccc;
+ text-decoration: underline;
+ }
+ }
+
+ // turn show/hide link gray
+ .flow-post-moderated-view {
+ color: #aaa;
+ }
+
+ // hide user links until hovered
+ .mw-usertoollinks {
+ color: @post-title-color;
+ display: none;
+ }
+ &:hover {
+ .mw-usertoollinks {
+ display: inline;
}
}
@@ -249,7 +264,6 @@
color: #aaa;
// hide non-essential elements
- .flow-post-title,
.flow-datestamp {
display: none;
}
diff --git a/modules/discussion/styles/topic.less
b/modules/discussion/styles/topic.less
index 65ad066..e873fe5 100644
--- a/modules/discussion/styles/topic.less
+++ b/modules/discussion/styles/topic.less
@@ -26,6 +26,17 @@
background-position: left;
background-size: 14px auto;
background-repeat: no-repeat;
+
+ // hide user links until hovered
+ .mw-usertoollinks {
+ color: @post-title-color;
+ display: none;
+ }
+ &:hover {
+ .mw-usertoollinks {
+ display: inline;
+ }
+ }
}
.flow-topic-moderated-hide {
--
To view, visit https://gerrit.wikimedia.org/r/102153
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I284f1f03bfb88cb0de38b5571d8b2e3ccbcf79a5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Matthias Mullie <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits