Browse Source

Ajustes en urls

politica
Celestino Rey 1 year ago
parent
commit
946c8d9581
11 changed files with 20 additions and 20 deletions
  1. BIN
      ReyMotaAppsDj/reymota/db.sqlite3
  2. BIN
      ReyMotaAppsDj/reymota/mediafiles/vehiculos/bmw_PMjCK7Q.png
  3. BIN
      ReyMotaAppsDj/reymota/mediafiles/vehiculos/bmw_cSbhRuf.png
  4. BIN
      ReyMotaAppsDj/reymota/mediafiles/vehiculos/bmw_x00n9W7.png
  5. +6
    -6
      ReyMotaAppsDj/reymota/repostajes/views.py
  6. +2
    -2
      ReyMotaAppsDj/reymota/templates/libros/index.html
  7. +1
    -1
      ReyMotaAppsDj/reymota/templates/repostajes/detalle_repostaje.html
  8. +3
    -3
      ReyMotaAppsDj/reymota/templates/repostajes/detalle_vehiculo.html
  9. +2
    -2
      ReyMotaAppsDj/reymota/templates/repostajes/index.html
  10. +2
    -2
      ReyMotaAppsDj/reymota/templates/repostajes/lista_repostajes.html
  11. +4
    -4
      ReyMotaAppsDj/reymota/templates/repostajes/lista_vehiculos.html

BIN
ReyMotaAppsDj/reymota/db.sqlite3 View File


BIN
ReyMotaAppsDj/reymota/mediafiles/vehiculos/bmw_PMjCK7Q.png View File

Before After
Width: 360  |  Height: 225  |  Size: 9.5 KiB

BIN
ReyMotaAppsDj/reymota/mediafiles/vehiculos/bmw_cSbhRuf.png View File

Before After
Width: 360  |  Height: 225  |  Size: 9.5 KiB

BIN
ReyMotaAppsDj/reymota/mediafiles/vehiculos/bmw_x00n9W7.png View File

Before After
Width: 360  |  Height: 225  |  Size: 9.5 KiB

+ 6
- 6
ReyMotaAppsDj/reymota/repostajes/views.py View File

@ -36,7 +36,7 @@ def nuevo_vehiculo(request):
form = VehiculoForm(request.POST, request.FILES)
if form.is_valid():
form.save()
return redirect('lista_vehiculos')
return redirect('repostajes:lista_vehiculos')
else:
form = VehiculoForm()
return render(request, 'repostajes/form_vehiculo.html', {'form': form})
@ -49,7 +49,7 @@ def editar_vehiculo(request, vehiculo_id):
form = VehiculoForm(request.POST, request.FILES, instance=vehiculo)
if form.is_valid():
form.save()
return redirect('lista_vehiculos')
return redirect('repostajes:lista_vehiculos')
else:
form = VehiculoForm(instance=vehiculo)
return render(request, 'repostajes/form_vehiculo.html', {'form': form})
@ -59,7 +59,7 @@ def editar_vehiculo(request, vehiculo_id):
def eliminar_vehiculo(request, vehiculo_id):
vehiculo = get_object_or_404(Vehiculo, pk=vehiculo_id)
vehiculo.delete()
return redirect('lista_vehiculos')
return redirect('repostajes:lista_vehiculos')
# Vistas para los repostajes
@ -116,7 +116,7 @@ def nuevo_repostaje(request):
instancia.save()
return redirect('lista_repostajes')
return redirect('repostajes:lista_repostajes')
else:
form = RepostajeForm()
return render(request, 'repostajes/form_repostaje.html', {'form': form})
@ -132,7 +132,7 @@ def editar_repostaje(request, repostaje_id):
form = RepostajeForm(request.POST, request.FILES, instance=repostaje)
if form.is_valid():
form.save()
return redirect('lista_repostajes')
return redirect('repostajes:lista_repostajes')
else:
form = RepostajeForm(instance=repostaje)
return render(request, 'repostajes/form_repostaje.html', {'form': form})
@ -142,4 +142,4 @@ def editar_repostaje(request, repostaje_id):
def eliminar_repostaje(request, repostaje_id):
repostaje = Repostaje.objects.get(pk=repostaje_id)
repostaje.delete()
return redirect('lista_repostajes')
return redirect('repostajes:lista_repostajes')

+ 2
- 2
ReyMotaAppsDj/reymota/templates/libros/index.html View File

@ -32,7 +32,7 @@
<i class='bx bx-bowl-hot'></i>
</div>
<h4><a href="{% url 'libros:lista_autores' %}">Autores</a></h4>
<p>Mis recetas, probadas por mi y adaptadas</p>
<p>Todos los autores</p>
</div>
<div class="icon-box iconbox-pink">
<div class="icon">
@ -42,7 +42,7 @@
<i class='bx bx-bowl-hot'></i>
</div>
<h4><a href="{% url 'libros:lista_libros' %}">Libros</a></h4>
<p>Mis recetas, probadas por mi y adaptadas</p>
<p>Listado de libros</p>
</div>
</div>
</div><!--//row-->


+ 1
- 1
ReyMotaAppsDj/reymota/templates/repostajes/detalle_repostaje.html View File

@ -10,7 +10,7 @@
<h4 class="notification-title mb-1">{{ repostaje.fecha }}</h4>
<ul class="notification-meta list-inline mb-0">
<li class="list-inline-item"><a href="{% url 'detalle_vehiculo' repostaje.vehiculo_id %}">{{ repostaje.vehiculo.matricula }}</a></li>
<li class="list-inline-item"><a href="{% url 'repostajes:detalle_vehiculo' repostaje.vehiculo_id %}">{{ repostaje.vehiculo.matricula }}</a></li>
<li class="list-inline-item">|</li>
<li class="list-inline-item">{{ repostaje.kms }} kms</li>
<li class="list-inline-item">|</li>


+ 3
- 3
ReyMotaAppsDj/reymota/templates/repostajes/detalle_vehiculo.html View File

@ -40,7 +40,7 @@
<tbody>
{% for repostaje in repostajes %}
<tr>
<td class="cell"><a href="{% url 'detalle_repostaje' repostaje.id %}">{{ repostaje.fecha }}</a></td>
<td class="cell"><a href="{% url 'repostajes:detalle_repostaje' repostaje.id %}">{{ repostaje.fecha }}</a></td>
<td class="cell">{{ repostaje.kms }}</td>
<td class="cell">{{ repostaje.litros }}</td>
<td class="cell">{{ repostaje.importe }}</td>
@ -60,11 +60,11 @@
<div class="row g-3 mb-4 align-items-center justify-content-between">
<div class="col-auto">
<a class="btn app-btn-secondary" href="{% url 'lista_repostajes' %}">Volver al inicio</a>
<a class="btn app-btn-secondary" href="{% url 'repostajes:lista_repostajes' %}">Volver al inicio</a>
</div>
<div class="col-auto">
<a class="btn app-btn-primary" href="{% url 'nuevo_repostaje' %}">Añadir repostaje</a> <!-- Faltaría poner el id del vehiculo-->
<a class="btn app-btn-primary" href="{% url 'repostajes:nuevo_repostaje' %}">Añadir repostaje</a> <!-- Faltaría poner el id del vehiculo-->
</div>
</div>
</div>


+ 2
- 2
ReyMotaAppsDj/reymota/templates/repostajes/index.html View File

@ -32,7 +32,7 @@
<i class='bx bx-bowl-hot'></i>
</div>
<h4><a href="{% url 'repostajes:lista_vehiculos' %}">Vehículos</a></h4>
<p>Mis recetas, probadas por mi y adaptadas</p>
<p>Listado de vehículoss</p>
</div>
<div class="icon-box iconbox-pink">
<div class="icon">
@ -42,7 +42,7 @@
<i class='bx bx-bowl-hot'></i>
</div>
<h4><a href="{% url 'repostajes:lista_repostajes' %}">Repostajes</a></h4>
<p>Mis recetas, probadas por mi y adaptadas</p>
<p>Relación de repostajes</p>
</div>
</div>
</div><!--//row-->


+ 2
- 2
ReyMotaAppsDj/reymota/templates/repostajes/lista_repostajes.html View File

