<div class="popover">
  <h3 class="popover-title">
    <translate>tools.builder.fields.edit.save.title</translate>
  </h3>
  <!--globalsave est true quand il s'agit du bouton "Enregistrer" de l'intervention simple-->
  <!--globalsave est défini dans l'attribut ng-init du bouton dans intervention_simple.html-->
  <div ng-if="!globalsave" class="popover-content" style="width: 350px;">
    <div class="row">
      <div class="col-xs-12">
        <input type="checkbox" ng-model="field.config.mustHaveGeometry"/>
        <translate>tools.builder.intervention_simple.must_have_geometry</translate>
      </div>
    </div>
    <div class="row">
      <div class="col-xs-12">
        <input type="checkbox" ng-model="field.config.autoCreateGeometry"/>
        <translate>tools.builder.intervention_simple.auto_create_geometry</translate>
      </div>
    </div>
    <div class="row">
      <div class="col-xs-12">
        <label><translate>common.label</translate></label>
        <input class="form-control" type="text" ng-model="field.label" />
      </div>
    </div>
    <div class="row">
      <div class="col-xs-12">
        <label><translate>tools.builder.fields.edit.save.fti</translate></label>
        <model-component
          ftid="field.config.ftid"
          class="ftipicker"
        ></model-component>
      </div>
    </div>
  </div>
  <div ng-if="!globalsave">
    <form-builder-variables
      label="tools.builder.fields.edit.save.to_save"
      res="field.config.feats"
      formvariables="formvariables"
    ></form-builder-variables>
    <form-builder-variables
      label="tools.builder.fields.edit.save.linked"
      res="field.config.related"
      formvariables="formvariables"
    ></form-builder-variables>
    <form-builder-variables
      label="tools.builder.fields.edit.save.association"
      res="field.config.association"
      formvariables="formvariables"
    ></form-builder-variables>
    <form-builder-variables
      label="tools.builder.fields.common.add_to_id"
      res="field.config.res"
      formvariables="formvariables"
    ></form-builder-variables>
    <form-builder-function
      label="tools.builder.fields.common.before_finish"
      res="field.config.beforefinish"
    ></form-builder-function>
    <form-builder-function
      label="tools.builder.fields.common.on_finish"
      res="field.config.finish"
    ></form-builder-function>
  </div>

  <!--IS - POPOVER DU BOUTON ENREGISTRER GLOBAL-->
  <!--Les variables affectées à la propriété "res" sont différentes-->
  <div ng-if="globalsave" class="popover-content" style="width: 350px;">
    <div class="row">
      <div class="col-xs-12">
        <input type="checkbox" ng-model="savefield.config.mustHaveGeometry"/>
        <translate>tools.builder.intervention_simple.must_have_geometry</translate>
      </div>
    </div>
    <div class="row">
      <div class="col-xs-12">
        <input type="checkbox" ng-model="savefield.config.autoCreateGeometry"/>
        <translate>tools.builder.intervention_simple.auto_create_geometry</translate>
      </div>
    </div>
  </div>
  <div ng-if="globalsave">
    <form-builder-variables
        label="tools.builder.fields.edit.save.linked"
        res="savefield.config.related"
        globalsave="true"
        formvariables="formvariables"
    ></form-builder-variables>
    <form-builder-variables
        label="tools.builder.fields.edit.save.association"
        res="savefield.config.association"
        association="true"
        formvariables="formvariables"
    ></form-builder-variables>
    <form-builder-function
        label="tools.builder.fields.common.before_finish"
        res="savefield.config.beforefinish"
        is-before-finish="true"
    ></form-builder-function>
    <form-builder-function
        label="tools.builder.fields.common.on_finish"
        res="savefield.config.finish"
        is-finish="true"
    ></form-builder-function>
  </div>
</div>
