{% extends 'base.html' %}
{% load i18n %}
{% get_current_language as LANGUAGE_CODE %}
{% block languagecode %}{{ LANGUAGE_CODE }}{% endblock languagecode %}
{% block title %}{% translate "cscherr.de" %} - {% translate "Links" %}{% endblock title %}
{% block main %}
<div class="container-fluid mt-5">
    <h4 class="">{% trans "Personal" %}</h4>
    <div class="row row-cols-1 row-cols-md-6 my-4">
        {% for link in personal_links %}
        <div class="card col m-2 p-0">
            <a class="text-reset link-offset-2 link-underline link-underline-opacity-0" href="{{ link.url }}" target="_blank">
                <div class="card-body" style="height: 150px;">
                    <img src="{{ link.favicon.url }}" class="card-img-top rounded float-end" style="max-height: 32px; max-width: 32px;" alt="">
                    {% if LANGUAGE_CODE == "de" %}
                    <h5 class="card-title" style="height: 35px;">{{ link.title_de }}<small class="text-body-secondary">{{ link.subtitle }}</small></h5>
                    <hr>
                    <p class="card-text">{{ link.desc_de }}</p>
                    {% elif LANGUAGE_CODE == "en" %}
                    <h5 class="card-title" style="height: 35px;">{{ link.title_en }}<small class="text-body-secondary">{{ link.subtitle }}</small></h5>
                    <hr>
                    <p class="card-text">{{ link.desc_en }}</p>
                    {% else %}
                    <h5 class="card-title" style="height: 35px;">{{ link.title_en }}<small class="text-body-secondary">{{ link.subtitle }}</small></h5>
                    <hr>
                    <p class="card-text">{{ link.desc_en }}</p>
                    {% endif %}
                </div>
                <div class="container pt-5 mt-3">
                    <ul class="list-group list-group-flush">
                        {% for keyword in link.keywords.all %}
                        {% if LANGUAGE_CODE == "de" %}
                        <li class="list-group-item">{{ keyword.text_de }}</li>
                        {% elif LANGUAGE_CODE == "en" %}
                        <li class="list-group-item">{{ keyword.text_en }}</li>
                        {% else %}
                        <li class="list-group-item">{{ keyword.text_en }}</li>
                        {% endif %}
                        {% endfor %}
                        <li class="list-group-item">
                        <i class="bi-box-arrow-up-right"></i>
                        {% translate "visit" %}
                        </li>
                    </ul>
                </div>
            </a>
        </div>
        {% endfor %}
    </div>
</div>
<div class="container-fluid mt-5">
    <h4 class="">{% trans "Others" %}</h4>
    <div class="row row-cols-1 row-cols-md-6 my-4">
        {% for link in links %}
        <div class="card col m-2 p-0">
            <a class="text-reset link-offset-2 link-underline link-underline-opacity-0" href="{{ link.url }}" target="_blank">
                <div class="card-body" style="height: 150px;">
                    <img src="{{ link.favicon.url }}" class="card-img-top rounded float-end" style="max-height: 32px; max-width: 32px;" alt="">
                    {% if LANGUAGE_CODE == "de" %}
                    <h5 class="card-title" style="height: 35px;">{{ link.title_de }}<small class="text-body-secondary">{{ link.subtitle }}</small></h5>
                    <hr>
                    <p class="card-text">{{ link.desc_de }}</p>
                    {% elif LANGUAGE_CODE == "en" %}
                    <h5 class="card-title" style="height: 35px;">{{ link.title_en }}<small class="text-body-secondary">{{ link.subtitle }}</small></h5>
                    <hr>
                    <p class="card-text">{{ link.desc_en }}</p>
                    {% else %}
                    <h5 class="card-title" style="height: 35px;">{{ link.title_en }}<small class="text-body-secondary">{{ link.subtitle }}</small></h5>
                    <hr>
                    <p class="card-text">{{ link.desc_en }}</p>
                    {% endif %}
                </div>
                <div class="container pt-5 mt-3">
                    <ul class="list-group list-group-flush">
                        {% for keyword in link.keywords.all %}
                        {% if LANGUAGE_CODE == "de" %}
                        <li class="list-group-item">{{ keyword.text_de }}</li>
                        {% elif LANGUAGE_CODE == "en" %}
                        <li class="list-group-item">{{ keyword.text_en }}</li>
                        {% else %}
                        <li class="list-group-item">{{ keyword.text_en }}</li>
                        {% endif %}
                        {% endfor %}
                        <li class="list-group-item">
                        <i class="bi-box-arrow-up-right"></i>
                        {% translate "visit" %}
                        </li>
                    </ul>
                </div>
            </a>
        </div>
        {% endfor %}
    </div>
</div>
{% endblock main %}
