{% extends 'base.html.twig' %}
{% import '@theme/components/badge.html.twig' as badge %}

{% block main %}
    <div class="row row-cards mb-3">
        <div class="col-lg-4">
            <div class="card">
                <div class="card-body card_intro p-4 text-center">

                    <img src="{{ asset('apple-touch-icon.png') }}" class="avatar avatar-2xl mb-3 avatar-rounded" alt="{{ constant('App\\Constants::SOFTWARE') }}">

                    <h3 class="m-0 mb-1">
                        <a href="{{ constant('App\\Constants::HOMEPAGE') }}" target="_blank">{{ constant('App\\Constants::SOFTWARE') }}</a>
                    </h3>
                    <div class="text-body-secondary">
                        {{ constant('App\\Constants::VERSION') }}
                    </div>
                </div>
                <div class="d-flex">
                    <a href="{{ ''|docu_link }}" target="_blank" class="card-btn">
                        <i class="me-2 text-body-secondary {{ 'help'|icon(false) }}"></i>
                        {{ 'help'|trans({}, 'about') }}
                    </a>
                    <a href="{{ constant('App\\Constants::GITHUB') }}discussions" target="_blank" class="card-btn">
                        <i class="me-2 text-body-secondary {{ 'fab fa-github'|icon(false) }}"></i>
                        {{ 'support'|trans({}, 'about') }}
                    </a>
                </div>
                <div class="d-flex">
                    <a href="{{ constant('App\\Constants::HOMEPAGE') }}" target="_blank" class="card-btn">
                        <i class="me-2 text-body-secondary {{ 'home'|icon(false) }}"></i>
                        {{ 'website'|trans({}, 'about') }}
                    </a>
                    <a href="{{ constant('App\\Constants::HOMEPAGE') }}/donate/" target="_blank" class="card-btn">
                        <i class="me-2 text-body-secondary {{ 'fas fa-hand-holding-heart'|icon(false) }}"></i>
                        {{ 'donate'|trans({}, 'about') }}
                    </a>
                </div>
                <div class="card-footer">
                    Made with ♥ by <a href="https://www.kevinpapst.de/">Kevin Papst</a> and <a href="{{ constant('App\\Constants::GITHUB') }}graphs/contributors" target="_blank">great contributors</a>.
                </div>
            </div>
        </div>
        <div class="col-lg-8">
            {% embed '@theme/embeds/card.html.twig' %}
                {% block box_title %}Credits{% endblock %}
                {% block box_body_class %}credits_card{% endblock %}
                {% block box_body %}
                    <p>
                        The following amazing software libraries were used when creating Kimai. It wouldn't be possible without them.
                        My biggest thanks go out to the authors 👍
                    </p>
                    <ul>
                        <li>Bootstrap: <a href="https://getbootstrap.com" target="_blank">https://getbootstrap.com</a></li>
                        <li>Chart.js: <a href="https://www.chartjs.org" target="_blank">https://www.chartjs.org</a></li>
                        <li>Doctrine: <a href="https://www.doctrine-project.org" target="_blank">https://www.doctrine-project.org</a></li>
                        <li>FontAwesome: <a href="https://fontawesome.com" target="_blank">https://fontawesome.com</a></li>
                        <li>FullCalendar: <a href="https://fullcalendar.io" target="_blank">https://fullcalendar.io</a></li>
                        <li>gridstack.js: <a href="https://gridstackjs.com" target="_blank">https://gridstackjs.com</a></li>
                        <li>Litepicker: <a href="https://litepicker.com/" target="_blank">https://litepicker.com/</a></li>
                        <li>Luxon: <a href="https://moment.github.io/luxon/" target="_blank">https://moment.github.io/luxon/</a></li>
                        <li>MPDF <a href="https://mpdf.github.io" target="_blank">https://mpdf.github.io</a></li>
                        <li>PHPOffice: <a href="https://github.com/PHPOffice" target="_blank">https://github.com/PHPOffice</a></li>
                        <li>Symfony: <a href="https://symfony.com" target="_blank">https://symfony.com</a></li>
                        <li>Tabler: <a href="https://tabler.io" target="_blank">https://tabler.io</a></li>
                        <li>Tom Select: <a href="https://tom-select.js.org/" target="_blank">https://tom-select.js.org/</a></li>
                        <li>Twig: <a href="https://twig.symfony.com" target="_blank">https://twig.symfony.com</a></li>
                    </ul>
                {% endblock %}
                {% block box_footer %}
                    Apologies to all projects that I forgot to mention. Please feel free and send a PR to fix that!
                {% endblock %}
            {% endembed %}
        </div>
    </div>
    <div class="row row-cards mb-3">
        <div class="col-lg-8">
            <div class="card card-lg">
                <div class="card-body card_license">
                    <div class="markdown">
                        <h3>License</h3>
                        <div style="white-space: pre">{{ license|nl2br|replace({'<br />': ''})|raw }}</div>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-lg-4">
            <div class="card">
                <div class="card-body card_details">
                    <div class="d-flex align-items-center mb-3">
                        <div class="me-3">
                            <i class="fa-2x fas fa-balance-scale"></i>
                        </div>
                        <div>
                            <small class="text-body-secondary">{{ constant('\\App\\Constants::SOFTWARE') }} is licensed under the</small>
                            <h3 class="lh-1">GNU Affero General Public License v3.0</h3>
                        </div>
                    </div>
                    <div class="text-body-secondary mb-3">
                        Permissions of this strongest copyleft license are conditioned on making available complete source code of licensed works and modifications,
                        which include larger works using a licensed work, under the same license.
                        Copyright and license notices must be preserved. Contributors provide an express grant of patent rights.
                        When a modified version is used to provide a service over a network, the complete source code of the modified version must be made available.
                    </div>
                    <h4>Permissions</h4>
                    <ul class="list-unstyled space-y-1">
                        <li><i class="{{ 'success'|icon(false) }} text-green"></i> Commercial use</li>
                        <li><i class="{{ 'success'|icon(false) }} text-green"></i> Modification</li>
                        <li><i class="{{ 'success'|icon(false) }} text-green"></i> Distribution</li>
                        <li><i class="{{ 'success'|icon(false) }} text-green"></i> Patent use</li>
                        <li><i class="{{ 'success'|icon(false) }} text-green"></i> Private use</li>
                    </ul>
                    <h4>Limitations</h4>
                    <ul class="list-unstyled space-y-1">
                        <li><i class="{{ 'failure'|icon(false) }} text-red"></i> Liability</li>
                        <li><i class="{{ 'failure'|icon(false) }} text-red"></i> Warranty</li>
                    </ul>
                    <h4>Conditions</h4>
                    <ul class="list-unstyled space-y-1">
                        <li><i class="{{ 'details'|icon(false) }} text-blue"></i> Disclose source</li>
                        <li><i class="{{ 'details'|icon(false) }} text-blue"></i> License and copyright notice</li>
                        <li><i class="{{ 'details'|icon(false) }} text-blue"></i> Network use is distribution</li>
                        <li><i class="{{ 'details'|icon(false) }} text-blue"></i> Same license</li>
                        <li><i class="{{ 'details'|icon(false) }} text-blue"></i> State changes</li>
                    </ul>
                </div>
                <div class="card-footer">
                    This is not legal advice. Learn more about this licenses at
                    <a href="https://choosealicense.com/licenses/agpl-3.0/" target="_blank">choosealicense.com</a> and
                    <a href="https://www.gnu.org/licenses/agpl-3.0.en.html" target="_blank">GNU</a>.
                </div>
            </div>
        </div>
    </div>
{% endblock %}
