<style>
  .widthCheckbox {
    min-width: 70px;
  }
</style>
<div>
  <h4 style=" font-weight: bold; color : #428bca; margin-bottom:5px">
    {{'aepintervention.intervBranchement' | translate}}
  </h4>
  <button
    ng-disabled="res.int.intRep['intbranchement'].geometry==undefined"
    type="button"
    class="btn btn-default"
    ng-click="localiaseAno(res.int.intRep['intbranchement'])"
    title="{{'bizedition.attributesPopupLocate'|translate}}"
  >
    <i class="fa fa-location-arrow"></i>
  </button>
  <table class="table">
    <thead>
      <tr>
        <th style="text-align:left;color : #ff4000;">
          {{'aepintervention.branchement' | translate}}
        </th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td>
          <div>{{selectedBranch.id}}</div>
          <div class="row" style=" padding-bottom: 4px">
            <label for="example-text-input" class=" col-xs-5 col-form-label"
              >{{'aepintervention.canaMateriau' | translate}}
            </label>
            <div class="col-xs-5">
              <input
                class="form-control"
                name="Nom"
                ng-model="selectedBranch.properties.materiau"
                disabled
              />
            </div>
            <!--  <div form-field 
			        class="col-xs-4"
			         fti="ftis['branchement']"
			         ftid="ftis['branchement'].uid"
			         map="map"
			         attname="'materiau'"
			         default=""
			         initvalue="selectedBranch.properties"
			         res="res['branchement'].properties" >
			    </div> -->
          </div>
          <div class="row">
            <label for="example-text-input" class=" col-xs-5 col-form-label"
              >{{'aepintervention.canaDiametre' | translate}}</label
            >
            <div class="col-xs-5">
              <input
                class="form-control"
                name="Nom"
                ng-model="selectedBranch.properties.diametre"
                disabled
              />
            </div>
            <!-- <div form-field 
			        class="col-xs-4"
			         fti="ftis['branchement']"
			         ftid="ftis['branchement'].uid"
			         map="map"
			         attname="'diametre'"
			         default=""
			         initvalue="selectedBranch.properties"
			         res="res['branchement'].properties" >
			    </div> -->
          </div>
        </td>
      </tr>
    </tbody>
  </table>

  <table class="table">
    <thead>
      <tr>
        <th style="text-align:left;color : #ff4000;">
          {{'aepintervention.intervention' | translate}}
        </th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td>
          <div class="row">
            <div class="col-xs-6">
              <label for="inputKey" class=" col-form-label"
                >{{'aepintervention.dateDebut' | translate}}</label
              >
              <div
                javautildate
                gcatt="{name:'date_debut'}"
                result="res.int.intRep['intbranchement'].properties"
                ng-init="res.int.intRep['intbranchement'].properties"
                class="input-group ng-isolate-scope"
                data-type="date"
                field-data="fieldData"
              ></div>
            </div>
            <div class="col-xs-6">
              <label for="example-text-input" class="col-form-label">
                Agent</label
              >
              <div class="form-group">
                <select
                  class="form-control"
                  ng-model="res.int.intRep['intbranchement'].properties.agent"
                >
                  <option disabled selected hidden value>
                    -------------------
                  </option>
                  <option ng-repeat="ag in agents"> {{ag}} </option>
                </select>
              </div>
            </div>
          </div>
          <div class="row">
            <div class="col-xs-6">
              <label for="inputKey" class=" col-form-label"
                >{{'aepintervention.dateFin' | translate}}</label
              >
              <div
                javautildate
                gcatt="{name:'date_fin'}"
                result="res.int.intRep['intbranchement'].properties"
                ng-init="res.int.intRep['intbranchement'].properties"
                class="input-group ng-isolate-scope"
                data-type="date"
                field-data="fieldData"
              ></div>
            </div>
          </div>
          <table class="table table-xs">
            <thead>
              <tr>
                <th style="text-align:left; padding-left:2px">
                  {{'aepintervention.cause' | translate}}
                </th>
              </tr>
            </thead>
            <tbody>
              <tr>
                <td>
                  <div class="row">
                    <div class="col-xs-4">
                      <label
                        style="font-weight:200"
                        for="example-text-input"
                        class="col-form-label"
                        >{{'aepintervention.joint' | translate}}</label
                      >
                      <div
                        form-field
                        fti="ftis['intbranchement']"
                        ftid="ftis['intbranchement'].uid"
                        map="map"
                        attname="'br_cause_jt'"
                        default=""
                        initvalue="res.int.intRep['intbranchement'].properties"
                        res="res.int.intRep['intbranchement'].properties"
                      ></div>
                    </div>
                    <div class="col-xs-4">
                      <label
                        style="font-weight:200"
                        for="example-text-input"
                        class="col-form-label"
                        >{{'aepintervention.casseFranche' | translate}}</label
                      >
                      <div
                        form-field
                        fti="ftis['intbranchement']"
                        ftid="ftis['intbranchement'].uid"
                        map="map"
                        attname="'br_cause_cassefr'"
                        default=""
                        initvalue="res.int.intRep['intbranchement'].properties"
                        res="res.int.intRep['intbranchement'].properties"
                      ></div>
                    </div>
                    <div class="col-xs-4">
                      <label
                        style="font-weight:200"
                        for="example-text-input"
                        class="col-form-label"
                        >{{'aepintervention.fissure' | translate}}</label
                      >
                      <div
                        form-field
                        fti="ftis['intbranchement']"
                        ftid="ftis['intbranchement'].uid"
                        map="map"
                        attname="'br_cause_fiss'"
                        default=""
                        initvalue="res.int.intRep['intbranchement'].properties"
                        res="res.int.intRep['intbranchement'].properties"
                      ></div>
                    </div>
                  </div>
                  <div class="row">
                    <div class="col-xs-4">
                      <label
                        style="font-weight:200"
                        for="example-text-input"
                        class="col-form-label"
                        >{{'aepintervention.vetuste' | translate}}</label
                      >
                      <div
                        form-field
                        fti="ftis['intbranchement']"
                        ftid="ftis['intbranchement'].uid"
                        map="map"
                        attname="'br_cause_vetuste'"
                        default=""
                        initvalue="res.int.intRep['intbranchement'].properties"
                        res="res.int.intRep['intbranchement'].properties"
                      ></div>
                    </div>
                    <div class="col-xs-4">
                      <label
                        style="font-weight:200"
                        for="example-text-input"
                        class="col-form-label"
                        >{{'aepintervention.poinconnement' | translate}}</label
                      >
                      <div
                        form-field
                        fti="ftis['intbranchement']"
                        ftid="ftis['intbranchement'].uid"
                        map="map"
                        attname="'br_cause_pc'"
                        default=""
                        initvalue="res.int.intRep['intbranchement'].properties"
                        res="res.int.intRep['intbranchement'].properties"
                      ></div>
                    </div>
                    <div class="col-xs-4">
                      <label
                        style="font-weight:200"
                        for="example-text-input"
                        class="col-form-label"
                        >{{'aepintervention.conduiteDeboite' |
                        translate}}</label
                      >
                      <div
                        form-field
                        fti="ftis['intbranchement']"
                        ftid="ftis['intbranchement'].uid"
                        map="map"
                        attname="'br_cause_cond'"
                        default=""
                        initvalue="res.int.intRep['intbranchement'].properties"
                        res="res.int.intRep['intbranchement'].properties"
                      ></div>
                    </div>
                  </div>
                  <div class="row">
                    <div class="col-xs-4">
                      <label
                        style="font-weight:200"
                        for="example-text-input"
                        class="col-form-label"
                        >{{'aepintervention.corrosion' | translate}}</label
                      >
                      <div
                        form-field
                        fti="ftis['intbranchement']"
                        ftid="ftis['intbranchement'].uid"
                        map="map"
                        attname="'br_cause_corr'"
                        default=""
                        initvalue="res.int.intRep['intbranchement'].properties"
                        res="res.int.intRep['intbranchement'].properties"
                      ></div>
                    </div>
                    <div class="col-xs-4">
                      <label
                        style="font-weight:200"
                        for="example-text-input"
                        class="col-form-label"
                        >{{'aepintervention.canaAutre' | translate}}</label
                      >
                      <div
                        form-field
                        fti="ftis['intbranchement']"
                        ftid="ftis['intbranchement'].uid"
                        map="map"
                        attname="'br_cause_autre'"
                        default=""
                        initvalue="res.int.intRep['intbranchement'].properties"
                        res="res.int.intRep['intbranchement'].properties"
                      ></div>
                    </div>
                    <div class="col-xs-4">
                      <label
                        style="font-weight:200"
                        for="example-text-input"
                        class="col-form-label"
                        >{{'aepintervention.nonConnu' | translate}}</label
                      >
                      <div
                        form-field
                        fti="ftis['intbranchement']"
                        ftid="ftis['intbranchement'].uid"
                        map="map"
                        attname="'br_cause_nc'"
                        default=""
                        initvalue="res.int.intRep['intbranchement'].properties"
                        res="res.int.intRep['intbranchement'].properties"
                      ></div>
                    </div>
                  </div>
                </td>
              </tr>
            </tbody>
          </table>
          <div class="row">
            <label for="example-text-input" class=" col-xs-4 col-form-label"
              >{{'aepintervention.branchConforme' | translate}}
            </label>
            <div
              form-field
              class="col-xs-4"
              fti="ftis['intbranchement']"
              ftid="ftis['intbranchement'].uid"
              map="map"
              attname="'branchement_conforme'"
              default=""
              initvalue="res.int.intRep['intbranchement'].properties"
              res="res.int.intRep['intbranchement'].properties"
            ></div>
          </div>
          <div class="row">
            <label for="example-text-input" class=" col-xs-4 col-form-label"
              >{{'aepintervention.commentaireAno' | translate}}</label
            >
            <textarea
              class="form-control"
              ng-model="res.int.intRep['intbranchement'].properties.int_branch_observation"
            ></textarea>
          </div>
        </td>
      </tr>
    </tbody>
  </table>

  <button
    type="button"
    ng-if="res.int.intRep['intbranchement'].id==undefined"
    ng-click="saveIntervention(res.int.intRep['intbranchement'],geomInterBranch,selectedBranch, ftis['intbranchement'].uid, ftis['branchement'].uid,'Ano_RepBranch','Ano_Branch','IntBranch_Branch')"
    title="{{'common.save' | translate}}"
    class="btn btn-default"
  >
    <i class="glyphicon glyphicon-floppy-save"></i>
  </button>
  <button
    type="button"
    ng-if="res.int.intRep['intbranchement'].id!=undefined"
    ng-disabled="currentAnomalie.properties.etat=='Dossier clos'"
    class="btn btn-default"
    ng-click="updateIntervention(res.int.intRep['intbranchement'],ftis['intbranchement'].uid)"
    title="{{'common.save' | translate}}"
  >
    <i class="glyphicon glyphicon-floppy-save"></i>
  </button>
  <button
    type="button"
    ng-if="res.int.intRep['intbranchement'].id!=undefined"
    ng-disabled="currentAnomalie.properties.etat=='Dossier clos'"
    class="btn btn-default"
    ng-click="removeIntReparation(res.int.intRep['intbranchement'],'Ano_RepBranch',ftis['intbranchement'].uid,ftis['anomalie'].uid,'IntBranch_Branch','Ano_Branch',selectedBranch.id, ftis['branchement'].uid)"
    title="{{'common.delete' | translate}}"
  >
    <i class="glyphicon glyphicon-trash"></i>
  </button>
</div>
