Frontend Fixes + Adjust Caddyfile (#518)

* token error handling

* Add additional settings to recipes

* fixes #515

* remove index.html

Co-authored-by: hay-kot <hay-kot@pm.me>
This commit is contained in:
Hayden
2021-06-14 19:37:38 -08:00
committed by GitHub
parent 17a7d0b31e
commit d7c883feca
19 changed files with 48 additions and 319 deletions

View File

@@ -1,6 +1,6 @@
from mealie.db.models.model_base import BaseMixins, SqlAlchemyBase
from requests import Session
from sqlalchemy import Boolean, Column, ForeignKey, Integer, String, Table, orm
from sqlalchemy import Column, ForeignKey, Integer, String, Table, orm
ingredients_to_units = Table(
"ingredients_to_units",
@@ -82,14 +82,10 @@ class RecipeIngredient(SqlAlchemyBase):
quantity = Column(Integer)
# Extras
disable_amount = Column(Boolean, default=False)
def __init__(
self, title: str, note: str, unit: dict, food: dict, quantity: int, disable_amount: bool, session: Session, **_
) -> None:
def __init__(self, title: str, note: str, unit: dict, food: dict, quantity: int, session: Session, **_) -> None:
self.title = title
self.note = note
self.unit = IngredientUnit.get_ref_or_create(session, unit)
self.food = IngredientFood.get_ref_or_create(session, food)
self.quantity = quantity
self.disable_amount = disable_amount

View File

@@ -10,9 +10,21 @@ class RecipeSettings(SqlAlchemyBase):
show_nutrition = sa.Column(sa.Boolean)
show_assets = sa.Column(sa.Boolean)
landscape_view = sa.Column(sa.Boolean)
disable_amount = sa.Column(sa.Boolean, default=False)
disable_comments = sa.Column(sa.Boolean, default=False)
def __init__(self, public=True, show_nutrition=True, show_assets=True, landscape_view=True) -> None:
def __init__(
self,
public=True,
show_nutrition=True,
show_assets=True,
landscape_view=True,
disable_amount=True,
disable_comments=False,
) -> None:
self.public = public
self.show_nutrition = show_nutrition
self.show_assets = show_assets
self.landscape_view = landscape_view
self.disable_amount = disable_amount
self.disable_comments = disable_comments