From 10e0e83adfb012eb61dac293abd9f8b7ab043eca Mon Sep 17 00:00:00 2001 From: Russell Ballestrini Date: Sat, 4 Oct 2025 13:20:45 -0400 Subject: [PATCH] Replace inline styles with CSS classes across template files - Add comprehensive CSS classes to common.css for status messages, layouts, and styling - Remove all inline styles from shop_settings.j2 (16 instances) - Remove all inline styles from crypto_checkout.j2 (25 instances) - Remove all inline styles from cart_checkout.j2 (18 instances) - Remove all inline styles from cart.j2 (16 instances) New CSS classes added: - Status indicators: .status-message, .success-indicator, .error-indicator - Layout helpers: .inline-label, .full-width-input, .disabled-input - Crypto checkout: .crypto-logo, .payment-grid, .payment-buttons, .status-box - Cart styles: .cart-float-right, .cart-shop-name, .cart-total-amount - Notice boxes: .success-notice, .warning-notice, .warning-banner This improves maintainability, consistency, and enables better theming support. All conditional styling preserved using dynamic CSS class application. --- make_post_sell/static/css/common.css | 249 ++++++++++++++++++++ make_post_sell/templates/cart.j2 | 32 +-- make_post_sell/templates/cart_checkout.j2 | 36 +-- make_post_sell/templates/crypto_checkout.j2 | 36 +-- make_post_sell/templates/shop_settings.j2 | 33 ++- 5 files changed, 317 insertions(+), 69 deletions(-) diff --git a/make_post_sell/static/css/common.css b/make_post_sell/static/css/common.css index e337212..0201cdf 100644 --- a/make_post_sell/static/css/common.css +++ b/make_post_sell/static/css/common.css @@ -1069,3 +1069,252 @@ div.message-ribbon { display: block; } /* hidden control area */ + +/* Status and message styling */ +.status-message { + color: #666; +} + +.success-indicator { + color: green; +} + +.error-indicator { + color: #d44; +} + +.note-text { + color: #666; +} + +.inline-label { + display: inline; +} + +.favicon-preview { + width: 32px; +} + +/* Input field styling */ +.full-width-input { + width: 100%; +} + +.disabled-input { + opacity: 0.5; + background-color: #f5f5f5; +} + +/* Crypto checkout styles */ +.crypto-logo { + width: 150px; + height: 150px; + margin-right: 15px; + vertical-align: middle; +} + +.payment-grid { + display: grid; + grid-template-columns: auto 1fr; + gap: 20px; + margin: 16px 0; + align-items: start; +} + +.crypto-address { + white-space: pre-wrap; + word-wrap: break-word; +} + +.payment-buttons { + display: grid; + grid-template-columns: 1fr 1fr 1fr; + gap: 8px; + margin: 8px 0; +} + +.payment-button-row-1 { + grid-row: 1; +} + +.payment-button-cancel { + grid-column: 1 / -1; + grid-row: 2; +} + +.status-box { + background: #f8f9fa; + border: 1px solid #dee2e6; + border-radius: 4px; + padding: 15px; + margin: 10px 0; +} + +.confirmations-hidden { + display: none; +} + +.qr-fallback { + width: 150px; + height: 150px; + background: #f0f0f0; + display: flex; + align-items: center; + justify-content: center; + font-size: 12px; + color: #666; + border: 1px solid #ddd; +} + +.success-notice { + background: #d1fae5; + border: 1px solid #10b981; + border-radius: 4px; + padding: 15px; + margin: 20px 0; +} + +.warning-notice { + background: #fef3c7; + border: 1px solid #f59e0b; + border-radius: 4px; + padding: 15px; + margin: 20px 0; +} + +.monospace-address { + font-family: monospace; + background: #f0f0f0; + padding: 8px; + border-radius: 3px; + word-break: break-all; +} + +.notice-list { + margin: 10px 0; +} + +.notice-footer { + margin-top: 10px; +} + +/* Cart checkout styles */ +.disabled-crypto-button { + background: #aaa !important; + cursor: not-allowed; +} + +.crypto-button-icon { + width: 32px; + height: 32px; + margin-right: 8px; + vertical-align: middle; +} + +.crypto-settings-link { + color: #f59e0b; + text-decoration: none; + display: block; + margin-top: 10px; + font-size: 14px; +} + +.warning-banner { + background: #fff3cd; + border: 1px solid #ffeaa7; + padding: 10px; + border-radius: 5px; + color: #856404; +} + +.warning-banner-alt { + background: #fff3cd; + border: 1px solid #ffc107; + border-radius: 4px; + padding: 15px; + margin: 20px 0; +} + +.warning-banner p { + margin: 0; + font-size: 14px; +} + +.warning-banner h3 { + margin-top: 0; +} + +.warning-banner-content { + margin-bottom: 15px; +} + +.pending-quote-item { + background: #f8f9fa; + border: 1px solid #dee2e6; + border-radius: 3px; + padding: 10px; + margin: 8px 0; +} + +.pending-quote-grid { + display: grid; + grid-template-columns: 1fr auto; + align-items: start; +} + +.pending-quote-status { + color: #666; + margin-left: 10px; +} + +.view-quote-button { + background: #17a2b8; + font-size: 12px; + padding: 5px 10px; +} + +.pending-quote-details { + font-size: 12px; + color: #666; + margin-top: 5px; +} + +/* Cart page styles */ +.cart-float-right { + float: right; +} + +.cart-shop-grid-span { + grid-column: span 3; +} + +.cart-shop-name { + font-size: 1.5em; + font-weight: bold; +} + +.cart-inline-form { + display: inline; +} + +.cart-update-button { + width: 80px; +} + +.cart-total-section { + text-align: right; +} + +.cart-total-grid-span { + text-align: right; + grid-column: span 3; +} + +.cart-total-amount { + font-size: 1.5em; + font-weight: bold; +} + +.cart-public-link { + font-size: 0.8em; +} diff --git a/make_post_sell/templates/cart.j2 b/make_post_sell/templates/cart.j2 index 7b2e160..8b6e784 100644 --- a/make_post_sell/templates/cart.j2 +++ b/make_post_sell/templates/cart.j2 @@ -31,7 +31,7 @@ {{ coupon.human_limit_per_customer }} -
+
-
- {{ shop.name }} +
+ {{ shop.name }}
{% for product, quantity in product_quantity_tuples %} @@ -110,22 +110,22 @@
- + {% include "snippets/csrf.j2" %} quantity: - +
-
+ {% include "snippets/csrf.j2" %}
-
+
{{ "{:,}".format(product_quantity) }} x ${{ "{:,.2f}".format(product.price) }}
${{ "{:,.2f}".format(line_total) }} @@ -140,23 +140,23 @@
{% if request.shop_location.local_pickup %} -
+
{% endif %} {% if request.shop_location.local_delivery %} -