Explorar o código

Añado base.html y corrijo resto de templates.

Celestino Rey hai 1 ano
pai
achega
b773c29ae7

+ 5 - 1
finanzas/forms.py

@@ -7,7 +7,11 @@ class MovimientoForm(forms.ModelForm):
         model = Movimiento
         fields = ['cuenta_origen', 'cuenta_destino', 'monto', 'fecha', 'descripcion']
         widgets = {
-            'fecha': forms.DateInput(attrs={'type': 'date'})
+            'cuenta_origen': forms.Select(attrs={'class': 'form-control'}),
+            'cuenta_destino': forms.Select(attrs={'class': 'form-control'}),
+            'monto': forms.TextInput(attrs={'class': 'form-control'}),
+            'descripcion': forms.Textarea(attrs={'class': 'form-control', 'rows': 3}),
+            'fecha': forms.DateInput(attrs={'class': 'form-control', 'placeholder': 'MM-DD-YYYY'}),
         }
 
 

+ 15 - 0
templates/_cabecera.html

@@ -0,0 +1,15 @@
+{% load static %}
+
+<head>
+    <meta charset="UTF-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Finanzas</title>
+ 
+    <link rel="stylesheet" href="{% static 'style.css' %}">
+    <link href="{% static 'bootstrap/css/bootstrap-icons.css' %}" rel="stylesheet" />
+    <link href="{% static 'bootstrap/css/bootstrap.min.css' %}" rel="stylesheet" />
+ 
+    <script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
+    
+ </head>

+ 1 - 1
templates/_head.html

@@ -1,6 +1,6 @@
 {% load static %}
 
- <!DOCTYPE html>
+<!DOCTYPE html>
 <html lang="en"> 
     <head>
         <meta charset="UTF-8">

+ 3 - 6
templates/agregar_cuenta.html

@@ -1,9 +1,6 @@
-{% load i18n static %}
-
-{% include "_head.html" %}
-
-{% include "_menu.html" %}
+{% extends "base.html" %}
 
+{% block interface %}
 <section id="interface">
     <div class="board">
         {% include "_navigation.html" %}
@@ -24,4 +21,4 @@
         </div>
     </div>
 </section>  
-{% include "_footer.html" %}
+{% endblock %}

+ 23 - 16
templates/agregar_movimiento.html

@@ -1,16 +1,23 @@
-<!DOCTYPE html>
-<html lang="es">
-<head>
-    <meta charset="UTF-8">
-    <title>Agregar Movimiento</title>
-</head>
-<body>
-    <h1>Agregar Movimiento</h1>
-    <form method="post">
-        {% csrf_token %}
-        {{ form.as_p }}
-        <button type="submit">Guardar</button>
-    </form>
-    <a href="{% url 'dashboard' %}">Volver al Dashboard</a>
-</body>
-</html>
+{% extends "base.html" %}
+
+{% block interface %}
+<section id="interface">
+    <div class="board">
+            {% include "_navigation.html" %}
+        <div class="div-form">
+            <h1>Agregar Movimiento</h1>
+            <div class="form-group">
+                <form method="post">
+                    {% csrf_token %}
+                    {{ form.as_p }}
+                    <button class="btn btn-success" type="submit">Guardar</button>
+                </form>
+            </div>
+        </div>
+
+        <div class="botones">
+            <a href="{% url 'dashboard' %}"><button class="btn btn-secondary" type="button">Volver al Dashboard</button></a>
+        </div>
+    </div>
+</section> 
+{% endblock %}

+ 190 - 0
templates/base.html

