mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-01 04:10:06 -05:00
remove recipebook and recipebookentry pages
This commit is contained in:
@@ -1,32 +0,0 @@
|
|||||||
{% extends "base.html" %}
|
|
||||||
{% load render_bundle from webpack_loader %}
|
|
||||||
{% load static %}
|
|
||||||
{% load i18n %}
|
|
||||||
{% load l10n %}
|
|
||||||
|
|
||||||
{% block title %}{% trans 'Profile' %}{% endblock %}
|
|
||||||
|
|
||||||
{% block content %}
|
|
||||||
|
|
||||||
<div id="app" >
|
|
||||||
<profile-view></profile-view>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
|
|
||||||
{% block script %}
|
|
||||||
{% if debug %}
|
|
||||||
<script src="{% url 'js_reverse' %}"></script>
|
|
||||||
{% else %}
|
|
||||||
<script src="{% static 'django_js_reverse/reverse.js' %}"></script>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<script type="application/javascript">
|
|
||||||
|
|
||||||
window.CUSTOM_LOCALE = '{{ request.LANGUAGE_CODE }}'
|
|
||||||
</script>
|
|
||||||
|
|
||||||
{% render_bundle 'profile_view' %}
|
|
||||||
{% endblock %}
|
|
||||||
@@ -8,16 +8,16 @@ from rest_framework.schemas import get_schema_view
|
|||||||
from cookbook.version_info import TANDOOR_VERSION
|
from cookbook.version_info import TANDOOR_VERSION
|
||||||
from recipes.settings import DEBUG, PLUGINS
|
from recipes.settings import DEBUG, PLUGINS
|
||||||
|
|
||||||
from .models import (Automation, Comment, CustomFilter, Food, InviteLink, Keyword, PropertyType,
|
from .models import (Automation, Comment, CustomFilter, Food, InviteLink, Keyword, PropertyType, Recipe, RecipeImport, Space, Step, Storage, Supermarket, SupermarketCategory,
|
||||||
Recipe, RecipeBook, RecipeBookEntry, RecipeImport, Space, Step,
|
Sync, SyncLog, Unit, UnitConversion, UserFile, UserSpace, get_model_name,
|
||||||
Storage, Supermarket, SupermarketCategory, Sync, SyncLog, Unit, UnitConversion,
|
)
|
||||||
UserFile, UserSpace, get_model_name)
|
|
||||||
from .views import api, data, delete, edit, import_export, lists, new, telegram, views
|
from .views import api, data, delete, edit, import_export, lists, new, telegram, views
|
||||||
from .views.api import CustomAuthToken, ImportOpenData
|
from .views.api import CustomAuthToken, ImportOpenData
|
||||||
|
|
||||||
|
|
||||||
# extend DRF default router class to allow including additional routers
|
# extend DRF default router class to allow including additional routers
|
||||||
class DefaultRouter(routers.DefaultRouter):
|
class DefaultRouter(routers.DefaultRouter):
|
||||||
|
|
||||||
def extend(self, r):
|
def extend(self, r):
|
||||||
self.registry.extend(r.registry)
|
self.registry.extend(r.registry)
|
||||||
|
|
||||||
@@ -76,7 +76,6 @@ urlpatterns = [
|
|||||||
path('space-overview', views.space_overview, name='view_space_overview'),
|
path('space-overview', views.space_overview, name='view_space_overview'),
|
||||||
path('space-manage/<int:space_id>', views.space_manage, name='view_space_manage'),
|
path('space-manage/<int:space_id>', views.space_manage, name='view_space_manage'),
|
||||||
path('switch-space/<int:space_id>', views.switch_space, name='view_switch_space'),
|
path('switch-space/<int:space_id>', views.switch_space, name='view_switch_space'),
|
||||||
path('profile/<int:user_id>', views.view_profile, name='view_profile'),
|
|
||||||
path('no-perm', views.no_perm, name='view_no_perm'),
|
path('no-perm', views.no_perm, name='view_no_perm'),
|
||||||
path('invite/<slug:token>', views.invite_link, name='view_invite'),
|
path('invite/<slug:token>', views.invite_link, name='view_invite'),
|
||||||
path('system/', views.system, name='view_system'),
|
path('system/', views.system, name='view_system'),
|
||||||
@@ -90,28 +89,22 @@ urlpatterns = [
|
|||||||
path('ingredient-editor/', views.ingredient_editor, name='view_ingredient_editor'),
|
path('ingredient-editor/', views.ingredient_editor, name='view_ingredient_editor'),
|
||||||
path('property-editor/<int:pk>', views.property_editor, name='view_property_editor'),
|
path('property-editor/<int:pk>', views.property_editor, name='view_property_editor'),
|
||||||
path('abuse/<slug:token>', views.report_share_abuse, name='view_report_share_abuse'),
|
path('abuse/<slug:token>', views.report_share_abuse, name='view_report_share_abuse'),
|
||||||
|
|
||||||
path('api/import/', api.import_files, name='view_import'),
|
path('api/import/', api.import_files, name='view_import'),
|
||||||
path('import-response/<int:pk>/', import_export.import_response, name='view_import_response'),
|
path('import-response/<int:pk>/', import_export.import_response, name='view_import_response'),
|
||||||
path('export/', import_export.export_recipe, name='view_export'),
|
path('export/', import_export.export_recipe, name='view_export'),
|
||||||
path('export-response/<int:pk>/', import_export.export_response, name='view_export_response'),
|
path('export-response/<int:pk>/', import_export.export_response, name='view_export_response'),
|
||||||
path('export-file/<int:pk>/', import_export.export_file, name='view_export_file'),
|
path('export-file/<int:pk>/', import_export.export_file, name='view_export_file'),
|
||||||
|
|
||||||
path('view/recipe/<int:pk>', views.recipe_view, name='view_recipe'),
|
path('view/recipe/<int:pk>', views.recipe_view, name='view_recipe'),
|
||||||
path('view/recipe/<int:pk>/<slug:share>', views.recipe_view, name='view_recipe'),
|
path('view/recipe/<int:pk>/<slug:share>', views.recipe_view, name='view_recipe'),
|
||||||
|
|
||||||
path('new/recipe-import/<int:import_id>/', new.create_new_external_recipe, name='new_recipe_import'),
|
path('new/recipe-import/<int:import_id>/', new.create_new_external_recipe, name='new_recipe_import'),
|
||||||
path('new/share-link/<int:pk>/', new.share_link, name='new_share_link'),
|
path('new/share-link/<int:pk>/', new.share_link, name='new_share_link'),
|
||||||
|
|
||||||
path('edit/recipe/<int:pk>/', edit.switch_recipe, name='edit_recipe'),
|
path('edit/recipe/<int:pk>/', edit.switch_recipe, name='edit_recipe'),
|
||||||
|
|
||||||
# for internal use only
|
# for internal use only
|
||||||
path('edit/recipe/internal/<int:pk>/', edit.internal_recipe_update, name='edit_internal_recipe'),
|
path('edit/recipe/internal/<int:pk>/', edit.internal_recipe_update, name='edit_internal_recipe'),
|
||||||
path('edit/recipe/external/<int:pk>/', edit.ExternalRecipeUpdate.as_view(), name='edit_external_recipe'),
|
path('edit/recipe/external/<int:pk>/', edit.ExternalRecipeUpdate.as_view(), name='edit_external_recipe'),
|
||||||
path('edit/recipe/convert/<int:pk>/', edit.convert_recipe, name='edit_convert_recipe'),
|
path('edit/recipe/convert/<int:pk>/', edit.convert_recipe, name='edit_convert_recipe'),
|
||||||
|
|
||||||
path('edit/storage/<int:pk>/', edit.edit_storage, name='edit_storage'),
|
path('edit/storage/<int:pk>/', edit.edit_storage, name='edit_storage'),
|
||||||
|
|
||||||
path('delete/recipe-source/<int:pk>/', delete.delete_recipe_source, name='delete_recipe_source'),
|
path('delete/recipe-source/<int:pk>/', delete.delete_recipe_source, name='delete_recipe_source'),
|
||||||
|
|
||||||
# TODO move to generic "new" view
|
# TODO move to generic "new" view
|
||||||
@@ -120,7 +113,6 @@ urlpatterns = [
|
|||||||
path('data/batch/import', data.batch_import, name='data_batch_import'),
|
path('data/batch/import', data.batch_import, name='data_batch_import'),
|
||||||
path('data/sync/wait', data.sync_wait, name='data_sync_wait'),
|
path('data/sync/wait', data.sync_wait, name='data_sync_wait'),
|
||||||
path('data/import/url', data.import_url, name='data_import_url'),
|
path('data/import/url', data.import_url, name='data_import_url'),
|
||||||
|
|
||||||
path('api/get_external_file_link/<int:recipe_id>/', api.get_external_file_link, name='api_get_external_file_link'),
|
path('api/get_external_file_link/<int:recipe_id>/', api.get_external_file_link, name='api_get_external_file_link'),
|
||||||
path('api/get_recipe_file/<int:recipe_id>/', api.get_recipe_file, name='api_get_recipe_file'),
|
path('api/get_recipe_file/<int:recipe_id>/', api.get_recipe_file, name='api_get_recipe_file'),
|
||||||
path('api/sync_all/', api.sync_all, name='api_sync'),
|
path('api/sync_all/', api.sync_all, name='api_sync'),
|
||||||
@@ -133,70 +125,39 @@ urlpatterns = [
|
|||||||
path('api/reset-food-inheritance/', api.reset_food_inheritance, name='api_reset_food_inheritance'),
|
path('api/reset-food-inheritance/', api.reset_food_inheritance, name='api_reset_food_inheritance'),
|
||||||
path('api/switch-active-space/<int:space_id>/', api.switch_active_space, name='api_switch_active_space'),
|
path('api/switch-active-space/<int:space_id>/', api.switch_active_space, name='api_switch_active_space'),
|
||||||
path('api/download-file/<int:file_id>/', api.download_file, name='api_download_file'),
|
path('api/download-file/<int:file_id>/', api.download_file, name='api_download_file'),
|
||||||
|
|
||||||
path('telegram/setup/<int:pk>', telegram.setup_bot, name='telegram_setup'),
|
path('telegram/setup/<int:pk>', telegram.setup_bot, name='telegram_setup'),
|
||||||
path('telegram/remove/<int:pk>', telegram.remove_bot, name='telegram_remove'),
|
path('telegram/remove/<int:pk>', telegram.remove_bot, name='telegram_remove'),
|
||||||
path('telegram/hook/<slug:token>/', telegram.hook, name='telegram_hook'),
|
path('telegram/hook/<slug:token>/', telegram.hook, name='telegram_hook'),
|
||||||
|
|
||||||
path('docs/markdown/', views.markdown_info, name='docs_markdown'),
|
path('docs/markdown/', views.markdown_info, name='docs_markdown'),
|
||||||
path('docs/search/', views.search_info, name='docs_search'),
|
path('docs/search/', views.search_info, name='docs_search'),
|
||||||
path('docs/api/', views.api_info, name='docs_api'),
|
path('docs/api/', views.api_info, name='docs_api'),
|
||||||
|
path('openapi/', get_schema_view(title="Django Recipes", version=TANDOOR_VERSION, public=True, permission_classes=(permissions.AllowAny, )), name='openapi-schema'),
|
||||||
path('openapi/', get_schema_view(title="Django Recipes", version=TANDOOR_VERSION, public=True,
|
|
||||||
permission_classes=(permissions.AllowAny,)), name='openapi-schema'),
|
|
||||||
|
|
||||||
path('api/', include((router.urls, 'api'))),
|
path('api/', include((router.urls, 'api'))),
|
||||||
path('api-auth/', include('rest_framework.urls', namespace='rest_framework')),
|
path('api-auth/', include('rest_framework.urls', namespace='rest_framework')),
|
||||||
path('api-token-auth/', CustomAuthToken.as_view()),
|
path('api-token-auth/', CustomAuthToken.as_view()),
|
||||||
path('api-import-open-data/', ImportOpenData.as_view(), name='api_import_open_data'),
|
path('api-import-open-data/', ImportOpenData.as_view(), name='api_import_open_data'),
|
||||||
|
|
||||||
path('offline/', views.offline, name='view_offline'),
|
path('offline/', views.offline, name='view_offline'),
|
||||||
|
path('service-worker.js', (TemplateView.as_view(template_name="sw.js", content_type='application/javascript', )), name='service_worker'),
|
||||||
path('service-worker.js', (TemplateView.as_view(template_name="sw.js", content_type='application/javascript', )),
|
|
||||||
name='service_worker'),
|
|
||||||
path('manifest.json', views.web_manifest, name='web_manifest'),
|
path('manifest.json', views.web_manifest, name='web_manifest'),
|
||||||
]
|
]
|
||||||
|
|
||||||
generic_models = (
|
generic_models = (Recipe, RecipeImport, Storage, SyncLog, Sync, Comment, InviteLink, UserSpace, Space)
|
||||||
Recipe, RecipeImport, Storage, RecipeBook, SyncLog, Sync,
|
|
||||||
Comment, RecipeBookEntry, InviteLink, UserSpace, Space
|
|
||||||
)
|
|
||||||
|
|
||||||
for m in generic_models:
|
for m in generic_models:
|
||||||
py_name = get_model_name(m)
|
py_name = get_model_name(m)
|
||||||
url_name = py_name.replace('_', '-')
|
url_name = py_name.replace('_', '-')
|
||||||
|
|
||||||
if c := locate(f'cookbook.views.new.{m.__name__}Create'):
|
if c := locate(f'cookbook.views.new.{m.__name__}Create'):
|
||||||
urlpatterns.append(
|
urlpatterns.append(path(f'new/{url_name}/', c.as_view(), name=f'new_{py_name}'))
|
||||||
path(
|
|
||||||
f'new/{url_name}/', c.as_view(), name=f'new_{py_name}'
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
if c := locate(f'cookbook.views.edit.{m.__name__}Update'):
|
if c := locate(f'cookbook.views.edit.{m.__name__}Update'):
|
||||||
urlpatterns.append(
|
urlpatterns.append(path(f'edit/{url_name}/<int:pk>/', c.as_view(), name=f'edit_{py_name}'))
|
||||||
path(
|
|
||||||
f'edit/{url_name}/<int:pk>/',
|
|
||||||
c.as_view(),
|
|
||||||
name=f'edit_{py_name}'
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
if c := getattr(lists, py_name, None):
|
if c := getattr(lists, py_name, None):
|
||||||
urlpatterns.append(
|
urlpatterns.append(path(f'list/{url_name}/', c, name=f'list_{py_name}'))
|
||||||
path(
|
|
||||||
f'list/{url_name}/', c, name=f'list_{py_name}'
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
if c := locate(f'cookbook.views.delete.{m.__name__}Delete'):
|
if c := locate(f'cookbook.views.delete.{m.__name__}Delete'):
|
||||||
urlpatterns.append(
|
urlpatterns.append(path(f'delete/{url_name}/<int:pk>/', c.as_view(), name=f'delete_{py_name}'))
|
||||||
path(
|
|
||||||
f'delete/{url_name}/<int:pk>/',
|
|
||||||
c.as_view(),
|
|
||||||
name=f'delete_{py_name}'
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
vue_models = [Food, Keyword, Unit, Supermarket, SupermarketCategory, Automation, UserFile, Step, CustomFilter, UnitConversion, PropertyType]
|
vue_models = [Food, Keyword, Unit, Supermarket, SupermarketCategory, Automation, UserFile, Step, CustomFilter, UnitConversion, PropertyType]
|
||||||
for m in vue_models:
|
for m in vue_models:
|
||||||
@@ -204,11 +165,7 @@ for m in vue_models:
|
|||||||
url_name = py_name.replace('_', '-')
|
url_name = py_name.replace('_', '-')
|
||||||
|
|
||||||
if c := getattr(lists, py_name, None):
|
if c := getattr(lists, py_name, None):
|
||||||
urlpatterns.append(
|
urlpatterns.append(path(f'list/{url_name}/', c, name=f'list_{py_name}'))
|
||||||
path(
|
|
||||||
f'list/{url_name}/', c, name=f'list_{py_name}'
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
if DEBUG:
|
if DEBUG:
|
||||||
urlpatterns.append(path('test/', views.test, name='view_test'))
|
urlpatterns.append(path('test/', views.test, name='view_test'))
|
||||||
|
|||||||
@@ -169,11 +169,6 @@ def meal_plan(request):
|
|||||||
return render(request, 'meal_plan.html', {})
|
return render(request, 'meal_plan.html', {})
|
||||||
|
|
||||||
|
|
||||||
@group_required('user')
|
|
||||||
def view_profile(request, user_id):
|
|
||||||
return render(request, 'profile.html', {})
|
|
||||||
|
|
||||||
|
|
||||||
@group_required('guest')
|
@group_required('guest')
|
||||||
def user_settings(request):
|
def user_settings(request):
|
||||||
if request.space.demo:
|
if request.space.demo:
|
||||||
|
|||||||
@@ -29,10 +29,6 @@ const pages = {
|
|||||||
entry: "./src/apps/ExportView/main.js",
|
entry: "./src/apps/ExportView/main.js",
|
||||||
chunks: ["chunk-vendors","locales-chunk","api-chunk"],
|
chunks: ["chunk-vendors","locales-chunk","api-chunk"],
|
||||||
},
|
},
|
||||||
supermarket_view: {
|
|
||||||
entry: "./src/apps/SupermarketView/main.js",
|
|
||||||
chunks: ["chunk-vendors","locales-chunk","api-chunk"],
|
|
||||||
},
|
|
||||||
model_list_view: {
|
model_list_view: {
|
||||||
entry: "./src/apps/ModelListView/main.js",
|
entry: "./src/apps/ModelListView/main.js",
|
||||||
chunks: ["chunk-vendors","locales-chunk","api-chunk"],
|
chunks: ["chunk-vendors","locales-chunk","api-chunk"],
|
||||||
@@ -65,10 +61,6 @@ const pages = {
|
|||||||
entry: "./src/apps/SpaceManageView/main.js",
|
entry: "./src/apps/SpaceManageView/main.js",
|
||||||
chunks: ["chunk-vendors","locales-chunk","api-chunk"],
|
chunks: ["chunk-vendors","locales-chunk","api-chunk"],
|
||||||
},
|
},
|
||||||
profile_view: {
|
|
||||||
entry: "./src/apps/ProfileView/main.js",
|
|
||||||
chunks: ["chunk-vendors","locales-chunk","api-chunk"],
|
|
||||||
},
|
|
||||||
settings_view: {
|
settings_view: {
|
||||||
entry: "./src/apps/SettingsView/main.js",
|
entry: "./src/apps/SettingsView/main.js",
|
||||||
chunks: ["chunk-vendors","locales-chunk","api-chunk"],
|
chunks: ["chunk-vendors","locales-chunk","api-chunk"],
|
||||||
|
|||||||
Reference in New Issue
Block a user