<%@ 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 id="blocksize-block" class="col">
        <label for="blocksize" class="form-label text-truncate"><mvc:message code="mailing.mailsperhour" /></label>
        <mvc:select id="blocksize" path="blocksize" cssClass="form-control" disabled="${not canSendOrActivateMailing}">
            <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>
</emm:ShowByPermission>
