Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Add microformats to muscles and ingredients

Roland Geidered112e10ce6f
diff --git a/exercises/templates/muscle_overview.html b/exercises/templates/muscle_overview.html
index 4bb9d436d..d8d462aae 100644
--- a/exercises/templates/muscle_overview.html
+++ b/exercises/templates/muscle_overview.html
@@ -20,11 +20,11 @@ $(document).ready(function() {
// Reset all other highlighted muscles
$('.muscle').removeClass('muscle-active');
$('.muscle').addClass('muscle-inactive');
-
+
// Hightligh the current one
$(this).removeClass('muscle-inactive');
$(this).addClass('muscle-active');
-
+
// Set the corresponding background
$('#muscle-system').css('background-image',
@@ -73,7 +73,9 @@ $(document).ready(function() {
{% for muscle in group.list %}
<li class="muscle"
data-target="muscle-{{muscle.id}}"
- data-is-front="{{muscle.is_front}}">{{muscle.name}}</li>
+ data-is-front="{{muscle.is_front}}"
+ itemscope itemtype="http://schema.org/Muscle">
+ <div itemprop="name">{{muscle.name}}</div></li>
{% endfor %}
</ul>
{% endfor %}
diff --git a/nutrition/templates/view_ingredient.html b/nutrition/templates/view_ingredient.html
index 8a728b4c5..ee7851dbe 100644
--- a/nutrition/templates/view_ingredient.html
+++ b/nutrition/templates/view_ingredient.html
@@ -7,7 +7,8 @@
{% block content %}
-<h2>{{ingredient.name}}</h2>
+<div itemscope itemtype="http://schema.org/NutritionInformation">
+<h2 itemprop="name">{{ingredient.name}}</h2>
<p>{% trans "Nutritional values in 100g of product." %}</p>
@@ -22,27 +23,27 @@
<tbody>
<tr>
<td style="width:80%;">{% trans "Energy" %}</td>
- <td>{{ingredient.energy}} kcal</td>
+ <td itemprop="calories">{{ingredient.energy}} kcal</td>
</tr>
<tr>
<td>{% trans "Protein" %}</td>
- <td>{{ingredient.protein}} g</td>
+ <td itemprop="proteinContent">{{ingredient.protein}} g</td>
</tr>
<tr>
<td>{% trans "Carbohydrates" %}</td>
- <td>{{ingredient.carbohydrates}} g</td>
+ <td itemprop="carbohydrateContent">{{ingredient.carbohydrates}} g</td>
</tr>
<tr>
<td style="padding-left: 3em;">{% trans "Sugar content in carbohydrates" %}</td>
- <td>{{ingredient.carbohydrates_sugar}} g</td>
+ <td itemprop="sugarContent">{{ingredient.carbohydrates_sugar}} g</td>
</tr>
<tr>
<td>{% trans "Fat" %}</td>
- <td>{{ingredient.fat}} g</td>
+ <td itemprop="fatContent">{{ingredient.fat}} g</td>
</tr>
<tr>
<td style="padding-left: 3em;">{% trans "Saturated fat content in fats" %}</td>
- <td>{{ingredient.fat_saturated}} g</td>
+ <td itemprop="saturatedFatContent">{{ingredient.fat_saturated}} g</td>
</tr>
</tbody>
</table>
@@ -58,15 +59,15 @@
<tbody>
<tr>
<td style="width:80%;">{% trans "Fibres" %}</td>
- <td>{% if ingredient.fibres %}{{ingredient.fibres}} g{% else %}-/-{% endif %}</td>
+ <td itemprop="fiberContent">{% if ingredient.fibres %}{{ingredient.fibres}} g{% else %}-/-{% endif %}</td>
</tr>
<tr>
<td>{% trans "Sodium" %}</td>
- <td>{% if ingredient.sodium %}{{ingredient.sodium}} g{% else %}-/-{% endif %}</td>
+ <td itemprop="sodiumContent">{% if ingredient.sodium %}{{ingredient.sodium}} g{% else %}-/-{% endif %}</td>
</tr>
</tbody>
</table>
-
+</div>
{% endblock %}