{% extends 'layout.twig' %}
{% block title %}{{ app.title }}{% endblock %}

{% block body %}
    {% include 'navigation.twig' %}

    <div class="container mt-3">

        <h4>{{ repo }}</h4>

        <div class="alert alert-warning">
            {{ 'index.repo.empty'|t }}
        </div>

        {% if app.show_http_remote or app.show_ssh_remote %}
            <div class="card mb-3">
                <div class="card-header">
                    <strong>{{ 'breadcrumb.clone'|t }}</strong>
                </div>
                <div class="card-body">

                    <div class="mb-2">
                        <div class="btn-group">
                            {% if app.show_ssh_remote %}
                                <button type="button"
                                        class="btn btn-primary{{ app.show_ssh_remote and app.show_http_remote ? ' active' }}"
                                        id="clone-button-ssh">{{ 'breadcrumb.clone.ssh'|t }}
                                </button>
                            {% endif %}
                            {% if app.show_http_remote %}
                                <button type="button" class="btn btn-primary" id="clone-button-http">{{ 'breadcrumb.clone.https'|t }}</button>
                            {% endif %}
                        </div>
                    </div>

                    {% if app.show_ssh_remote %}
                        <input readonly
                               type="text" class="form-control mb-2{{ app.show_ssh_remote ? ' visible' }}"
                               id="clone-input-ssh"
                               value="git clone ssh://{{ app.ssh_user | url_encode }}{{ app.ssh_user ? '@' }}{{ global.request.host }}:{{ app.ssh_clone_subdir }}{{ repo }}">
                    {% endif %}
                    {% if app.show_http_remote %}
                        <input type="text"
                               readonly
                               class="form-control mb-2{{ app.show_ssh_remote is empty and app.show_http_remote ? ' visible' }}"
                               id="clone-input-http"
                               value="git clone http{{ app.use_https ? 's' }}://{{ app.http_user | url_encode }}{{ app.http_user ? '@' }}{{ global.request.host }}{{ app.git_http_subdir_calculated ? app.url_subdir : app.git_http_subdir }}/{{ repo }}">
                    {% endif %}

                </div>
            </div>
        {% endif %}

        <a class="btn btn-secondary" href="{{ path('homepage') }}">{{ 'error.go_back'|t }}</a>

        {% include 'footer.twig' %}
    </div>
{% endblock %}
