<div class="col col-md-4">
    <div class="card">
        <div class="card-header">
            <span class="mdi mdi-license" title="License">
                {% if plugin.private %}Subscription{% else %}Community{% endif %}
            </span>
            <span class="separator">&middot;</span>
            <span class="mdi mdi-star" title="Stars">{{ plugin.stars }}</span>

            {% if plugin.installed %}
                <span class="separator">&middot;</span>
                <span class="mdi mdi-check-circle" title="Installed"></span> {{ plugin.current_version }}
            {% endif %}

            {% if plugin.upgrade_available %}
                <span class="separator">&middot;</span>
                <span class="mdi mdi-arrow-up-bold" title="Upgrade available"></span> {{ plugin.latest_version }}
            {% endif %}
        </div>
        <div class="card-body text-center">
            <h4>{{ plugin_name }}</h4>
            <p>{{ plugin.description }}</p>
            {% if plugin.github_url and not plugin.private %}
                <a href="{{ plugin.github_url }}" target="_blank" class="btn btn-sm">
                    <i class="mdi mdi-github"></i> View on GitHub
                </a>
            {% endif %}
            {% if plugin.pypi_url %}
                <a href="{{ plugin.pypi_url }}" target="_blank" class="btn btn-sm">
                    <i class="mdi mdi-package"></i> View on PyPI
                </a>
            {% endif %}
        </div>
        <div class="card-footer text-end">
            {% if plugin.installed %}
                {% if plugin.disabled %}
                    <a class="btn btn-sm btn-success"
                       href="{% url 'plugins:netbox_paas:netboxconfiguration_plugin_enable' pk=object.pk %}?name={{ plugin_name }}&return_url={{ request.path }}">
                        <i class="mdi mdi-power-plug"></i> Enable
                    </a>
                {% else %}
                    <a class="btn btn-sm btn-warning"
                       href="{% url 'plugins:netbox_paas:netboxconfiguration_plugin_disable' pk=object.pk %}?name={{ plugin_name }}&return_url={{ request.path }}">
                        <i class="mdi mdi-power-sleep"></i> Disable
                    </a>
                {% endif %}

                <a class="btn btn-sm btn-cyan"
                   href="{% url 'plugins:netbox_paas:netboxconfiguration_plugin_install' pk=object.pk %}?name={{ plugin_name }}&version={{ plugin.current_version }}&type=update&return_url={{ request.path }}">
                    <i class="mdi mdi-cog"></i> Configure
                </a>

                <a class="btn btn-sm btn-danger"
                   href="{% url 'plugins:netbox_paas:netboxconfiguration_plugin_uninstall' pk=object.pk %}?name={{ plugin_name }}&return_url={{ request.path }}">
                    <i class="mdi mdi-trash-can-outline"></i> Uninstall
                </a>
            {% else %}
                <a class="btn btn-sm btn-primary"
                   href="{% url 'plugins:netbox_paas:netboxconfiguration_plugin_install' pk=object.pk %}?name={{ plugin_name }}&type=install&return_url={{ request.path }}">
                    <i class="mdi mdi-plus-thick"></i> Install
                </a>
            {% endif %}
        </div>
    </div>
</div>