Rename coop to blog throughout codebase
- coop_url() → blog_url(), AUTH_APP default → "blog" - Session cookie: coop_session → blog_session - Config keys: coop_root/coop_title → market_root/market_title - All Jinja templates: coop_url → blog_url, coop_title → market_title - Template blocks: coop-child-header → blog-child-header Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -54,7 +54,7 @@ def create_base_app(
|
||||
context_fn:
|
||||
Async function returning a dict for template context.
|
||||
Each app provides its own — the cart app queries locally,
|
||||
while coop/market apps fetch via internal API.
|
||||
while blog/market apps fetch via internal API.
|
||||
If not provided, a minimal default context is used.
|
||||
before_request_fns:
|
||||
Extra before-request hooks (e.g. cart_loader for the cart app).
|
||||
@@ -84,7 +84,7 @@ def create_base_app(
|
||||
cookie_domain = os.getenv("SESSION_COOKIE_DOMAIN") # e.g. ".rose-ash.com"
|
||||
if cookie_domain:
|
||||
app.config["SESSION_COOKIE_DOMAIN"] = cookie_domain
|
||||
app.config["SESSION_COOKIE_NAME"] = "coop_session"
|
||||
app.config["SESSION_COOKIE_NAME"] = "blog_session"
|
||||
|
||||
# Ghost / Redis config
|
||||
app.config["GHOST_API_URL"] = os.getenv("GHOST_API_URL")
|
||||
|
||||
@@ -13,7 +13,7 @@ from shared.browser.app.csrf import generate_csrf_token
|
||||
from shared.browser.app.authz import has_access
|
||||
from shared.browser.app.filters import register as register_filters
|
||||
|
||||
from .urls import coop_url, market_url, cart_url, events_url, login_url, page_cart_url, market_product_url
|
||||
from .urls import blog_url, market_url, cart_url, events_url, login_url, page_cart_url, market_product_url
|
||||
|
||||
|
||||
def setup_jinja(app: Quart) -> None:
|
||||
@@ -93,7 +93,7 @@ def setup_jinja(app: Quart) -> None:
|
||||
app.jinja_env.globals["site"] = site
|
||||
|
||||
# cross-app URL helpers available in all templates
|
||||
app.jinja_env.globals["coop_url"] = coop_url
|
||||
app.jinja_env.globals["blog_url"] = blog_url
|
||||
app.jinja_env.globals["market_url"] = market_url
|
||||
app.jinja_env.globals["cart_url"] = cart_url
|
||||
app.jinja_env.globals["events_url"] = events_url
|
||||
|
||||
@@ -21,8 +21,8 @@ def app_url(app_name: str, path: str = "/") -> str:
|
||||
return base + path
|
||||
|
||||
|
||||
def coop_url(path: str = "/") -> str:
|
||||
return app_url("coop", path)
|
||||
def blog_url(path: str = "/") -> str:
|
||||
return app_url("blog", path)
|
||||
|
||||
|
||||
def market_url(path: str = "/") -> str:
|
||||
@@ -66,9 +66,9 @@ def market_product_url(product_slug: str, suffix: str = "", market_place=None) -
|
||||
|
||||
|
||||
def login_url(next_url: str = "") -> str:
|
||||
# Auth lives in blog (coop) for now. Set AUTH_APP=federation to switch.
|
||||
# Auth lives in blog for now. Set AUTH_APP=federation to switch.
|
||||
from quart import session as qsession
|
||||
auth_app = os.getenv("AUTH_APP", "coop")
|
||||
auth_app = os.getenv("AUTH_APP", "blog")
|
||||
base = app_url(auth_app, "/auth/login/")
|
||||
params: list[str] = []
|
||||
if next_url:
|
||||
|
||||
Reference in New Issue
Block a user