From 4eaf0df9a391ad5f6b2d56759898dca2af3c9d33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Perj=C3=A9ssy=2C=20L=C3=B3r=C3=A1nt?= Date: Sun, 31 Oct 2021 14:10:57 +0100 Subject: [PATCH 01/14] Added LDAP usage description in authentication page of documentation. --- docs/features/authentication.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/features/authentication.md b/docs/features/authentication.md index d4b273fc6..6390e91ef 100644 --- a/docs/features/authentication.md +++ b/docs/features/authentication.md @@ -60,6 +60,25 @@ Use the superuser account to grant permissions to the newly created users. To link an account to an already existing normal user go to the settings page of the user and link it. Here you can also unlink your account if you no longer want to use a social login method. +## LDAP + +LDAP authentication can be enabled in the `.env` file by setting `LDAP_AUTH=1`. +If set, users listed in the LDAP instance will be able to sign in without signing up. +These variables must be set to configure the connection to the LDAP instance: +``` +AUTH_LDAP_SERVER_URI=ldap://ldap.example.org:389 +AUTH_LDAP_BIND_DN=uid=admin,ou=users,dc=example,dc=org +AUTH_LDAP_BIND_PASSWORD=adminpassword +AUTH_LDAP_USER_SEARCH_BASE_DN=ou=users,dc=example,dc=org +``` +Additional optional variables: +``` +AUTH_LDAP_USER_SEARCH_FILTER_STR=(uid=%(user)s) +AUTH_LDAP_USER_ATTR_MAP={'first_name': 'givenName', 'last_name': 'sn', 'email': 'mail'} +AUTH_LDAP_ALWAYS_UPDATE_USER=1 +AUTH_LDAP_CACHE_TIMEOUT=3600 +``` + ## Reverse Proxy Authentication !!! Info "Community Contributed Tutorial" From 31720927b1be1995bce80b082872cadcb16f56a2 Mon Sep 17 00:00:00 2001 From: Kaibu Date: Sun, 31 Oct 2021 18:08:37 +0100 Subject: [PATCH 02/14] deprecated old meal plan --- README.md | 70 +- cookbook/templates/meal_plan.html | 746 +-------------------- cookbook/urls.py | 1 - cookbook/views/views.py | 20 +- docs/index.md | 97 +-- vue/src/apps/CookbookView/CookbookView.vue | 8 +- vue/src/apps/MealPlanView/MealPlanView.vue | 22 +- vue/src/components/MealPlanEditModal.vue | 2 +- 8 files changed, 148 insertions(+), 818 deletions(-) diff --git a/README.md b/README.md index dbd087502..cd6442de9 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@


- +
Tandoor Recipes
@@ -15,46 +15,74 @@ +

+WebsiteInstallation • -Documentation • +DocsDemo • -Discord server +Discord

