mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-22 14:51:09 -05:00
Add new component system for buttons, cards, and inputs
Integrates Django Cotton to replace existing UI components with a new templating system. Adds a test page to compare the new components against the old ones. Replit-Commit-Author: Agent Replit-Commit-Session-Id: dcfff319-6e91-4220-98a9-8295b87755b7 Replit-Commit-Checkpoint-Type: intermediate_checkpoint
This commit is contained in:
47
backend/templates/cotton/input.html
Normal file
47
backend/templates/cotton/input.html
Normal file
@@ -0,0 +1,47 @@
|
||||
{% comment %}
|
||||
Input Component - Django Cotton Version of shadcn/ui Input
|
||||
Usage: <c-input type="text" placeholder="Enter text..." name="field_name" />
|
||||
Preserves EXACT same HTML output as the original include version
|
||||
{% endcomment %}
|
||||
|
||||
<c-vars
|
||||
type="text"
|
||||
name=""
|
||||
id=""
|
||||
placeholder=""
|
||||
value=""
|
||||
required=""
|
||||
disabled=""
|
||||
readonly=""
|
||||
autocomplete=""
|
||||
x_model=""
|
||||
x_on=""
|
||||
hx_get=""
|
||||
hx_post=""
|
||||
hx_target=""
|
||||
hx_trigger=""
|
||||
hx_swap=""
|
||||
hx_include=""
|
||||
/>
|
||||
|
||||
<input
|
||||
type="{{ type|default:'text' }}"
|
||||
class="flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 {{ class|default:'' }}"
|
||||
{% if name %}name="{{ name }}"{% endif %}
|
||||
{% if id %}id="{{ id }}"{% endif %}
|
||||
{% if placeholder %}placeholder="{{ placeholder }}"{% endif %}
|
||||
{% if value %}value="{{ value }}"{% endif %}
|
||||
{% if required %}required{% endif %}
|
||||
{% if disabled %}disabled{% endif %}
|
||||
{% if readonly %}readonly{% endif %}
|
||||
{% if autocomplete %}autocomplete="{{ autocomplete }}"{% endif %}
|
||||
{% if x_model %}x-model="{{ x_model }}"{% endif %}
|
||||
{% if x_on %}{{ x_on }}{% endif %}
|
||||
{% if hx_get %}hx-get="{{ hx_get }}"{% endif %}
|
||||
{% if hx_post %}hx-post="{{ hx_post }}"{% endif %}
|
||||
{% if hx_target %}hx-target="{{ hx_target }}"{% endif %}
|
||||
{% if hx_trigger %}hx-trigger="{{ hx_trigger }}"{% endif %}
|
||||
{% if hx_swap %}hx-swap="{{ hx_swap }}"{% endif %}
|
||||
{% if hx_include %}hx-include="{{ hx_include }}"{% endif %}
|
||||
{{ attrs }}
|
||||
/>
|
||||
Reference in New Issue
Block a user