{% extends "users/base.html" %}
{% block title %}My Backup{% endblock title %}
{% block content %}



 <div class="card card-default">
      <div class="card-header">
        <h2>List of backup</h2>
		
        

      </div>
    
   
	
	
	
	<div class="card-body">
<div class="table-responsive">
    <table class="table table-bordered">
        <thead class="thead-light">
            <tr>
               
                <th>type</th>
				
                <th>Backup</th>
                <th>Actions</th>
            </tr>
        </thead>
        <tbody id="domainTable">
            {% for backupp in backups %}
            <tr>
                
                <td>{{ bk }}</td>
				
                <td><span id="domainPath_{{ forloop.counter }}">{{ backupp }}</span></td>
                <td>
				{% if bk == 'local' %}
    <a href="{% url 'download' %}?file=/home/{{ user.username }}/backup/{{ backupp }}" class="btn btn-success btn-sm">Download</a>
{% endif %}

                    <form method="POST" style="display:inline;">
                {% csrf_token %}
                <input type="hidden" name="delete_file" value="{{ backupp }}">
                <button type="submit" class="btn btn-danger btn-sm" onclick="return confirm('Are you sure you want to delete {{ backupp }} backup?');">Delete</button>
            </form>
                    
                </td>
            </tr>
            {% empty %}
            <tr>
                <td colspan="4" class="text-center">No backup found.</td>
            </tr>
            {% endfor %}
        </tbody>
    </table>
</div>
    <!-- No Results Message -->
    <div id="noResults" class="text-center text-danger" style="display:none;">No results found.</div>

</div>
</div>


{% endblock content %}

{% include "users/footer.html" %}