
<!--  CONTENEUR DU MENU POPUP -->
<div class="svgitvpopover2" style="position:absolute;"></div>

<div ng-show="wrongLength()(currentPart)">
  <span class="fa-stack" >
    <i class="fa fa-circle fa-stack-2x itvLengthWarningBackground"></i>
    <i class="fa fa-exclamation fa-stack-1x itvLengthWarning"></i>
  </span>
  <label>{{getWrongLengthMessage()}}</label>
</div>

<div
  class="itv-ignore-init-part"
  ng-class="{'right': !$hiderow || !conf.config.mayIgnorePortions}"
>
  <!-- Bouton "ignorer la portion" -->
  <div ng-show="$hiderow && conf.config.mayIgnorePortions">
    <!-- Ignorer la correspondane pour le branchement  -->
    <label class="normal">
      <input
        type="checkbox"
        ng-model="selectedPart.ignorePortion"
        ng-change="savePortionIgnoredState(selectedPart)"
      >
      <span translate>itv.correspondance.connectionPortionToIgnore</span>
    </label>
  </div>

  <!-- Réinitialisation des correspondances de la portion -->
  <!-- Le bouton “Réinitialiser” est visible uniquement
    -- après une correspondance manuelle -->
  <div>
    <button type="button"
            ng-show="corresp.partHeaderAval.partHeader.validated
      || corresp.partHeaderAmont.partHeader.validated
      || corresp.partHeaderCenter.partHeader.validated"
            title="{{'itv.correspondance.resetMatching' | translate}}"
            class="btn btn-default" ng-click="resetMatching()">
    <span class="fa fa-repeat fa-rotate-180 fa-flip-horizontal" >
    </span>
    </button>
  </div>
</div>


<!-- COCHE DE CHAQUE TYPE D'OUVRAGE:
      regard d'entrée, tronçon(s), regard de sortie
      ou
      juste regard dans le cas d'une inspection de regard
-->
<i ng-if="corresp.inspectionType!=='regard'"
  class="fa fa-check fa-1x itvSoumCheckPositionAAD"
  ng-class="[{itvSoumGreen: corresp.partHeaderAmont.partHeader.validated},
  {itvSoumOrange: !corresp.partHeaderAmont.partHeader.validated
    && corresp.partHeaderAmont.partHeader.matchedAutomatically},
   {itvSoumRed: !corresp.partHeaderAmont.partHeader.validated
    && !corresp.partHeaderAmont.partHeader.matchedAutomatically}]">
</i>
<i ng-if="corresp.inspectionType!=='regard'"
  class="fa fa-check fa-1 itvSoumCheckPositionAAF"
  ng-class="[{itvSoumGreen: corresp.partHeaderAval.partHeader.validated},
  {itvSoumOrange: !corresp.partHeaderAval.partHeader.validated
    && corresp.partHeaderAval.partHeader.matchedAutomatically},
   {itvSoumRed: !corresp.partHeaderAval.partHeader.validated
    && !corresp.partHeaderAval.partHeader.matchedAutomatically}]">
</i>
<i class="fa fa-check fa-1 itvSoumCheckPositionAAA"
  ng-class="[{itvSoumGreen: corresp.partHeaderCenter.partHeader.validated},
  {itvSoumOrange: !corresp.partHeaderCenter.partHeader.validated
    && corresp.partHeaderCenter.partHeader.matchedAutomatically},
   {itvSoumRed: !corresp.partHeaderCenter.partHeader.validated
    && !corresp.partHeaderCenter.partHeader.matchedAutomatically}]">
</i>

<!-- Inspection de collecteur: ROND vert    TRAIT vert foncé    ROND rouge -->
<svg class="itvCorrespSvg" ng-show="corresp.inspectionType!=='regard'">
  <rect class="itvSoumGreenPipe" x="43" y="50" width="394" height="16"
    ng-click="closeCfgPopovers();clickOnPolygon('polygonCenter',$event)"
    data-template="js/XG/widgets/utilities/itv/views/soumission/itvSoumissionPopover.html"
    data-placement="auto"
    data-animation="am-flip-x"
    data-container=".svgitvpopover2"
    data-target=".svgitvpopover2"
    bs-popover />
  <circle cx="43" cy="57" r="16" stroke="black" stroke-width="1"
    fill="#00fb45"
    ng-click="closeCfgPopovers();clickOnPolygon('polygonAmont',$event)"
    data-template="js/XG/widgets/utilities/itv/views/soumission/itvSoumissionPopover.html"
    data-placement="left"
    data-animation="am-flip-x"
    data-container=".svgitvpopover2"
    data-target=".svgitvpopover2"
    bs-popover />
  <circle cx="437" cy="57" r="16" stroke="black" stroke-width="1" fill="red"
    ng-click="closeCfgPopovers();clickOnPolygon('polygonAval',$event)"
    data-template="js/XG/widgets/utilities/itv/views/soumission/itvSoumissionPopover.html"
    data-placement="right"
    data-animation="am-flip-x"
    data-container=".svgitvpopover2"
    data-target=".svgitvpopover2"
    bs-popover />
