Browse Source

Nueva canción desde album pone arista,año y album

politica
Celestino Rey 1 year ago
parent
commit
e133cc81b2
4 changed files with 12 additions and 4 deletions
  1. +1
    -1
      ReyMotaAppsDj/K8S/Makefile.local
  2. +9
    -1
      ReyMotaAppsDj/reymota/lyrics/views.py
  3. +1
    -1
      ReyMotaAppsDj/reymota/templates/lyrics/detalle_album.html
  4. +1
    -1
      ReyMotaAppsDj/reymota/templates/lyrics/form_song.html

+ 1
- 1
ReyMotaAppsDj/K8S/Makefile.local View File

@ -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


+ 9
- 1
ReyMotaAppsDj/reymota/lyrics/views.py View File

@ -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})


+ 1
- 1
ReyMotaAppsDj/reymota/templates/lyrics/detalle_album.html View File

@ -66,7 +66,7 @@
<div class="page-utilities">
<div class="row g-4 justify-content-start justify-content-md-end align-items-center">
<div class="col-auto">
<a class="btn app-btn-primary" href="{% url 'lyrics:nuevo_song' %}">Añadir canción</a>
<a class="btn app-btn-primary" href="{% url 'lyrics:nuevo_song' %}?album_id={{ album.id}}">Añadir canción</a>
</div>
</div><!--//row-->
</div><!--//table-utilities-->


+ 1
- 1
ReyMotaAppsDj/reymota/templates/lyrics/form_song.html View File

@ -8,7 +8,7 @@
{% block content %}
<div class="column is-4 is-offset-4">
<h3>{% if form.instance.pk %}Editar repostaje{% else %}Nuevo repostaje{% endif %}</h3>
<h3>{% if form.instance.pk %}Editar canción{% else %}Nueva canción{% endif %}</h3>
<div class="box">
<form method="POST" enctype="multipart/form-data">
{% csrf_token %}


Loading…
Cancel
Save