Commit 8f9f5ea1 authored by Sondre Westby Liestøl's avatar Sondre Westby Liestøl
Browse files

Changes in wokrout view

parent e55da8f8
Pipeline #161706 passed with stage
in 26 seconds
......@@ -106,7 +106,7 @@ class WorkoutSerializer(serializers.HyperlinkedModelSerializer):
for exercise_instance_data in exercise_instances_data:
exercise = ExerciseInstance.objects.create(workout=workout, **exercise_instance_data)
difficulty += exercise.exercise.difficulty;
difficulty += exercise.exercise.difficulty
for file_data in files_data:
......@@ -164,7 +164,7 @@ class WorkoutSerializer(serializers.HyperlinkedModelSerializer):
exercise_instance.sets = exercise_instance_data.get(
"sets", exercise_instance.sets
)
difficulty += exercise_instance.exercise.difficulty;
difficulty += exercise_instance.exercise.difficulty
exercise_instance.save()
# If new exercise instances have been added to the workout, then create them
......@@ -174,7 +174,7 @@ class WorkoutSerializer(serializers.HyperlinkedModelSerializer):
exercise = ExerciseInstance.objects.create(
workout=instance, **exercise_instance_data
)
difficulty += exercise.exercise.difficulty;
difficulty += exercise.exercise.difficulty
# Else if exercise instances have been removed from the workout, then delete them
elif len(exercise_instances_data) < len(exercise_instances.all()):
for i in range(len(exercise_instances_data), len(exercise_instances.all())):
......
......@@ -82,6 +82,19 @@
<div class="col-lg-6"></div>
</form>
<div class="col-lg-6"></div>
<form class="row g-3 mb-4" id="form-add-members">
<div class="col-lg-12">
<label for="add-member" class="form-label">Add Member</label>
<input type="text" class="form-control" id="memberName" name="memberName" readonly>
<input type="button" class="btn btn-primary" id="btn-add-member" value="addmember">
</div>
<div class="col-lg-6"></div>
<div class="row bootstrap snippets bootdeys" id="div-comment-row">
<div class="col-md-8 col-sm-12">
<div class="comment-wrapper">
......@@ -126,15 +139,6 @@
<div class="col-lg-6"></div>
</div>
</template>
<div class="col-lg-6"></div>
<form class="row g-3 mb-4" id="form-add-users">
<div class="col-lg-6">
<label for="add-member" class="form-label">Add Member</label>
<input type="text" class="form-control" id="memberName" name="memberName" readonly>
<input type="button" class="form-control" id="btn-add-member" name="addmember" readonly>
</div>
<div class="col-lg-6"></div>
<script src="scripts/defaults.js"></script>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment