{% extends 'base.html' %}

{% block title %}
    Applications
{% endblock %}

{% block content %}
    <h1 class="page-header">Applications</h1>
        {% if list_applications %}
        <h2 class="sub-header"></h2>
                  <div class="table-responsive">
                    <table class="table table-striped">
                      <thead>
                        <tr>
                            <th>ID</th>
                            <th>Name</th>
                            <th>Description</th>
                            <th>Organization ID</th>
                            <th>Service Profile ID</th>
                            <th>Service Profile Name</th>
                        </tr>
                      </thead>
                        <tbody>
                            {% for app in list_applications.get('result') %}
                                <tr>
                                    <td>{{ app.get('id') }}</td>
                                    <td>{{ app.get('name') }}</td>
                                    <td>{{ app.get('description') }}</td>
                                    <td>{{ app.get('organizationID') }}</td>
                                    <td>{{ app.get('serviceProfileID') }}</td>
                                    <td>{{ app.get('serviceProfileName') }}</td>
                                    <td><a href="{{ url_for('service.edit_application', application_id=app.get('id')) }}" class="btn btn-warning">Edit</a></td>
                                </tr>
                            {% endfor %}
                        </tbody>
                        </table>
                        <p>Total count of applications: {{ list_applications.get('totalCount') }}</p>
                    </div>
{% endif %}
{% endblock %}