<?xml version="1.0" encoding="UTF-8"?>

<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:c="http://xmlns.jcp.org/jsp/jstl/core" xmlns:f="http://xmlns.jcp.org/jsf/core" xmlns:ui="http://xmlns.jcp.org/jsf/facelets" xmlns:h="http://xmlns.jcp.org/jsf/html"
  xmlns:p="http://primefaces.org/ui" xmlns:e="http://www.ivu.de/elect/tags">

  <ui:fragment rendered="#{not empty hints}">
    <ui:repeat value="#{hints}" var="facesMessage">
      <ui:param name="hintSeverityOrdinal" value="#{facesMessage.severity.ordinal}" />
      <ui:param name="hintSeverityName" value="#{(hintSeverityOrdinal == 0) ? 'info' : (hintSeverityOrdinal == 1 ? 'warn' : (hintSeverityOrdinal == 2 ? 'error' : (hintSeverityOrdinal == 3 ? 'success' : '')))}" />
      <ui:param name="hintStyleClass" value="#{'ui-message-'.concat(hintSeverityName.toLowerCase())}" />

      <span class="#{hintStyleClass} ui-widget ui-corner-all hint-container">
        <span class="#{hintStyleClass}-icon"></span>
        <h:outputText rendered="#{not empty facesMessage.summary}" value="#{facesMessage.summary}" styleClass="#{hintStyleClass}-summary" />
        <h:outputText rendered="#{not empty facesMessage.detail}" value="#{facesMessage.detail}" styleClass="#{hintStyleClass}-detail" />
      </span>
    </ui:repeat>
  </ui:fragment>
</ui:composition>
