package de.ivu.elect.presentation.gruppe.form;

import de.ivu.elect.business.gruppe.entity.Gruppe;
import de.ivu.elect.business.gruppe.entity.GruppeProperties;
import de.ivu.elect.jee.presentation.dynamicform.FormBuilder;
import de.ivu.elect.jee.presentation.dynamicform.PropertyType;

import javax.enterprise.inject.Specializes;

@Specializes
public class NlWasGruppeViewFormBuilder extends NlCoreGruppeViewFormBuilder {

  private static final long serialVersionUID = 1L;

  public NlWasGruppeViewFormBuilder() {
    super();
  }

  @Override
  public void addProperties(FormBuilder formBuilder, Gruppe gruppe, boolean propertiesAufGebietenReadonly, boolean globalReadonly) {
    super.addProperties(formBuilder, gruppe, propertiesAufGebietenReadonly, true/*ELECT-10027*/);

    // ELECT-2633
    if (!gruppe.isReferendumVorlage()) {
      GruppeProperties gruppeProperties = gruppe.getProperties();

      // TODO ELECT-9733 nur im CSB
      formBuilder.addProperty(gruppeProperties.getFarbeProperty()).withType(PropertyType.INPUT_COLOR).withReadonly(globalReadonly)./* ELECTSL-34 */required();

      // ELECT-11511
//      if (gruppe.isPolitischeGruppe()) {
//        formBuilder.addProperty(gruppeProperties.getInPraesentationProperty()).withReadonly(globalReadonly);
//      }
    }
  }
}