![Preview](docs/preview.png) -# Your Feedback +## Core Features +- 🥗 **Manage your recipes** - Manage your ever growing recipe collection +- 📆 **Plan** - multiple meals for each day +- 🛒 **Shopping lists** - via the meal plan or straight from recipes +- 📚 **Cookbooks** - collect recipes into books +- 👪 **Share and collaborate** on recipes with friends and family -Share some information on how you use Tandoor to help me improve the application [Google Survey](https://forms.gle/qNfLK2tWTeWHe9Qd7) +## Made by and for power users -## Features - -- 📦 **Sync** files with Dropbox and Nextcloud (more can easily be added) -- 🔍 Powerful **search** with Djangos [TrigramSimilarity](https://docs.djangoproject.com/en/3.0/ref/contrib/postgres/search/#trigram-similarity) +- 🔍 Powerful & customizable **search** with fulltext support and [TrigramSimilarity](https://docs.djangoproject.com/en/3.0/ref/contrib/postgres/search/#trigram-similarity) - 🏷️ Create and search for **tags**, assign them in batch to all files matching certain filters -- 📄 **Create recipes** locally within a nice, standardized web interface -- ⬇️ **Import recipes** from thousands of websites supporting [ld+json or microdata](https://schema.org/Recipe) -- 📱 Optimized for use on **mobile** devices like phones and tablets -- 🛒 Generate **shopping** lists from recipes -- 📆 Create a **Plan** on what to eat when -- 👪 **Share** recipes with friends and comment on them to suggest or remember changes you made -- ➗ automatically convert decimal units to **fractions** for those who like this -- 🐳 Easy setup with **Docker** and included examples for Kubernetes, Unraid and Synology +- ↔️ Quickly merge and rename ingredients, tags and units +- 📥️ **Import recipes** from thousands of websites supporting [ld+json or microdata](https://schema.org/Recipe) +- ➗ Support for **fractions** or decimals +- 🐳 Easy setup with **Docker** and included examples for **Kubernetes**, **Unraid** and **Synology** - 🎨 Customize your interface with **themes** -- ✉️ Export and import recipes from other users +- 📦 **Sync** files with Dropbox and Nextcloud + +## All the must haves + +- 📱Optimized for use on **mobile** devices - 🌍 localized in many languages thanks to the awesome community -- ➕ Many more like recipe scaling, image compression, cookbooks, printing views, ... +- 📥️ **Import your collection** from many other [recipe managers](https://docs.tandoor.dev/features/import_export/) +- ➕ Many more like recipe scaling, image compression, printing views and supermarkets This application is meant for people with a collection of recipes they want to share with family and friends or simply store them in a nicely organized way. A basic permission system exists but this application is not meant to be run as a public page. + +## Docs + Documentation can be found [here](https://docs.tandoor.dev/). -While this application has been around for a while and is actively used by many (including myself), it is still considered -**beta** software that has a lot of rough edges and unpolished parts. +## Contributing + +You can help out with the ongoing development by looking for potential bugs in our code base, or by contributing new features. We are always welcoming new pull requests containing bug fixes, refactors and new features. We have a list of tasks and bugs on our issue tracker on Github. Please comment on issues if you want to contribute with, to avoid duplicating effort. + +## Your Feedback + +Share some information on how you use Tandoor to help me improve the application [Google Survey](https://forms.gle/qNfLK2tWTeWHe9Qd7) + +## Get in touch + + + + + + + + + + + +
DiscordWe have a public Discord server that anyone can join. This is where all our developers and contributors hang out and where we make announcements
TwitterYou can follow our Twitter account to get updates on new features or releases
+ ## License Beginning with version 0.10.0 the code in this repository is licensed under the [GNU AGPL v3](https://www.gnu.org/licenses/agpl-3.0.de.html) license with a diff --git a/cookbook/templates/meal_plan.html b/cookbook/templates/meal_plan.html index 187b3f95e..f835d72a9 100644 --- a/cookbook/templates/meal_plan.html +++ b/cookbook/templates/meal_plan.html @@ -1,742 +1,36 @@ {% extends "base.html" %} -{% load i18n %} -{% load static %} {% load render_bundle from webpack_loader %} +{% load static %} +{% load i18n %} +{% load l10n %} + {% block title %}{% trans 'Meal-Plan' %}{% endblock %} -{% block extra_head %} +{% block content_fluid %} - {% include 'include/vue_base.html' %} +
+ +
- - - - - - - {% endblock %} -{% block content %} -
-
-
-
-
- -
- -
- -
-
-
- -
- -
-
- - - - - - - - - - - - - - -
- [[formatDateDayname(d)]]
[[formatDateDay(d)]]. - -
- [[ meal_plan[t.name].name]] - -
- - - -
-
-
- -
-
- {% trans 'New Entry' %} -
-
-
- -
-
-
-
- -
- -
-
-
-
- -
- - [[element.name]] - - [[element.servings]] -
-
-
-
-
-
-
- - - {% trans 'You can use markdown to format this field. See the docs here' %} -
-
- -
- -
- {% trans 'Create only note' %} -
-
-
- -
-
-
-
- -
-
-
-
-
- {% trans 'Shopping List' %} -
- -
- - -
-
-
-
-
-
- {% trans 'Plan' %} -
- -
-
-
- -
- -
-
-
- -
- -
- - - {% trans 'Edit plan types' %}
- {% trans 'Show help' %}
- {% trans 'Week iCal export' %} -
-
-
-
- -
-
- - - - - - - -
- - +{% block script %} + {% if debug %} + + {% else %} + + {% endif %} + + {% render_bundle 'meal_plan_view' %} {% endblock %} \ No newline at end of file diff --git a/cookbook/urls.py b/cookbook/urls.py index 80537c8d0..5ed5b825e 100644 --- a/cookbook/urls.py +++ b/cookbook/urls.py @@ -58,7 +58,6 @@ urlpatterns = [ path('search/v2/', views.search_v2, name='view_search_v2'), path('books/', views.books, name='view_books'), path('plan/', views.meal_plan, name='view_plan'), - path('plan_new/', views.meal_plan_new, name='view_plan_new'), path('plan/entry/', views.meal_plan_entry, name='view_plan_entry'), path('shopping/', views.shopping_list, name='view_shopping'), path('shopping/', views.shopping_list, name='view_shopping'), diff --git a/cookbook/views/views.py b/cookbook/views/views.py index 0ccd54612..6ef53bf6e 100644 --- a/cookbook/views/views.py +++ b/cookbook/views/views.py @@ -220,11 +220,6 @@ def meal_plan(request): return render(request, 'meal_plan.html', {}) -@group_required('user') -def meal_plan_new(request): - return render(request, 'meal_plan_new.html', {}) - - @group_required('user') def supermarket(request): return render(request, 'supermarket.html', {}) @@ -343,10 +338,13 @@ def user_settings(request): if fields_searched == 0: search_form.add_error(None, _('You must select at least one field to search!')) search_error = True - elif search_form.cleaned_data['search'] in ['websearch', 'raw'] and len(search_form.cleaned_data['fulltext']) == 0: - search_form.add_error('search', _('To use this search method you must select at least one full text search field!')) + elif search_form.cleaned_data['search'] in ['websearch', 'raw'] and len( + search_form.cleaned_data['fulltext']) == 0: + search_form.add_error('search', + _('To use this search method you must select at least one full text search field!')) search_error = True - elif search_form.cleaned_data['search'] in ['websearch', 'raw'] and len(search_form.cleaned_data['trigram']) > 0: + elif search_form.cleaned_data['search'] in ['websearch', 'raw'] and len( + search_form.cleaned_data['trigram']) > 0: search_form.add_error(None, _('Fuzzy search is not compatible with this search method!')) search_error = True else: @@ -385,7 +383,8 @@ def user_settings(request): else: preference_form = UserPreferenceForm() - fields_searched = len(sp.icontains.all()) + len(sp.istartswith.all()) + len(sp.trigram.all()) + len(sp.fulltext.all()) + fields_searched = len(sp.icontains.all()) + len(sp.istartswith.all()) + len(sp.trigram.all()) + len( + sp.fulltext.all()) if sp and not search_error and fields_searched > 0: search_form = SearchPreferenceForm(instance=sp) elif not search_error: @@ -395,7 +394,8 @@ def user_settings(request): api_token = Token.objects.create(user=request.user) # these fields require postgress - just disable them if postgress isn't available - if not settings.DATABASES['default']['ENGINE'] in ['django.db.backends.postgresql_psycopg2', 'django.db.backends.postgresql']: + if not settings.DATABASES['default']['ENGINE'] in ['django.db.backends.postgresql_psycopg2', + 'django.db.backends.postgresql']: search_form.fields['search'].disabled = True search_form.fields['lookup'].disabled = True search_form.fields['trigram'].disabled = True diff --git a/docs/index.md b/docs/index.md index 595a96a2c..6e3504ba3 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,72 +1,79 @@


- +
Tandoor Recipes

-

This is my personal beta of vabene's excellent recipe app. It includes many of the new features I've developed and should be considered experimental.

-## Experimental Features -- Manual import recipes from URL & Source (HTML/JSON) -- Bookmarklet to import recipes from any website -- Full Text Search -- Hierarchical Keywords - -## Coming Next -- Heirarchical Ingredients -- Faceted Search -- Search filter by rating -- What Can I Make Now? -- Better ingredient/unit matching on import -- Custom word replacement on import (e.g. 'grams' automatically imported as 'g') -- improved ingredient parser (items in parens moved to notes) -- quick view ingredients -- quick view associated recipe -- favorite recipes -

The recipe manager that allows you to manage your ever growing collection of digital recipes.

- - - - - - + + + + + + +

-Installation • -Documentation • -Demo +Website • +Installation • +Docs • +Demo • +Discord

![Preview](preview.png) -!!! info "WIP" - The documentation is work in progress. New information will be added over time. - Feel free to open pull requests to enhance the documentation. +## Core Features +- 🥗 **Manage your recipes** - Manage your ever growing recipe collection +- 📆 **Plan** - multiple meals for each day +- 🛒 **Shopping lists** - via the meal plan or straight from recipes +- 📚 **Cookbooks** - collect recipes into books +- 👪 **Share and collaborate** on recipes with friends and family -## Features +## Made by and for power users -- 📦 **Sync** files with Dropbox and Nextcloud (more can easily be added) -- 🔍 Powerful **search** with Djangos [TrigramSimilarity](https://docs.djangoproject.com/en/3.0/ref/contrib/postgres/search/#trigram-similarity) +- 🔍 Powerful & customizable **search** with fulltext support and [TrigramSimilarity](https://docs.djangoproject.com/en/3.0/ref/contrib/postgres/search/#trigram-similarity) - 🏷️ Create and search for **tags**, assign them in batch to all files matching certain filters -- 📄 **Create recipes** locally within a nice, standardized web interface -- ⬇️ **Import recipes** from thousands of websites supporting [ld+json or microdata](https://schema.org/Recipe) -- 📱 Optimized for use on **mobile** devices like phones and tablets -- 🛒 Generate **shopping** lists from recipes -- 📆 Create a **Plan** on what to eat when -- 👪 **Share** recipes with friends and comment on them to suggest or remember changes you made -- ➗ automatically convert decimal units to **fractions** for those who like this -- 🐳 Easy setup with **Docker** and included examples for Kubernetes, Unraid and Synology +- ↔️ Quickly merge and rename ingredients, tags and units +- 📥️ **Import recipes** from thousands of websites supporting [ld+json or microdata](https://schema.org/Recipe) +- ➗ Support for **fractions** or decimals +- 🐳 Easy setup with **Docker** and included examples for **Kubernetes**, **Unraid** and **Synology** - 🎨 Customize your interface with **themes** -- ✉️ Export and import recipes from other users +- 📦 **Sync** files with Dropbox and Nextcloud + +## All the must haves + +- 📱Optimized for use on **mobile** devices - 🌍 localized in many languages thanks to the awesome community -- ➕ Many more like recipe scaling, image compression, cookbooks, printing views, ... +- 📥️ **Import your collection** from many other [recipe managers](https://docs.tandoor.dev/features/import_export/) +- ➕ Many more like recipe scaling, image compression, printing views and supermarkets +This application is meant for people with a collection of recipes they want to share with family and friends or simply +store them in a nicely organized way. A basic permission system exists but this application is not meant to be run as +a public page. +## Your Feedback + +Share some information on how you use Tandoor to help me improve the application [Google Survey](https://forms.gle/qNfLK2tWTeWHe9Qd7) + +## Get in touch + + + + + + + + + + + +
DiscordWe have a public Discord server that anyone can join. This is where all our developers and contributors hang out and where we make announcements
TwitterYou can follow our Twitter account to get updates on new features or releases
## Roadmap This application has been under rapid development over the last year. diff --git a/vue/src/apps/CookbookView/CookbookView.vue b/vue/src/apps/CookbookView/CookbookView.vue index 32284f604..30949d5e7 100644 --- a/vue/src/apps/CookbookView/CookbookView.vue +++ b/vue/src/apps/CookbookView/CookbookView.vue @@ -61,10 +61,10 @@ import Vue from 'vue' import {BootstrapVue} from 'bootstrap-vue' import 'bootstrap-vue/dist/bootstrap-vue.css' -import {ApiApiFactory} from "../../utils/openapi/api"; -import CookbookSlider from "../../components/CookbookSlider"; -import LoadingSpinner from "../../components/LoadingSpinner"; -import {StandardToasts} from "../../utils/utils"; +import {ApiApiFactory} from "@/utils/openapi/api"; +import CookbookSlider from "@/components/CookbookSlider"; +import LoadingSpinner from "@/components/LoadingSpinner"; +import {StandardToasts} from "@/utils/utils"; Vue.use(BootstrapVue) diff --git a/vue/src/apps/MealPlanView/MealPlanView.vue b/vue/src/apps/MealPlanView/MealPlanView.vue index e11dbb944..d436e3592 100644 --- a/vue/src/apps/MealPlanView/MealPlanView.vue +++ b/vue/src/apps/MealPlanView/MealPlanView.vue @@ -231,22 +231,24 @@