Fix error on refresh where footer elements fused with action button
This commit is contained in:
10
app.py
10
app.py
@@ -115,8 +115,8 @@ def get_calendar(person_id):
|
||||
|
||||
if htmx:
|
||||
return render_template('partials/page/calendar.html',
|
||||
person=person, selected_date=selected_date, selected_view=selected_view, next_date=next_date, previous_date=previous_date, start_date=start_date, end_date=end_date), 200, {"HX-Trigger": "updatedPeople"}
|
||||
return render_template('calendar.html', person=person, selected_date=selected_date, selected_view=selected_view, next_date=next_date, previous_date=previous_date, start_date=start_date, end_date=end_date), 200, {"HX-Trigger": "updatedPeople"}
|
||||
person=person, selected_date=selected_date, selected_view=selected_view, next_date=next_date, previous_date=previous_date, start_date=start_date, end_date=end_date)
|
||||
return render_template('calendar.html', person=person, selected_date=selected_date, selected_view=selected_view, next_date=next_date, previous_date=previous_date, start_date=start_date, end_date=end_date)
|
||||
|
||||
|
||||
@ app.route("/person/<int:person_id>/workout/<int:workout_id>/modal", methods=['GET'])
|
||||
@@ -291,9 +291,9 @@ def settings():
|
||||
def my_utility_processor():
|
||||
|
||||
def is_selected_page(url):
|
||||
if htmx:
|
||||
parsed_url = urlparse(htmx.current_url)
|
||||
return 'bg-gray-200' if url == parsed_url.path else ''
|
||||
# if htmx:
|
||||
# parsed_url = urlparse(htmx.current_url)
|
||||
# return 'bg-gray-200' if url == parsed_url.path else ''
|
||||
if url == request.path:
|
||||
return 'bg-gray-200'
|
||||
return ''
|
||||
|
||||
@@ -87,7 +87,8 @@
|
||||
<div class="flex-1 px-3 bg-white divide-y space-y-1">
|
||||
<div class="space-y-2 pt-2">
|
||||
<a hx-get="{{ url_for('dashboard') }}" hx-push-url="true" hx-target="#container"
|
||||
class="text-base text-gray-900 font-normal rounded-lg flex items-center p-2 hover:bg-gray-100 group cursor-pointer {{ is_selected_page(url_for('dashboard')) }}">
|
||||
class="text-base text-gray-900 font-normal rounded-lg flex items-center p-2 hover:bg-gray-100 group cursor-pointer {{ is_selected_page(url_for('dashboard')) }}"
|
||||
_="on click toggle .bg-gray-200 on me">
|
||||
<svg class="w-6 h-6 text-gray-500 group-hover:text-gray-900 transition duration-75"
|
||||
fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M2 10a8 8 0 018-8v8h8a8 8 0 11-16 0z"></path>
|
||||
@@ -104,7 +105,8 @@
|
||||
</ul>
|
||||
<div class="space-y-2 pt-2">
|
||||
<a hx-get="{{ url_for('settings') }}" hx-push-url="true" hx-target="#container"
|
||||
class="text-base text-gray-900 font-normal rounded-lg hover:bg-gray-100 group transition duration-75 flex items-center p-2 cursor-pointer {{ is_selected_page(url_for('settings')) }}">
|
||||
class="text-base text-gray-900 font-normal rounded-lg hover:bg-gray-100 group transition duration-75 flex items-center p-2 cursor-pointer {{ is_selected_page(url_for('settings')) }}"
|
||||
_="on click toggle .bg-gray-200 on me">
|
||||
<svg class="w-6 h-6 text-gray-500 group-hover:text-gray-900 transition duration-75"
|
||||
fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"
|
||||
data-darkreader-inline-fill="" style="--darkreader-inline-fill:currentColor;">
|
||||
|
||||
@@ -174,4 +174,5 @@
|
||||
<path fill="#FFFFFF" d="M16,10c0,0.553-0.048,1-0.601,1H11v4.399C11,15.951,10.553,16,10,16c-0.553,0-1-0.049-1-0.601V11H4.601
|
||||
C4.049,11,4,10.553,4,10c0-0.553,0.049-1,0.601-1H9V4.601C9,4.048,9.447,4,10,4c0.553,0,1,0.048,1,0.601V9h4.399
|
||||
C15.952,9,16,9.447,16,10z" />
|
||||
</svg>
|
||||
</button>
|
||||
@@ -155,6 +155,6 @@
|
||||
<svg viewBox="0 0 20 20" enable-background="new 0 0 20 20" class="w-6 h-6 inline-block">
|
||||
<path fill="#FFFFFF" d="M16,10c0,0.553-0.048,1-0.601,1H11v4.399C11,15.951,10.553,16,10,16c-0.553,0-1-0.049-1-0.601V11H4.601
|
||||
C4.049,11,4,10.553,4,10c0-0.553,0.049-1,0.601-1H9V4.601C9,4.048,9.447,4,10,4c0.553,0,1,0.048,1,0.601V9h4.399
|
||||
C15.952,9,16,9.447,16,10z">
|
||||
C15.952,9,16,9.447,16,10z" />
|
||||
</svg>
|
||||
</button>
|
||||
@@ -2,7 +2,7 @@
|
||||
<li>
|
||||
<a hx-get="{{ url_for('get_calendar' ,person_id=p['PersonId']) }}" hx-push-url="true" hx-target="#container"
|
||||
class="text-base text-gray-900 font-normal rounded-lg hover:bg-gray-100 flex items-center p-2 group cursor-pointer {% if
|
||||
p['IsActive']==1 %} bg-gray-200 {% endif %} {{ is_selected_page(url_for('get_calendar' ,person_id=p['PersonId'])) }}">
|
||||
p['IsActive']==1 %} bg-gray-200 {% endif %} {{ is_selected_page(url_for('get_calendar' ,person_id=p['PersonId'])) }}" _="on click toggle .bg-gray-200 on me">
|
||||
<svg class="w-6 h-6 text-gray-500 flex-shrink-0 group-hover:text-gray-900 transition duration-75"
|
||||
fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" d="M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z" clip-rule="evenodd">
|
||||
|
||||
Reference in New Issue
Block a user