From cb944485b82d6d7b5a8a0616fdc8e7700b264607 Mon Sep 17 00:00:00 2001 From: pac7 <47831526-pac7@users.noreply.replit.com> Date: Sun, 21 Sep 2025 13:51:06 +0000 Subject: [PATCH] Add testing pages and update component attributes for enhanced interactivity Integrates Django Cotton components with new test pages, updating button and input component templates to correctly handle `x_data` and `x_on` attributes for improved interactivity. Replit-Commit-Author: Agent Replit-Commit-Session-Id: eff39de1-3afa-446d-a965-acaf61837fc7 Replit-Commit-Checkpoint-Type: intermediate_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/d6d61dac-164d-45dd-929f-7dcdfd771b64/eff39de1-3afa-446d-a965-acaf61837fc7/J3NgjVS --- backend/templates/cotton/ui/button.html | 6 +- backend/templates/cotton/ui/input.html | 8 +- .../templates/pages/cotton_minimal_test.html | 21 + .../templates/pages/cotton_simple_test.html | 64 +++ backend/templates/pages/cotton_test.html | 460 ++++++++++++++++++ backend/thrillwiki/urls.py | 15 + 6 files changed, 567 insertions(+), 7 deletions(-) create mode 100644 backend/templates/pages/cotton_minimal_test.html create mode 100644 backend/templates/pages/cotton_simple_test.html create mode 100644 backend/templates/pages/cotton_test.html diff --git a/backend/templates/cotton/ui/button.html b/backend/templates/cotton/ui/button.html index bc9ad39b..c3ff7229 100644 --- a/backend/templates/cotton/ui/button.html +++ b/backend/templates/cotton/ui/button.html @@ -13,8 +13,8 @@ Converts existing button component to use Django Cotton's component system type="type|default:'button'" disabled="disabled|default:''" onclick="onclick|default:''" - x_data="x_data|default:''" - x_on="x_on|default:''" + x_data="x_data" + x_on="x_on" hx_get="hx_get|default:''" hx_post="hx_post|default:''" hx_target="hx_target|default:''" @@ -60,7 +60,7 @@ Converts existing button component to use Django Cotton's component system {% if hx_post %}hx-post="{{ hx_post }}"{% endif %} {% if hx_target %}hx-target="{{ hx_target }}"{% endif %} {% if hx_swap %}hx-swap="{{ hx_swap }}"{% endif %} - {% if x_data and x_data != '' %}x-data="{{ x_data }}"{% endif %} + {% if x_data and x_data != 'x_data' %}x-data="{{ x_data }}"{% endif %} {% if x_on %}{{ x_on }}{% endif %} {% if disabled and disabled != '' %}disabled{% endif %} {{ attrs }} diff --git a/backend/templates/cotton/ui/input.html b/backend/templates/cotton/ui/input.html index 5a1e185d..b308839e 100644 --- a/backend/templates/cotton/ui/input.html +++ b/backend/templates/cotton/ui/input.html @@ -14,9 +14,9 @@ Converts existing input component to use Django Cotton's component system disabled="disabled|default:''" required="required|default:''" readonly="readonly|default:''" - x_model="x_model|default:''" - x_data="x_data|default:''" - x_on="x_on|default:''" + x_model="x_model" + x_data="x_data" + x_on="x_on" hx_get="hx_get|default:''" hx_post="hx_post|default:''" hx_target="hx_target|default:''" @@ -41,7 +41,7 @@ Converts existing input component to use Django Cotton's component system {% if required %}required{% endif %} {% if readonly %}readonly{% endif %} {% if x_model %}x-model="{{ x_model }}"{% endif %} - {% if x_data %}x-data="{{ x_data }}"{% endif %} + {% if x_data and x_data != 'x_data' %}x-data="{{ x_data }}"{% endif %} {% if x_on %}{{ x_on }}{% endif %} {% if hx_get %}hx-get="{{ hx_get }}"{% endif %} {% if hx_post %}hx-post="{{ hx_post }}"{% endif %} diff --git a/backend/templates/pages/cotton_minimal_test.html b/backend/templates/pages/cotton_minimal_test.html new file mode 100644 index 00000000..fcc30651 --- /dev/null +++ b/backend/templates/pages/cotton_minimal_test.html @@ -0,0 +1,21 @@ +{% extends 'base/base.html' %} +{% load cotton %} + +{% block title %}Minimal Cotton Test - ThrillWiki{% endblock %} + +{% block content %} +
If you see buttons above, Cotton components are working correctly!
++ Basic test of Cotton components +
+Card content goes here.
++ If you can see this page without errors, basic Cotton components are working. +
++ Testing all 9 Phase 1 Cotton Components +
++ This is the main content area of the card component. +
++ Testing nested components within cards. +
++ Value: +
++ Testing pagination with mock page object data: +
+ + ++ Showing 11 to 20 of 100 results +
+Components Tested
+JavaScript Status
+Responsive Design
+