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

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

        <p>{{ message }}</p>

        <hr/>

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

        <p>Congratulations! FOSSBilling was successfully installed.</p>

        <p>There are a few more actions you need to take to configure your environment.</p>

        <h3>1) Remove Installer</h3>
        <p>The <b>./install/</b> folder is normally deleted automatically. Check to make sure it was fully deleted.</p>
        <pre>rm -rfv {{ install_module_path }}</pre>

        <h3>2) Configuration Permission</h3>
        <p>Change the <b>config.php</b> file permissions to read-only.</p>
        <pre>chmod 644 {{ config_file_path }}</pre>

        <h3>3) Set up Cron Job</h3>
        <p>Add the following command into your crontab. <a href='https://fossbilling.org/docs/getting-started/apache#setting-up-the-cron-jobs' data-tooltip="Opens in a new tab." target='_blank'>Click here</a> for help.</p>
        <pre>*/5 * * * * php {{ cron_path }}</pre>

        <hr/>

        <div style='text-align:center;'>
            <p style='margin-bottom:3em;'>All done? Welcome to FOSSBilling!</p>
            <div class="grid">
                <div><a href='{{ url_customer }}' role="button" target='_blank' data-tooltip="Opens in a new tab.">Customer Area</a></div>
                <div><a href='{{ url_admin }}' role="button" target='_blank' data-tooltip="Opens in a new tab.">Staff Dashboard</a></div>
            </div>
        </div>
    {% endif %}
{% endblock %}
