mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-09 03:04:54 -04:00
Merge branch 'mealie-next' into fix/translation-issues-when-scraping
This commit is contained in:
commit
36088f0db9
@ -200,7 +200,7 @@
|
|||||||
"created-on-date": "נוצר ב-{0}",
|
"created-on-date": "נוצר ב-{0}",
|
||||||
"unsaved-changes": "יש שינויים שלא נשמרו. לצאת לפני שמירה? אשר לשמירה, בטל למחיקת שינויים.",
|
"unsaved-changes": "יש שינויים שלא נשמרו. לצאת לפני שמירה? אשר לשמירה, בטל למחיקת שינויים.",
|
||||||
"clipboard-copy-failure": "כשלון בהעתקה ללוח ההדבקה.",
|
"clipboard-copy-failure": "כשלון בהעתקה ללוח ההדבקה.",
|
||||||
"confirm-delete-generic-items": "Are you sure you want to delete the following items?"
|
"confirm-delete-generic-items": "האם אתה בטוח שברצונך למחוק את הפריטים הנבחרים?"
|
||||||
},
|
},
|
||||||
"group": {
|
"group": {
|
||||||
"are-you-sure-you-want-to-delete-the-group": "האם את/ה בטוח/ה שברצונך למחוק את <b>{groupName}<b/>?",
|
"are-you-sure-you-want-to-delete-the-group": "האם את/ה בטוח/ה שברצונך למחוק את <b>{groupName}<b/>?",
|
||||||
@ -259,7 +259,7 @@
|
|||||||
},
|
},
|
||||||
"meal-plan": {
|
"meal-plan": {
|
||||||
"create-a-new-meal-plan": "יצירת תכנית ארוחות חדשה",
|
"create-a-new-meal-plan": "יצירת תכנית ארוחות חדשה",
|
||||||
"update-this-meal-plan": "Update this Meal Plan",
|
"update-this-meal-plan": "עדכן את תכנון הארוחות",
|
||||||
"dinner-this-week": "ארוחות ערב השבוע",
|
"dinner-this-week": "ארוחות ערב השבוע",
|
||||||
"dinner-today": "ארוחת ערב היום",
|
"dinner-today": "ארוחת ערב היום",
|
||||||
"dinner-tonight": "ארוחת ערב היום",
|
"dinner-tonight": "ארוחת ערב היום",
|
||||||
@ -474,11 +474,11 @@
|
|||||||
"add-to-timeline": "הוסף לציר הזמן",
|
"add-to-timeline": "הוסף לציר הזמן",
|
||||||
"recipe-added-to-list": "מתכון נוסף לרשימה",
|
"recipe-added-to-list": "מתכון נוסף לרשימה",
|
||||||
"recipes-added-to-list": "מתכונים הוספו לרשימה",
|
"recipes-added-to-list": "מתכונים הוספו לרשימה",
|
||||||
"successfully-added-to-list": "Successfully added to list",
|
"successfully-added-to-list": "נוסף לרשימה בהצלחה",
|
||||||
"recipe-added-to-mealplan": "מתכון נוסף לתכנון ארוחות",
|
"recipe-added-to-mealplan": "מתכון נוסף לתכנון ארוחות",
|
||||||
"failed-to-add-recipes-to-list": "כשלון בהוספת מתכון לרשימה",
|
"failed-to-add-recipes-to-list": "כשלון בהוספת מתכון לרשימה",
|
||||||
"failed-to-add-recipe-to-mealplan": "הוספת מתכון לתכנון ארוחות נכשלה",
|
"failed-to-add-recipe-to-mealplan": "הוספת מתכון לתכנון ארוחות נכשלה",
|
||||||
"failed-to-add-to-list": "Failed to add to list",
|
"failed-to-add-to-list": "כשלון בהוספה לרשימה",
|
||||||
"yield": "תשואה",
|
"yield": "תשואה",
|
||||||
"quantity": "כמות",
|
"quantity": "כמות",
|
||||||
"choose-unit": "בחירת יחידת מידה",
|
"choose-unit": "בחירת יחידת מידה",
|
||||||
@ -515,7 +515,7 @@
|
|||||||
"how-did-it-turn-out": "איך יצא?",
|
"how-did-it-turn-out": "איך יצא?",
|
||||||
"user-made-this": "{user} הכין את זה",
|
"user-made-this": "{user} הכין את זה",
|
||||||
"last-made-date": "נעשה לאחרונה ב{date}",
|
"last-made-date": "נעשה לאחרונה ב{date}",
|
||||||
"api-extras-description": "Recipes extras are a key feature of the Mealie API. They allow you to create custom JSON key/value pairs within a recipe, to reference from 3rd party applications. You can use these keys to provide information, for example to trigger automations or custom messages to relay to your desired device.",
|
"api-extras-description": "מתכונים נוספים הם יכולת מפתח של Mealie API. הם מאפשרים ליצור צמדי key/value בצורת JSON על מנת לקרוא אותם בתוכנת צד שלישית. תוכלו להשתמש בצמדים האלה כדי לספק מידע, לדוגמא להפעיל אוטומציות או הודעות מותאמות אישית למכשירים מסויימים.",
|
||||||
"message-key": "מפתח הודעה",
|
"message-key": "מפתח הודעה",
|
||||||
"parse": "ניתוח",
|
"parse": "ניתוח",
|
||||||
"attach-images-hint": "הוסף תמונות ע\"י גרירה ושחרור אל תוך העורך",
|
"attach-images-hint": "הוסף תמונות ע\"י גרירה ושחרור אל תוך העורך",
|
||||||
@ -537,8 +537,8 @@
|
|||||||
"new-recipe-names-must-be-unique": "שם מתכון חדש חייב להיות ייחודי",
|
"new-recipe-names-must-be-unique": "שם מתכון חדש חייב להיות ייחודי",
|
||||||
"scrape-recipe": "קריאת מתכון",
|
"scrape-recipe": "קריאת מתכון",
|
||||||
"scrape-recipe-description": "קריאת מתכון בעזרת לינק. ספק את הלינק של האתר שברצונך לקרוא, ומילי תנסה לקרוא את המתכון מהאתר ולהוסיף אותו לאוסף.",
|
"scrape-recipe-description": "קריאת מתכון בעזרת לינק. ספק את הלינק של האתר שברצונך לקרוא, ומילי תנסה לקרוא את המתכון מהאתר ולהוסיף אותו לאוסף.",
|
||||||
"scrape-recipe-have-a-lot-of-recipes": "Have a lot of recipes you want to scrape at once?",
|
"scrape-recipe-have-a-lot-of-recipes": "יש לך הרבה מתכונים שאתה רוצה לקרוא בבת אחת?",
|
||||||
"scrape-recipe-suggest-bulk-importer": "Try out the bulk importer",
|
"scrape-recipe-suggest-bulk-importer": "נסה את יכולת קריאת רשימה",
|
||||||
"import-original-keywords-as-tags": "ייבא שמות מפתח מקוריות כתגיות",
|
"import-original-keywords-as-tags": "ייבא שמות מפתח מקוריות כתגיות",
|
||||||
"stay-in-edit-mode": "השאר במצב עריכה",
|
"stay-in-edit-mode": "השאר במצב עריכה",
|
||||||
"import-from-zip": "ייבא מקובץ",
|
"import-from-zip": "ייבא מקובץ",
|
||||||
@ -562,7 +562,7 @@
|
|||||||
"upload-image": "העלה תמונה",
|
"upload-image": "העלה תמונה",
|
||||||
"screen-awake": "השאר את המסך פעיל",
|
"screen-awake": "השאר את המסך פעיל",
|
||||||
"remove-image": "האם למחוק את התמונה?",
|
"remove-image": "האם למחוק את התמונה?",
|
||||||
"nextStep": "Next step"
|
"nextStep": "השלב הבא"
|
||||||
},
|
},
|
||||||
"search": {
|
"search": {
|
||||||
"advanced-search": "חיפוש מתקדם",
|
"advanced-search": "חיפוש מתקדם",
|
||||||
@ -797,7 +797,7 @@
|
|||||||
"untagged-count": "לא מתוייג {count}",
|
"untagged-count": "לא מתוייג {count}",
|
||||||
"create-a-tag": "צור תגית",
|
"create-a-tag": "צור תגית",
|
||||||
"tag-name": "שם תגית",
|
"tag-name": "שם תגית",
|
||||||
"tag": "Tag"
|
"tag": "תגית"
|
||||||
},
|
},
|
||||||
"tool": {
|
"tool": {
|
||||||
"tools": "כלים",
|
"tools": "כלים",
|
||||||
@ -807,7 +807,7 @@
|
|||||||
"create-new-tool": "יצירת כלי חדש",
|
"create-new-tool": "יצירת כלי חדש",
|
||||||
"on-hand-checkbox-label": "הראה מה יש לי במטבח",
|
"on-hand-checkbox-label": "הראה מה יש לי במטבח",
|
||||||
"required-tools": "צריך כלים",
|
"required-tools": "צריך כלים",
|
||||||
"tool": "Tool"
|
"tool": "כלי"
|
||||||
},
|
},
|
||||||
"user": {
|
"user": {
|
||||||
"admin": "אדמין",
|
"admin": "אדמין",
|
||||||
@ -898,10 +898,10 @@
|
|||||||
"user-can-organize-group-data": "משתמש יכול לשנות מידע של קבוצה",
|
"user-can-organize-group-data": "משתמש יכול לשנות מידע של קבוצה",
|
||||||
"enable-advanced-features": "אפשר אפשרויות מתקדמות",
|
"enable-advanced-features": "אפשר אפשרויות מתקדמות",
|
||||||
"it-looks-like-this-is-your-first-time-logging-in": "נראה שזו ההתחברות הראשונה שלך.",
|
"it-looks-like-this-is-your-first-time-logging-in": "נראה שזו ההתחברות הראשונה שלך.",
|
||||||
"dont-want-to-see-this-anymore-be-sure-to-change-your-email": "Don't want to see this anymore? Be sure to change your email in your user settings!",
|
"dont-want-to-see-this-anymore-be-sure-to-change-your-email": "לא רוצה לראות את זה יותר? דאג לשנות את המייל של בהגדרות המשתמש!",
|
||||||
"forgot-password": "שכחתי סיסמא",
|
"forgot-password": "שכחתי סיסמא",
|
||||||
"forgot-password-text": "Please enter your email address and we will send you a link to reset your password.",
|
"forgot-password-text": "נא לספק כתובת דוא\"ל. אנו נשלח לך הודעת דוא\"ל לצורך איפוס הסיסמה שלך.",
|
||||||
"changes-reflected-immediately": "Changes to this user will be reflected immediately."
|
"changes-reflected-immediately": "השינויים למשתמש זה יבוצעו מיידית."
|
||||||
},
|
},
|
||||||
"language-dialog": {
|
"language-dialog": {
|
||||||
"translated": "תורגם",
|
"translated": "תורגם",
|
||||||
@ -923,8 +923,8 @@
|
|||||||
"food-label": "תוית אוכל",
|
"food-label": "תוית אוכל",
|
||||||
"edit-food": "עריכת מזון",
|
"edit-food": "עריכת מזון",
|
||||||
"food-data": "נתוני אוכל",
|
"food-data": "נתוני אוכל",
|
||||||
"example-food-singular": "ex: Onion",
|
"example-food-singular": "דוגמא: בצל",
|
||||||
"example-food-plural": "ex: Onions"
|
"example-food-plural": "דוגמא: בצלים"
|
||||||
},
|
},
|
||||||
"units": {
|
"units": {
|
||||||
"seed-dialog-text": "אכלס את מסד הנתונים עם יחידות מדידה בהתאם לשפה המקומית שלך.",
|
"seed-dialog-text": "אכלס את מסד הנתונים עם יחידות מדידה בהתאם לשפה המקומית שלך.",
|
||||||
@ -935,7 +935,7 @@
|
|||||||
"merging-unit-into-unit": "ממזג את {0} לתוך {1}",
|
"merging-unit-into-unit": "ממזג את {0} לתוך {1}",
|
||||||
"create-unit": "יצירת יחידה",
|
"create-unit": "יצירת יחידה",
|
||||||
"abbreviation": "קיצור",
|
"abbreviation": "קיצור",
|
||||||
"plural-abbreviation": "Plural Abbreviation",
|
"plural-abbreviation": "צורת הרבית",
|
||||||
"description": "תיאור",
|
"description": "תיאור",
|
||||||
"display-as-fraction": "הצגה כשבר",
|
"display-as-fraction": "הצגה כשבר",
|
||||||
"use-abbreviation": "השתמש בקיצור",
|
"use-abbreviation": "השתמש בקיצור",
|
||||||
@ -943,10 +943,10 @@
|
|||||||
"unit-data": "נתוני יחידה",
|
"unit-data": "נתוני יחידה",
|
||||||
"use-abbv": "השתמש בקיצור",
|
"use-abbv": "השתמש בקיצור",
|
||||||
"fraction": "שבר",
|
"fraction": "שבר",
|
||||||
"example-unit-singular": "ex: Tablespoon",
|
"example-unit-singular": "דוגמא: כפית",
|
||||||
"example-unit-plural": "ex: Tablespoons",
|
"example-unit-plural": "דוגמא: כפיות",
|
||||||
"example-unit-abbreviation-singular": "ex: Tbsp",
|
"example-unit-abbreviation-singular": "דוגמא: כף",
|
||||||
"example-unit-abbreviation-plural": "ex: Tbsps"
|
"example-unit-abbreviation-plural": "דוגמא: כפות"
|
||||||
},
|
},
|
||||||
"labels": {
|
"labels": {
|
||||||
"seed-dialog-text": "אכלס את מסד הנתונים בתגיות נפוצות בהתאם לשפה המקומית שלך.",
|
"seed-dialog-text": "אכלס את מסד הנתונים בתגיות נפוצות בהתאם לשפה המקומית שלך.",
|
||||||
@ -1187,7 +1187,7 @@
|
|||||||
"require-all-tools": "זקוק לכל הכלים",
|
"require-all-tools": "זקוק לכל הכלים",
|
||||||
"cookbook-name": "שם ספר בישול",
|
"cookbook-name": "שם ספר בישול",
|
||||||
"cookbook-with-name": "ספר בישול {0}",
|
"cookbook-with-name": "ספר בישול {0}",
|
||||||
"create-a-cookbook": "Create a Cookbook",
|
"create-a-cookbook": "צור ספר בישול חדש",
|
||||||
"cookbook": "Cookbook"
|
"cookbook": "ספר בישול"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -33,6 +33,7 @@ export interface AppInfo {
|
|||||||
version: string;
|
version: string;
|
||||||
demoStatus: boolean;
|
demoStatus: boolean;
|
||||||
allowSignup: boolean;
|
allowSignup: boolean;
|
||||||
|
defaultGroupSlug?: string;
|
||||||
}
|
}
|
||||||
export interface AppStartupInfo {
|
export interface AppStartupInfo {
|
||||||
isFirstLogin: boolean;
|
isFirstLogin: boolean;
|
||||||
|
@ -4,17 +4,28 @@
|
|||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { computed, defineComponent, useContext, useRouter } from "@nuxtjs/composition-api";
|
import { computed, defineComponent, useContext, useRouter } from "@nuxtjs/composition-api";
|
||||||
|
import { AppInfo } from "~/lib/api/types/admin";
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
layout: "blank",
|
layout: "blank",
|
||||||
setup() {
|
setup() {
|
||||||
const { $auth } = useContext();
|
const { $auth, $axios } = useContext();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const groupSlug = computed(() => $auth.user?.groupSlug);
|
const groupSlug = computed(() => $auth.user?.groupSlug);
|
||||||
|
|
||||||
|
async function redirectPublicUserToDefaultGroup() {
|
||||||
|
const { data } = await $axios.get<AppInfo>("/api/app/about");
|
||||||
|
if (data?.defaultGroupSlug) {
|
||||||
|
router.push(`/g/${data.defaultGroupSlug}`);
|
||||||
|
} else {
|
||||||
|
router.push("/login");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (groupSlug.value) {
|
if (groupSlug.value) {
|
||||||
router.push(`/g/${groupSlug.value}`);
|
router.push(`/g/${groupSlug.value}`);
|
||||||
} else {
|
} else {
|
||||||
router.push("/login");
|
redirectPublicUserToDefaultGroup();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -5,21 +5,30 @@ from mealie.core.config import get_app_settings
|
|||||||
from mealie.core.settings.static import APP_VERSION
|
from mealie.core.settings.static import APP_VERSION
|
||||||
from mealie.db.db_setup import generate_session
|
from mealie.db.db_setup import generate_session
|
||||||
from mealie.db.models.users.users import User
|
from mealie.db.models.users.users import User
|
||||||
|
from mealie.repos.all_repositories import get_repositories
|
||||||
from mealie.schema.admin.about import AppInfo, AppStartupInfo, AppTheme
|
from mealie.schema.admin.about import AppInfo, AppStartupInfo, AppTheme
|
||||||
|
|
||||||
router = APIRouter(prefix="/about")
|
router = APIRouter(prefix="/about")
|
||||||
|
|
||||||
|
|
||||||
@router.get("", response_model=AppInfo)
|
@router.get("", response_model=AppInfo)
|
||||||
def get_app_info():
|
def get_app_info(session: Session = Depends(generate_session)):
|
||||||
"""Get general application information"""
|
"""Get general application information"""
|
||||||
settings = get_app_settings()
|
settings = get_app_settings()
|
||||||
|
|
||||||
|
repos = get_repositories(session)
|
||||||
|
default_group = repos.groups.get_by_name(settings.DEFAULT_GROUP)
|
||||||
|
if default_group and default_group.preferences and not default_group.preferences.private_group:
|
||||||
|
default_group_slug = default_group.slug
|
||||||
|
else:
|
||||||
|
default_group_slug = None
|
||||||
|
|
||||||
return AppInfo(
|
return AppInfo(
|
||||||
version=APP_VERSION,
|
version=APP_VERSION,
|
||||||
demo_status=settings.IS_DEMO,
|
demo_status=settings.IS_DEMO,
|
||||||
production=settings.PRODUCTION,
|
production=settings.PRODUCTION,
|
||||||
allow_signup=settings.ALLOW_SIGNUP,
|
allow_signup=settings.ALLOW_SIGNUP,
|
||||||
|
default_group_slug=default_group_slug,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -14,6 +14,7 @@ class AppInfo(MealieModel):
|
|||||||
version: str
|
version: str
|
||||||
demo_status: bool
|
demo_status: bool
|
||||||
allow_signup: bool
|
allow_signup: bool
|
||||||
|
default_group_slug: str | None = None
|
||||||
|
|
||||||
|
|
||||||
class AppTheme(MealieModel):
|
class AppTheme(MealieModel):
|
||||||
|
@ -1,11 +1,36 @@
|
|||||||
|
import pytest
|
||||||
from fastapi.testclient import TestClient
|
from fastapi.testclient import TestClient
|
||||||
|
|
||||||
from mealie.core.config import get_app_settings
|
from mealie.core.config import get_app_settings
|
||||||
from mealie.core.settings.static import APP_VERSION
|
from mealie.core.settings.static import APP_VERSION
|
||||||
|
from mealie.repos.repository_factory import AllRepositories
|
||||||
from tests.utils import api_routes
|
from tests.utils import api_routes
|
||||||
from tests.utils.fixture_schemas import TestUser
|
from tests.utils.fixture_schemas import TestUser
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize("is_private_group", [True, False], ids=["private group", "public group"])
|
||||||
|
def test_public_about_get_app_info(api_client: TestClient, is_private_group: bool, database: AllRepositories):
|
||||||
|
settings = get_app_settings()
|
||||||
|
group = database.groups.get_by_name(settings.DEFAULT_GROUP)
|
||||||
|
assert group and group.preferences
|
||||||
|
|
||||||
|
group.preferences.private_group = is_private_group
|
||||||
|
database.group_preferences.update(group.id, group.preferences)
|
||||||
|
|
||||||
|
response = api_client.get(api_routes.app_about)
|
||||||
|
as_dict = response.json()
|
||||||
|
|
||||||
|
assert as_dict["production"] == settings.PRODUCTION
|
||||||
|
assert as_dict["version"] == APP_VERSION
|
||||||
|
assert as_dict["demoStatus"] == settings.IS_DEMO
|
||||||
|
assert as_dict["allowSignup"] == settings.ALLOW_SIGNUP
|
||||||
|
|
||||||
|
if is_private_group:
|
||||||
|
assert as_dict["defaultGroupSlug"] == None
|
||||||
|
else:
|
||||||
|
assert as_dict["defaultGroupSlug"] == group.slug
|
||||||
|
|
||||||
|
|
||||||
def test_admin_about_get_app_info(api_client: TestClient, admin_user: TestUser):
|
def test_admin_about_get_app_info(api_client: TestClient, admin_user: TestUser):
|
||||||
response = api_client.get(api_routes.admin_about, headers=admin_user.token)
|
response = api_client.get(api_routes.admin_about, headers=admin_user.token)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user