diff --git a/backend/templates/components/layout/enhanced_header.html b/backend/templates/components/layout/enhanced_header.html index 475f6928..773e40c1 100644 --- a/backend/templates/components/layout/enhanced_header.html +++ b/backend/templates/components/layout/enhanced_header.html @@ -4,6 +4,7 @@ Includes: Browse menu, advanced search, theme toggle, user dropdown, mobile menu {% endcomment %} {% load static %} +{% load cotton %}
@@ -149,7 +150,7 @@ Includes: Browse menu, advanced search, theme toggle, user dropdown, mobile menu hx-include="this" name="q" /> - {% include 'components/ui/button.html' with variant='default' size='sm' text='Search' class='absolute right-1 top-1/2 transform -translate-y-1/2' %} +
@@ -315,7 +316,7 @@ Includes: Browse menu, advanced search, theme toggle, user dropdown, mobile menu hx-swap="beforeend" class="cursor-pointer" > - {% include 'components/ui/button.html' with variant='outline' size='sm' text='Login' %} +
- {% include 'components/ui/button.html' with variant='default' size='sm' text='Join' %} +
{% endif %} @@ -440,7 +441,7 @@ Includes: Browse menu, advanced search, theme toggle, user dropdown, mobile menu hx-include="this" name="q" /> - {% include 'components/ui/button.html' with variant='default' size='sm' text='Search' class='absolute right-1 top-1/2 transform -translate-y-1/2' %} +
diff --git a/backend/templates/cotton/auth/login_form.html b/backend/templates/cotton/auth/login_form.html new file mode 100644 index 00000000..d37b9d10 --- /dev/null +++ b/backend/templates/cotton/auth/login_form.html @@ -0,0 +1,131 @@ +{% comment %} +Cotton Login Form Component +Converts existing login form to use Django Cotton's component system +{% endcomment %} + +{% load i18n %} +{% load account socialaccount %} +{% load turnstile_tags %} + + + + +
+ {% csrf_token %} + + + {% if form.non_field_errors %} +
+
{{ form.non_field_errors }}
+
+ {% endif %} + + +
+ + + {% if form.login.errors %} +

{{ form.login.errors }}

+ {% endif %} +
+ + +
+ + + {% if form.password.errors %} +

{{ form.password.errors }}

+ {% endif %} +
+ + +
+ {% if show_remember and show_remember != '' %} +
+ + +
+ {% endif %} + + {% if show_forgot_password and show_forgot_password != '' %} + + {% endif %} +
+ + + + + + {% if redirect_field_value %} + + {% endif %} + + + +
+ +
+
+ + + +
+
+
+
+
\ No newline at end of file diff --git a/backend/templates/cotton/auth/turnstile_empty.html b/backend/templates/cotton/auth/turnstile_empty.html new file mode 100644 index 00000000..a1605855 --- /dev/null +++ b/backend/templates/cotton/auth/turnstile_empty.html @@ -0,0 +1,17 @@ +{% comment %} +Cotton Turnstile Empty Widget Component +Empty template when DEBUG is True - converts to Cotton format +{% endcomment %} + + + + + +{% if show_debug_message and show_debug_message != '' %} +
+ {{ debug_message }} +
+{% endif %} \ No newline at end of file diff --git a/backend/templates/cotton/auth/turnstile_widget.html b/backend/templates/cotton/auth/turnstile_widget.html new file mode 100644 index 00000000..b5dc1048 --- /dev/null +++ b/backend/templates/cotton/auth/turnstile_widget.html @@ -0,0 +1,36 @@ +{% comment %} +Cotton Turnstile Widget Component +Converts existing Cloudflare Turnstile widget to use Django Cotton's component system +{% endcomment %} + + + + + + +
+
+
+ + \ No newline at end of file diff --git a/backend/templates/cotton/ui/button.html b/backend/templates/cotton/ui/button.html new file mode 100644 index 00000000..ce7a9e99 --- /dev/null +++ b/backend/templates/cotton/ui/button.html @@ -0,0 +1,82 @@ +{% comment %} +Cotton Button Component - Django Template Version of shadcn/ui Button +Converts existing button component to use Django Cotton's component system +{% endcomment %} + +{% load static %} + + + + + \ No newline at end of file diff --git a/backend/templates/cotton/ui/card.html b/backend/templates/cotton/ui/card.html new file mode 100644 index 00000000..5787a44e --- /dev/null +++ b/backend/templates/cotton/ui/card.html @@ -0,0 +1,58 @@ +{% comment %} +Cotton Card Component - Django Template Version of shadcn/ui Card +Converts existing card component to use Django Cotton's component system +{% endcomment %} + + + + +
+ {% if title or description or header_content %} +
+ {% if title %} +