@@ -0,0 +1,190 @@
+<!DOCTYPE html>
+<html lang="es">
+
+{% include "_cabecera.html" %}
+
+<body>
+
+    {% include "_menu.html" %}
+
+    {%block interface %}
+    <section id="interface">
+        <div class="navigation">
+            <div class="n1">
+                <div>
+                <i id="menu-btn" class="bi bi-list""></i>               
+                </div>
+                <div class="search">
+                <i class="bi bi-search"></i>              
+                    <input type="text" placeholder="Buscar...">
+                </div>
+            </div>
+
+            <div class="profile">
+                <i class="bi bi-bell"></i>            
+                <img src="static/images/auster.jpg" alt="">
+            </div>
+        </div>
+
+        <h3 class="i-name">
+            Panel principal
+        </h3>
+
+        <div class="values">
+            <div class="val-box">
+                <i class="bi bi-people-fill"></i>         
+                <div>
+                <h3>Usuarios</h3>
+                <span>Los usuarios</span>
+                </div>
+            </div>
+
+            <div class="val-box">
+                <i class="bi bi-calendar-event-fill"></i>            
+                <div>
+                <h3>Pozos</h3>
+                <span>Los pozos</span>
+                </div>
+            </div>
+
+            <div class="val-box">
+                <i class="bi bi-bookmark-plus-fill"></i>            
+                <div>
+                <h3>Reservas</h3>
+                <span>Los reservas</span>
+                </div>
+            </div>
+
+            <div class="val-box">
+                <i class="bi bi-camera-fill"></i>
+                <div>
+                <h3>Fiestas</h3>
+                <span>Los fiestas</span>
+                </div>
+            </div>
+        </div>
+
+        <div class="board">
+            <table width="100%">
+                <thead>
+                <tr>
+                    <td>Nombre</td>
+                    <td>Descripción</td>
+                    <td>Estado</td>
+                    <td>Puesto</td>
+                    <td></td>
+                </tr>
+                </thead>
+
+                <tbody>
+                <tr>
+                    <td class="people"> 
+                        <img src="static/images/cercas.jpg" alt="">
+                        <div class="people-de">
+                            <h5>Cercas</h5>
+                            <p>creylopez@yahoo.es</p>
+                        </div>
+                    </td>
+                    <td class="people-des">
+                        <h5>Admin</h5>
+                        <p>Gestor</p>
+                    </td>
+                    <td class="active">
+                        <p>Activo</p>
+                    </td>
+                    <td class="role">
+                        <p>Administrador</p>
+                    </td>
+                    <td class="edit"><a href="#">Edit</td>
+                </tr>
+                <tr>
+                    <td class="people"> 
+                        <img src="static/images/auster.jpg" alt="">
+                        <div class="people-de">
+                            <h5>Auster</h5>
+                            <p>creylopez@yahoo.es</p>
+                        </td>
+                    <td class="people-des">
+                        <h5>Admin</h5>
+                        <p>Gestor</p>
+                    </td>
+                    <td class="active">
+                        <p>Activo</p>
+                    </td>
+                    <td class="role">
+                        <p>Administrador</p>
+                    </td>
+                    <td class="edit"><a href="#">Edit</td>
+                </tr>               
+                <tr>
+                    <td class="people"> 
+                        <img src="static/images/bruce.jpg" alt="">
+                        <div class="people-de">
+                            <h5>Bruce</h5>
+                            <p>creylopez@yahoo.es</p>
+                        </td>
+                    <td class="people-des">
+                        <h5>Admin</h5>
+                        <p>Gestor</p>
+                    </td>
+                    <td class="active">
+                        <p>Activo</p>
+                    </td>
+                    <td class="role">
+                        <p>Administrador</p>
+                    </td>
+                    <td class="edit"><a href="#">Edit</td>
+                </tr>               
+                <tr>
+                    <td class="people"> 
+                        <img src="static/images/gravatar-tino.jpeg" alt="">
+                        <div class="people-de">
+                            <h5>Reymota</h5>
+                            <p>creylopez@yahoo.es</p>
+                        </td>
+                    <td class="people-des">
+                        <h5>Admin</h5>
+                        <p>Gestor</p>
+                    </td>
+                    <td class="active">
+                        <p>Activo</p>
+                    </td>
+                    <td class="role">
+                        <p>Administrador</p>
+                    </td>
+                    <td class="edit"><a href="#">Edit</td>
+                </tr>               
+                <tr>
+                    <td class="people"> 
+                        <img src="static/images/Imagen generada.jpeg" alt="">
+                        <div class="people-de">
+                            <h5>Oldman</h5>
+                            <p>creylopez@yahoo.es</p>
+                        </td>
+                    <td class="people-des">
+                        <h5>Admin</h5>
+                        <p>Gestor</p>
+                    </td>
+                    <td class="active">
+                        <p>Activo</p>
+                    </td>
+                    <td class="role">
+                        <p>Administrador</p>
+                    </td>
+                    <td class="edit"><a href="#">Edit</td>
+                </tr>
+                </tbody>
+            </table>
+        </div>
+    </section>
+   {% endblock %}
+
+   <script>
+      $('#menu-btn').click(function() {
+         $('#menu').toggleClass('active');
+         $('#interface').toggleClass('active');
+      });
+   </script>
+</body>
+
+</html>

+ 3 - 5
templates/dashboard.html

@@ -1,8 +1,6 @@
-{% load i18n static %}
+{% extends "base.html" %}
 
-{% include "_head.html" %}
-
-{% include "_menu.html" %}
+{% block interface %}
 
 <section id="interface">
     {% include "_navigation.html" %}
@@ -51,4 +49,4 @@
         </ul>
     </div>
 </section>
-{% include "_footer.html" %}
+{% endblock %}

+ 4 - 5
templates/listar_cuentas.html

@@ -1,8 +1,6 @@
-{% load i18n static %}
+{% extends "base.html" %}
 
-{% include "_head.html" %}
-
-{% include "_menu.html" %}
+{% block interface %}
 
 <section id="interface">
     {% include "_navigation.html" %}
@@ -62,4 +60,5 @@
     </div>
 </section>
 <!-- Footer -->
-    {% include "_footer.html" %}
+{% endblock %}
+