Switch to using render_partial instead of include

This commit is contained in:
Peter Stockings
2023-10-20 19:40:43 +11:00
parent ec9ec443e4
commit f340d1d3a9
4 changed files with 12 additions and 18 deletions

View File

@@ -1,8 +1,8 @@
<div class="block p-6 bg-white border border-b-0 border-gray-200 rounded-lg rounded-b-none shadow">
<div class="flex flex-row justify-between">
<h5 class="mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white">{{ u.name }}</h5>
<h5 class="mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white">{{ user.name }}</h5>
<div hx-delete="{{ url_for('delete_user', user_id=user.id) }}"
hx-confirm="Are you sure you wish to delete your account {{ u.name }}?" hx-target="#users-container"
hx-confirm="Are you sure you wish to delete your account {{ user.name }}?" hx-target="#users-container"
class="cursor-pointer pr-2">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" class="w-6 h-6" data-darkreader-inline-stroke=""
@@ -37,13 +37,14 @@
</div>
<button
class="shadow mt-6 bg-purple-500 hover:bg-purple-400 focus:shadow-outline focus:outline-none text-white font-bold py-2 px-4 rounded w-full ml-0 md:ml-4"
type="submit" onclick="location.href = '{{ url_for('new_workout', user_id=u.id) }}';">New Workout</button>
type="submit" onclick="location.href = '{{ url_for('new_workout', user_id=user.id) }}';">New
Workout</button>
</div>
</div>
<div
class="border border-t-0 border-neutral-200 border-b-lg bg-white dark:border-neutral-600 dark:bg-neutral-800 mb-8">
{% if u.workouts_count > 0 %}
{% if user.workouts_count > 0 %}
<h2 class="mb-0">
<button
@@ -63,11 +64,11 @@
</button>
</h2>
<div class="!visible collapse p-4 hidden">
{{ render_partial('partials/calendar.html', calendar_month=u.calendar_month, user_id = u.id) }}
{{ render_partial('partials/calendar.html', calendar_month=user.calendar_month, user_id = user.id) }}
<div id="workouts-list-wrapper-for-user-{{ u.id }}" class="mt-5 pl-2">{{
<div id="workouts-list-wrapper-for-user-{{ user.id }}" class="mt-5 pl-2">{{
render_partial('partials/workouts_list_fragment.html',
workouts=workouts[:7], user_id = u.id) }}</div>
workouts=workouts[:7], user_id = user.id) }}</div>
</div>