{% extends "./index.html" %}
{% load static %}

{% block subtitle %}
Edition de Modules 
{% endblock %}

{% block maketteur_content_1 %}



<div class="h3 text-"> Vos Modules</div>

<div class=""> <a href="#" onclick="showCreateAppForm()" data-toggle="modal" class=" text-primary"> <i class="fas fa-add"></i>&nbsp;Nouveau Module</a> </div>

<div class="py-2 d-flex flex-wrap justify-content-">
	{% for app in list_apps %}
	<div class="p-1 col-lg-2 col-sm-4 col-md-3">
		<div class="card">
			<div class="card-body" style="text-overflow: ellipsis;">
				{{app}}
			</div>
		</div>
	</div>
	{% endfor %}
</div>

<script>
function showCreateAppForm() {
    alertify.alert('Nouveau Module',`
    	<form method='POST' action='/maketteur/new_module/'>
    	{% csrf_token %}
 <div class="modal-body">
          <div class="mb-3">
            <label class="form-label">Nom</label>
            <input type="text" class="form-control" name="module_name" required>
          </div>
          <div class="mb-3">
            <label class="form-label">Logo</label>
            <input type="file" class="form-control" name="app_logo">
          </div>
          <div class="mb-3">
            <label class="form-label">Description</label>
            <textarea class="form-control" name="module_img"></textarea>
          </div>
        </div>
    	<div class="modal-footer">
          <button class="btn btn-secondary" data-bs-dismiss="modal">Annuler</button>
          <button class="btn btn-success" type="submit">Créer</button>
        </div>
    	</form>
    `,function(){});
}
</script>

{% endblock %}