From 76e379bd4fbc15f44022b296653dfbb058aa7c1f Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Sat, 23 Feb 2019 14:58:06 +0000 Subject: [PATCH] refactor: Extract message_controls template. This is a pretty coherent chunk of template code related to these icons: - edit pencil - reactions - chevron - star Moving it to a partial will simplify future diffs where we re-work the message HTML. This is a pure code move. --- static/templates/message_controls.handlebars | 28 +++++++++++++++++++ static/templates/single_message.handlebars | 29 +------------------- 2 files changed, 29 insertions(+), 28 deletions(-) create mode 100644 static/templates/message_controls.handlebars diff --git a/static/templates/message_controls.handlebars b/static/templates/message_controls.handlebars new file mode 100644 index 0000000000..b28739a12a --- /dev/null +++ b/static/templates/message_controls.handlebars @@ -0,0 +1,28 @@ +
+ {{#if msg/sent_by_me}} +
+ {{/if}} + + {{#unless msg/sent_by_me}} +
+ +
+ {{/unless}} + + {{#unless msg/locally_echoed}} +
+ +
+ {{/unless}} + +
+ + +
+ + {{#unless msg/locally_echoed}} +
+
+ {{/unless}} + +
diff --git a/static/templates/single_message.handlebars b/static/templates/single_message.handlebars index 349f5adb0b..72808781ef 100644 --- a/static/templates/single_message.handlebars +++ b/static/templates/single_message.handlebars @@ -67,35 +67,8 @@ {{/unless}} {{/if_and}} -
+ {{partial "message_controls"}} - {{#if msg/sent_by_me}} -
- {{/if}} - - {{#unless msg/sent_by_me}} -
- -
- {{/unless}} - - {{#unless msg/locally_echoed}} -
- -
- {{/unless}} - -
- - -
- - {{#unless msg/locally_echoed}} -
-
- {{/unless}} - -
{{#unless status_message}}{{#if use_match_properties}}{{{msg/match_content}}}{{else}}{{{msg/content}}}{{/if}}{{/unless}}