Simplify rendering a banner

Now the banner component accepts either a banner or a section and loads
the banner if it's a section, so we don't have to add the `@banners`
variable in several controllers.
This commit is contained in:
Javi Martín
2021-01-14 16:06:34 +01:00
parent c3147a1bb6
commit a7bbdb1bd0
14 changed files with 82 additions and 26 deletions

View File

@@ -11,7 +11,6 @@ class WelcomeController < ApplicationController
@header = Widget::Card.header.first
@feeds = Widget::Feed.active
@cards = Widget::Card.body
@banners = Banner.in_section("homepage").with_active
@remote_translations = detect_remote_translations(@feeds,
@recommended_debates,
@recommended_proposals)