<style>
.menu-label {     
    max-height: 40px;
    float: right;
    width: 220px; 
}</style>
<check if="{{ 'softsat.process.processo_list' | role }}">
<!-- Notifications: style can be found in dropdown.less -->
<li class="dropdown notifications-menu">
    <a href="#" class="dropdown-toggle" data-toggle="dropdown">
        <i class="glyphicon glyphicon-alert"></i>
        <check if="{{ @processos_atrasados }}">
            <span class="label label-warning">{{ count(@processos_atrasados) }}</span>
        </check>
    </a>
    <ul class="dropdown-menu">
        <li class="header">Avisos</li>
        <li>
            <!-- inner menu: contains the actual data -->
            <ul class="menu">
                <check if="{{ !@processos_atrasados }}">
                <li>
                    <a href="javascript:void(0);">
                        <i class="glyphicon glyphicon-briefcase success"></i> Todos os processos estão em dia
                    </a>
                </li>
                </check>
                <repeat group="{{ @processos_atrasados }}" value="{{ @row }}">
                <li>
                    <check if="{{ 'softsat.process.processo_edit' | role }}">
                        <true>
                        <a href="{{ 'softsat_process_processo_edit', 'id='.@row.processo_id | alias }}">
                        </true>
                        <false>
                        <a href="javascript:void(0);">
                        </false>
                    </check>
                        <check if="{{ @row.vencimento == date('Y-m-d') }}">
                            <true>
                                <i class="glyphicon glyphicon-briefcase warning"></i>
                                <p class="menu-label">
                                    <strong>Processo {{ @row.processo_id }}</strong><br>
                                    {{ @row.descricao }} <br>
                                    deve ocorrer hoje.
                                </p>
                            </true>
                            <false>
                                <check if="{{ @row.vencimento == date('Y-m-d', strtotime('+1 day')) }}">
                                    <true>
                                        <i class="glyphicon glyphicon-briefcase info"></i>
                                        <p class="menu-label">
                                            <strong>Processo {{ @row.processo_id }}</strong><br>
                                            {{ @row.descricao }} <br>
                                            deve ocorrer até amanhã.
                                        </p>
                                    </true>
                                    <false>
                                        <i class="glyphicon glyphicon-briefcase danger"></i>
                                        <p class="menu-label">
                                            <strong>Processo {{ @row.processo_id }}</strong><br>
                                            {{ @row.descricao }} <br>
                                            deveria ter ocorrido {{ @row.atraso == 1 ? 'ontem' : ' há ' . @row.atraso . ' dias' }}.
                                        </p>
                                    </false>
                                </check>
                            </false>
                        </check>
                    </a>
                </li>
                </repeat>
            </ul>
        </li>
        <li class="footer"><a href="{{ @ALIASES.softsat_process_processo_list }}">Ver todos os processos</a></li>
    </ul>
</li>
</check>