Add footer buffer only in necessary templates

This commit is contained in:
syeopite 2024-11-07 20:28:26 -08:00
parent 2c798c9452
commit d1b9769d89
No known key found for this signature in database
GPG Key ID: A73C186DA3955A1A
6 changed files with 10 additions and 9 deletions

View File

@ -48,9 +48,8 @@ module JSON::Serializable
end
end
macro templated(_filename, template = "template", navbar_search = true, buffer_footer = false)
macro templated(_filename, template = "template", navbar_search = true)
navbar_search = {{navbar_search}}
buffer_footer = {{buffer_footer}}
{{ filename = "src/invidious/views/" + _filename + ".ecr" }}
{{ layout = "src/invidious/views/" + template + ".ecr" }}

View File

@ -152,7 +152,8 @@ module Invidious::Routes::Channels
items.each(&.author = "")
selected_tab = Frontend::ChannelPage::TabsAvailable::Playlists
templated "channel", buffer_footer: true
templated "channel"
end
def self.podcasts(env)

View File

@ -8,7 +8,7 @@ module Invidious::Routes::PreferencesRoute
preferences = env.get("preferences").as(Preferences)
templated "user/preferences", buffer_footer: true
templated "user/preferences"
end
def self.update(env)

View File

@ -52,3 +52,7 @@
<%= rendered "components/items_paginated" %>
<% if selected_tab == Frontend::ChannelPage::TabsAvailable::Playlists %>
<div id="footer_buffer"></div>
<% end %>

View File

@ -111,11 +111,6 @@
<% end %>
<%= content %>
<% if buffer_footer %>
<div id="footer_buffer"></div>
<% end %>
</div>
</div>
<script src="/js/handlers.js?v=<%= ASSET_COMMIT %>"></script>

View File

@ -361,3 +361,5 @@
</fieldset>
</form>
</div>
<div id="footer_buffer"></div>