From 5c0458a887f95158b283b649702ead365bc34088 Mon Sep 17 00:00:00 2001 From: syeopite Date: Sat, 17 Apr 2021 05:18:58 -0700 Subject: [PATCH] Move navbar search bar render check to templated --- src/invidious/helpers/macros.cr | 3 ++- src/invidious/routes/misc.cr | 2 +- src/invidious/views/template.ecr | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/invidious/helpers/macros.cr b/src/invidious/helpers/macros.cr index 8b74bc86..5d426a8b 100644 --- a/src/invidious/helpers/macros.cr +++ b/src/invidious/helpers/macros.cr @@ -48,7 +48,8 @@ module JSON::Serializable end end -macro templated(filename, template = "template") +macro templated(filename, template = "template", navbar_search = true) + navbar_search = {{navbar_search}} render "src/invidious/views/#{{{filename}}}.ecr", "src/invidious/views/#{{{template}}}.ecr" end diff --git a/src/invidious/routes/misc.cr b/src/invidious/routes/misc.cr index 12e9d5a5..d32ba892 100644 --- a/src/invidious/routes/misc.cr +++ b/src/invidious/routes/misc.cr @@ -22,7 +22,7 @@ class Invidious::Routes::Misc < Invidious::Routes::BaseRoute env.redirect "/feed/popular" end else - templated "search_homepage" + templated "search_homepage", navbar_search: false end end diff --git a/src/invidious/views/template.ecr b/src/invidious/views/template.ecr index 2ee2f453..33638055 100644 --- a/src/invidious/views/template.ecr +++ b/src/invidious/views/template.ecr @@ -28,7 +28,7 @@