{% set lineColor = 'eee' %}
{% if line.color is defined and line.color is not empty %}
{% set lineColor = line.color %}
{% endif %}
{% set lineTextColor = '000' %}
{% if line.textColor is defined and line.textColor is not empty %}
{% set lineTextColor = line.textColor %}
{% endif %}
{% set disruptions = [] %}
{% if currentDisruptions is defined and currentDisruptions is not empty and disruptionStatus == 'currents' %}
{% set disruptions = currentDisruptions %}
{% endif %}
{% if futureDisruptions is defined and futureDisruptions is not empty and disruptionStatus == 'futures' %}
{% set disruptions = futureDisruptions %}
{% endif %}
{% if showDisruptionBadge is not defined %}
{% set showDisruptionBadge = false %}
{% endif %}
{% set style = '' %}
{% if disruptionStatus is defined %}
{% set style = "style=opacity:0.5" %}
{% if line.disruptions[disruptionStatus ~ 's'] is defined and line.disruptions[disruptionStatus ~ 's'] is not empty %}
{% set notifnumber = line.disruptions[disruptionStatus ~ 's']|length %}
{% elseif line.disruptions[disruptionStatus~'Disruptions'] is defined and line.disruptions[disruptionStatus~'Disruptions'] is not empty %}
{% set notifnumber = (line.disruptions[disruptionStatus~'Disruptions']|length) - 1 %}
{% endif %}
{% if notifnumber is defined and notifnumber > 0 %}
{% set style = '' %}
{% endif %}
{% endif %}
{% if line is defined and line is not empty %}
{% set mode = 'BUS' %}
{% if line.mode is defined and line.mode is not empty %}
{% set mode = line.mode %}
{% endif %}
<span class="is-Badge {% if line.sName %} is-Badge_WithIconText{% endif %}{% if line.imageUrl is not defined or line.imageUrl is empty %} is-Badge_WithIcon{% else %} is-Badge_WithImage{% endif %}">
<span class="is-Badge-Icon"><span class="is-hidden-text is-dib">{{ ('mode.' ~ line.mode|lower)|trans }}</span>
<i class="is-Icon is-Icon-sim-{{ line.mode }}"></i>
{% if line.scholar is defined and line.scholar %}
<i class="is-Icon is-Icon-sim-scholastic" data-toggle="is-tooltip" title="{{ 'line.scholastic' | trans }}"><i class="is-path1"></i><i class="is-path2"></i></i>
{% endif %}
</span>
{% if line.imageUrl is defined and line.imageUrl is not empty %}
<img src="{{ line.imageUrl }}" alt="{{ line.sName }}" class="is-Badge-Image">
{% else %}
{% if line.sName %}
<span class="is-Badge-Text" style="background-color: #{{ lineColor }}; color: #{{ lineTextColor }};">
<span class="is-hidden-text is-dib"> {{ 'schedule.line'|trans }} </span>{{ line.sName }}
</span>
{% endif %}
{% endif %}
{% if showDisruptionBadge and disruptions is defined and line.id in disruptions.lines|keys %}
{% if currentLine.disruptions is defined %}
{% set disruptionsIconClass = 'is-Badge-NotifIcon is-Icon-com-notice is-Disruption-State_' ~ currentLine.disruptions.effect %}
{% else %}
{% set disruption = disruptions.lines[line.id].disruptions.currents[0] %}
{% set disruptionsIconClass = 'is-Badge-NotifIcon is-Icon-com-notice is-Disruption-State-' ~ disruption.effect|lower %}
{% endif %}
<i class="{{ disruptionsIconClass }}" aria-hidden="true"></i>
<span class="is-hidden-text is-dib">{{ disruptionStatus == 'currents' ? 'disruptions.status_ongoing' | trans : 'disruptions.status_tocome' | trans }}</span>
{% endif %}
</span>
{% endif %}