<div class="portalCfgModal">
  <h3 ng-if="editModalIsNew">
    <translate>portals.portals.create</translate>
  </h3>
  <h3 ng-if="!editModalIsNew">
    <translate>portals.portals.edit</translate>
  </h3>

  <form ng-submit="editPortal();closeThisDialog()" class="form-horizontal" role="form">

    <div style="margin: 30px 0;">
      <div class="form-group">
        <label for="portail_name" class="col-xs-3 control-label">
          <translate>portals.name</translate>
        </label>
        <div class="col-xs-9" ng-class="{'has-error': !validForm.name}">
          <input type="text" class="form-control" id="portail_name" ng-model="edit_resource.name"
            ng-init="validateName()" required />
          <div class="alert inlinealert alert-danger" ng-if="!validForm.name">
            <translate>portals.already_exist</translate>
          </div>
        </div>
      </div>

      <div ng-if="!editModalIsNew" class="form-group">
        <label for="portail_title" class="col-xs-3 control-label">
          <translate>portals.title</translate>
        </label>
        <div class="col-xs-9">
          <input type="text" class="form-control" id="portail_title" ng-model="edit_resource.title" />
        </div>
      </div>
    </div>

    <div ng-if="!editModalIsNew" class="edit-portal-content">
      <!-- Arbre des rubriques -->
      <abn-tree
        tree-data="menuSetup"
        on-select="tree_handler(branch)"
      ></abn-tree>
      <!-- Template de la rubrique active -->
      <div class="render" ng-include="" src="curtemplate" onload=""></div>
    </div>

    <div class="buttons">
      <close-modale-button></close-modale-button>
      <button class="btn btn-primary" ng-disabled="!validForm.name || !validPortalCfg() ||validGeocodageName">
        <translate>common.save</translate>
      </button>
    </div>
  </form>
</div>
