<commit_before><style>
    .onlyclosed {
        display: none;
        margin-top: 5px;
    }
    
    .collapsed-box>.box-header>.row>div.onlyclosed {
        display: block;
    }
    
    .fakeHTML {
        border: none;
        border-radius: 0px;
        border-top: 1px solid #ddd;
        border-bottom: 1px solid #eee;
        padding: 15px;
        background-color: white;
        font-family: inherit;
        font-size: 13px;
        line-height: 1.42;
    }
</style>
<div class="content">
    <div class="pull-right" ng-if="configConsulta.botoes=='GENERICO'">


        <button type="button" class="btn btn-primary btn-sm" ng-click="buscarProposicoes()" class="btn btn-success"><i class="fa fa-plus"></i> Buscar/Adicionar proposições</a>

    </div>
    <h3>Consultar Proposições</h3>
    <div class="row">
        <div class="panel panel-default" style="background-color:transparent;">
            <div class="panel-heading">
                <div class="clearfix">
                    <form action="{{getReportURL()}}" ng-submit="token=getAuthorization()" target="_relatorio" method="POST">
                        <div class="box-tools pull-right">
                            <button type="submit" class="btn btn-default" title="Relatório"> <i class="fa  fa-file-word-o"></i> Gerar Relatório
                            </button>
                        </div>

                        <div class="row" role="form">

                            <div class="col-sm-12 col-md-2 col-lg-2 col-xs-12">
                                <label>Por sigla:</label>
                                <input name="sigla" ng-keypress="avoidSubmit($event)" type="text" class="form-control" ng-model="filtro.sigla" placeholder="tipo número/ano"
                                ng-model-options="{ debounce: 1000 }">
                            </div>
                            <div class="col-sm-3 col-md-2 col-lg-2 col-xs-6">
                                <label>Por casa legislativa:</label>
                                <select name="origem" ng-model="filtro.origem" class="form-control" ng-change="updateComissoes()">
                                    <option value=""></option>
                                    <option value="CAMARA">CAMARA</option>
                                    <option value="SENADO">SENADO</option>
                                </select>
                            </div>
                            <div class="col-sm-3 col-md-2 col-lg-2 col-xs-6">
                                <label>Por comissão:</label>
                                <select name="comissao" ng-model="filtro.comissao" class="form-control" ng-disabled="filtro.origem==null || filtro.origem==''"
                                ng-options="item as item.sigla+' - '+(item.nome!=null?item.nome:'') for item in comissoes track by item.sigla.trim()|orderBy:'nome'">
                                    <option value=""></option>
                                </select>
                            </div>
                            <div class="col-sm-3 col-md-2 col-lg-2 col-xs-6" ng-if="configConsulta.botoes=='GENERICO'">
                                <label>Pelo estado na SAL:</label>
                                <select name="estado" ng-model="filtro.estado" class="form-control">
                                    <option value=""></option>
                                    <option value="FORADECOMPETENCIA">Fora de competência</option>
                                    <option value="INCLUIDO">Incluída pela ASPAR</option>
                                    <option value="EMANALISE">Em análise pelos técnicos</option>
                                    <option value="ANALISADA">Em revisão pelo diretor</option>
                                    <option value="ADESPACHAR">A despachar pelo secretário</option>
                                    <option value="ADESPACHAR_PRESENCA">Em despacho presencial</option>
                                    <option value="DESPACHADA">Despachada</option>
                                </select>
                            </div>
                            <div class="col-sm-3 col-md-2 col-lg-2 col-xs-6">
                                <label>Por prioritárias:</label>
                                <select name="isFavorita" ng-model="filtro.isFavorita" class="form-control">
                                    <option value=""></option>
                                    <option value="true">Prioritárias</option>
                                    <option value="false">Não-prioritárias</option>
                                </select>
                            </div>


                        </div>
                        <div class="row" role="form">


                            <div class="col-sm-3 col-md-2 col-lg-2 col-xs-6">
                                <label>Por equipe:</label>
                                <select name="idEquipe" ng-model="filtro.equipe" class="form-control" ng-options="item as item.nome for item in equipesFiltro track by item.id">
                                    <option value=""></option>

                                </select>
                            </div>
                            <div class="col-sm-3 col-md-2 col-lg-2 col-xs-6">
                                <label>Por responsável:</label>
                                <input typeahead-editable="false" ng-keypress="avoidSubmit($event)" ng-model="filtro.responsavel" type="text" placeholder="Nome do responsável"
                                typeahead="user as user.nome for user in getUsuarios($viewValue, false) " ng-model-options="{ debounce: 500 }"
                                class="form-control">
                                <input type="hidden" name="idResponsavel" value="{{filtro.responsavel.id}}">
                            </div>
                            <div class="col-sm-3 col-md-2 col-lg-2 col-xs-6">
                                <label>Por posicionamento:</label>
                                <select name="idPosicionamento" ng-model="filtro.posicionamento" class="form-control" ng-options="item as item.nome for item in posicionamentoFiltro track by item.id">
                                    <option value=""></option>

                                </select>
                            </div>

                            <div class="col-sm-3 col-md-2 col-lg-2 col-xs-6">
                                <label>Por macrotema:</label>
                                <select name="macrotema" ng-model="filtro.macrotema" class="form-control" ng-options="item as item.tag for item in macrotemas|orderBy:'tag'">
                                    <option value=""></option>
                                </select>
                            </div>

                            <div class="col-sm-12 col-md-2 col-lg-2 col-xs-6">
                                <div class="checkbox">
                                    <label for="pautadas">
                                        <input type="checkbox" id="pautadas" name="somentePautadas" ng-model="filtro.somentePautadas" />Somente Pautadas
                                    </label>
                                </div>

                            </div>
                            <div class="col-sm-12 col-md-2 col-lg-2 col-xs-6">
                                <div class="checkbox">
                                    <label for="pautadas">
                                        <input type="checkbox" id="pautadas" name="comAtencaoEspecial" ng-model="filtro.comAtencaoEspecial" />Com atenção especial
                                    </label>
                                </div>

                            </div>



                        </div>
                        <div class="collapse" id="collapseFullFilters">
                            <div class="row" role="form">

                                <div class="col-sm-2 col-md-2 col-lg-2 col-xs-6">
                                    <label>Pela ementa:</label>
                                    <input name="ementa" ng-keypress="avoidSubmit($event)" type="text" class="form-control" ng-model="filtro.ementa" placeholder="Texto da ementa">
                                </div>
                                <div class="col-sm-3 col-xs-6">
                                    <label>Por autor:</label>

                                    <input typeahead-editable="true" ng-model="filtro.autor" ng-keypress="avoidSubmit($event)" type="text" placeholder="<NAME> autor"
                                    typeahead-min-length="2" typeahead="entrada.nome for entrada in  getAutores($viewValue) | limitTo:8"
                                    ng-model-options="{ debounce: 500 }" class="form-control">

                                </div>


                                <div class="col-sm-3 col-xs-6">
                                    <label>Por relator:</label>
                                    <input typeahead-editable="true" ng-model="filtro.relator" ng-keypress="avoidSubmit($event)" type="text" placeholder="<NAME> relator"
                                    typeahead-min-length="2" typeahead="entrada.nome for entrada in  getRelatores($viewValue) | limitTo:8"
                                    ng-model-options="{ debounce: 500 }" class="form-control">

                                </div>
                                <div class="col-sm-3 col-xs-6">

                                    <div class="input-group date">
                                        <label>Proposições inseridas após:</label>
                                        <div class="input-group width-grid-2">
                                            <input type="text" class="form-control" name="inseridaApos" ng-keypress="avoidSubmit($event)" datepicker-popup="{{format}}"
                                            ng-model="filtro.inseridaApos" date-type="string" is-open="opened_inseridaApos"
                                            min-date="minDate" max-date="'2020-06-22'" datepicker-options="dateOptions" close-text="Fechar"
                                            clear-text="Limpar" current-text="Hoje" readonly /> <span class="input-group-btn">
							             <button type="button" class="btn btn-default" ng-click="openCalendar($event,'inseridaApos')">
								                <i class="glyphicon glyphicon-calendar"></i></button></span>
                                        </div>
                                    </div>
                                </div>

                            </div>
                            <div class="row" role="form">
                                <div class="col-sm-3 col-xs-6">
                                    <label>Proposições despachadas:</label>
                                    <div class="input-group date">


                                        <div class="col-sm-6">

                                            <div class="input-group ">
                                                <input type="text" class="form-control" ng-keypress="avoidSubmit($event)" name="foiDespachadaApos" datepicker-popup="{{format}}"
                                                ng-model="filtro.foiDespachadaApos" date-type="string" is-open="opened_foiDespachadaApos"
                                                min-date="minDate" max-date="'2020-06-22'" current-text="Hoje" datepicker-options="dateOptions"
                                                placeholder="Desde" close-text="Fechar" readonly clear-text="Limpar" /> <span class="input-group-btn">
							             <button type="button" class="btn btn-default" ng-click="openCalendar($event,'foiDespachadaApos')">
								                <i class="glyphicon glyphicon-calendar"></i></button></span>
                                            </div>
                                        </div>
                                        <div class="col-sm-6">

                                            <div class="input-group ">
                                                <input type="text" class="form-control" ng-keypress="avoidSubmit($event)" name="foiDespachadaAte" datepicker-popup="{{format}}"
                                                ng-model="filtro.foiDespachadaAte" date-type="string" is-open="opened_foiDespachadaAte"
                                                 max-date="'2020-06-22'" current-text="Hoje"
                                                placeholder="Até" datepicker-options="dateOptions" close-text="Fechar" readonly
                                                clear-text="Limpar" /> <span class="input-group-btn">
							             <button type="button" class="btn btn-default" ng-click="openCalendar($event,'foiDespachadaAte')">
								                <i class="glyphicon glyphicon-calendar"></i></button></span>
                                            </div>
                                        </div>
                                    </div>
                                    <small class="text-muted">*Força filtro por despachadas</small>
                                </div>
                                <div class="col-sm-6 col-md-2 col-lg-2 col-xs-6">
                                    <div class="checkbox">
                                        <label for="comNotaTecnica">
                                            <input type="checkbox" id="comNotaTecnica" name="comNotaTecnica" ng-model="filtro.comNotaTecnica" />Com nota técnica
                                        </label>
                                    </div>

                                </div>
                            </div>
                        </div>




                        <input type="hidden" name="a" value="{{token}}">
                </div>
                </form>
                <a class="small-box-footer" data-toggle="collapse" aria-expanded="false" data-target="#collapseFullFilters" aria-controls="collapseFullFilters">
                    <span id="expandido">Mais filtros <i class="fa fa-caret-down"></i></span><span id="colapsado" style="display:none;">Reduzir filtros <i class="fa fa-caret-up"></i></span>
                </a>
            </div>

        </div>

        <div class="panel-body">

            <div infinite-scroll='consultarProposicoes()' infinite-scroll-disabled='infiniteScroll.busy'>
                <div class="box box-info collapsed-box" ng-repeat="item in proposicoes track by item.idProposicao | orderBy : ['origem','comissao','favorita','pautaComissaoAtual.pautaReuniaoComissao.data','pautaComissaoAtual.ordem']">
                    <div class="box-header" title="{{item.sigla}}">

                        <div class="box-tools pull-right" ng-show="inactivateSpinner==true && item===savingItem">
                            <i class="fa fa-refresh fa-spin"></i>
                        </div>

                        <div class="box-tools pull-right" ng-if="configConsulta.botoes=='MINISTRO'" ng-hide="inactivateSpinner==true && item===savingItem">



                            <button ng-show="item.comAtencaoEspecial==null" type="button" class="btn bg-olive-active color-palette btn-sm" title="Marcar proposição para ter maior atenção"
                            ng-click="marcarAtencaoEspecial(item)">
                                Atenção especial
                            </button>
                            <button ng-show="item.comAtencaoEspecial!=null" type="button" class="btn  bg-olive color-palette btn-sm" title="Marcar proposição para ter maior atenção"
                            ng-click="desmarcarAtencaoEspecial(item)">
                                Remover atenção especial
                            </button>
                        </div>
                        <div class="box-tools pull-right" ng-if="configConsulta.botoes=='GENERICO'" ng-hide="inactivateSpinner==true && item===savingItem">
                            <button ng-if="Auth.isAspar(true) && item.estado!='FORADECOMPETENCIA'" type="button" class="btn btn-default btn-sm" title="Remover da lista de análise da SAL"
                            ng-mouseover="showBtnText='fc'" ng-mouseleave="showBtnText=null" ng-click="setaEstado(item,'FORADECOMPETENCIA')"> <i class="fa fa-remove"></i> <span ng-show="showBtnText=='fc'">Fora de competência</span>
                            </button>
                            <button ng-if="Auth.isAspar(true) && (item.estado=='FORADECOMPETENCIA' || item.estado=='INCLUIDO')" type="button" class="btn btn-default btn-sm" title="Marcar análise SAL"
                            ng-click="setaEstado(item,'EMANALISE')" ng-mouseover="showBtnText='ma'" ng-mouseleave="showBtnText=null"> <i class="fa fa-mail-forward"></i> <span ng-show="showBtnText=='ma'">Marcar para análise da SAL</span>
                            </button>
                            <button ng-if="Auth.isAspar(true) && item.estado=='DESPACHADA'" type="button" class="btn btn-default btn-sm" title="Fazer nova avaliação, despachada desde {{item.foiDespachada|date:'shortDate'}}"
                            ng-click="setaEstado(item,'EMANALISE')"  ng-mouseover="showBtnText='na'" ng-mouseleave="showBtnText=null">
                                <i class="fa fa-mail-forward"></i> <span ng-show="showBtnText=='na'">Fazer nova avaliação</span>
                            </button>

                            <button ng-if="Auth.isEquipe(true) && item.estado=='EMANALISE'" type="button" class="btn btn-default btn-sm" title="Enviar para revisão, em análise desde {{item.foiEncaminhada|date:'shortDate'}}"
                            ng-click="setaEstado(item,'ANALISADA')" ng-mouseover="showBtnText='re'" ng-mouseleave="showBtnText=null">
                                <i class="fa fa-check-circle-o"></i> <span ng-show="showBtnText=='re'">Enviar para revisão</span>
                            </button>

                            <button ng-if="Auth.isDiretor() && (item.estado=='ANALISADA'  || item.estado=='ADESPACHAR' )&& item.foiDespachada>0" type="button" 
                            class="btn btn-default btn-sm" title="Despacho sem necessidade de revisão do secretário" ng-click="setaEstado(item, 'DESPACHADA')"  ng-mouseover="showBtnText='dd'" ng-mouseleave="showBtnText=null">
                                <i class="fa fa-paper-plane"></i> <span ng-show="showBtnText=='dd'">Despachar direto</span>
                            </button>
                            <button ng-if="Auth.isDiretor(true) && item.estado=='ANALISADA'" type="button" class="btn btn-default btn-sm" title="Enviar para despacho do Secretário, em revisão desde {{item.foiAnalisada|date:'shortDate'}}"
                            ng-click="setaEstado(item, 'ADESPACHAR')" ng-mouseover="showBtnText='ed'" ng-mouseleave="showBtnText=null">
                                <i class="fa fa-check-circle"></i> <span ng-show="showBtnText=='ed'">Enviar para despacho do Secretário</span>
                            </button>
                            <button ng-if="Auth.isEquipe(true) && (item.estado=='ANALISADA' || item.estado=='ADESPACHAR' || item.estado=='ADESPACHAR_PRESENCA')" type="button" class="btn btn-default btn-sm"
                            title="Enviar para re análise" ng-click="setaEstado(item, 'EMANALISE')"  ng-mouseover="showBtnText='nt'" ng-mouseleave="showBtnText=null">
                                <i class="fa fa-retweet"></i> <span ng-show="showBtnText=='nt'">Nova análise pelo técnico</span>
                            </button>

                            <button ng-if="Auth.isSecretario(true) && item.estado=='ADESPACHAR'" type="button" class="btn btn-default btn-sm" title="Despachar, em despacho desde {{item.foiRevisada|date:                           'shortDate'}}"
                            ng-click="setaEstado(item, 'DESPACHADA')" ng-mouseover="showBtnText='de'" ng-mouseleave="showBtnText=null">
                                <i class="fa fa-paper-plane"></i> <span ng-show="showBtnText=='de'">Despachar</span>
                            </button>


                            <button ng-if="Auth.isEquipe(true) && item.estado=='ADESPACHAR_PRESENCA'" type="button" class="btn btn-default btn-sm" title="Re enviar para despacho do secretário"
                            ng-click="setaEstado(item, 'ADESPACHAR')" ng-mouseover="showBtnText='eds'" ng-mouseleave="showBtnText=null">
                                <i class="fa fa-check-circle"></i> <span ng-show="showBtnText=='eds'">Enviar para despacho do Secretário</span>
                            </button>

                            <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-plus"></i>
                            </button>
                        </div>
                        <div class="box-tools pull-right" ng-if="Auth.isSecretario(true) && configConsulta.botoes=='DESPACHO'" ng-hide="inactivateSpinner==true && item===savingItem">


                            <button ng-if="item.estado=='EMANALISE'" type="button" class="btn btn-default btn-sm" title="Desfazer" ng-click="setaEstado(item, 'ADESPACHAR')">
                                <i class="fa fa-undo"></i> Desfazer
                            </button>

                            <button ng-if="item.estado=='DESPACHADA'" type="button" class="btn btn-default btn-sm" title="Desfazer" ng-click="setaEstado(item, 'ADESPACHAR')">
                                <i class="fa fa-undo"></i> Desfazer
                            </button>

                            <button ng-if=" item.estado=='ADESPACHAR'" type="button" class="btn btn-success btn-sm" title="Despachar" ng-click="setaEstado(item, 'DESPACHADA')">
                                <i class="fa fa-paper-plane"></i> Despachar
                            </button>
                            <button ng-if="item.estado=='ADESPACHAR'" type="button" class="btn btn-info btn-sm" title="Despachar com técnico" ng-click="despachoPresencial(item)">
                                <i class="fa fa-user"></i> Despacho presencial
                            </button>

                            <button ng-if="(item.estado=='ANALISADA' || item.estado=='ADESPACHAR' )" type="button" class="btn btn-warning btn-sm" title="Enviar para re análise"
                            ng-click="setaEstado(item, 'EMANALISE')">
                                <i class="fa fa-retweet"></i> Re-Analisar
                            </button>
                            <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-plus"></i>
                            </button>
                        </div>
                        <div class="row">
                            <div class="col-sm-6 col-md-3 col-lg-3">
                                <span ng-if="Auth.isMinistro()">
                                <i style="cursor:pointer" class="fa fa-flag-o " ng-show="item.comAtencaoEspecial==null" title="Marcar com Atenção Especial"  ng-click="marcarAtencaoEspecial(item)"></i>
                                <i style="cursor:pointer" class="fa  fa-flag text-red " ng-show="item.comAtencaoEspecial!=null" title="Remover Atenção Especial" ng-click="desmarcarAtencaoEspecial(item)"></i>
                                </span>
                                <span ng-if="!Auth.isMinistro()">
                                <i class="fa fa-flag text-red " ng-hide="item.comAtencaoEspecial==null" title="Atenção Especial" ></i>
                                
                                </span>

                                <i style="cursor:pointer" class="fa fa-star-o" ng-show="!item.favorita" ng-click="item.favorita=true;save(item)"></i>
                                <i style="cursor:pointer;color: orange;" class="fa fa-star" ng-show="item.favorita" ng-click="item.favorita=false;save(item)"></i>

                                <h3 class="box-title"><a   data-widget="collapse"   title="{{item.sigla}} - {{getNameEstado(item.estado)}}">{{item.sigla}}</a></h3>
                                <div style="cursor:default" class="time" ng-class="{ 'text-muted':item.pautaComissaoAtual.pautaReuniaoComissao.data<today}"
                                ng-show="item.pautaComissaoAtual.pautaReuniaoComissao.data>getSunday()" title="Pautada para {{item.pautaComissaoAtual.pautaReuniaoComissao.data| date:'fullDate'}}">
                                    <i class="fa fa-clock-o"></i> {{item.pautaComissaoAtual.pautaReuniaoComissao.data| date:'EEE,&nbsp;H:mm'}}
                                </div>
                            </div>

                            <div class="col-sm-6 col-md-3 col-lg-3">
                                <strong>Relator: </strong><span ng-if="item.pautaComissaoAtual.relator==null">Não identificado</span>{{item.pautaComissaoAtual.relator}}
                            </div>
                            <div class="col-sm-6 col-md-2 col-lg-2">


                                <span class="label" ng-class="{'bg-gray':item.posicionamentoAtual==null,
                                                'label-danger':(item.posicionamentoAtual.posicionamento.nome.indexOf('Contrário')>-1),
                                                'label-info':(item.posicionamentoAtual.posicionamento.nome.indexOf('Nada')>-1)||(item.posicionamentoAtual.posicionamento.nome.indexOf('Monitorar')>-1),
                                                'label-success':item.posicionamentoAtual.posicionamento.nome.indexOf('Favorável')>-1
                                                }">{{item.posicionamentoAtual.posicionamento.nome}}</span>



                            </div>
                        </div>
                        <div class="row">

                            <div class="col-sm-12 col-lg-12 onlyclosed">
                                <blockquote>
                                    <small ng-if="item.explicacao!=null" title="Explicação da SAL"> {{item.explicacao}}</small>
                                    <small ng-if="item.explicacao==null" title="Ementa"> {{item.ementa}}</small>
                                </blockquote>

                            </div>
                            <div class="col-sm-12 col-lg-12 onlyclosed text-muted">
                                <small>Inserida  <cite style="font-style:italic" title="{{item.sigla}} (inserida {{item.created| date:'shortDate'}}, atualizada {{item.updated| date:'shortDate'}})">{{item.created| date:'shortDate'}}</cite></small>
                            </div>

                        </div>

                    </div>
                    <div class="box-body" ng-if="configConsulta.botoes!='MINISTRO'">
                        <div ng-include="'views/Proposicao/proposicao_fragment.html'" ng-controller="ProposicaoItemController" onload="proposicao = item;">
                        </div>
                    </div>
                    <div class="box-body" ng-if="configConsulta.botoes=='MINISTRO'">
                        <div ng-include="'views/Proposicao/proposicao_fragment_readonly.html'" ng-controller="ProposicaoItemController" onload="proposicao = item;">
                        </div>
                    </div>
                    <div class="box-footer">
                        <div class="col-sm-12 col-lg-12  text-muted" >
                            <small>Inserida  <cite style="font-style:italic" title="Inserida {{item.created| date:'shortDate'}}, atualizada {{item.updated| date:'shortDate'}}">{{item.created| date:'shortDate'}}</cite></small>
                        </div>
                    </div>

                </div>
            </div>
            <div class="alert alert-info" ng-show="infiniteScroll.full">
                <i class="icon fa fa-info"></i> Todos registros carregados baseado no filtro atual
            </div>
        </div>
    </div>
