repman-io/repman

View on GitHub
templates/organization/package/scanResults.html.twig

Summary

Maintainability
Test Coverage
{% extends 'base.html.twig' %}

{% block header %}
    <a href="{{ path('organization_packages', {"organization":organization.alias}) }}"
       class="btn btn-secondary px-1 mr-1" title="Package List">
        <span class="text-muted mr-1">&laquo;</span>
        {% include 'svg/package.svg' %}
    </a>

    <a href="{{ path('organization_package_details', {organization: organization.alias, package: package.id}) }}">{{ package.name }}</a>
    security scan results
{% endblock %}

{% block header_btn %}
    {% include 'component/packageActions.html.twig' %}
{% endblock %}

{% block content %}

<table class="table">
    <thead>
        <tr>
            <th>Date</th>
            <th>Status</th>
            <th>Version</th>
            <th>Content</th>
        </tr>
    </thead>
    <tbody>
        {% if results is empty %}
            <tr><td colspan="4">package not scanned yet</tr>
        {% endif %}
        {% for result in results %}
            <tr>
                <td>
                    <span data-toggle="tooltip" title="{{ result.date|date_time }} ({{ gmt_offset() }})">
                        {{ result.date|date_time|time_diff }}
                    </span>
                </td>
                <td>
                    {% if result.isOk %}
                        <span class="badge badge-success">{{ result.status }}</span>
                    {% elseif result.isPending or result.isNotAvailable %}
                        <span class="badge badge-warning">{{ result.status }}</span>
                    {% else %}
                        <span class="badge badge-danger">{{ result.status }}</span>
                    {% endif %}
                </td>
                <td>{{ result.version }}</td>
                <td>
                    {% include 'organization/package/scanResultContent.html.twig' with {'result': result.content, 'simple': false} %}
                </td>
            </tr>
        {% endfor %}
    </tbody>
</table>

{% include 'component/pagination.html.twig' with {'path_name': 'organization_package_scan_results', 'path_params': {'organization': organization.alias, 'package': package.id}} %}

{% endblock %}