<!DOCTYPE html>
<html xmlns:th="https://www.thymeleaf.org">


<th:block th:fragment="watermark(cssClass)">
  <th:block th:with="
    watermarkEnabled = ${theme.config.basic != null && theme.config.basic.watermarkConfig != null && theme.config.basic.watermarkConfig.watermarkEnabled != false},
    watermarkSource = ${theme.config.basic != null && theme.config.basic.watermarkConfig != null ? theme.config.basic.watermarkConfig.watermarkSource : 'custom'},
    watermarkText = ${theme.config.basic != null && theme.config.basic.watermarkConfig != null && theme.config.basic.watermarkConfig.watermarkText != null ? theme.config.basic.watermarkConfig.watermarkText : 'Serenity'},
    watermarkOpacity = ${theme.config.basic != null && theme.config.basic.watermarkConfig != null && theme.config.basic.watermarkConfig.watermarkOpacity != null ? theme.config.basic.watermarkConfig.watermarkOpacity : 0.05},
    finalText = ${watermarkSource == 'siteTitle' ? site.title : watermarkText}
  ">
    <span 
      th:if="${watermarkEnabled}"
      th:class="${cssClass}"
      th:text="${finalText}"
      th:style="|opacity: ${watermarkOpacity};|">
      Serenity
    </span>
  </th:block>
</th:block>


<th:block th:fragment="watermarkText">
  <th:block th:with="
    watermarkEnabled = ${theme.config.basic != null && theme.config.basic.watermarkConfig != null && theme.config.basic.watermarkConfig.watermarkEnabled != false},
    watermarkSource = ${theme.config.basic != null && theme.config.basic.watermarkConfig != null ? theme.config.basic.watermarkConfig.watermarkSource : 'custom'},
    watermarkText = ${theme.config.basic != null && theme.config.basic.watermarkConfig != null && theme.config.basic.watermarkConfig.watermarkText != null ? theme.config.basic.watermarkConfig.watermarkText : 'Serenity'},
    finalText = ${watermarkSource == 'siteTitle' ? site.title : watermarkText}
  ">
    <th:block th:if="${watermarkEnabled}" th:text="${finalText}">Serenity</th:block>
  </th:block>
</th:block>

</html>
