<%-- 
    Document   : addDSD
    Created on : 21.1.2018, 19:59:33
    Author     : themi
--%>
<%@ page import="cz.csu.sdmx.constants.URL"%>
<%@ page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix = "fn" uri = "http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<jsp:include page="reusable/header.jsp">
    <jsp:param name="title" value="Add condition" />
</jsp:include>

<h2>Add condition</h2>
    <div class="well">
        Detected DSD: ${dsd.URN}
        <form action="<c:url value="<%= URL.DSD_CLEAR%>" />" method="POST">
            <input class="btn btn-primary" type="submit" value="Change DSD" />
        </form>
    </div>
    <c:url var="post_url"  value="<%= URL.CONDITION_ADD_SUBMIT%>" />
    <form:form action="${post_url}" method="POST" modelAttribute="logicCondition">
        <div class="form-group">
            <form:label path="expression">Condition:</form:label>
            <form:input path="expression" cssClass="form-control"/>
            <span class="help-block">Dimensions in condition must be enclosed by [ ] eg. [SIZECLASS=GE10]</span>
        </div>
        <form:hidden path="DsdName" value="${dsd.URN}" />
        <h4 class="bg-info">Series common dimesions</h4>
        <div class="dimensions">
            <form:checkboxes items="${dsd.seriesDimensions}" path="commonDimensions" element="p"/>
        </div>
        <hr>
        <h4 class="bg-info">Obs value attribute name</h4>
        <div class="dimensions">
            <form:radiobuttons items="${dsd.obsDimensions}" path="obsValAttrName" element="p" />   
        </div>
        <input class="btn btn-primary form-control" type="submit" value="Add conditon" />
        <form:errors path="*" cssClass="error" />
    </form:form>
<jsp:include page="reusable/footer.jsp" />