From 72c32d93799e91931044147becec85a0b7f48c9d Mon Sep 17 00:00:00 2001 From: allejo Date: Sun, 4 Feb 2018 23:38:10 -0800 Subject: [PATCH] Fix Twig macro _self deprecation warnings in navbar --- views/navbar.html.twig | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/views/navbar.html.twig b/views/navbar.html.twig index 3360c50a..d89017cc 100644 --- a/views/navbar.html.twig +++ b/views/navbar.html.twig @@ -1,3 +1,5 @@ +{% from _self import page, userOptions %} + {% macro badge(number, class) %} {%- if number -%} @@ -16,17 +18,18 @@ {% endmacro %} {% macro userOptions(class) %} + {% from _self import badge, page %} {# TODO: Don't count notifications and messages twice #} - {{ _self.page( - _self.badge(me.countUnreadNotifications, "js-counter__notifications"), + {{ page( + badge(me.countUnreadNotifications, "js-counter__notifications"), 'Notification', 'notification_list', 'bell', class, 'Notifications' ) }} - {{ _self.page( - _self.badge(me.countUnreadMessages, "js-counter__messages"), + {{ page( + badge(me.countUnreadMessages, "js-counter__messages"), 'Message', 'message_list', 'comments-o', class, 'Messages' ) }} - {{ _self.page( + {{ page( null, 'Profile', 'profile_edit', 'gear', class, 'My Profile' ) }} @@ -34,16 +37,16 @@