</svg>


<!-- Inspection de regard: ROND bleu (seulement) -->
<svg class="itvCorrespSvg" ng-show='corresp.inspectionType=="regard"'>
  <circle cx="195" cy="57" r="16" stroke="black" stroke-width="1"
    fill="#0045fb"
    id="itvCircleRondBleu"
    ng-click="closeCfgPopovers();clickOnPolygon('polygonAlone', $event)"
    data-template="js/XG/widgets/utilities/itv/views/soumission/itvSoumissionPopover.html"
    data-placement="left"
    data-animation="am-flip-x"
    data-container=".svgitvpopover2"
    data-target=".svgitvpopover2"
    bs-popover />
</svg>

<!-- IDENTIFIANT DES OUVRAGES -->
<div class="corresp-identifiers">
  <div class="itvSoumIdAmontPos"
    ng-show="corresp.inspectionType === 'collecteur'">
    {{AAD.originalId}}
    <span ng-show="AAD.changed" class="glyphicon glyphicon-screenshot"></span>
  </div>
  <div class="itvSoumIdTronconPos"
    ng-show="corresp.inspectionType !== 'branchement'">
    <div>
      {{AAA.originalId == null ? AAA.id : AAA.originalId }}
    </div>
    <span ng-show="AAA.changed" class="glyphicon glyphicon-screenshot"></span>
  </div>
  <div class="itvSoumIdAvalPos"
    ng-show="corresp.inspectionType === 'collecteur'">
    {{AAF.originalId}}
    <span ng-show="AAF.changed" class="glyphicon glyphicon-screenshot"></span>
  </div>
  <div class="itvSoumIdAmontPos"
    ng-show="corresp.inspectionType === 'branchement'">
    {{AAT.originalId === '' ? AAT.id : AAT.originalId }}
    <span ng-show="AAT.changed" class="glyphicon glyphicon-screenshot"></span>
  </div>
  <div class="itvSoumIdTronconPos"
    ng-show="corresp.inspectionType === 'branchement'">
    {{A01.id}}
    <span ng-show="A01.changed" class="glyphicon glyphicon-screenshot"></span>
  </div>
  <div class="itvSoumIdAvalPos"
    ng-show="corresp.inspectionType === 'branchement'">
    {{AAU.originalId === '' ? AAU.id : AAU.originalId }}
    <span ng-show="AAU.changed" class="glyphicon glyphicon-screenshot"></span>
  </div>
</div>


<!-- PARCOURS RESEAU ET INVERSION DU SENS D'INSPECTION -->
<div
  class="itvNetworkPath"
  ng-show="$hiderow"
  ng-class="{'ignore-portion': isOnlyIgnorePortionShown()}"
>
  <div ng-show="usenetwork">
    <span get-path-select map="map" netname="conf.config.network"
      minnodes="config.minnodes" maxnodes="config.maxnodes"
      nodesincr="config.nodesincr" res="lastDPath.fullData"
      featuresres="lastDPath.featureCollectionData"
      netfeaturesres="lastDPath.nFeatureCollectionData"
      onfinish="lastDPathFound();"
      title="{{'profil.selectStartNode' | translate}}" id="parcourReseau"
      toolbarwidget="toolBarWidget">
      </span>
  </div>

  <div ng-show="canReverseNodes()">
    <button type="button"
      title="{{'itv.correspondance.inverserlesnoeuds' | translate}}"
      class="btn btn-default" ng-click="inverserlaselection()">
      <span class="glyphicon glyphicon-transfer" style="top:2px;">
      </span>
    </button>
  </div>

  <!-- Case à cocher "Afficher uniquement les couches du réseau" -->
  <div ng-show="$hiderow">
      <input type="checkbox" ng-model="displayOnlyNetwork"
        ng-change="manageLayersOnMap()"/>
      <translate>itv.correspondance.displayOnlyNetwork</translate>
    </div>
  </div>
</div>
