jenkins-bot has submitted this change and it was merged.
Change subject: Add style to new topic
......................................................................
Add style to new topic
Change-Id: I7c706546b1e4fb29d302dbdab19dc7565199dde5
---
M Flow.i18n.php
M modules/discussion/styles/topic.less
M modules/discussion/ui.js
M templates/topiclist.html.php
4 files changed, 37 insertions(+), 9 deletions(-)
Approvals:
EBernhardson (WMF): Looks good to me, approved
jenkins-bot: Verified
diff --git a/Flow.i18n.php b/Flow.i18n.php
index 79c2757..3338b81 100644
--- a/Flow.i18n.php
+++ b/Flow.i18n.php
@@ -28,7 +28,7 @@
'flow-newtopic-content-placeholder' => 'Message text. Be nice!',
'flow-newtopic-header' => 'Add a new topic',
'flow-newtopic-save' => 'Add topic',
- 'flow-newtopic-start-placeholder' => 'Click here to start a new
discussion. Be nice!',
+ 'flow-newtopic-start-placeholder' => 'Start a new topic',
'flow-reply-placeholder' => 'Click to {{GENDER:$1|reply}} to $1. Be
nice!',
'flow-reply-submit' => '{{GENDER:$1|Reply}}',
diff --git a/modules/discussion/styles/topic.less
b/modules/discussion/styles/topic.less
index ca98bbf..ee8294c 100644
--- a/modules/discussion/styles/topic.less
+++ b/modules/discussion/styles/topic.less
@@ -153,14 +153,27 @@
}
}
-.flow-newtopic-form {
- padding-bottom: 30px;
+.flow-new-topic-container {
+ .flow-newtopic-form {
+ padding-bottom: 30px;
- .flow-newtopic-title {
- font-weight: bold;
- }
+ .flow-newtopic-title {
+ font-weight: bold;
+ }
- .flow-post-form-controls {
- text-align: right;
+ .flow-post-form-controls {
+ text-align: right;
+ }
+
+ .flow-new-topic-link {
+ background-position: center center;
+ background-size: 25px auto;
+ background-repeat: no-repeat;
+
.background-image-svg('../../base/images/createtopic_normal.svg',
'../../base/images/createtopic_normal.png');
+
+ &:hover {
+
.background-image-svg('../../base/images/createtopic_hover.svg',
'../../base/images/createtopic_hover.png');
+ }
+ }
}
}
diff --git a/modules/discussion/ui.js b/modules/discussion/ui.js
index ee9ea05..b5a68ab 100644
--- a/modules/discussion/ui.js
+++ b/modules/discussion/ui.js
@@ -104,9 +104,15 @@
.attr( 'placeholder', mw.msg(
'flow-newtopic-title-placeholder' ) );
$( '.flow-newtopic-submit' )
.attr( 'disabled', 'disabled' );
+ $container.find( '.flow-new-topic-link'
).hide();
mw.flow.editor.load( $(
'.flow-newtopic-content' ) );
} );
+
+ $container.find( '.flow-new-topic-link' ).click ( function( e )
{
+ e.preventDefault();
+ $container.find( '.flow-newtopic-title' ).trigger(
'click' ).focus();
+ } );
$( '<a />' )
.attr( 'href', '#' )
@@ -131,6 +137,7 @@
$form.find( '.flow-error' )
.remove();
} );
+ $container.find( '.flow-new-topic-link'
).show();
} )
.after( ' ' )
.insertBefore( $container.find( '.flow-newtopic-form
input[type=submit]' ) );
diff --git a/templates/topiclist.html.php b/templates/topiclist.html.php
index f34f95b..e116bdb 100644
--- a/templates/topiclist.html.php
+++ b/templates/topiclist.html.php
@@ -1,5 +1,6 @@
<?php
+echo Html::openElement( 'div', array( 'class' => 'flow-new-topic-container' )
);
echo Html::openElement( 'form', array(
'method' => 'POST',
'action' => $this->generateUrl( $block->getWorkflow(), 'new-topic' ),
@@ -17,6 +18,12 @@
)
);
+// @Todo - Update href to a real link for no-js support
+echo Html::element( 'a', array(
+ 'class' => array( 'flow-new-topic-link', 'flow-icon',
'flow-icon-bottom-aligned' ),
+ 'href' => '#'
+), wfMessage( 'flow-newtopic-start-placeholder' )->text() );
+
if ( $block->hasErrors( 'content' ) ) {
echo '<p>' . $block->getError( 'content' )->escaped() . '</p>';
}
@@ -32,7 +39,8 @@
'value' => wfMessage( 'flow-newtopic-save' )->text(),
) );
echo Html::closeElement( 'div' );
-echo '</form>';
+echo Html::closeElement( 'form' );
+echo Html::closeElement( 'div' );
if ( $page && $page->getPagingLink( 'rev' ) ) {
$linkData = $page->getPagingLink( 'rev' );
--
To view, visit https://gerrit.wikimedia.org/r/87637
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I7c706546b1e4fb29d302dbdab19dc7565199dde5
Gerrit-PatchSet: 7
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Bsitu <[email protected]>
Gerrit-Reviewer: EBernhardson (WMF) <[email protected]>
Gerrit-Reviewer: Matthias Mullie <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: Spage <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits