mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-01 04:10:06 -05:00
display of external recipes
This commit is contained in:
@@ -191,7 +191,7 @@ class RecipeSerializer(WritableNestedModelSerializer):
|
||||
fields = (
|
||||
'id', 'name', 'image', 'keywords', 'steps', 'working_time',
|
||||
'waiting_time', 'created_by', 'created_at', 'updated_at',
|
||||
'internal', 'nutrition', 'servings'
|
||||
'internal', 'nutrition', 'servings', 'file_path'
|
||||
)
|
||||
read_only_fields = ['image', 'created_by', 'created_at']
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
|
||||
<script type="application/javascript">
|
||||
window.RECIPE_ID = 6;
|
||||
window.RECIPE_ID = {{pk}};
|
||||
window.USER_PREF = {
|
||||
'use_fractions': {% if request.user.userpreference.use_fractions %} true {% else %} false {% endif %},
|
||||
'ingredient_decimals': {{ request.user.userpreference.ingredient_decimals }},
|
||||
|
||||
@@ -56,7 +56,7 @@ urlpatterns = [
|
||||
),
|
||||
name='service_worker'
|
||||
),
|
||||
path('test/', views.test, name='view_test'),
|
||||
path('test/<int:pk>', views.test, name='view_test'),
|
||||
|
||||
path('import/', import_export.import_recipe, name='view_import'),
|
||||
path('export/', import_export.export_recipe, name='view_export'),
|
||||
|
||||
@@ -493,8 +493,8 @@ def offline(request):
|
||||
return render(request, 'offline.html', {})
|
||||
|
||||
|
||||
def test(request):
|
||||
def test(request, pk):
|
||||
if not settings.DEBUG:
|
||||
return HttpResponseRedirect(reverse('index'))
|
||||
|
||||
return render(request, 'test.html', {'test': None})
|
||||
return render(request, 'test.html', {'pk': pk})
|
||||
|
||||
Reference in New Issue
Block a user