51👍
✅
Can’t you use the yesno
built-in template filter?
As in,
<div class="stream {{ stream.online|yesno:"online,offline" }}">
Source:stackexchange.com