added loading spinner and made new view the main recipe view

This commit is contained in:
vabene1111
2021-01-13 20:59:31 +01:00
parent 948eb9be3e
commit 9e5a7b2cc0
6 changed files with 146 additions and 774 deletions

View File

@@ -153,7 +153,6 @@ def recipe_view(request, pk, share=None):
)
comment_form = CommentForm()
bookmark_form = RecipeBookEntryForm()
user_servings = None
if request.user.is_authenticated:
@@ -172,18 +171,7 @@ def recipe_view(request, pk, share=None):
.exists():
ViewLog.objects.create(recipe=recipe, created_by=request.user)
return render(
request,
'recipe_view.html',
{
'recipe': recipe,
'comments': comments,
'comment_form': comment_form,
'bookmark_form': bookmark_form,
'share': share,
'user_servings': user_servings
}
)
return render(request, 'recipe_view.html', {'recipe': recipe, 'comments': comments, 'comment_form': comment_form, 'share': share, 'user_servings': user_servings})
@group_required('user')