diff --git a/ReyMotaAppsDj/K8S/Makefile.local b/ReyMotaAppsDj/K8S/Makefile.local index b4ddfed..328bb61 100644 --- a/ReyMotaAppsDj/K8S/Makefile.local +++ b/ReyMotaAppsDj/K8S/Makefile.local @@ -2,7 +2,7 @@ export ARQUITECTURA := $(shell lscpu |grep itectur | tr -d ' '| cut -f2 -d':') export REGISTRY=localhost:30500 #export REGISTRY=registry.reymota.es -export IMG_VERSION = 0.60 +export IMG_VERSION = 0.63 export IMG_NGINX_VERSION = 1.0 # limpia todo diff --git a/ReyMotaAppsDj/reymota/lyrics/views.py b/ReyMotaAppsDj/reymota/lyrics/views.py index 984c13e..9c1ab61 100644 --- a/ReyMotaAppsDj/reymota/lyrics/views.py +++ b/ReyMotaAppsDj/reymota/lyrics/views.py @@ -141,6 +141,8 @@ def detalle_song(request, song_id): @login_required def nuevo_song(request): + album_id = request.GET.get('album_id') # Obtener el album_id de los parámetros de la URL + if request.method == 'POST': form = SongForm(request.POST, request.FILES) if form.is_valid(): @@ -158,7 +160,13 @@ def nuevo_song(request): return redirect('lyrics:lista_songs') else: - form = SongForm() + if album_id: + # Si tenemos un album_id, preseleccionamos ese álbum en el formulario + album = get_object_or_404(Album, id=album_id) + form = SongForm(initial={'album': album, 'artist': album.artist, 'year': album.year}) + else: + form = SongForm() + return render(request, 'lyrics/form_song.html', {'form': form}) diff --git a/ReyMotaAppsDj/reymota/templates/lyrics/detalle_album.html b/ReyMotaAppsDj/reymota/templates/lyrics/detalle_album.html index 62ee8ee..d471dc0 100644 --- a/ReyMotaAppsDj/reymota/templates/lyrics/detalle_album.html +++ b/ReyMotaAppsDj/reymota/templates/lyrics/detalle_album.html @@ -66,7 +66,7 @@
diff --git a/ReyMotaAppsDj/reymota/templates/lyrics/form_song.html b/ReyMotaAppsDj/reymota/templates/lyrics/form_song.html index 9357c8c..0b7e183 100644 --- a/ReyMotaAppsDj/reymota/templates/lyrics/form_song.html +++ b/ReyMotaAppsDj/reymota/templates/lyrics/form_song.html @@ -8,7 +8,7 @@ {% block content %}
-

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

+

{% if form.instance.pk %}Editar canción{% else %}Nueva canción{% endif %}

{% csrf_token %}