{{ title }}

+ {% endif %} + {% if description %} +

{{ description }}

+ {% endif %} + + + + {% if header_content %} + {{ header_content|safe }} + {% endif %} + +
+ {% endif %} + + {% if content or body_content %} +
+ + + {% if content %} + {{ content|safe }} + {% endif %} + {% if body_content %} + {{ body_content|safe }} + {% endif %} + +
+ {% endif %} + + {% if footer_content %} +
+ + + {{ footer_content|safe }} + +
+ {% endif %} +
\ No newline at end of file diff --git a/backend/templates/cotton/ui/input.html b/backend/templates/cotton/ui/input.html new file mode 100644 index 00000000..5a1e185d --- /dev/null +++ b/backend/templates/cotton/ui/input.html @@ -0,0 +1,51 @@ +{% comment %} +Cotton Input Component - Django Template Version of shadcn/ui Input +Converts existing input component to use Django Cotton's component system +{% endcomment %} + + + + + \ No newline at end of file diff --git a/backend/templates/cotton/ui/pagination.html b/backend/templates/cotton/ui/pagination.html new file mode 100644 index 00000000..4b564545 --- /dev/null +++ b/backend/templates/cotton/ui/pagination.html @@ -0,0 +1,111 @@ +{% comment %} +Cotton Pagination Component +Converts existing pagination component to use Django Cotton's component system +{% endcomment %} + + + + +{% if page_obj %} +
+ +
+ {% if page_obj.has_previous %} + + Previous + + {% else %} + + Previous + + {% endif %} + + {% if page_obj.has_next %} + + Next + + {% else %} + + Next + + {% endif %} +
+ + + +
+{% endif %} \ No newline at end of file diff --git a/backend/templates/cotton/ui/search_form.html b/backend/templates/cotton/ui/search_form.html new file mode 100644 index 00000000..e5a4e7aa --- /dev/null +++ b/backend/templates/cotton/ui/search_form.html @@ -0,0 +1,158 @@ +{% comment %} +Cotton Search Form Component +Converts existing search form component to use Django Cotton's component system +Preserves accessibility and structure from original component +{% endcomment %} + + + + +
+
+ +
+ +
+
+ + + +
+ +
+
+ + + + {% if filters %} + {% for filter in filters %} +
+ + + {% if filter.type == 'select' %} + + + {% elif filter.type == 'checkbox' %} +
+ {% for option in filter.options %} + + {% endfor %} +
+ + {% elif filter.type == 'range' %} +
+ + +
+ {% endif %} +
+ {% endfor %} + {% endif %} +
+
+ + +
+
+ + + {% if request.GET.urlencode %} + + + + + Clear + + {% endif %} +
+ + + + {% if show_sort %} +
+ + +
+ {% endif %} +
+
+
\ No newline at end of file diff --git a/backend/templates/cotton/ui/status_badge.html b/backend/templates/cotton/ui/status_badge.html new file mode 100644 index 00000000..26362349 --- /dev/null +++ b/backend/templates/cotton/ui/status_badge.html @@ -0,0 +1,39 @@ +{% comment %} +Cotton Status Badge Component +Converts existing status badge component to use Django Cotton's component system +Preserves canonical status mapping from park_tags +{% endcomment %} + +{% load park_tags %} + + + + +{% with status_config=status|get_status_config %} + + {% if status_config.icon %} + + + + {% endif %} + + + + {{ status_config.label }} + + +{% endwith %} \ No newline at end of file