Self hosted FLOSS fitness/workout, nutrition and weight tracker
Re-add the workout session loader to log template
Roland Geidercd4af2b0a42e
diff --git a/wger/core/static/js/workout-manager.js b/wger/core/static/js/workout-manager.jsindex a7dff2d71..361c4d93c 100644--- a/wger/core/static/js/workout-manager.js+++ b/wger/core/static/js/workout-manager.js@@ -532,12 +532,12 @@ function prefetch_images(imageArray) {$('#id_date').on('change', function() {var date = $('#id_date').val();if(date) {- $.get( '/api/v1/workoutsession/?date=' + date, function( result ) {- if (result.objects.length == 1) {- $('#id_notes').val(result.objects[0].notes)- $('#id_impression').val(result.objects[0].impression)- $('#id_time_start').val(result.objects[0].time_start)- $('#id_time_end').val(result.objects[0].time_end)+ $.get( '/api/v2/workoutsession/?date=' + date, function(data) {+ if (data.results.length == 1) {+ $('#id_notes').val(data.results[0].notes)+ $('#id_impression').val(data.results[0].impression)+ $('#id_time_start').val(data.results[0].time_start)+ $('#id_time_end').val(data.results[0].time_end)}else {$('#id_notes').val('');diff --git a/wger/manager/templates/day/log.html b/wger/manager/templates/day/log.htmlindex 65eb8e8e9..c7d0b04b4 100644--- a/wger/manager/templates/day/log.html+++ b/wger/manager/templates/day/log.html@@ -6,6 +6,11 @@{% block title %}{% trans "New weight log" %} – {{day.description}}{% endblock %}{% block header %}+<script type="text/javascript">+$(document).ready(function () {+ get_workout_session();+});+</script>{% endblock %}{% block content %}