Spage has uploaded a new change for review.
https://gerrit.wikimedia.org/r/136635
Change subject: Towards front-end templating
......................................................................
Towards front-end templating
Remove dummy messages from mw.message() function.
In 'ext.flow.new' RL module, load flow_block_topiclist.html.handlebars and
all the templates depending on it according to handlebars/Makefile, and
all the message keys these templates use in {{l10n "message" }} invocations.
WIP, doesn't work!
Change-Id: Ib47b9f03d68045d8c448a12abf23a065a0eca9bc
---
M Resources.php
M modules/new/flow-handlebars.js
2 files changed, 24 insertions(+), 22 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow
refs/changes/35/136635/1
diff --git a/Resources.php b/Resources.php
index 5228dde..095b092 100644
--- a/Resources.php
+++ b/Resources.php
@@ -57,6 +57,29 @@
),
'templates' => array(
'timestamp.html.handlebars',
+ // other dependencies of flow_block_topiclist from
Makefile
+ 'flow_block_topiclist.html.handlebars',
+ 'flow_board_navigation.html.handlebars',
+ 'flow_topic_navigation.html.handlebars',
+ 'flow_newtopic_form.html.handlebars',
+ // TOPIC_SUBTEMPLATES from Makefile
+ 'flow_topic.html.handlebars',
+ 'flow_reply_form.html.handlebars',
+ ),
+ 'messages' => array(
+ 'flow-cancel',
+ 'flow-load-more',
+ 'flow-newtopic-content-placeholder',
+ 'flow-newtopic-save',
+ 'flow-newtopic-start-placeholder',
+ 'flow-post-action-delete-post',
+ 'flow-post-action-hide-post',
+ 'flow-post-action-suppress-post',
+ 'flow-preview',
+ 'flow-sorting-tooltip',
+ 'flow-newest-topics',
+ 'flow-terms-of-use-new-topic',
+ 'flow-terms-of-use-reply',
)
),
'ext.flow.vendor.storer' => $flowResourceTemplate + array(
diff --git a/modules/new/flow-handlebars.js b/modules/new/flow-handlebars.js
index 711cf4c..91ebd4d 100644
--- a/modules/new/flow-handlebars.js
+++ b/modules/new/flow-handlebars.js
@@ -121,29 +121,10 @@
// @todo remove and replace with mw.message || $.noop
mw.message = mw.message || function ( str ) {
var strings = ( {
- "No_header": "This talk page has no header.",
- "Reply": "Reply",
- "Edit": "Edit",
- "Newest_topics": "Newest topics",
- "Toggle_small_topics": "Toggle small topics
view",
- "Toggle_topics_only": "Toggle topics only view",
- "Toggle_topics_and_posts": "Toggle topics and
posts view",
- "Topics": "Topics",
+ "Reply": "Reply", // TODO: pass in and parse
$author['gender']
"Topics_n": function ( count, options ) {
return "Topics (" + count + ")";
},
- "Load_More": "Load More",
- "Start_a_new_topic": "Start a new topic",
- "topic_details_placeholder": "Add some details,
if you'd like.",
- "Cancel": "Cancel",
- "Preview": "Preview",
- "Add_Topic": "Add Topic",
- "Talk": "Talk",
- "block": "block",
- "Lock": "Lock",
- "Hide": "Hide",
- "Delete": "Delete",
- "Suppress": "Suppress",
"started_with_participants": function (
context, options ) {
var author =
FlowHandlebars.prototype.authorBlock( context, options );
@@ -163,8 +144,6 @@
return context.reply_count + "
comment" + ( !context.reply_count || context.reply_count > 1 ? 's' : '' );
},
- "topic_TOU": FlowHandlebars.prototype.html( 'By
clicking add topic, you agree to our <a rel="nofollow" class="external text"
href="//wikimediafoundation.org/wiki/Terms_of_use">Terms of Use</a> and agree
to irrevocably release your text under the <a rel="nofollow" class="external
text" href="//creativecommons.org/licenses/by-sa/3.0">CC BY-SA 3.0 License</a>
and <a rel="nofollow" class="external text"
href="//en.wikipedia.org/wiki/Wikipedia:Text_of_the_GNU_Free_Documentation_License">GFDL</a>.'
),
- "reply_TOU": FlowHandlebars.prototype.html( 'By
clicking reply, you agree to our <a rel="nofollow" class="external text"
href="//wikimediafoundation.org/wiki/Terms_of_use">Terms of Use</a> and agree
to irrevocably release your text under the <a rel="nofollow" class="external
text" href="//creativecommons.org/licenses/by-sa/3.0">CC BY-SA 3.0 License</a>
and <a rel="nofollow" class="external text"
href="//en.wikipedia.org/wiki/Wikipedia:Text_of_the_GNU_Free_Documentation_License">GFDL</a>.'
),
"_time": function ( seconds_ago ) {
var str = ' second',
--
To view, visit https://gerrit.wikimedia.org/r/136635
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib47b9f03d68045d8c448a12abf23a065a0eca9bc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: frontend-rewrite
Gerrit-Owner: Spage <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits