Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Rearange the different blocks on the muscle overview page

Roland Geiderf30b476ca7bf
diff --git a/exercises/templates/muscle_overview.html b/exercises/templates/muscle_overview.html
index 206e58d4b..003a798e0 100644
--- a/exercises/templates/muscle_overview.html
+++ b/exercises/templates/muscle_overview.html
@@ -12,28 +12,28 @@
<script>
$(document).ready(function() {
$('.muscle').hover(function(e) {
- e.preventDefault();
- var div_id = $(this).data('target');
- var is_front = ($(this).data('isFront') == 'True') ? 'front' : 'back';
- var muscle_id = div_id.match(/\d+/);
-
- // Reset all other highlighted muscles
- $('.muscle').css('background-color', 'transparent');
- $('.muscle').css('font-weight', 'normal');
-
- // Hightligh the current one
- $(this).css('font-weight', 'bold');
- $(this).css('background-color', '#eeeeec');
-
- // Set the corresponding background
- $('#muscle-system').css('background-image',
- 'url(/static/images/muscles/main/muscle-' + muscle_id + '.svg),'
- + 'url(/static/images/muscles/muscular_system_' + is_front + '.svg)');
-
- // Show the corresponding exercises
- $('.exercise-list').hide();
- $('#' + div_id).show();
- });
+ e.preventDefault();
+ var div_id = $(this).data('target');
+ var is_front = ($(this).data('isFront') == 'True') ? 'front' : 'back';
+ var muscle_id = div_id.match(/\d+/);
+
+ // Reset all other highlighted muscles
+ $('.muscle').css('background-color', 'transparent');
+ $('.muscle').css('font-weight', 'normal');
+
+ // Hightligh the current one
+ $(this).css('font-weight', 'bold');
+ $(this).css('background-color', '#eeeeec');
+
+ // Set the corresponding background
+ $('#muscle-system').css('background-image',
+ 'url(/static/images/muscles/main/muscle-' + muscle_id + '.svg),'
+ + 'url(/static/images/muscles/muscular_system_' + is_front + '.svg)');
+
+ // Show the corresponding exercises
+ $('.exercise-list').hide();
+ $('#' + div_id).show();
+ });
});
</script>
{% endblock %}
@@ -50,8 +50,17 @@ $(document).ready(function() {
<div class="ym-grid linearize-level-1">
<div class="ym-g33 ym-gl">
<div class="ym-gbox-left">
- {% regroup muscle_list by is_front as test %}
- {% for group in test %}
+ <h3 style="text-align:center;">{% trans "Muscles" %}</h3>
+ <div id="muscle-system"
+ class="muscle-background"
+ style="background-image: url('/static/images/muscles/muscular_system_front.svg');">
+ </div>
+ </div>
+ </div>
+ <div class="ym-g33 ym-gl">
+ <div class="ym-gbox-left">
+ {% regroup muscle_list by is_front as muscle_group %}
+ {% for group in muscle_group %}
{% if group.grouper %}
<h3>{% trans "Front" %}</h3>
{% else %}
@@ -66,11 +75,10 @@ $(document).ready(function() {
{% endfor %}
</ul>
{% endfor %}
-
</div>
</div>
- <div class="ym-g33 ym-gl">
- <div class="ym-gbox-left">
+ <div class="ym-g33 ym-gr">
+ <div class="ym-gbox-right">
{% for muscle in muscle_list %}
<div id="muscle-{{muscle.id}}" style="display:none;" class="exercise-list">
<h3>{% trans "Exercises" %}</h3>
@@ -87,15 +95,6 @@ $(document).ready(function() {
{% endfor %}
</div>
</div>
- <div class="ym-g33 ym-gr">
- <div class="ym-gbox-right">
- <h3 style="text-align:center;">{% trans "Muscles" %}</h3>
- <div id="muscle-system"
- class="muscle-background"
- style="background-image: url('/static/images/muscles/muscular_system_front.svg');">
- </div>
- </div>
- </div>
</div>
{% endblock %}