This would be better as
```mako
<header class="global ${"slim" if course else ""}" aria-label="${_('Global Navigation')}">
```