add social battery sorting engine
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
<div id="task-recommendations">
|
||||
{% set battery_levels = {
|
||||
1: ['Low', 'battery_0_bar'],
|
||||
2: ['Steady', 'battery_2_bar'],
|
||||
3: ['Okay', 'battery_3_bar'],
|
||||
4: ['Good', 'battery_5_bar'],
|
||||
5: ['Full', 'battery_full']
|
||||
} %}
|
||||
<section class="social-battery" aria-labelledby="social-battery-title">
|
||||
<div>
|
||||
<h2 id="social-battery-title">Social battery</h2>
|
||||
<p>Choose today’s energy. We’ll put tasks that fit your {{ battery_budget }}-minute budget first.</p>
|
||||
</div>
|
||||
<form class="social-battery__levels">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token('social_battery') }}">
|
||||
{% for level, option in battery_levels %}
|
||||
<input
|
||||
id="social-battery-{{ level }}"
|
||||
class="social-battery__input"
|
||||
type="radio"
|
||||
name="social_battery"
|
||||
value="{{ level }}"
|
||||
{{ battery_level == level ? 'checked' : '' }}
|
||||
aria-label="{{ option[0] }} energy"
|
||||
hx-post="{{ path('app_task_social_battery') }}"
|
||||
hx-include="closest form"
|
||||
hx-target="#task-recommendations"
|
||||
hx-swap="outerHTML"
|
||||
>
|
||||
<label for="social-battery-{{ level }}" title="{{ option[0] }} energy">
|
||||
<span class="material-symbols-outlined" aria-hidden="true">{{ option[1] }}</span>
|
||||
<span class="visually-hidden">{{ option[0] }} energy</span>
|
||||
</label>
|
||||
{% endfor %}
|
||||
</form>
|
||||
</section>
|
||||
|
||||
{{ include('task/_task_list.html.twig', {tasks: tasks}) }}
|
||||
</div>
|
||||
Reference in New Issue
Block a user