{% extends 'base.html' %}


{% block content %}
    <div class='row'>
        <div class='col-lg-12'>
            <div class="card card-primary card-outline">
                {% if page_title %}
                    <div class="card-header">
                        <h3 class="card-title">{{ page_title }}</h3>
                    </div>
                {% endif %}
                <div class="card-body">
                    {% include 'backup/backup_nav_tabs.html' %}
                    <div class="row">
                        <div class="col-lg-12">
                            <table class="table table-hover datatables-no-export">
                                <thead>
                                    <tr>
                                        <th>Name</th>
                                        <th>Routers</th>
                                        <th>Daily</th>
                                        <th>Weekly</th>
                                        <th>Monthly</th>
                                        <th></th>
                                        <th></th>
                                    </tr>
                                </thead>
                                
                                <tbody>
                                {% for backup_profile in backup_profile_list %}
                                    <tr>
                                        <td>{{ backup_profile.name }}</td>

                                        <td>
                                            {{ backup_profile.router_set.count }}
                                        </td>

                                        <td>
                                            {% if backup_profile.daily_backup %}
                                                <i class="far fa-check-circle text-success"></i>
                                            {% endif %}
                                        </td>
                                        <td>
                                            {% if backup_profile.weekly_backup %}
                                                <i class="far fa-check-circle text-success"></i>
                                            {% endif %}
                                        </td>

                                        <td>
                                            {% if backup_profile.monthly_backup %}
                                                <i class="far fa-check-circle text-success"></i>
                                            {% endif %}
                                        </td>
                                    
                                        <td>
                                            {% if backup_profile.profile_error_information %}
                                            <i class="fas fa-exclamation-triangle text-warning"></i> {{ backup_profile.profile_error_information }}
                                            
                                            {% endif %}
                                        </td>

                                        <td class="min-width">
                                            <a href="/backup/manage_profile/?uuid={{ backup_profile.uuid }}"><i class="fas fa-edit"></i></a>
                                        </td>
                                    </tr>
                                {% endfor %}
                                </tbody>
                            </table>
                        </div>

                    </div>
                    <div class="row">
                        <div class="col-lg-12">
                            <a href="/backup/manage_profile/" class="btn btn-primary">Add Backup Profile</a>
                        </div>

                    </div>

                </div>
            </div>
        </div>
    </div>
{% endblock %}