diff --git a/cookbook/templates/test.html b/cookbook/templates/test.html index d36a8adc9..629d81bef 100644 --- a/cookbook/templates/test.html +++ b/cookbook/templates/test.html @@ -1,26 +1,33 @@ {% extends "base.html" %} -{% load crispy_forms_filters %} -{% load i18n %} +{% load render_bundle from webpack_loader %} {% load static %} +{% load i18n %} +{% load l10n %} + + +{% block title %}Test{% endblock %} + + +{% block content_fluid %} + +
+ +
-{% block title %}{% trans 'Import Recipes' %}{% endblock %} -{% block extra_head %} - {{ form.media }} {% endblock %} -{% block content %} -

{% trans 'Import' %}

-
-
-
- {% csrf_token %} - {{ form|crispy }} - -
-
-
+{% block script %} + {% if debug %} + + {% else %} + + {% endif %} + + + {% render_bundle 'import_view' %} {% endblock %} \ No newline at end of file diff --git a/cookbook/views/views.py b/cookbook/views/views.py index 26d80f6be..2d298547b 100644 --- a/cookbook/views/views.py +++ b/cookbook/views/views.py @@ -647,11 +647,7 @@ def test(request): if not settings.DEBUG: return HttpResponseRedirect(reverse('index')) - with scopes_disabled(): - result = ShoppingList.objects.filter( - Q(created_by=request.user) | Q(shared=request.user)).filter( - space=request.space).values().distinct() - return JsonResponse(list(result), safe=False, json_dumps_params={'indent': 2}) + return render(request, 'test.html', {}) def test2(request): diff --git a/vue/src/apps/ImportView/ImportView.vue b/vue/src/apps/ImportView/ImportView.vue new file mode 100644 index 000000000..8761aefe4 --- /dev/null +++ b/vue/src/apps/ImportView/ImportView.vue @@ -0,0 +1,47 @@ + + + + + diff --git a/vue/src/apps/ImportView/main.js b/vue/src/apps/ImportView/main.js new file mode 100644 index 000000000..f55808a72 --- /dev/null +++ b/vue/src/apps/ImportView/main.js @@ -0,0 +1,18 @@ +import Vue from 'vue' +import App from './ImportView.vue' +import i18n from '@/i18n' + +Vue.config.productionTip = false + +// TODO move this and other default stuff to centralized JS file (verify nothing breaks) +let publicPath = localStorage.STATIC_URL + 'vue/' +if (process.env.NODE_ENV === 'development') { + publicPath = 'http://localhost:8080/' +} +export default __webpack_public_path__ = publicPath // eslint-disable-line + + +new Vue({ + i18n, + render: h => h(App), +}).$mount('#app') diff --git a/vue/vue.config.js b/vue/vue.config.js index a94390ce8..a4b0c98be 100644 --- a/vue/vue.config.js +++ b/vue/vue.config.js @@ -13,6 +13,10 @@ const pages = { entry: "./src/apps/OfflineView/main.js", chunks: ["chunk-vendors"], }, + import_view: { + entry: "./src/apps/ImportView/main.js", + chunks: ["chunk-vendors"], + }, import_response_view: { entry: "./src/apps/ImportResponseView/main.js", chunks: ["chunk-vendors"],