mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-01 12:18:45 -05:00
first vue 3 commit
This commit is contained in:
21
cookbook/static/vue3/assets/main-Ck0XzBN_.js
Normal file
21
cookbook/static/vue3/assets/main-Ck0XzBN_.js
Normal file
File diff suppressed because one or more lines are too long
7
cookbook/static/vue3/manifest.json
Normal file
7
cookbook/static/vue3/manifest.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"src/apps/tandoor/main.ts": {
|
||||
"file": "assets/main-Ck0XzBN_.js",
|
||||
"src": "src/apps/tandoor/main.ts",
|
||||
"isEntry": true
|
||||
}
|
||||
}
|
||||
11
cookbook/templates/frontend/tandoor.html
Normal file
11
cookbook/templates/frontend/tandoor.html
Normal file
@@ -0,0 +1,11 @@
|
||||
{% load django_vite %}
|
||||
|
||||
|
||||
{% vite_hmr_client %}
|
||||
{% vite_asset 'src/apps/tandoor/main.ts' %}
|
||||
|
||||
<script src="{% url 'js_reverse' %}"></script>
|
||||
|
||||
<div id="app">
|
||||
|
||||
</div>
|
||||
@@ -73,6 +73,7 @@ for p in PLUGINS:
|
||||
|
||||
urlpatterns = [
|
||||
path('', views.index, name='index'),
|
||||
path('v3/', views.vue3, name='vue3'),
|
||||
path('setup/', views.setup, name='view_setup'),
|
||||
path('no-group', views.no_groups, name='view_no_group'),
|
||||
path('space-overview', views.space_overview, name='view_space_overview'),
|
||||
|
||||
@@ -50,7 +50,7 @@ def index(request):
|
||||
|
||||
# TODO need to deprecate
|
||||
def search(request):
|
||||
if has_group_permission(request.user, ('guest', )):
|
||||
if has_group_permission(request.user, ('guest',)):
|
||||
return render(request, 'search.html', {})
|
||||
else:
|
||||
if request.user.is_authenticated:
|
||||
@@ -130,7 +130,7 @@ def recipe_view(request, pk, share=None):
|
||||
messages.add_message(request, messages.ERROR, _('You do not have the required permissions to view this page!'))
|
||||
return HttpResponseRedirect(reverse('account_login') + '?next=' + request.path)
|
||||
|
||||
if not (has_group_permission(request.user, ('guest', )) and recipe.space == request.space) and not share_link_valid(recipe, share):
|
||||
if not (has_group_permission(request.user, ('guest',)) and recipe.space == request.space) and not share_link_valid(recipe, share):
|
||||
messages.add_message(request, messages.ERROR, _('You do not have the required permissions to view this page!'))
|
||||
return HttpResponseRedirect(reverse('index'))
|
||||
|
||||
@@ -160,8 +160,7 @@ def recipe_view(request, pk, share=None):
|
||||
if request.method == "GET":
|
||||
servings = request.GET.get("servings")
|
||||
return render(request, 'recipe_view.html',
|
||||
{'recipe': recipe, 'comments': comments, 'comment_form': comment_form, 'share': share, 'servings': servings })
|
||||
|
||||
{'recipe': recipe, 'comments': comments, 'comment_form': comment_form, 'share': share, 'servings': servings})
|
||||
|
||||
|
||||
@group_required('user')
|
||||
@@ -451,19 +450,19 @@ def web_manifest(request):
|
||||
|
||||
manifest_info = {
|
||||
"name":
|
||||
theme_values['app_name'], "short_name":
|
||||
theme_values['app_name'], "description":
|
||||
_("Manage recipes, shopping list, meal plans and more."), "icons":
|
||||
icons, "start_url":
|
||||
"./search", "background_color":
|
||||
theme_values['nav_bg_color'], "display":
|
||||
"standalone", "scope":
|
||||
".", "theme_color":
|
||||
theme_values['nav_bg_color'], "shortcuts":
|
||||
[{"name": _("Plan"), "short_name": _("Plan"), "description": _("View your meal Plan"), "url":
|
||||
"./plan"}, {"name": _("Books"), "short_name": _("Books"), "description": _("View your cookbooks"), "url": "./books"},
|
||||
{"name": _("Shopping"), "short_name": _("Shopping"), "description": _("View your shopping lists"), "url":
|
||||
"./list/shopping-list/"}], "share_target": {"action": "/data/import/url", "method": "GET", "params": {"title": "title", "url": "url", "text": "text"}}
|
||||
theme_values['app_name'], "short_name":
|
||||
theme_values['app_name'], "description":
|
||||
_("Manage recipes, shopping list, meal plans and more."), "icons":
|
||||
icons, "start_url":
|
||||
"./search", "background_color":
|
||||
theme_values['nav_bg_color'], "display":
|
||||
"standalone", "scope":
|
||||
".", "theme_color":
|
||||
theme_values['nav_bg_color'], "shortcuts":
|
||||
[{"name": _("Plan"), "short_name": _("Plan"), "description": _("View your meal Plan"), "url":
|
||||
"./plan"}, {"name": _("Books"), "short_name": _("Books"), "description": _("View your cookbooks"), "url": "./books"},
|
||||
{"name": _("Shopping"), "short_name": _("Shopping"), "description": _("View your shopping lists"), "url":
|
||||
"./list/shopping-list/"}], "share_target": {"action": "/data/import/url", "method": "GET", "params": {"title": "title", "url": "url", "text": "text"}}
|
||||
}
|
||||
|
||||
return JsonResponse(manifest_info, json_dumps_params={'indent': 4})
|
||||
@@ -504,6 +503,11 @@ def test2(request):
|
||||
return HttpResponseRedirect(reverse('index'))
|
||||
|
||||
|
||||
@group_required('admin')
|
||||
def vue3(request):
|
||||
return render(request, 'frontend/tandoor.html', {})
|
||||
|
||||
|
||||
def get_orphan_files(delete_orphans=False):
|
||||
# Get list of all image files in media folder
|
||||
media_dir = settings.MEDIA_ROOT
|
||||
|
||||
Reference in New Issue
Block a user