mirror of
https://github.com/TrentSPalmer/trentpalmerdotorg.git
synced 2024-11-25 02:41:30 -08:00
fix edit_feed redirect, add edit_feed link to feed view
This commit is contained in:
parent
2b10df12ed
commit
8cf2ba0edf
@ -17,6 +17,13 @@
|
|||||||
<div class="col-0 col-sm-3">
|
<div class="col-0 col-sm-3">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-sm-6 px-0 mx-0">
|
<div class="col-12 col-sm-6 px-0 mx-0">
|
||||||
|
{% if user.is_authenticated %}
|
||||||
|
{% if view == 'feed' %}
|
||||||
|
<div class="text-center mb-3">
|
||||||
|
<a href="{% url 'audio:edit_feed' pk=feed_pk title_slug=feed_slug %}">Edit Feed?</a>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
{% for j in episodes %}
|
{% for j in episodes %}
|
||||||
<div class="card mx-1 mb-3">
|
<div class="card mx-1 mb-3">
|
||||||
<h3 class="text-center mt-2">
|
<h3 class="text-center mt-2">
|
||||||
|
@ -19,8 +19,9 @@ def feed(request, pk, slug):
|
|||||||
return render(
|
return render(
|
||||||
request, 'audio/index.html',
|
request, 'audio/index.html',
|
||||||
{
|
{
|
||||||
'episodes': episodes, 'IMAGES_URL': IMAGES_URL,
|
'episodes': episodes, 'IMAGES_URL': IMAGES_URL, 'view': 'feed',
|
||||||
'MP3_URL': MP3_URL, 'title': feed.title, 'heading': feed.title
|
'MP3_URL': MP3_URL, 'title': feed.title, 'heading': feed.title,
|
||||||
|
'feed_pk': pk, 'feed_slug': slug,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
@ -70,7 +71,7 @@ def edit_feed(request, pk, title_slug):
|
|||||||
form = FeedForm(request.POST, request.FILES, instance=feed)
|
form = FeedForm(request.POST, request.FILES, instance=feed)
|
||||||
if form.is_valid():
|
if form.is_valid():
|
||||||
feed.save()
|
feed.save()
|
||||||
return redirect('audio:new_feed')
|
return redirect('audio:feed', pk=pk, slug=title_slug)
|
||||||
else:
|
else:
|
||||||
form = FeedForm(instance=feed)
|
form = FeedForm(instance=feed)
|
||||||
return render(
|
return render(
|
||||||
|
Loading…
Reference in New Issue
Block a user