{% extends "./assets/layout.html.twig" %}

{% block page %}
    {% if success != true %}
        <h1 class="red">Installation Failure</h1>

        <p>FOSSBilling could not complete the installation.</p>
        <p>{{ message }}</p>

        <hr/>

        <a role="button" href='javascript:history.back()'>Back to installer</a>
    {% else %}
        <h1 class="green">Installation Completed</h1>

        <p class="installer-intro">FOSSBilling is ready. Review these final checks before you start accepting orders.</p>

        <ol class="success-list">
            <li>
                <h3>Remove Installer</h3>
                <p>The <b>./install/</b> folder is normally deleted automatically. If it still exists, remove it before using FOSSBilling.</p>
                <pre>rm -rfv {{ install_module_path }}</pre>
            </li>
            <li>
                <h3>Configuration Permission</h3>
                <p>Restrict write access to <b>config.php</b> after setup.</p>
                <pre>chmod 644 {{ config_file_path }}</pre>
            </li>
            <li>
                <h3>Set up Cron Job</h3>
                <p>Run the FOSSBilling cron task every five minutes. The official Docker image configures this automatically. For other installs, add this to your crontab. <a href='https://docs.fossbilling.org/getting-started/installation/#configuring-the-cronjob' data-tooltip="Opens in a new tab." target='_blank'>Cron setup help</a></p>
                <pre>*/5 * * * * php {{ cron_path }}</pre>
            </li>
        </ol>

        <hr/>

        <div>
            <p>Next, open the customer area or sign in to the admin dashboard.</p>
            <div class="result-actions">
                <a href='{{ url_customer }}' role="button" target='_blank' data-tooltip="Opens in a new tab.">Customer Area</a>
                <a href='{{ url_admin }}' role="button" target='_blank' data-tooltip="Opens in a new tab.">Admin Dashboard</a>
            </div>
        </div>
    {% endif %}
{% endblock %}
