From f6a8f16c61e1694aa60c5270b52caece4bd37bcc Mon Sep 17 00:00:00 2001 From: merlin Date: Thu, 2 Jan 2025 15:56:55 -0500 Subject: [PATCH] Food rescue PP --- freezing/web/templates/base.html | 6 +++--- freezing/web/templates/pointless/foodrescue.html | 9 +++++---- freezing/web/views/general.py | 15 +++++++-------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/freezing/web/templates/base.html b/freezing/web/templates/base.html index 903e075e..5f2bb521 100644 --- a/freezing/web/templates/base.html +++ b/freezing/web/templates/base.html @@ -216,6 +216,9 @@ Extra Mile +
  • + Food Rescue +
  • Group Ride Groupie
  • @@ -313,9 +316,6 @@
  • Flag
  • -
  • - Food Rescue -
  • Golden Spike
  • diff --git a/freezing/web/templates/pointless/foodrescue.html b/freezing/web/templates/pointless/foodrescue.html index b276a69c..5f343d45 100644 --- a/freezing/web/templates/pointless/foodrescue.html +++ b/freezing/web/templates/pointless/foodrescue.html @@ -13,15 +13,16 @@
    to local social service agencies that feed the food insecure.

    - Sign up on the Food Rescue DC website. + Sign up on the + Food Rescue DC website. Make food rescue rides, tag them with #foodrescue. If you make multiple rescues on one ride, append the number of rescues to the tag with an x like so: #foodrescuex2.

    - {% set url = "https://www.bikearlingtonforum.com/forums/topic/pointless-prize-rescuing-food-by-bike/" %} + {% set url = "https://www.bikearlingtonforum.com/forums/topic/pointless-rpize-food-rescues-by-bike/" %} {% set sponsor = "Henry" %}

    See: {{ url }} diff --git a/freezing/web/views/general.py b/freezing/web/views/general.py index 61409411..9549caeb 100644 --- a/freezing/web/views/general.py +++ b/freezing/web/views/general.py @@ -38,18 +38,17 @@ class AccessDenied(RuntimeError): # When a hashtag has a "/pointless/*" route instead of "/pointless/hashtag/*". # Many of the generic leaderboards ought to be pure hashtag leaderboards. custom_tag_pages = { + "adulting": "generic/adulting", "civilwarmarker": "civilwarhistory", "civilwarstreet": "civilwarhistory", "coffeeride": "coffeeride", + "decasleaze": "generic/decasleaze", "foodrescue": "foodrescue", - "kidical": "kidmiles", - "withkid": "pointlesskids", - "rosshillloop": "rosshillloop", - "adulting": "generic/adulting", "freezingerrands": "generic/adulting", - "londonbridge": "generic/londonbridge", "fsrealsuppleride": "generic/suppleride", - "decasleaze": "generic/decasleaze", + "kidical": "kidmiles", + "londonbridge": "generic/londonbridge", + "rosshillloop": "rosshillloop", "withkid": "pointlesskids", } @@ -163,8 +162,8 @@ def index(): for res in meta.scoped_session().execute(q).fetchall(): ride_tags = {} # Prevent double-tagging for hash in findall(r"(?<=#)\w+", res["name"]): - if hash.lower().startswith("withkid"): - hash = "withkid" + desuffix = fullmatch(r"(?i)(withkid|foodrescue).*", hash) + hash = desuffix[1] if desuffix else hash if not fullmatch( r"(?i)(BAFS|FS|FreezingSaddles)?\d*", hash ): # Ditch useless tags