Skip to content

Commit

Permalink
Add styling to media dropdown
Browse files Browse the repository at this point in the history
could not get select-bordered to work no matter what i did.
I tried to add the class to a random html element so tailwindcss
would detect it and add it to the css file, but it still didnt work.
input-bordered seems to be working fine tho 🤷
  • Loading branch information
stveit committed Dec 4, 2024
1 parent 428a8d8 commit 992d8b5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/argus/htmx/destination/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ class Meta:
labels = {
"label": "Name",
}
widgets = {
"media": forms.Select(attrs={"class": "select input-bordered w-full max-w-xs"}),
}

def clean(self):
super().clean()
Expand Down
6 changes: 5 additions & 1 deletion src/argus/htmx/templates/htmx/destination/_create_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
<div class="label">
<span class="label-text">{{ field.label }}</span>
</div>
<div class="input input-bordered flex items-center gap-2">{{ field }}</div>
{% if field.name == "media" %}
{{ field }}
{% else %}
<div class="input input-bordered flex items-center gap-2">{{ field }}</div>
{% endif %}
<div class="label">
<span class="label-text-alt min-h-4">
{% if field.errors %}<p class="text-error">{{ field.errors }}</p>{% endif %}
Expand Down

0 comments on commit 992d8b5

Please sign in to comment.