@ -39,8 +39,8 @@
<tbody>
<tr>
<td class="cell"><a href="{% url 'detalle_repostaje' repostaje.id %}">{{ repostaje.fecha }}</a></td>
<td class="cell"><a href="{% url 'detalle_vehiculo' repostaje.vehiculo.id %}">{{ repostaje.vehiculo.matricula }}</a></td>
<td class="cell"><a href="{% url 'repostajes:detalle_repostaje' repostaje.id %}">{{ repostaje.fecha }}</a></td>
<td class="cell"><a href="{% url 'repostajes:detalle_vehiculo' repostaje.vehiculo.id %}">{{ repostaje.vehiculo.matricula }}</a></td>
<td class="cell">{{ repostaje.kms }}</td>
<td class="cell">{{ repostaje.litros }}</td>
<td class="cell">{{ repostaje.importe }} €</td>


+ 4
- 4
ReyMotaAppsDj/reymota/templates/repostajes/lista_vehiculos.html View File

@ -29,7 +29,7 @@
{% else %}
Sin imágen
{% endif %}
<h4 class="app-doc-title truncate mb-0"><a href="{% url 'detalle_vehiculo' vehiculo.id %}">{{ vehiculo.matricula}}</a></h4>
<h4 class="app-doc-title truncate mb-0"><a href="{% url 'repostajes:detalle_vehiculo' vehiculo.id %}">{{ vehiculo.matricula}}</a></h4>
<div class="app-card-actions">
<div class="dropdown">
@ -39,14 +39,14 @@
</svg>
</div><!--//dropdown-toggle-->
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="{% url 'detalle_vehiculo' vehiculo.id %}"><svg width="1em" height="1em" viewBox="0 0 16 16" class="bi bi-eye me-2" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
<li><a class="dropdown-item" href="{% url 'repostajes:detalle_vehiculo' vehiculo.id %}"><svg width="1em" height="1em" viewBox="0 0 16 16" class="bi bi-eye me-2" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.134 13.134 0 0 0 1.66 2.043C4.12 11.332 5.88 12.5 8 12.5c2.12 0 3.879-1.168 5.168-2.457A13.134 13.134 0 0 0 14.828 8a13.133 13.133 0 0 0-1.66-2.043C11.879 4.668 10.119 3.5 8 3.5c-2.12 0-3.879 1.168-5.168 2.457A13.133 13.133 0 0 0 1.172 8z"/>
<path fill-rule="evenodd" d="M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0z"/>
</svg>Ver</a></li>
<li><a class="dropdown-item" href="{% url 'editar_vehiculo' vehiculo.id %}"><svg width="1em" height="1em" viewBox="0 0 16 16" class="bi bi-pencil me-2" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
<li><a class="dropdown-item" href="{% url 'repostajes:editar_vehiculo' vehiculo.id %}"><svg width="1em" height="1em" viewBox="0 0 16 16" class="bi bi-pencil me-2" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" d="M12.146.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1 0 .708l-10 10a.5.5 0 0 1-.168.11l-5 2a.5.5 0 0 1-.65-.65l2-5a.5.5 0 0 1 .11-.168l10-10zM11.207 2.5L13.5 4.793 14.793 3.5 12.5 1.207 11.207 2.5zm1.586 3L10.5 3.207 4 9.707V10h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.293l6.5-6.5zm-9.761 5.175l-.106.106-1.528 3.821 3.821-1.528.106-.106A.5.5 0 0 1 5 12.5V12h-.5a.5.5 0 0 1-.5-.5V11h-.5a.5.5 0 0 1-.468-.325z"/>
</svg>Editar</a></li>
<li><a class="dropdown-item" href="{% url 'eliminar_vehiculo' vehiculo.id %}"><svg width="1em" height="1em" viewBox="0 0 16 16" class="bi bi-download me-2" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
<li><a class="dropdown-item" href="{% url 'repostajes:eliminar_vehiculo' vehiculo.id %}"><svg width="1em" height="1em" viewBox="0 0 16 16" class="bi bi-download me-2" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" d="M.5 9.9a.5.5 0 0 1 .5.5v2.5a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-2.5a.5.5 0 0 1 1 0v2.5a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2v-2.5a.5.5 0 0 1 .5-.5z"/>
<path fill-rule="evenodd" d="M7.646 11.854a.5.5 0 0 0 .708 0l3-3a.5.5 0 0 0-.708-.708L8.5 10.293V1.5a.5.5 0 0 0-1 0v8.793L5.354 8.146a.5.5 0 1 0-.708.708l3 3z"/>
</svg>Eliminar</a></li>


Loading…
Cancel
Save