regenerate: true


{% capture cache %}

{% comment %}

# -----------------------------------------------------------------------------
#  ~/assets/data/footer.html
#  Liquid procedure to generate HTML (data) portion of the page footer for
#  (fragmented) AJAX load
#
#  Product/Info:
#  https://jekyll-one.com
#
#  Copyright (C) 2019 Juergen Adams
#
#  J1 Template is licensed under the MIT License.
#  See: https://github.com/jekyll-one/j1_template_mde/blob/master/LICENSE
#
# -----------------------------------------------------------------------------
#  Test data:
#    {{ variable | debug }}
#
# -----------------------------------------------------------------------------

{% endcomment %}

<!– [INFO ] [j1.assets.data.footer ] [Footer generated: {{site.time}}] –>

{% comment %} Liquid procedures ——————————————————————————– {% endcomment %} {% capture select_color %}themes/{{site.template.name}}/procedures/global/select_color.proc{% endcapture %} {% capture select_icon_size %}themes/{{site.template.name}}/procedures/global/select_icon_size.proc{% endcapture %} {% capture about_box %}themes/{{site.template.name}}/modules/footers/boxes/about_box.proc{% endcapture %} {% capture news_box %}themes/{{site.template.name}}/modules/footers/boxes/news_box.proc{% endcapture %} {% capture links_box %}themes/{{site.template.name}}/modules/footers/boxes/links_box.proc{% endcapture %} {% capture contacts_box %}themes/{{site.template.name}}/modules/footers/boxes/contacts_box.proc{% endcapture %} {% capture legal_statements %}themes/{{site.template.name}}/modules/footers/boxes/legal_statements.proc{% endcapture %} {% capture social_media_icons %}themes/{{site.template.name}}/modules/footers/boxes/social_media_icons.proc{% endcapture %}

{% comment %} Variables ——————————————————————————– {% endcomment %}

{% comment %} Set config data ——————————————————————————– {% endcomment %} {% assign footer_config_file = site.data.modules.j1_footer %} {% assign footer_config = footer_config_file.footer %}

{% comment %} Set global settings ——————————————————————————– {% endcomment %} {% assign footer_id = footer_config_file.global.id %} {% assign footer_theme = footer_config_file.global.theme %}

{% comment %} Set base icons and sizes ——————————————————————————– {% endcomment %} <!– [INFO ] [j1.assets.data.footer ] [initialize default menu icon properties] –> {% assign nav_menu_icon_family = nav_menu_options.icon_family %} {% assign nav_menu_icon_style = nav_menu_options.icon_style %} {% assign nav_menu_icon_color = nav_menu_options.icon_color %} {% assign nav_menu_icon_size = nav_menu_options.icon_size %}

{% assign icon_family = nav_menu_icon_family | strip | downcase %}

{% if icon_family == 'fontawesome' or icon_family == 'fontawesome5' %}

{% assign nav_menu_icon_family        = 'fa' %}
{% assign nav_menu_icon_style         = nav_menu_icon_style %}

{% elsif icon_family == 'mdi' %}

{% assign nav_menu_icon_family        = 'mdi' %}
{% assign nav_menu_icon_style         = nav_menu_icon_style %}

{% else %}

{% assign nav_menu_icon_family        = 'mdi' %}
{% assign nav_menu_icon_style         = nav_menu_icon_style %}

{% endif %}

