Modificacion de clientes form, CBV
This commit is contained in:
47
Templates/Clientes/edit_cliente.html
Normal file
47
Templates/Clientes/edit_cliente.html
Normal file
@@ -0,0 +1,47 @@
|
||||
{% extends 'base.html' %}
|
||||
{% load widget_tweaks %}
|
||||
|
||||
{% block title %}Editar Cliente{% endblock title %}
|
||||
{% block titlePage %}RFC: {{object.RFC}}{% endblock titlePage %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<form method="POST" action=".">
|
||||
{% csrf_token %}
|
||||
<div class="form-group">
|
||||
<label for="{{form.RFC.name}}"><strong> {{form.RFC.label|capfirst}} </strong></label>
|
||||
{% render_field form.RFC id+="add" id+=form.RFC.name placeholder=form.RFC.label class="form-control" type="text" autocomplete="off" %}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="{{form.Nombre.name}}"><strong> {{form.Nombre.label|capfirst}} </strong></label>
|
||||
{% render_field form.Nombre id+="add" id+=form.Nombre.name placeholder=form.Nombre.label class="form-control" type="text" autocomplete="off" %}
|
||||
</div>
|
||||
|
||||
<div class="form-group form-check">
|
||||
{% render_field form.Activo class+="form-checkbox" type="checkbox" %}
|
||||
<label class="form-check-label" for="{{form.Activo.label}}">Activo</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{% render_field form.fecha_baja.label %}
|
||||
{% render_field form.fecha_baja placeholder=form.fecha_baja.label class+="form-control" type="date" %}
|
||||
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Submit</button>
|
||||
</form>
|
||||
{% endblock content %}
|
||||
|
||||
{% block scripts %}
|
||||
<script>
|
||||
id_fecha_baja.addEventListener('click',(event)=>{
|
||||
|
||||
if(id_Activo.checked){
|
||||
event.preventDefault()
|
||||
alert('El cliente esta activo necesita deseleccionar "Activo" y colocar fecha baja.')
|
||||
return
|
||||
}
|
||||
})
|
||||
</script>
|
||||
{% endblock scripts %}
|
||||
|
||||
|
||||
@@ -32,7 +32,9 @@
|
||||
<tbody>
|
||||
{% for obj in clientes %}
|
||||
<tr class="">
|
||||
<td>{{obj.RFC}}</td>
|
||||
<td>
|
||||
<a href="{% url 'update_cliente' obj.pk %}">{{obj.RFC}}</a>
|
||||
</td>
|
||||
<td>{{obj.Nombre}}</td>
|
||||
<td>{{obj.timbres_mes_count}}</td>
|
||||
<td>
|
||||
@@ -51,6 +53,7 @@
|
||||
table_rfcc.addEventListener('click',(event)=>{
|
||||
document.getElementById('rfcc').checked= table_rfcc.checked? true:false;
|
||||
})
|
||||
add
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user