
<body
  th:remove="tag"
  th:fragment="body(className, classAppend, styleText)"
  th:with="footerBottomClass = ${#strings.defaultString(className, 'footer-bottom')},
           footerBottomClassAppend = ${#strings.defaultString(classAppend, '')},
           footerBottomStyle = ${#strings.defaultString(styleText, '')}"
>
  <div
    th:if="${theme.config?.styles?.is_footer_content_show}"
    th:class="${footerBottomClass}"
    th:classappend="${footerBottomClassAppend}"
    th:style="${footerBottomStyle}"
  >
    <p th:utext="${theme.config?.styles?.footer_content}"></p>
  </div>
  <th:block
    th:if="${theme.config?.styles?.is_18n_footer_content_show}"
    th:with="footerContentItems = ${theme.config?.styles?.i18n_footer_content}"
  >
    <th:block th:if="not ${theme.config?.global?.is_i18n_prefix_match_mode}">
      <th:block th:each="footerContentItem : ${footerContentItems}">
        <th:block th:if="${#strings.equals(footerContentItem.lang, param.lang)}">
          <div
            th:class="${footerBottomClass}"
            th:classappend="${footerBottomClassAppend + ' matched-footer-content'}"
            th:style="${footerBottomStyle}"
          >
            <p th:utext="${#strings.defaultString(footerContentItem.footer_content, '')}"></p>
          </div>
        </th:block>
      </th:block>
    </th:block>
    <th:block th:if="${theme.config?.global?.is_i18n_prefix_match_mode}">
      <th:block th:each="footerContentItem : ${footerContentItems}">
        <th:block
          th:if="${param.lang != null
                           and footerContentItem.lang != null
                           and #strings.startsWith(param.lang, footerContentItem.lang)}"
        >
          <div
            th:class="${footerBottomClass}"
            th:classappend="${footerBottomClassAppend + ' matched-footer-content'}"
            th:style="${footerBottomStyle}"
          >
            <p th:utext="${#strings.defaultString(footerContentItem.footer_content, '')}"></p>
          </div>
        </th:block>
      </th:block>
    </th:block>
    <th:block th:each="footerContentItem : ${footerContentItems}">
      <th:block th:if="${#strings.equals(footerContentItem.lang, theme.config?.global?.default_page_language)}">
        <div
          th:class="${footerBottomClass}"
          th:classappend="${footerBottomClassAppend + ' default-footer-content'}"
          th:style="${#strings.isEmpty(footerBottomStyle) ? 'display: none' : footerBottomStyle + '; display: none'}"
        >
          <p th:utext="${#strings.defaultString(footerContentItem.footer_content, '')}"></p>
        </div>
      </th:block>
    </th:block>
  </th:block>
</body>
