dashboard.html 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. {% extends "base.html" %}
  2. {% load humanize %}
  3. {% load range_filters %}
  4. {% block interface %}
  5. <section id="interface">
  6. {% include "_navigation.html" %}
  7. <h3 class="i-name">
  8. Bienvenido, {{ user.nombre }}
  9. </h3>
  10. <div class="values">
  11. {% for f in favoritas %}
  12. <div class="val-cuenta">
  13. <div>
  14. <h3>{{ f.nombre }}</h3>
  15. <span>{{ f.saldo|floatformat:2|intcomma }}</span>
  16. </div>
  17. </div>
  18. {% empty %}
  19. <li>Sin cuentas favoritas configuradas</li>
  20. {% endfor %}
  21. </div>
  22. <div class="values">
  23. {% for f in frecuentes %}
  24. <div class="val-favoritos">
  25. <div>
  26. <a href="{% url 'agregar_movimiento' %}?origen={{ f.cuenta_origen.nombre|urlencode }}&destino={{ f.cuenta_destino.nombre|urlencode }}&monto={{ f.monto }}&categoria={{ f.categoria.nombre|urlencode }}&descripcion={{ f.descripcion }}">
  27. {{ f.nombre }} ({{ f.monto }} €)
  28. </a>
  29. </div>
  30. </div>
  31. {% empty %}
  32. <li>Sin movimientos frecuentes configurados</li>
  33. {% endfor %}
  34. </div>
  35. <div class="board">
  36. <div>
  37. <form method="get" class="mb-3">
  38. <select name="mes">
  39. {% for m in 1|to:12 %}
  40. <option value="{{ m }}" {% if m == mes %}selected{% endif %}>
  41. {{ m }}
  42. </option>
  43. {% endfor %}
  44. </select>
  45. <select name="anio">
  46. {% for y in 2020|to:anio %}
  47. <option value="{{ y }}" {% if y == anio %}selected{% endif %}>{{ y }}</option>
  48. {% endfor %}
  49. </select>
  50. <button type="submit">Filtrar</button>
  51. </form>
  52. </div>
  53. <h3>Movimientos recientes</h3>
  54. <table width="100%">
  55. <thead>
  56. <tr>
  57. <td>Fecha</td>
  58. <td>Origen</td>
  59. <td>Destino</td>
  60. <td>Cantidad</td>
  61. <td>Descripción</td>
  62. <td></td>
  63. </tr>
  64. </thead>
  65. <tbody>
  66. {% for m in movimientos %}
  67. <tr class="{% cycle 'fila-impar' 'fila-par' %}">
  68. <td class="movimiento">
  69. {{ m.fecha|date:"d-m-Y H:i" }}
  70. </td>
  71. <td class="movimiento">
  72. {{ m.cuenta_origen }}
  73. </td>
  74. <td class="movimiento">
  75. {{ m.cuenta_destino }}
  76. </td>
  77. <td class="movimiento-monto">
  78. {{ m.monto|floatformat:2|intcomma }} €
  79. </td>
  80. <td class="movimiento">
  81. {{ m.descripcion }}
  82. </td>
  83. <td class="edit">
  84. <a href="{% url 'editar_movimiento' m.id %}">
  85. <i class="bi bi-pencil-square"></i>
  86. </a>
  87. <a href="{% url 'eliminar_movimiento' m.id %}">
  88. <i class="bi bi-trash3"></i>
  89. </a>
  90. <a href="{% url 'duplicar_movimiento' m.id %}">
  91. <i class="bi bi-copy"></i>
  92. </a>
  93. </td>
  94. </tr>
  95. {% endfor %}
  96. </tbody>
  97. </table>
  98. </div>
  99. </section>
  100. {% endblock %}