From f185fab4db0974fddb920520aae9ac62a387e8cb Mon Sep 17 00:00:00 2001 From: Celestino Rey Date: Tue, 10 Sep 2024 16:16:46 +0200 Subject: [PATCH] Voy completando lyrics --- ReyMotaAppsDj/reymota/db.sqlite3 | Bin 184320 -> 184320 bytes ReyMotaAppsDj/reymota/lyrics/forms.py | 45 ++++ .../reymota/lyrics/migrations/0001_initial.py | 52 +++++ ReyMotaAppsDj/reymota/lyrics/models.py | 43 +++- ReyMotaAppsDj/reymota/lyrics/urls.py | 27 +++ ReyMotaAppsDj/reymota/lyrics/views.py | 197 +++++++++++++++++- ReyMotaAppsDj/reymota/reymota/settings.py | 1 + ReyMotaAppsDj/reymota/reymota/urls.py | 2 + .../reymota/templates/_cabecera.html | 3 +- .../templates/lyrics/detalle_album.html | 24 +++ .../templates/lyrics/detalle_artista.html | 62 ++++++ .../templates/lyrics/detalle_song.html | 32 +++ .../reymota/templates/lyrics/form_album.html | 17 ++ .../templates/lyrics/form_artista.html | 17 ++ .../reymota/templates/lyrics/form_song.html | 17 ++ .../reymota/templates/lyrics/index.html | 64 ++++++ .../templates/lyrics/lista_albumes.html | 57 +++++ .../templates/lyrics/lista_artistas.html | 65 ++++++ .../reymota/templates/lyrics/lista_songs.html | 57 +++++ 19 files changed, 778 insertions(+), 4 deletions(-) create mode 100644 ReyMotaAppsDj/reymota/lyrics/forms.py create mode 100644 ReyMotaAppsDj/reymota/lyrics/migrations/0001_initial.py create mode 100644 ReyMotaAppsDj/reymota/lyrics/urls.py create mode 100644 ReyMotaAppsDj/reymota/templates/lyrics/detalle_album.html create mode 100644 ReyMotaAppsDj/reymota/templates/lyrics/detalle_artista.html create mode 100644 ReyMotaAppsDj/reymota/templates/lyrics/detalle_song.html create mode 100644 ReyMotaAppsDj/reymota/templates/lyrics/form_album.html create mode 100644 ReyMotaAppsDj/reymota/templates/lyrics/form_artista.html create mode 100644 ReyMotaAppsDj/reymota/templates/lyrics/form_song.html create mode 100644 ReyMotaAppsDj/reymota/templates/lyrics/index.html create mode 100644 ReyMotaAppsDj/reymota/templates/lyrics/lista_albumes.html create mode 100644 ReyMotaAppsDj/reymota/templates/lyrics/lista_artistas.html create mode 100644 ReyMotaAppsDj/reymota/templates/lyrics/lista_songs.html diff --git a/ReyMotaAppsDj/reymota/db.sqlite3 b/ReyMotaAppsDj/reymota/db.sqlite3 index 0e86c981bc21090e19f20a0f7c723d782d363707..f315c3e4955e20782f12f604bb3cf08761e7086d 100644 GIT binary patch delta 2150 zcmaJ?e@q)y9KUzH_67&<9WZtjhFq`fMz`TwprtK8TE>rwFfbDmV~pL=R@MaAECuDS z?vUw{{WI3g`p32`>OUsBSsP^uZfas;GNVran9;wc#;A!J;V=Kt=)L!@HTi>YKRyIx;g?e)mswoq$($m@C7*Xj)hI|_^S=d8QRP#c5R&`)Ryy@_%tfksdp zx|`Q5h(lj7yRwc$^B|JV9SSu_`m7u(v$%E;)w!rTJvl!kv6eQFQ@cTpLoC-BBD}?* z-_azRM`zKe=v#CRS>Oh|1;2pb7wSD%V7tiKB|s&Jf>_Pj8;U?Got#Un2yymW1DZQI zI|U0HJ=MSx5$st$lB^Sc5WW;X5UvZCg|ot(a9nsy=oa=1_Pn-Io)J0V0OCS2@fg<#O^&k#30a1;|DW#iG5S5{(x^{BF4Ny^tf}IpBN~O|I zV*jBk4mbfKYLpiw`jF`1jsk=M4Ka*#P{dHeh#zvG5kRbhZ+(T0;c9M=2yZgzH}nm< zjow19pqEe@sb~m!Pz_??I{XfP4sYhQi?AJu9AlSE3tfeDpuqsBEeLg}mO^-r!ur!S zUP}a?$@1rub?_7T5nO}s!t3x2_!_(nb8rQogJ<&E-<6M8EdYoSQp2S7klKwa>LRt1 z)DWpbTw#FJ4pRN3`U;<2>FBjYY?re9y=2{vdj3!TE`Ni6nV;ncd4=a}_iXRmF6FhI zw#-8jD+3&E)8_W6voc;&nIuUG>*KDLlD)odR_@S8od?W`Gr1uQKV_H_X!4;m8mH=gI;GKdKaxcUBs%_|Z-4#H9Zp>3 z?ts4#s4Rd#{t3VOw)mch<>WmgSZ2^n*|YlAme~Z`$JR7=%~Ho+sJv0ZmaoBI*-EgS z*Pa3y%@*RNVHeQc$=P_~d74dnD5JE~XfhrRdV`5TKy5b0i+zhnM<0c**4g%fo4Paynsd(tPbOJdF1q9vLWYGuIme zzT7W90CT1293w||0d*tGR%sVyp|$O~#p zPim^!>+yKp^61#OJUTHlqWeCD-@uA~=wrI~=^{#A5X5{%(L6r-*!tcw{V5u)2X)tc zWXQ)$ZZ}vuYHrRrc|}3G8co}_Xi(|myC&E%PXAb*SkdB{On{e;=qYpjH)Yr%PJ7Jn l_f5w2*BJhs&ylY|tkCpMk8jhSjD|M6J@if{spPPkAVOH delta 385 zcmY+;KS%;m90%}sfArML`)Z~|M`eG;MB~IjNJ?mkn%etMLxE6WkelaH&~kc%P2vzu zB^(bj2%4h7klLaqhoY7WZ-~YoE!F$+c|3mqc=@WFugZq%PZL5S%rN6*lEqPtOIyoF z5JH}uDfuFnKJB5o-UCOM3mU-%UQoaZ%2>x7G)q@uYSA?=ZkD4-HN;i~ng6Go7c{QC zGQkB@uZNYqicRp2RqS9NH+V!1f@0HftfCZ+q9$zUEb->nH<+(&00000 diff --git a/ReyMotaAppsDj/reymota/lyrics/forms.py b/ReyMotaAppsDj/reymota/lyrics/forms.py new file mode 100644 index 0000000..721b786 --- /dev/null +++ b/ReyMotaAppsDj/reymota/lyrics/forms.py @@ -0,0 +1,45 @@ +from django import forms + +from .models import Artista, Album, Song + + +class ArtistaForm(forms.ModelForm): + class Meta: + model = Artista + fields = ['nombre', 'biografia', 'foto'] + + nombre = forms.CharField( + widget=forms.TextInput(attrs={'class': 'form-control'})) + biografia = forms.CharField( + widget=forms.TextInput(attrs={'class': 'form-control'})) + + +class AlbumForm(forms.ModelForm): + class Meta: + model = Album + fields = ['name', 'artist', 'year', 'cover_image'] + + year = forms.DateField( + widget=forms.DateInput(attrs={'type': 'date', 'class': 'form-control'})) + + artist = forms.ModelChoiceField( + queryset=Artista.objects.all(), + widget=forms.Select(attrs={'class': 'form-control'})) + + + +class SongForm(forms.ModelForm): + class Meta: + model = Song + fields = ['title', 'artist', 'album', 'year', 'lyrics'] + + year = forms.DateField( + widget=forms.DateInput(attrs={'type': 'date', 'class': 'form-control'})) + + artist = forms.ModelChoiceField( + queryset=Artista.objects.all(), + widget=forms.Select(attrs={'class': 'form-control'})) + + album = forms.ModelChoiceField( + queryset=Album.objects.all(), # habría que seleccionar los álbumes del artista + widget=forms.Select(attrs={'class': 'form-control'})) diff --git a/ReyMotaAppsDj/reymota/lyrics/migrations/0001_initial.py b/ReyMotaAppsDj/reymota/lyrics/migrations/0001_initial.py new file mode 100644 index 0000000..538cf8c --- /dev/null +++ b/ReyMotaAppsDj/reymota/lyrics/migrations/0001_initial.py @@ -0,0 +1,52 @@ +# Generated by Django 4.2 on 2024-09-10 13:23 + +import django.core.validators +from django.db import migrations, models +import django.db.models.deletion +import lyrics.models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Album', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=200)), + ('year', models.PositiveBigIntegerField(default=2024, validators=[django.core.validators.MinValueValidator(1984), lyrics.models.max_value_current_year])), + ('cover_image', models.ImageField(blank=True, null=True, upload_to='cover_image/')), + ], + ), + migrations.CreateModel( + name='Artista', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('nombre', models.CharField(max_length=200)), + ('biografia', models.TextField(blank=True, null=True)), + ('foto', models.ImageField(blank=True, null=True, upload_to='artistas/')), + ], + ), + migrations.CreateModel( + name='Song', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('title', models.CharField(max_length=200)), + ('year', models.PositiveBigIntegerField(default=2024, validators=[django.core.validators.MinValueValidator(1984), lyrics.models.max_value_current_year])), + ('lyrics', models.CharField(max_length=1000)), + ('pista', models.DecimalField(blank=True, decimal_places=0, max_digits=5, null=True)), + ('album', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='lyrics.album')), + ('artist', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='lyrics.artista')), + ], + ), + migrations.AddField( + model_name='album', + name='artist', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='lyrics.artista'), + ), + ] diff --git a/ReyMotaAppsDj/reymota/lyrics/models.py b/ReyMotaAppsDj/reymota/lyrics/models.py index 71a8362..813ed35 100644 --- a/ReyMotaAppsDj/reymota/lyrics/models.py +++ b/ReyMotaAppsDj/reymota/lyrics/models.py @@ -1,3 +1,44 @@ from django.db import models +import datetime +from django.core.validators import MaxValueValidator, MinValueValidator +from django.utils.translation import gettext_lazy as _ + + +def current_year(): + return datetime.date.today().year + + +def max_value_current_year(value): + return MaxValueValidator(current_year())(value) + + +class Artista(models.Model): + nombre = models.CharField(max_length=200) + biografia = models.TextField(blank=True, null=True) + foto = models.ImageField(upload_to='artistas/', blank=True, null=True) # Nuevo campo + + def __str__(self): + return self.nombre + + +class Album(models.Model): + name = models.CharField(max_length=200) + artist = models.ForeignKey(Artista, on_delete=models.CASCADE) + year = models.PositiveBigIntegerField(default=current_year(), validators=[MinValueValidator(1984), max_value_current_year]) + cover_image = models.ImageField(upload_to='cover_image/', blank=True, null=True) # Nuevo campo + + def __str__(self): + return self.name + + +class Song(models.Model): + title = models.CharField(max_length=200) + artist = models.ForeignKey(Artista, on_delete=models.CASCADE) + album = models.ForeignKey(Album, on_delete=models.CASCADE) + year = models.PositiveBigIntegerField(default=current_year(), validators=[MinValueValidator(1984), max_value_current_year]) + lyrics = models.CharField(max_length=1000) + pista = models.DecimalField(max_digits=5, decimal_places=0, blank=True, null=True) + + def __str__(self): + return self.title -# Create your models here. diff --git a/ReyMotaAppsDj/reymota/lyrics/urls.py b/ReyMotaAppsDj/reymota/lyrics/urls.py new file mode 100644 index 0000000..81cac53 --- /dev/null +++ b/ReyMotaAppsDj/reymota/lyrics/urls.py @@ -0,0 +1,27 @@ + +from django.urls import path + +from . import views + +app_name='lyrics' + +urlpatterns = [ + path('', views.principal, name='principal'), + path('artistas/', views.lista_artistas, name='lista_artistas'), + path('artistas/nuevo/', views.nuevo_artista, name='nuevo_artista'), + path('artistas//', views.detalle_artista, name='detalle_artista'), + path('artistas//editar/', views.editar_artista, name='editar_artista'), + path('artistas//eliminar/', views.eliminar_artista, name='eliminar_artista'), + + path('album/', views.lista_albumes, name='lista_albumes'), + path('album/nuevo/', views.nuevo_album, name='nuevo_album'), + path('album//', views.detalle_album, name='detalle_album'), + path('album//editar/', views.editar_album, name='editar_album'), + path('album//eliminar/', views.eliminar_album, name='eliminar_album'), + + path('song/', views.lista_songs, name='lista_songs'), + path('song/nuevo/', views.nuevo_song, name='nuevo_song'), + path('song//', views.detalle_song, name='detalle_song'), + path('song//editar/', views.editar_song, name='editar_song'), + path('song//eliminar/', views.eliminar_song, name='eliminar_song'), +] diff --git a/ReyMotaAppsDj/reymota/lyrics/views.py b/ReyMotaAppsDj/reymota/lyrics/views.py index 91ea44a..dde48db 100644 --- a/ReyMotaAppsDj/reymota/lyrics/views.py +++ b/ReyMotaAppsDj/reymota/lyrics/views.py @@ -1,3 +1,196 @@ -from django.shortcuts import render - # Create your views here. +from django.shortcuts import render, get_object_or_404, redirect +from django.contrib.auth.decorators import login_required + +from .models import Artista, Album, Song +from .forms import ArtistaForm, AlbumForm, SongForm + + +@login_required +def principal(request): + artistas = Artista.objects.all() + albumes = Album.objects.all() + + return render(request, 'lyrics/index.html', {'artistas': artistas, 'albumes': albumes}) + + +######################### +# Vistas para los artistas +@login_required +def lista_artistas(request): + artistas = Artista.objects.all() + return render(request, 'lyrics/lista_artistas.html', {'artistas': artistas}) + + +@login_required +def detalle_artista(request, artista_id): + artista = get_object_or_404(Artista, pk=artista_id) + + albumes = Album.objects.filter(artista=artista_id) + + return render(request, 'lyrics/detalle_artista.html', {'artista': artista, 'albumes': albumes}) + + +@login_required +def nuevo_artista(request): + if request.method == 'POST': + form = ArtistaForm(request.POST, request.FILES) + if form.is_valid(): + form.save() + return redirect('lyrics:lista_artistas') + else: + form = ArtistaForm() + return render(request, 'lyrics/form_artista.html', {'form': form}) + + +@login_required +def editar_artista(request, artista_id): + artista = get_object_or_404(Artista, pk=artista_id) + if request.method == 'POST': + form = ArtistaForm(request.POST, request.FILES, instance=artista) + if form.is_valid(): + form.save() + return redirect('lyrics:lista_artistas') + else: + form = ArtistaForm(instance=artista) + return render(request, 'lyrics/form_artista.html', {'form': form}) + + +@login_required +def eliminar_artista(request, artista_id): + artista = get_object_or_404(Artista, pk=artista_id) + artista.delete() + return redirect('lyrics:lista_artistas') + + +######################### +# Vistas para los albumes +@login_required +def lista_albumes(request): + albumes = Album.objects.all() + return render(request, 'lyrics/lista_albumes.html', {'albumes': albumes}) + + +@login_required +def detalle_album(request, album_id): + album = get_object_or_404(Album, pk=album_id) + return render(request, 'lyrics/detalle_album.html', {'album': album}) + + +@login_required +def nuevo_album(request): + + artistas = Artista.objects.all() # vamos a ver si hay vehículos dados de alta + + if artistas: + if request.method == 'POST': + form = AlbumForm(request.POST, request.FILES) + if form.is_valid(): + instancia = form.save(commit=False) + + aplica_descuento = form.cleaned_data['aplica_descuento'] + + if aplica_descuento: + instancia.descuento = float(instancia.importe) * 0.03 + else: + instancia.descuento = 0.0 + + instancia.importe = float(instancia.importe) - instancia.descuento + + if instancia.litros > 0: + instancia.precioxlitro = round(instancia.importe / float(instancia.litros), 2) + else: + instancia.precioxlitro = 0 + + # lee todos los albumes del vehículo + # albumes = Albums.query.filter_by(artista_id=artista_id).all() + + if Album.objects.filter(artista_id=instancia.artista): + albumes = Album.objects.filter(artista_id=instancia.artista).order_by('-fecha')[0] + + instancia.kmsrecorridos = instancia.kms - albumes.kms + + if instancia.kmsrecorridos > 0: + instancia.consumo = round(instancia.litros * 100 / instancia.kmsrecorridos, 2) + else: + instancia.kmsrecorridos = 0 + instancia.consumo = 0 + + instancia.save() + + return redirect('lyrics:lista_albumes') + else: + form = AlbumForm() + return render(request, 'lyrics/form_album.html', {'form': form}) + else: + return render(request, 'lyrics/index.html') + + +@login_required +def editar_album(request, album_id): + album = get_object_or_404(Album, pk=album_id) + + if request.method == 'POST': + form = AlbumForm(request.POST, request.FILES, instance=album) + if form.is_valid(): + form.save() + return redirect('lyrics:lista_albumes') + else: + form = AlbumForm(instance=album) + return render(request, 'lyrics/form_album.html', {'form': form}) + + +@login_required +def eliminar_album(request, album_id): + album = Album.objects.get(pk=album_id) + album.delete() + return redirect('lyrics:lista_albumes') + + +######################### +# Vistas para los songs +@login_required +def lista_songs(request): + songs = Song.objects.all() + return render(request, 'lyrics/lista_songs.html', {'songs': songs}) + + +@login_required +def detalle_song(request, song_id): + song = get_object_or_404(Song, pk=song_id) + + albumes = Album.objects.filter(song=song_id) + + return render(request, 'lyrics/detalle_song.html', {'song': song, 'albumes': albumes}) + + +@login_required +def nuevo_song(request): + if request.method == 'POST': + form = SongForm(request.POST, request.FILES) + if form.is_valid(): + form.save() + return redirect('lyrics:lista_songs') + else: + form = SongForm() + return render(request, 'lyrics/form_song.html', {'form': form}) + + +@login_required +def editar_song(request, song_id): + song = get_object_or_404(Song, pk=song_id) + if request.method == 'POST': + form = SongForm(request.POST, request.FILES, instance=song) + if form.is_valid(): + form.save() + return redirect('lyrics:lista_songs') + else: + form = SongForm(instance=song) + return render(request, 'lyrics/form_song.html', {'form': form}) + + +@login_required +def eliminar_song(request, song_id): + song = get_object_or_404(Song, pk=song_id) + song.delete() + return redirect('lyrics:lista_songs') diff --git a/ReyMotaAppsDj/reymota/reymota/settings.py b/ReyMotaAppsDj/reymota/reymota/settings.py index 298bc4e..857a39c 100644 --- a/ReyMotaAppsDj/reymota/reymota/settings.py +++ b/ReyMotaAppsDj/reymota/reymota/settings.py @@ -42,6 +42,7 @@ INSTALLED_APPS = [ 'repostajes', 'libros', 'reymotausers', + 'lyrics', ] MIDDLEWARE = [ diff --git a/ReyMotaAppsDj/reymota/reymota/urls.py b/ReyMotaAppsDj/reymota/reymota/urls.py index 52b72e4..a7b653f 100644 --- a/ReyMotaAppsDj/reymota/reymota/urls.py +++ b/ReyMotaAppsDj/reymota/reymota/urls.py @@ -27,6 +27,8 @@ urlpatterns = [ path('repostajes/', include('repostajes.urls')), + path('lyrics/', include('lyrics.urls')), + path("accounts/", include("accounts.urls")), # new path("accounts/", include("django.contrib.auth.urls")), diff --git a/ReyMotaAppsDj/reymota/templates/_cabecera.html b/ReyMotaAppsDj/reymota/templates/_cabecera.html index ea087eb..3646a1a 100644 --- a/ReyMotaAppsDj/reymota/templates/_cabecera.html +++ b/ReyMotaAppsDj/reymota/templates/_cabecera.html @@ -97,7 +97,8 @@ diff --git a/ReyMotaAppsDj/reymota/templates/lyrics/detalle_album.html b/ReyMotaAppsDj/reymota/templates/lyrics/detalle_album.html new file mode 100644 index 0000000..3e8557a --- /dev/null +++ b/ReyMotaAppsDj/reymota/templates/lyrics/detalle_album.html @@ -0,0 +1,24 @@ + +{% extends 'base.html' %} + +{% block content %} +
+
+
+
+
+

{{ album.name }}

+ + +
+ +
+
+
+{% endblock %} diff --git a/ReyMotaAppsDj/reymota/templates/lyrics/detalle_artista.html b/ReyMotaAppsDj/reymota/templates/lyrics/detalle_artista.html new file mode 100644 index 0000000..e60f809 --- /dev/null +++ b/ReyMotaAppsDj/reymota/templates/lyrics/detalle_artista.html @@ -0,0 +1,62 @@ +{% extends 'base.html' %} + +{% block content %} +
+
+
+
+
+ {% if artista.foto %} +

{{ artista.nombre}}

+ {% else %} +

No hay imágen disponible

+ {% endif %} +
+
+

{{ artista.nombre }}

+ +
    +
  • {{ artista.nombre }}
  • +
+
+
+
+
+ + {% if albumes %} + + + + + + + + + + {% for album in albumes %} + + + + + + {% endfor %} + +
TítuloArtistaYear
{{ album.name }}{{ album.artist }}{{ album.year }}
+ {% else %} +

No se han encontrado albums para este artista

+ {% endif %} +
+
+ + +
+{% endblock %} + diff --git a/ReyMotaAppsDj/reymota/templates/lyrics/detalle_song.html b/ReyMotaAppsDj/reymota/templates/lyrics/detalle_song.html new file mode 100644 index 0000000..ccd2209 --- /dev/null +++ b/ReyMotaAppsDj/reymota/templates/lyrics/detalle_song.html @@ -0,0 +1,32 @@ + +{% extends 'base.html' %} + +{% block content %} +
+
+
+
+
+

{{ repostaje.fecha }}

+ +
    +
  • {{ repostaje.vehiculo.matricula }}
  • +
  • |
  • +
  • {{ repostaje.kms }} kms
  • +
  • |
  • +
  • {{ repostaje.litros }} litros
  • +
  • |
  • +
  • {{ repostaje.importe }} €
  • +
  • |
  • +
  • {{ repostaje.kmsrecorridos }} kms. recorridos
  • +
  • |
  • +
  • {{ repostaje.consumo }} litros/100 kms
  • +
  • |
  • +
  • {{ repostaje.precioxlitro }} €/litros
  • +
+
+ +
+
+
+{% endblock %} diff --git a/ReyMotaAppsDj/reymota/templates/lyrics/form_album.html b/ReyMotaAppsDj/reymota/templates/lyrics/form_album.html new file mode 100644 index 0000000..f953113 --- /dev/null +++ b/ReyMotaAppsDj/reymota/templates/lyrics/form_album.html @@ -0,0 +1,17 @@ +{% extends 'base.html' %} + +{% block content %} +
+

{% if form.instance.pk %}Editar álbum{% else %}Nuevo álbum{% endif %}

+
+
+ {% csrf_token %} + {{ form.as_p }} +
+ +
+
+ {{ form.media }} +
+
+{% endblock %} diff --git a/ReyMotaAppsDj/reymota/templates/lyrics/form_artista.html b/ReyMotaAppsDj/reymota/templates/lyrics/form_artista.html new file mode 100644 index 0000000..5878355 --- /dev/null +++ b/ReyMotaAppsDj/reymota/templates/lyrics/form_artista.html @@ -0,0 +1,17 @@ +{% extends 'base.html' %} + +{% block content %} +
+ +

{% if form.instance.pk %}Editar artista{% else %}Nuevo artista{% endif %}

+
+
+ {% csrf_token %} + {{ form.as_p }} +
+ +
+
+
+
+{% endblock %} diff --git a/ReyMotaAppsDj/reymota/templates/lyrics/form_song.html b/ReyMotaAppsDj/reymota/templates/lyrics/form_song.html new file mode 100644 index 0000000..d85edb9 --- /dev/null +++ b/ReyMotaAppsDj/reymota/templates/lyrics/form_song.html @@ -0,0 +1,17 @@ +{% extends 'base.html' %} + +{% block content %} +
+

{% if form.instance.pk %}Editar repostaje{% else %}Nuevo repostaje{% endif %}

+
+
+ {% csrf_token %} + {{ form.as_p }} +
+ +
+
+ {{ form.media }} +
+
+{% endblock %} diff --git a/ReyMotaAppsDj/reymota/templates/lyrics/index.html b/ReyMotaAppsDj/reymota/templates/lyrics/index.html new file mode 100644 index 0000000..d7d190e --- /dev/null +++ b/ReyMotaAppsDj/reymota/templates/lyrics/index.html @@ -0,0 +1,64 @@ +{% extends 'base.html' %} + +{% block content %} + +
+ +

Introducción

+ + + +
+
+ +
+
+ + + + +
+

Artistas

+

Listado de vehículoss

+
+ +
+
+ + + + +
+

Álbumes

+

Relación de repostajes

+
+ +
+
+ + + + +
+

Canciones

+

Listado de vehículoss

+
+
+
+
+ +{% endblock %} diff --git a/ReyMotaAppsDj/reymota/templates/lyrics/lista_albumes.html b/ReyMotaAppsDj/reymota/templates/lyrics/lista_albumes.html new file mode 100644 index 0000000..29c7bf2 --- /dev/null +++ b/ReyMotaAppsDj/reymota/templates/lyrics/lista_albumes.html @@ -0,0 +1,57 @@ + +{% extends 'base.html' %} + +{% block content %} +
+
+
+

Álbumes

+
+
+
+
+
+ +
+
+
+ + +
+
+ + + + + + + + + + + + + + + {% for repostaje in repostajes %} + + + + + + + + + + + + + + + {% endfor %} +
FechaVehículoKilómetrosLitrosImporteDescuentoPrecio por litroKms recorridosConsumo/100 kms
{{ repostaje.fecha }}{{ repostaje.vehiculo.matricula }}{{ repostaje.kms }}{{ repostaje.litros }}{{ repostaje.importe }} €{{ repostaje.descuento }} €{{ repostaje.precioxlitro }} €{{ repostaje.kmsrecorridos }}{{ repostaje.consumo }}
+
+
+{% endblock %} diff --git a/ReyMotaAppsDj/reymota/templates/lyrics/lista_artistas.html b/ReyMotaAppsDj/reymota/templates/lyrics/lista_artistas.html new file mode 100644 index 0000000..24ec06d --- /dev/null +++ b/ReyMotaAppsDj/reymota/templates/lyrics/lista_artistas.html @@ -0,0 +1,65 @@ +{% extends 'base.html' %} + +{% block content %} +
+ +
+
+

Artistas

+
+
+
+
+
+ +
+
+
+ +
+ {% for artista in artistas %} +
+
+
+ + {% if artista.foto %} + Foto del artista + {% else %} + Sin imágen + {% endif %} +

{{ artista.matricula}}

+ +
+ + +
+
+
+ {% endfor %} +
+
+{% endblock %} diff --git a/ReyMotaAppsDj/reymota/templates/lyrics/lista_songs.html b/ReyMotaAppsDj/reymota/templates/lyrics/lista_songs.html new file mode 100644 index 0000000..7b7fbd6 --- /dev/null +++ b/ReyMotaAppsDj/reymota/templates/lyrics/lista_songs.html @@ -0,0 +1,57 @@ + +{% extends 'base.html' %} + +{% block content %} +
+
+
+

Repostajes

+
+
+
+
+ +
+
+ + +
+
+ + + + + + + + + + + + + + + {% for repostaje in repostajes %} + + + + + + + + + + + + + + + {% endfor %} +
FechaVehículoKilómetrosLitrosImporteDescuentoPrecio por litroKms recorridosConsumo/100 kms
{{ repostaje.fecha }}{{ repostaje.vehiculo.matricula }}{{ repostaje.kms }}{{ repostaje.litros }}{{ repostaje.importe }} €{{ repostaje.descuento }} €{{ repostaje.precioxlitro }} €{{ repostaje.kmsrecorridos }}{{ repostaje.consumo }}
+
+
+{% endblock %}