Remove dependency on tail select component and instead role my own to minmise bundle size
This commit is contained in:
@@ -10,21 +10,17 @@
|
||||
<div class="mb-3 w-full"><label
|
||||
class="block uppercase tracking-wide text-gray-700 text-xs font-bold mb-2"
|
||||
for="grid-city">People</label>
|
||||
<select class="bg-gray-50 border border-gray-300 h-10 invisible"
|
||||
hx-get="{{ url_for('dashboard') }}"
|
||||
hx-include="[name='min_date'],[name='max_date'],[name='exercise_id']" hx-push-url="true"
|
||||
hx-target="#container" multiple="" name="person_id" _="init js(me)
|
||||
tail.select(me, {
|
||||
multiple: true,
|
||||
search: true,
|
||||
placeholder: 'Filter people',
|
||||
})
|
||||
end">
|
||||
{% for person in people %}
|
||||
<option value="{{ person.id }}" {% if person.selected %}selected{% endif %}>{{ person.name
|
||||
}}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
{{ render_partial('partials/custom_select.html',
|
||||
name='person_id',
|
||||
options=people,
|
||||
multiple=true,
|
||||
search=true,
|
||||
placeholder='Filter people',
|
||||
hx_get=url_for('dashboard'),
|
||||
hx_include="input[name='min_date'],input[name='max_date'],#select-exercise_id",
|
||||
hx_target='#container',
|
||||
hx_push_url=true)
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -35,21 +31,17 @@
|
||||
<div class="mb-3 w-full"><label
|
||||
class="block uppercase tracking-wide text-gray-700 text-xs font-bold mb-2"
|
||||
for="grid-city">Exercises</label>
|
||||
<select class="bg-gray-50 border border-gray-300 h-10 invisible"
|
||||
hx-get="{{ url_for('dashboard') }}"
|
||||
hx-include="[name='min_date'],[name='max_date'],[name='person_id']" hx-push-url="true"
|
||||
hx-target="#container" multiple="" name="exercise_id" _="init js(me)
|
||||
tail.select(me, {
|
||||
multiple: true,
|
||||
search: true,
|
||||
placeholder: 'Filter exercises',
|
||||
})
|
||||
end">
|
||||
{% for exercise in exercises %}
|
||||
<option value="{{ exercise.id }}" {% if exercise.selected %}selected{% endif %}>
|
||||
{{ exercise.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
{{ render_partial('partials/custom_select.html',
|
||||
name='exercise_id',
|
||||
options=exercises,
|
||||
multiple=true,
|
||||
search=true,
|
||||
placeholder='Filter exercises',
|
||||
hx_get=url_for('dashboard'),
|
||||
hx_include="input[name='min_date'],input[name='max_date'],#select-person_id",
|
||||
hx_target='#container',
|
||||
hx_push_url=true)
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -68,7 +60,7 @@
|
||||
</svg></div><input
|
||||
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5 w-full"
|
||||
hx-get="{{ url_for('dashboard') }}"
|
||||
hx-include="[name='min_date'],[name='max_date'],[name='person_id'],[name='exercise_id']"
|
||||
hx-include="input[name='min_date'],input[name='max_date'],#select-person_id,#select-exercise_id"
|
||||
hx-push-url="true" hx-target="#container" hx-trigger="change" name="min_date" type="date"
|
||||
value="{{ min_date }}">
|
||||
</div>
|
||||
@@ -98,7 +90,7 @@
|
||||
</div>
|
||||
|
||||
<div class="hidden" hx-get="{{ url_for('get_people_graphs') }}"
|
||||
hx-include="[name='exercise_id'],[name='min_date'],[name='max_date'],[name='person_id']" hx-trigger="load"
|
||||
hx-include="#select-exercise_id,input[name='min_date'],input[name='max_date'],#select-person_id" hx-trigger="load"
|
||||
hx-target="this" hx-swap="outerHTML">
|
||||
</div>
|
||||
|
||||
@@ -195,7 +187,7 @@
|
||||
|
||||
|
||||
<div class="hidden" hx-get="{{ url_for('get_stats') }}"
|
||||
hx-include="[name='exercise_id'],[name='min_date'],[name='max_date'],[name='person_id']" hx-trigger="load"
|
||||
hx-include="#select-exercise_id,input[name='min_date'],input[name='max_date'],#select-person_id" hx-trigger="load"
|
||||
hx-target="#stats" hx-swap="innerHTML">
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user