</div><commit_msg>Fix no relatorio de macrotemas<commit_after><style>
    .onlyclosed {
        display: none;
        margin-top: 5px;
    }
    
    .collapsed-box>.box-header>.row>div.onlyclosed {
        display: block;
    }
    
    .fakeHTML {
        border: none;
        border-radius: 0px;
        border-top: 1px solid #ddd;
        border-bottom: 1px solid #eee;
        padding: 15px;
        background-color: white;
        font-family: inherit;
        font-size: 13px;
        line-height: 1.42;
    }
</style>
<div class="content">
    <div class="pull-right" ng-if="configConsulta.botoes=='GENERICO'">


        <button type="button" class="btn btn-primary btn-sm" ng-click="buscarProposicoes()" class="btn btn-success"><i class="fa fa-plus"></i> Buscar/Adicionar proposições</a>

    </div>
    <h3>Consultar Proposições</h3>
    <div class="row">
        <div class="panel panel-default" style="background-color:transparent;">
            <div class="panel-heading">
                <div class="clearfix">
                    <form action="{{getReportURL()}}" ng-submit="token=getAuthorization()" target="_relatorio" method="POST" enctype="application/x-www-form-urlencoded;utf-8">
                        <div class="box-tools pull-right">
                            <button type="submit" class="btn btn-default" title="Relatório"> <i class="fa  fa-file-word-o"></i> Gerar Relatório
                            </button>
                        </div>

                        <div class="row" role="form">

                            <div class="col-sm-12 col-md-2 col-lg-2 col-xs-12">
                                <label>Por sigla:</label>
                                <input name="sigla" ng-keypress="avoidSubmit($event)" type="text" class="form-control" ng-model="filtro.sigla" placeholder="tipo número/ano"
                                ng-model-options="{ debounce: 1000 }">
                            </div>
                            <div class="col-sm-3 col-md-2 col-lg-2 col-xs-6">
                                <label>Por casa legislativa:</label>
                                <select name="origem" ng-model="filtro.origem" class="form-control" ng-change="updateComissoes()">
                                    <option value=""></option>
                                    <option value="CAMARA">CAMARA</option>
                                    <option value="SENADO">SENADO</option>
                                </select>
                            </div>
                            <div class="col-sm-3 col-md-2 col-lg-2 col-xs-6">
                                <label>Por comissão:</label>
                                <select name="comissao" ng-model="filtro.comissao" class="form-control" ng-disabled="filtro.origem==null || filtro.origem==''"
                                ng-options="item as item.sigla+' - '+(item.nome!=null?item.nome:'') for item in comissoes track by item.sigla.trim()|orderBy:'nome'">
                                    <option value=""></option>
                                </select>
                            </div>
                            <div class="col-sm-3 col-md-2 col-lg-2 col-xs-6" ng-if="configConsulta.botoes=='GENERICO'">
                                <label>Pelo estado na SAL:</label>
                                <select name="estado" ng-model="filtro.estado" class="form-control">
                                    <option value=""></option>
                                    <option value="FORADECOMPETENCIA">Fora de competência</option>
                                    <option value="INCLUIDO">Incluída pela ASPAR</option>
                                    <option value="EMANALISE">Em análise pelos técnicos</option>
                                    <option value="ANALISADA">Em revisão pelo diretor</option>
                                    <option value="ADESPACHAR">A despachar pelo secretário</option>
                                    <option value="ADESPACHAR_PRESENCA">Em despacho presencial</option>
                                    <option value="DESPACHADA">Despachada</option>
                                </select>
                            </div>
                            <div class="col-sm-3 col-md-2 col-lg-2 col-xs-6">
                                <label>Por prioritárias:</label>
                                <select name="isFavorita" ng-model="filtro.isFavorita" class="form-control">
                                    <option value=""></option>
                                    <option value="true">Prioritárias</option>
                                    <option value="false">Não-prioritárias</option>
                                </select>
                            </div>


                        </div>
                        <div class="row" role="form">


                            <div class="col-sm-3 col-md-2 col-lg-2 col-xs-6">
                                <label>Por equipe:</label>
                                <select name="idEquipe" ng-model="filtro.equipe" class="form-control" ng-options="item as item.nome for item in equipesFiltro track by item.id">
                                    <option value=""></option>

                                </select>
                            </div>
                            <div class="col-sm-3 col-md-2 col-lg-2 col-xs-6">
                                <label>Por responsável:</label>
                                <input typeahead-editable="false" ng-keypress="avoidSubmit($event)" ng-model="filtro.responsavel" type="text" placeholder="Nome do responsável"
                                typeahead="user as user.nome for user in getUsuarios($viewValue, false) " ng-model-options="{ debounce: 500 }"
                                class="form-control">
                                <input type="hidden" name="idResponsavel" value="{{filtro.responsavel.id}}">
                            </div>
                            <div class="col-sm-3 col-md-2 col-lg-2 col-xs-6">
                                <label>Por posicionamento:</label>
                                <select name="idPosicionamento" ng-model="filtro.posicionamento" class="form-control" ng-options="item as item.nome for item in posicionamentoFiltro track by item.id">
                                    <option value=""></option>

                                </select>
                            </div>

                            <div class="col-sm-3 col-md-2 col-lg-2 col-xs-6">
                                <label>Por macrotema:</label>
                                <select name="macrotema" ng-model="filtro.macrotema" class="form-control" ng-options="item as item.tag for item in macrotemas |orderBy:'tag' track by item.tag">
                                    <option value=""></option>
                                </select>
                            </div>

                            <div class="col-sm-12 col-md-2 col-lg-2 col-xs-6">
                                <div class="checkbox">
                                    <label for="pautadas">
                                        <input type="checkbox" id="pautadas" name="somentePautadas" ng-model="filtro.somentePautadas" />Somente Pautadas
                                    </label>
                                </div>

                            </div>
                            <div class="col-sm-12 col-md-2 col-lg-2 col-xs-6">
                                <div class="checkbox">
                                    <label for="pautadas">
                                        <input type="checkbox" id="pautadas" name="comAtencaoEspecial" ng-model="filtro.comAtencaoEspecial" />Com atenção especial
                                    </label>
                                </div>

                            </div>



                        </div>
                        <div class="collapse" id="collapseFullFilters">
                            <div class="row" role="form">

                                <div class="col-sm-2 col-md-2 col-lg-2 col-xs-6">
                                    <label>Pela ementa:</label>
                                    <input name="ementa" ng-keypress="avoidSubmit($event)" type="text" class="form-control" ng-model="filtro.ementa" placeholder="Texto da ementa">
                                </div>
                                <div class="col-sm-3 col-xs-6">
                                    <label>Por autor:</label>

                                    <input typeahead-editable="true" ng-model="filtro.autor" ng-keypress="avoidSubmit($event)" type="text" placeholder="Nome do autor"
                                    typeahead-min-length="2" typeahead="entrada.nome for entrada in  getAutores($viewValue) | limitTo:8"
                                    ng-model-options="{ debounce: 500 }" class="form-control">

                                </div>


                                <div class="col-sm-3 col-xs-6">
                                    <label>Por relator:</label>
                                    <input typeahead-editable="true" ng-model="filtro.relator" ng-keypress="avoidSubmit($event)" type="text" placeholder="<NAME> relator"
                                    typeahead-min-length="2" typeahead="entrada.nome for entrada in  getRelatores($viewValue) | limitTo:8"
                                    ng-model-options="{ debounce: 500 }" class="form-control">

                                </div>
                                <div class="col-sm-3 col-xs-6">

                                    <div class="input-group date">
                                        <label>Proposições inseridas após:</label>
                                        <div class="input-group width-grid-2">
                                            <input type="text" class="form-control" name="inseridaApos" ng-keypress="avoidSubmit($event)" datepicker-popup="{{format}}"
                                            ng-model="filtro.inseridaApos" date-type="string" is-open="opened_inseridaApos"
                                            min-date="minDate" max-date="'2020-06-22'" datepicker-options="dateOptions" close-text="Fechar"
                                            clear-text="Limpar" current-text="Hoje" readonly /> <span class="input-group-btn">
							             <button type="button" class="btn btn-default" ng-click="openCalendar($event,'inseridaApos')">
								                <i class="glyphicon glyphicon-calendar"></i></button></span>
                                        </div>
                                    </div>
                                </div>

                            </div>
                            <div class="row" role="form">
                                <div class="col-sm-3 col-xs-6">
                                    <label>Proposições despachadas:</label>
                                    <div class="input-group date">


                                        <div class="col-sm-6">

                                            <div class="input-group ">
                                                <input type="text" class="form-control" ng-keypress="avoidSubmit($event)" name="foiDespachadaApos" datepicker-popup="{{format}}"
                                                ng-model="filtro.foiDespachadaApos" date-type="string" is-open="opened_foiDespachadaApos"
                                                min-date="minDate" max-date="'2020-06-22'" current-text="Hoje" datepicker-options="dateOptions"
                                                placeholder="Desde" close-text="Fechar" readonly clear-text="Limpar" /> <span class="input-group-btn">
							             <button type="button" class="btn btn-default" ng-click="openCalendar($event,'foiDespachadaApos')">
								                <i class="glyphicon glyphicon-calendar"></i></button></span>
                                            </div>
                                        </div>
                                        <div class="col-sm-6">

                                            <div class="input-group ">
                                                <input type="text" class="form-control" ng-keypress="avoidSubmit($event)" name="foiDespachadaAte" datepicker-popup="{{format}}"
                                                ng-model="filtro.foiDespachadaAte" date-type="string" is-open="opened_foiDespachadaAte"
                                                 max-date="'2020-06-22'" current-text="Hoje"
                                                placeholder="Até" datepicker-options="dateOptions" close-text="Fechar" readonly
                                                clear-text="Limpar" /> <span class="input-group-btn">
							             <button type="button" class="btn btn-default" ng-click="openCalendar($event,'foiDespachadaAte')">
								                <i class="glyphicon glyphicon-calendar"></i></button></span>
                                            </div>
                                        </div>
                                    </div>
                                    <small class="text-muted">*Força filtro por despachadas</small>
                                </div>
                                <div class="col-sm-6 col-md-2 col-lg-2 col-xs-6">
                                    <div class="checkbox">
                                        <label for="comNotaTecnica">
                                            <input type="checkbox" id="comNotaTecnica" name="comNotaTecnica" ng-model="filtro.comNotaTecnica" />Com nota técnica
                                        </label>
                                    </div>

                                </div>
                            </div>
                        </div>




                        <input type="hidden" name="a" value="{{token}}">
                </div>
                </form>
                <a class="small-box-footer" data-toggle="collapse" aria-expanded="false" data-target="#collapseFullFilters" aria-controls="collapseFullFilters">
                    <span id="expandido">Mais filtros <i class="fa fa-caret-down"></i></span><span id="colapsado" style="display:none;">Reduzir filtros <i class="fa fa-caret-up"></i></span>
                </a>
            </div>

        </div>

        <div class="panel-body">

            <div infinite-scroll='consultarProposicoes()' infinite-scroll-disabled='infiniteScroll.busy'>
                <div class="box box-info collapsed-box" ng-repeat="item in proposicoes track by item.idProposicao | orderBy : ['origem','comissao','favorita','pautaComissaoAtual.pautaReuniaoComissao.data','pautaComissaoAtual.ordem']">
                    <div class="box-header" title="{{item.sigla}}">

                        <div class="box-tools pull-right" ng-show="inactivateSpinner==true && item===savingItem">
                            <i class="fa fa-refresh fa-spin"></i>
                        </div>

                        <div class="box-tools pull-right" ng-if="configConsulta.botoes=='MINISTRO'" ng-hide="inactivateSpinner==true && item===savingItem">



                            <button ng-show="item.comAtencaoEspecial==null" type="button" class="btn bg-olive-active color-palette btn-sm" title="Marcar proposição para ter maior atenção"
                            ng-click="marcarAtencaoEspecial(item)">
                                Atenção especial
                            </button>
                            <button ng-show="item.comAtencaoEspecial!=null" type="button" class="btn  bg-olive color-palette btn-sm" title="Marcar proposição para ter maior atenção"
                            ng-click="desmarcarAtencaoEspecial(item)">
                                Remover atenção especial
                            </button>
                        </div>
                        <div class="box-tools pull-right" ng-if="configConsulta.botoes=='GENERICO'" ng-hide="inactivateSpinner==true && item===savingItem">
                            <button ng-if="Auth.isAspar(true) && item.estado!='FORADECOMPETENCIA'" type="button" class="btn btn-default btn-sm" title="Remover da lista de análise da SAL"
                            ng-mouseover="showBtnText='fc'" ng-mouseleave="showBtnText=null" ng-click="setaEstado(item,'FORADECOMPETENCIA')"> <i class="fa fa-remove"></i> <span ng-show="showBtnText=='fc'">Fora de competência</span>
                            </button>
                            <button ng-if="Auth.isAspar(true) && (item.estado=='FORADECOMPETENCIA' || item.estado=='INCLUIDO')" type="button" class="btn btn-default btn-sm" title="Marcar análise SAL"
                            ng-click="setaEstado(item,'EMANALISE')" ng-mouseover="showBtnText='ma'" ng-mouseleave="showBtnText=null"> <i class="fa fa-mail-forward"></i> <span ng-show="showBtnText=='ma'">Marcar para análise da SAL</span>
                            </button>
                            <button ng-if="Auth.isAspar(true) && item.estado=='DESPACHADA'" type="button" class="btn btn-default btn-sm" title="Fazer nova avaliação, despachada desde {{item.foiDespachada|date:'shortDate'}}"
                            ng-click="setaEstado(item,'EMANALISE')"  ng-mouseover="showBtnText='na'" ng-mouseleave="showBtnText=null">
                                <i class="fa fa-mail-forward"></i> <span ng-show="showBtnText=='na'">Fazer nova avaliação</span>
                            </button>

                            <button ng-if="Auth.isEquipe(true) && item.estado=='EMANALISE'" type="button" class="btn btn-default btn-sm" title="Enviar para revisão, em análise desde {{item.foiEncaminhada|date:'shortDate'}}"
                            ng-click="setaEstado(item,'ANALISADA')" ng-mouseover="showBtnText='re'" ng-mouseleave="showBtnText=null">
                                <i class="fa fa-check-circle-o"></i> <span ng-show="showBtnText=='re'">Enviar para revisão</span>
                            </button>

                            <button ng-if="Auth.isDiretor() && (item.estado=='ANALISADA'  || item.estado=='ADESPACHAR' )&& item.foiDespachada>0" type="button" 
                            class="btn btn-default btn-sm" title="Despacho sem necessidade de revisão do secretário" ng-click="setaEstado(item, 'DESPACHADA')"  ng-mouseover="showBtnText='dd'" ng-mouseleave="showBtnText=null">
                                <i class="fa fa-paper-plane"></i> <span ng-show="showBtnText=='dd'">Despachar direto</span>
                            </button>
                            <button ng-if="Auth.isDiretor(true) && item.estado=='ANALISADA'" type="button" class="btn btn-default btn-sm" title="Enviar para despacho do Secretário, em revisão desde {{item.foiAnalisada|date:'shortDate'}}"
                            ng-click="setaEstado(item, 'ADESPACHAR')" ng-mouseover="showBtnText='ed'" ng-mouseleave="showBtnText=null">
                                <i class="fa fa-check-circle"></i> <span ng-show="showBtnText=='ed'">Enviar para despacho do Secretário</span>
                            </button>
                            <button ng-if="Auth.isEquipe(true) && (item.estado=='ANALISADA' || item.estado=='ADESPACHAR' || item.estado=='ADESPACHAR_PRESENCA')" type="button" class="btn btn-default btn-sm"
                            title="Enviar para re análise" ng-click="setaEstado(item, 'EMANALISE')"  ng-mouseover="showBtnText='nt'" ng-mouseleave="showBtnText=null">
                                <i class="fa fa-retweet"></i> <span ng-show="showBtnText=='nt'">Nova análise pelo técnico</span>
                            </button>

                            <button ng-if="Auth.isSecretario(true) && item.estado=='ADESPACHAR'" type="button" class="btn btn-default btn-sm" title="Despachar, em despacho desde {{item.foiRevisada|date:                           'shortDate'}}"
                            ng-click="setaEstado(item, 'DESPACHADA')" ng-mouseover="showBtnText='de'" ng-mouseleave="showBtnText=null">
                                <i class="fa fa-paper-plane"></i> <span ng-show="showBtnText=='de'">Despachar</span>
                            </button>


                            <button ng-if="Auth.isEquipe(true) && item.estado=='ADESPACHAR_PRESENCA'" type="button" class="btn btn-default btn-sm" title="Re enviar para despacho do secretário"
                            ng-click="setaEstado(item, 'ADESPACHAR')" ng-mouseover="showBtnText='eds'" ng-mouseleave="showBtnText=null">
                                <i class="fa fa-check-circle"></i> <span ng-show="showBtnText=='eds'">Enviar para despacho do Secretário</span>
                            </button>

                            <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-plus"></i>
                            </button>
                        </div>
                        <div class="box-tools pull-right" ng-if="Auth.isSecretario(true) && configConsulta.botoes=='DESPACHO'" ng-hide="inactivateSpinner==true && item===savingItem">


                            <button ng-if="item.estado=='EMANALISE'" type="button" class="btn btn-default btn-sm" title="Desfazer" ng-click="setaEstado(item, 'ADESPACHAR')">
                                <i class="fa fa-undo"></i> Desfazer
                            </button>

                            <button ng-if="item.estado=='DESPACHADA'" type="button" class="btn btn-default btn-sm" title="Desfazer" ng-click="setaEstado(item, 'ADESPACHAR')">
                                <i class="fa fa-undo"></i> Desfazer
                            </button>

                            <button ng-if=" item.estado=='ADESPACHAR'" type="button" class="btn btn-success btn-sm" title="Despachar" ng-click="setaEstado(item, 'DESPACHADA')">
                                <i class="fa fa-paper-plane"></i> Despachar
                            </button>
                            <button ng-if="item.estado=='ADESPACHAR'" type="button" class="btn btn-info btn-sm" title="Despachar com técnico" ng-click="despachoPresencial(item)">
                                <i class="fa fa-user"></i> Despacho presencial
                            </button>

                            <button ng-if="(item.estado=='ANALISADA' || item.estado=='ADESPACHAR' )" type="button" class="btn btn-warning btn-sm" title="Enviar para re análise"
                            ng-click="setaEstado(item, 'EMANALISE')">
                                <i class="fa fa-retweet"></i> Re-Analisar
                            </button>
                            <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-plus"></i>
                            </button>
                        </div>
                        <div class="row">
                            <div class="col-sm-6 col-md-3 col-lg-3">
                                <span ng-if="Auth.isMinistro()">
                                <i style="cursor:pointer" class="fa fa-flag-o " ng-show="item.comAtencaoEspecial==null" title="Marcar com Atenção Especial"  ng-click="marcarAtencaoEspecial(item)"></i>
                                <i style="cursor:pointer" class="fa  fa-flag text-red " ng-show="item.comAtencaoEspecial!=null" title="Remover Atenção Especial" ng-click="desmarcarAtencaoEspecial(item)"></i>
                                </span>
                                <span ng-if="!Auth.isMinistro()">
                                <i class="fa fa-flag text-red " ng-hide="item.comAtencaoEspecial==null" title="Atenção Especial" ></i>
                                
                                </span>

                                <i style="cursor:pointer" class="fa fa-star-o" ng-show="!item.favorita" ng-click="item.favorita=true;save(item)"></i>
                                <i style="cursor:pointer;color: orange;" class="fa fa-star" ng-show="item.favorita" ng-click="item.favorita=false;save(item)"></i>

                                <h3 class="box-title"><a   data-widget="collapse"   title="{{item.sigla}} - {{getNameEstado(item.estado)}}">{{item.sigla}}</a></h3>
                                <div style="cursor:default" class="time" ng-class="{ 'text-muted':item.pautaComissaoAtual.pautaReuniaoComissao.data<today}"
                                ng-show="item.pautaComissaoAtual.pautaReuniaoComissao.data>getSunday()" title="Pautada para {{item.pautaComissaoAtual.pautaReuniaoComissao.data| date:'fullDate'}}">
                                    <i class="fa fa-clock-o"></i> {{item.pautaComissaoAtual.pautaReuniaoComissao.data| date:'EEE,&nbsp;H:mm'}}
                                </div>
                            </div>

                            <div class="col-sm-6 col-md-3 col-lg-3">
                                <strong>Relator: </strong><span ng-if="item.pautaComissaoAtual.relator==null">Não identificado</span>{{item.pautaComissaoAtual.relator}}
                            </div>
                            <div class="col-sm-6 col-md-2 col-lg-2">


                                <span class="label" ng-class="{'bg-gray':item.posicionamentoAtual==null,
                                                'label-danger':(item.posicionamentoAtual.posicionamento.nome.indexOf('Contrário')>-1),
                                                'label-info':(item.posicionamentoAtual.posicionamento.nome.indexOf('Nada')>-1)||(item.posicionamentoAtual.posicionamento.nome.indexOf('Monitorar')>-1),
                                                'label-success':item.posicionamentoAtual.posicionamento.nome.indexOf('Favorável')>-1
                                                }">{{item.posicionamentoAtual.posicionamento.nome}}</span>



                            </div>
                        </div>
                        <div class="row">

                            <div class="col-sm-12 col-lg-12 onlyclosed">
                                <blockquote>
                                    <small ng-if="item.explicacao!=null" title="Explicação da SAL"> {{item.explicacao}}</small>
                                    <small ng-if="item.explicacao==null" title="Ementa"> {{item.ementa}}</small>
                                </blockquote>

                            </div>
                            <div class="col-sm-12 col-lg-12 onlyclosed text-muted">
                                <small>Inserida  <cite style="font-style:italic" title="{{item.sigla}} (inserida {{item.created| date:'shortDate'}}, atualizada {{item.updated| date:'shortDate'}})">{{item.created| date:'shortDate'}}</cite></small>
                            </div>

                        </div>

                    </div>
                    <div class="box-body" ng-if="configConsulta.botoes!='MINISTRO'">
                        <div ng-include="'views/Proposicao/proposicao_fragment.html'" ng-controller="ProposicaoItemController" onload="proposicao = item;">
                        </div>
                    </div>
                    <div class="box-body" ng-if="configConsulta.botoes=='MINISTRO'">
                        <div ng-include="'views/Proposicao/proposicao_fragment_readonly.html'" ng-controller="ProposicaoItemController" onload="proposicao = item;">
                        </div>
                    </div>
                    <div class="box-footer">
                        <div class="col-sm-12 col-lg-12  text-muted" >
                            <small>Inserida  <cite style="font-style:italic" title="Inserida {{item.created| date:'shortDate'}}, atualizada {{item.updated| date:'shortDate'}}">{{item.created| date:'shortDate'}}</cite></small>
                        </div>
                    </div>

                </div>
            </div>
            <div class="alert alert-info" ng-show="infiniteScroll.full">
                <i class="icon fa fa-info"></i> Todos registros carregados baseado no filtro atual
            </div>
        </div>
    </div>
</div>
{'fraction_non_alphanumeric': 0.13613759914446127, 'fraction_numerical': 0.005329293289368149, 'mean_word_length': 1.411605415860735, 'pattern_counts': {'":': 0, '<': 798, '<?xml version=': 0, '>': 814, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 244, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3422583', 'n_tokens_mistral': 15883, 'n_tokens_neox': 14823, 'n_words': 2445}