From 726cf6eebbfbcc94e626ef8a504bae21406d69cb Mon Sep 17 00:00:00 2001 From: "russell@unturf.com" Date: Sun, 1 Feb 2026 13:47:05 -0500 Subject: [PATCH] Add shop setting to toggle product/content date visibility Remove border-top from date metadata styling. Add show_dates boolean to Shop model (default on) with radio buttons in Branding Settings to show or hide created/updated dates on product and content pages. --- make_post_sell/models/shop.py | 3 ++ .../ecb51cffd213_add_show_dates_to_shop.py | 29 +++++++++++++++++++ make_post_sell/static/css/common.css | 2 -- make_post_sell/templates/content.j2 | 2 ++ make_post_sell/templates/product.j2 | 2 ++ make_post_sell/templates/shop_settings.j2 | 13 +++++++++ make_post_sell/views/shop.py | 14 +++++++++ 7 files changed, 63 insertions(+), 2 deletions(-) create mode 100644 make_post_sell/scripts/alembic/versions/ecb51cffd213_add_show_dates_to_shop.py diff --git a/make_post_sell/models/shop.py b/make_post_sell/models/shop.py index 3851b10..5bff3da 100644 --- a/make_post_sell/models/shop.py +++ b/make_post_sell/models/shop.py @@ -124,6 +124,9 @@ class Shop(RBase, Base): # Default theme for shop visitors (0=dark, 1=light) default_theme = Column(BigInteger, nullable=False, default=1) # Default light mode + # Show created/updated dates on product and content pages + show_dates = Column(Boolean, default=True) + # many to many uses association_proxy. users = association_proxy("shop_users", "user", creator=lambda u: UserShop(user=u)) diff --git a/make_post_sell/scripts/alembic/versions/ecb51cffd213_add_show_dates_to_shop.py b/make_post_sell/scripts/alembic/versions/ecb51cffd213_add_show_dates_to_shop.py new file mode 100644 index 0000000..ce3e703 --- /dev/null +++ b/make_post_sell/scripts/alembic/versions/ecb51cffd213_add_show_dates_to_shop.py @@ -0,0 +1,29 @@ +"""add show_dates to shop + +Revision ID: ecb51cffd213 +Revises: 05be3044c2d2 +Create Date: 2026-02-01 11:23:33.791512 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = 'ecb51cffd213' +down_revision = '05be3044c2d2' +branch_labels = None +depends_on = None + +from make_post_sell.models.meta import UUIDType + + +def upgrade(): + op.add_column( + "mps_shop", + sa.Column("show_dates", sa.Boolean(), nullable=False, server_default="1"), + ) + + +def downgrade(): + op.drop_column("mps_shop", "show_dates") diff --git a/make_post_sell/static/css/common.css b/make_post_sell/static/css/common.css index 3f01c26..4938ef2 100644 --- a/make_post_sell/static/css/common.css +++ b/make_post_sell/static/css/common.css @@ -2137,8 +2137,6 @@ img.crypto-button-icon { color: var(--text-muted); font-size: 0.8em; margin-top: 20px; - padding-top: 12px; - border-top: 1px solid var(--border-light); } .original-comment-box { diff --git a/make_post_sell/templates/content.j2 b/make_post_sell/templates/content.j2 index 686fa6f..6ed8e2f 100644 --- a/make_post_sell/templates/content.j2 +++ b/make_post_sell/templates/content.j2 @@ -84,9 +84,11 @@
{% endif %} + {% if request.shop.show_dates %}
Created {{ product.human_created_timestamp }}{% if product.human_created_timestamp != product.human_updated_timestamp %} · Updated {{ product.human_updated_timestamp }}{% endif %}
+ {% endif %}
diff --git a/make_post_sell/templates/product.j2 b/make_post_sell/templates/product.j2 index 9e4056c..5791b7f 100644 --- a/make_post_sell/templates/product.j2 +++ b/make_post_sell/templates/product.j2 @@ -159,9 +159,11 @@ Please make sure you have an application to open this file type. {% endif %} + {% if request.shop.show_dates %}
Created {{ product.human_created_timestamp }}{% if product.human_created_timestamp != product.human_updated_timestamp %} · Updated {{ product.human_updated_timestamp }}{% endif %}
+ {% endif %}
diff --git a/make_post_sell/templates/shop_settings.j2 b/make_post_sell/templates/shop_settings.j2 index 903e213..43550a9 100644 --- a/make_post_sell/templates/shop_settings.j2 +++ b/make_post_sell/templates/shop_settings.j2 @@ -727,6 +727,19 @@

+ +
+ + +
+ + +
+ Show or hide the created and last updated dates on product and content pages. + +
+
+
diff --git a/make_post_sell/views/shop.py b/make_post_sell/views/shop.py index 11a67cb..5fcae7d 100644 --- a/make_post_sell/views/shop.py +++ b/make_post_sell/views/shop.py @@ -592,6 +592,20 @@ def shop_settings(request): ) ) + # Handle show dates setting + show_dates_value = request.params.get("show_dates") + if show_dates_value is not None: + show_dates = int(show_dates_value) == 1 + if shop.show_dates != show_dates: + shop.show_dates = show_dates + status = "visible" if show_dates else "hidden" + request.session.flash( + ( + f"Product and content dates are now {status}", + "success", + ) + ) + # Handle stripe settings form if form_section == "stripe-settings": # Handle disable action