{% include {{select_color}} color=nav_menu_icon_color fallback=“#9E9E9E” %} {% assign nav_menu_icon_color = color %}

{% include {{select_icon_size}} family=nav_menu_icon_family size=nav_menu_icon_size %} {% assign nav_menu_icon_size = size %}

{% comment %} Main ——————————————————————————– {% endcomment %} {% assign enabled_boxes = 0 %}

{% comment %} Calculate number of enabled FooterBoxes ——————————————————————————– {% endcomment %} {% for item in footer_config %}

{% if item.footer_box %}
  {% for boxes in item.footer_box %}
    {% for box in boxes %}
        {% for property in box %}
          {% if property.enabled %} {% assign enabled_boxes = enabled_boxes | plus:1 %} {% endif %}
        {% endfor %}
    {% endfor %}
  {% endfor %}
{% endif %}

{% endfor %} {% assign footer_box_width_md = 12 | divided_by:enabled_boxes %} <!– [INFO ] [j1.assets.data.footer ] [Set footer column width to: {{ footer_box_width_md }}] –>

<div id=“{{footer_id}}” class=“{{footer_theme}}”>

<div class="footer">

  <div class="container">
    <div class="row">

    {% comment %} Collect footer config data
    -------------------------------------------------------------------------- {% endcomment %}
    {% for item in footer_config %}
      {% for box in item.footer_box %}
        {% for item in box %}
          {% assign box_type            = item[1].type %}
          {% assign box_enabled         = item[1].enabled %}
          {% assign title               = item[1].title %}
          {% assign address             = item[1].address.enabled %}
          {% assign address_1           = item[1].address.address_1 %}
          {% assign address_2           = item[1].address.address_2 %}
          {% assign phone               = item[1].phone.enabled %}
          {% assign phone_1             = item[1].phone.phone_1 %}
          {% assign phone_2             = item[1].phone.phone_2 %}
          {% assign internet            = item[1].internet.enabled %}
          {% assign mail                = item[1].internet.mail %}
          {% assign www                 = item[1].internet.www %}
          {% assign text                = item[1].text %}
          {% assign align               = item[1].align %}
          {% assign posts_category      = item[1].selected_category %}
          {% assign max_posts           = item[1].max_posts %}
          {% assign links               = item[1].links %}

          {% comment %} COLLECT|PLACE footer boxes
          -------------------------------------------------------------------- {% endcomment %}
          {% case box_type %}

          {% comment %} PLACE AboutBox
          -------------------------------------------------------------------- {% endcomment %}
          {% when 'AboutBox' %}
            {% if box_enabled %} {% include {{about_box}} %} {% endif %}

          {% comment %} PLACE NewsBox
          -------------------------------------------------------------------- {% endcomment %}
          {% when 'NewsBox' %}
            {% if box_enabled %}
              {% assign posts_collate = site.posts %}
              {% include {{news_box}} category=posts_category max_posts=max_posts items=posts_collate %}
            {% endif %}

          {% comment %} PLACE LinksBox
          -------------------------------------------------------------------- {% endcomment %}
          {% when 'LinksBox' %}
            {% if box_enabled %}
              {% include {{links_box}} links=links %}
            {% endif %}

          {% comment %} PLACE ContactsBox
          -------------------------------------------------------------------- {% endcomment %}
          {% when 'ContactsBox' %}
            {% if box_enabled %}
              {% include {{contacts_box}} %}
            {% endif %}

          {% else %}
            {% comment %} Exception: no footer box of given type found
            ------------------------------------------------------------------ {% endcomment %}
            <div class="row">
              <div class="col-md-6 col-md-offset-3">
                <div class="card raised-z10 mt-5">
                  <div class="content content-danger">
                    <h4 class="notoc">
                      <i class="zmdi zmdi-alert-triangle zmdi-hc-3x pl-3"></i>
                      Footer Box <i>{{type}}</i> not found
                    </h4>
                    <h4 class="notoc card-title">Check your configuration</h4>
                    <div class="card-description">
                      Don't worry about this. May you've a typo in the panel's configuration.
                      Check the panel config file for the unknown type. A line contains
                      something wrong like 'type: {{type}}'. Have a look at:
                    </div>
                    <div class="mb-5">
                      <h5 class="notoc">{{footer_config}}</h5>
                    </div>
                  </div>
                </div>
              </div>
            </div>

          {% endcase %}

          {% comment %} END footer boxes
          -------------------------------------------------------------------- {% endcomment %}

        {% endfor %}
      {% endfor %}
    {% endfor %}
    </div> <!-- end row -->
  </div> <!-- end container -->

</div> <!-- end footer main -->

{% comment %} COLLECT|PLACE copyright|issue date information
------------------------------------------------------------------------------ {% endcomment %}
<div class="copyright">
  <div class="container">
    <div class="row">
      <!-- [INFO   ] [j1.assets.data.footer              ] [Enable horizontal list using id #inline] -->
      <div class="col-md-10" id="inline">
      {% include {{legal_statements}} footer_config=footer_config %}
      </div>
      <div class="col-md-2">
      {% include {{social_media_icons}} footer_config=footer_config %}
      </div>
    </div> <!-- End Container -->
  </div>
</div>  <!-- End Copyright -->

</div> <!– end footer –>

{% endcapture %}

{{ cache | strip_empty_lines }} {% assign cache = nil %}