<%@ page import="com.agnitas.emm.core.components.service.MailingBlockSizeService" %>
<%--@elvariable id="sendingSpeedOptions" type="java.util.List<java.lang.Integer>"--%>

<c:set var="UNLIMITED_SPEED" value="<%= MailingBlockSizeService.UNLIMITED_SPEED %>" />

<emm:ShowByPermission token="mailing.send.admin.options">
    <div class="form-group" id="blocksizeElement">
        <div class="col-sm-12 control-label-left">
            <label class="control-label">
                <label for="blocksize"><mvc:message code="mailing.mailsperhour" /></label>
                <button class="icon icon-help" data-help="help_${helplanguage}/mailing/MaxSendPerHour.xml" tabindex="-1" type="button"></button>
            </label>
        </div>
        <div class="col-sm-12">
            <mvc:select path="blocksize" cssClass="form-control" id="blocksize">
                <c:forEach var="sendingSpeedOption" items="${sendingSpeedOptions}">
                    <mvc:option value="${sendingSpeedOption}">
                        <c:choose>
                            <c:when test="${sendingSpeedOption eq UNLIMITED_SPEED}">
                                <mvc:message code="mailing.unlimited" />
                            </c:when>
                            <c:otherwise>
                                <fmt:formatNumber value="${sendingSpeedOption}" type="number" pattern="#,##0" />
                            </c:otherwise>
                        </c:choose>
                    </mvc:option>
                </c:forEach>
            </mvc:select>
        </div>
    </div>
</emm:ShowByPermission>
