Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Many miscellaneous changes to make usage more intuitive and consistent

Roland Geider2bc3f9b2cb1b
diff --git a/wger/exercises/templates/mobile/overview.html b/wger/exercises/templates/mobile/overview.html
index 3bd9c691d..3700b6b6d 100644
--- a/wger/exercises/templates/mobile/overview.html
+++ b/wger/exercises/templates/mobile/overview.html
@@ -49,7 +49,7 @@ $( "#exercise_search_form" ).on( "listviewbeforefilter", function ( e, data ) {
{% block content %}
-<div data-role="collapsible-set" data-theme="c" data-content-theme="d">
+<div data-role="collapsible-set" data-theme="c" data-content-theme="c">
{% for category in categories %}
<div data-role="collapsible">
<h3>{{ category.name }}</h3>
@@ -76,6 +76,7 @@ $( "#exercise_search_form" ).on( "listviewbeforefilter", function ( e, data ) {
data-theme="c"
data-filter="true"
data-filter-reveal="true"
+ data-inset="true"
data-filter-placeholder="{% trans 'exercise name' %}"
id="exercise_search_form">
{% for category in categories %}
diff --git a/wger/manager/static/css/workout-manager-mobile.css b/wger/manager/static/css/workout-manager-mobile.css
index bf57ac19c..913393121 100644
--- a/wger/manager/static/css/workout-manager-mobile.css
+++ b/wger/manager/static/css/workout-manager-mobile.css
@@ -81,7 +81,7 @@ div.info a.ui-link, div.info a.ui-link:hover, div.info a.ui-link:active{
table {
width:100%;
border-collapse:collapse;
- margin: 1.3571em 0 0 0;
+ /*margin: 1.3571em 0 0 0;*/
color:#333;
border-top: 1px #ccc solid;
border-bottom: 1px #ccc solid;
@@ -127,8 +127,9 @@ tbody td {
*/
div.muscle-background
{
- width: 200px;
- height: 369px;
+ width: 150px;
+ height: 276px;
+ background-size: 150px;
background-repeat: no-repeat;
}
diff --git a/wger/manager/templates/mobile/day/log.html b/wger/manager/templates/mobile/day/log.html
index 079822024..2f2a11f44 100644
--- a/wger/manager/templates/mobile/day/log.html
+++ b/wger/manager/templates/mobile/day/log.html
@@ -21,74 +21,53 @@ $(document).ready(function () {
{{formset.management_form}}
<table class="workout-log-table">
-<tr>
- <td>
- {% trans dateform.date.label %}
- </td>
- <td >
- <div class= "ym-fbox-text {% if dateform.date.errors %}ym-error{% endif %}">
- {{dateform.date}}
- </div>
-
- <div class="ym-fbox-text {% if dateform.date.errors %}ym-error{% endif %}">
- <span class="ym-message">{{dateform.date.errors}}</span>
- </div>
- </td>
-</tr>
+{% yaml_form_field dateform.date %}
</table>
<h3>{% trans "Exercises" %}</h3>
-<table class="workout-log-table">
{% for key, value in exercises.items %}
-<tr>
- <td style="max-width: 5em; padding-right:0.4em;">
- {{value.obj.name}}
- </td>
-
- {% for form in value.forms %}
- <td class="narrow-input">
- <div class= "ym-fbox-text narrow-input {% if form.reps.errors %}ym-error{% endif %}">
- {{form.reps}}
- </div>
- <div class="ym-fbox-text narrow-input {% if form.reps.errors %}ym-error{% endif %}">
- <span class="ym-message">{% trans "Reps" %}</span>
- </div>
- </td>
- <td>
- <div class= "ym-fbox-text narrow-input {% if form.weight.errors %}ym-error{% endif %}">
- {{form.weight}}
- </div>
-
- <div class="ym-fbox-text narrow-input {% if form.weight.errors %}ym-error{% endif %}" >
- <span class="ym-message">kg.</span>
- </div>
- </td>
- {% endfor %}
-
-</tr>
+ <p>{{value.obj.name}}</p>
+
+ <table class="workout-log-table">
+ <tr>
+ {% for form in value.forms %}
+ <td class="narrow-input">
+ <div {% if form.weight.errors %}class="form-error"{% endif %}>
+ {{form.reps}}
+ </div>
+ <div {% if form.weight.errors %}class="form-error"{% endif %}>
+ <span class="ym-message">{% trans "Reps" %}</span>
+ </div>
+ </td>
+ <td>
+ <div {% if form.weight.errors %}class="form-error"{% endif %}>
+ {{form.weight}}
+ </div>
+
+ <div {% if form.weight.errors %}class="form-error"{% endif %}>
+ <span class="ym-message">kg.</span>
+ </div>
+ </td>
+ {% endfor %}
+ </tr>
+ </table>
{% empty %}
-<tr>
- <td>
<p>
- {% trans "Add exercises to this training day before adding a log." %}
-
- <a href="{% url 'workout-view' day.training.id %}">
- {% trans "Back to workout" %}
- </a>
-
+ {% trans "Add exercises to this training day before adding a log." %}
+ <a href="{% url 'workout-view' day.training.id %}">{% trans "Back to workout" %}</a>
</p>
- </td>
-</tr>
{% endfor %}
</table>
-<table>
-<tr>
- <td style="text-align:center;">
- <input type="submit" value="{% trans 'Save' %}" id="form-save" style="width: 95%;">
+
+<p>
+ <a href="{% url 'index' %}"
+ data-role="button"
+ data-rel="back"
+ data-mini="true">{% trans "Cancel" %}</a>
+ <input type="submit" value="{% trans 'Save' %}" id="form-save">
</td>
-</tr>
-</table>
+</p>
</form>
{% endblock %}
diff --git a/wger/manager/templates/mobile/delete.html b/wger/manager/templates/mobile/delete.html
new file mode 100644
index 000000000..6b10360a0
--- /dev/null
+++ b/wger/manager/templates/mobile/delete.html
@@ -0,0 +1,40 @@
+{% extends "base.html" %}
+{% load i18n %}
+{% load staticfiles %}
+
+<!--
+ Title
+-->
+{% block title %}{{title}}{% endblock %}
+
+
+<!--
+ Main Content
+-->
+{% block content %}
+<form action="{{form_action}}"
+ method="post"
+ class="ym-form">
+ {% csrf_token %}
+ <img src="{% static 'images/icons/warning.svg' %}"
+ width="48"
+ height="48"
+ class="flexible float-left"
+ alt="{% trans "Are you sure you want to delete this? This action cannot be undone." %}">
+ <p>{% trans "Are you sure you want to delete this? This action cannot be undone." %}</p>
+ <p>{{ delete_message }}</p>
+ <p>
+ <a href="{% url 'index' %}"
+ data-role="button"
+ data-rel="back"
+ data-mini="true">{% trans "Cancel" %}</a>
+ <input type="submit" value="{% trans 'Delete' %}">
+ </p>
+</form>
+{% endblock %}
+
+
+<!--
+ Side bar
+-->
+{% block sidebar %}{{sidebar|safe}}{% endblock %}
diff --git a/wger/manager/templates/mobile/form.html b/wger/manager/templates/mobile/form.html
new file mode 100644
index 000000000..28c33b57a
--- /dev/null
+++ b/wger/manager/templates/mobile/form.html
@@ -0,0 +1,66 @@
+{% extends "base.html" %}
+{% load i18n %}
+{% load staticfiles %}
+{% load wger_extras %}
+
+{% block header %}
+
+{{ form.media }}
+
+{% if custom_js %}
+<script type="text/javascript">
+ {{custom_js|safe}}
+</script>
+{% endif %}
+
+{% endblock %}
+
+<!--
+ Title
+-->
+{% block title %}{{title}}{% endblock %}
+
+
+<!--
+ Main Content
+-->
+{% block content %}
+<form action="{{form_action}}"
+ method="post"
+ class="ym-form">
+{% csrf_token %}
+
+{% if form.non_field_errors %}
+<div class="ym-fbox-text ym-error">
+ {% for error in form.non_field_errors %}
+ <p class="ym-message">{% trans error %}</p>
+ {% endfor %}
+</div>
+{% endif %}
+
+<table>
+ {% for current_field in form_fields %}
+ {% if current_field.name in select_lists %}
+ {% yaml_form_field current_field "ym-fbox-select" %}
+ {% else %}
+ {% yaml_form_field current_field %}
+ {% endif %}
+ {% endfor %}
+ <tr>
+ <td colspan="2">
+ <a href="{% url 'index' %}"
+ data-role="button"
+ data-rel="back"
+ data-mini="true">{% trans "Cancel" %}</a>
+ <input type="submit" value="{{submit_text}}" id="form-save">
+ </td>
+ </tr>
+</table>
+</form>
+{% endblock %}
+
+
+<!--
+ Side bar
+-->
+{% block sidebar %}{% if sidebar %}{% include sidebar %}{% endif %}{% endblock %}
diff --git a/wger/manager/templates/mobile/schedule/view.html b/wger/manager/templates/mobile/schedule/view.html
index 2f84d4f61..1ed2bb8af 100644
--- a/wger/manager/templates/mobile/schedule/view.html
+++ b/wger/manager/templates/mobile/schedule/view.html
@@ -100,27 +100,16 @@ $(function() {
</a>
</li>
{% endfor %}
+<li>
+ <a href="{% url 'step-add' schedule.id %}">{% trans "Add workout" %}</a>
+</li>
{% if schedule.is_loop %}
<li>
{% trans "This schedule is a loop and will go through the workouts above till you deactivate it" %}
</li>
- {% endif %}
+{% endif %}
</ul>
-
-
-
-<p>
-<a href="{% url 'step-add' schedule.id %}"
- data-role="button"
- data-mini="true">
-<img src="{% static 'images/icons/new.svg' %}"
- width="32"
- height="32"
- alt="{% trans 'Add workout' %}"
- title="{% trans 'Add workout' %}">
-{% trans "Add workout" %}</a>
-</p>
{% endblock %}
@@ -153,5 +142,4 @@ than once.{% endblocktrans %}</p>
title="{% trans 'Delete schedule' %}">
{% trans "Delete schedule" %}</a>
</p>
-
{% endblock %}
diff --git a/wger/manager/templates/mobile/set/add.html b/wger/manager/templates/mobile/set/add.html
index a6c449282..4c9e97c8d 100644
--- a/wger/manager/templates/mobile/set/add.html
+++ b/wger/manager/templates/mobile/set/add.html
@@ -61,6 +61,10 @@ $(document).on('pageinit', function(){
</tr>
<tr>
<td colspan="2">
+ <a href="{% url 'index' %}"
+ data-role="button"
+ data-rel="back"
+ data-mini="true">{% trans "Cancel" %}</a>
<input type="submit" value="{% trans 'Save' %}" id="form-save">
</td>
</tr>
diff --git a/wger/manager/templates/mobile/set/edit.html b/wger/manager/templates/mobile/set/edit.html
new file mode 100644
index 000000000..605466ddc
--- /dev/null
+++ b/wger/manager/templates/mobile/set/edit.html
@@ -0,0 +1,46 @@
+{% extends "base.html" %}
+{% load url from future %}
+{% load i18n %}
+{% load staticfiles %}
+{% load wger_extras %}
+
+
+<!--
+ Title
+-->
+
+{% block title %}{% trans "Edit set" %}{% endblock %}
+
+<!--
+ Main Content
+-->
+{% block content %}
+
+
+<form action="{{form_action}}"
+ method="post"
+ class="ym-form">
+
+{% csrf_token %}
+<table>
+ <tr>
+ <td colspan="2">
+ <div id="formsets">
+ {% for formset in formsets %}
+ {% include 'set/formset.html' with exercise=formset.exercise formset=formset.formset %}
+ {% endfor %}
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <a href="{% url 'index' %}"
+ data-role="button"
+ data-rel="back"
+ data-mini="true">{% trans "Cancel" %}</a>
+ <input type="submit" value="{% trans 'Save' %}" id="form-save">
+ </td>
+ </tr>
+</table>
+
+{% endblock %}
diff --git a/wger/manager/templates/mobile/template.html b/wger/manager/templates/mobile/template.html
index 6eceb74d5..9c8df8715 100644
--- a/wger/manager/templates/mobile/template.html
+++ b/wger/manager/templates/mobile/template.html
@@ -34,6 +34,7 @@
<script src="{% static 'js/jquery.js' %}" type="text/javascript"></script>
+ <script src="{% static 'js/jquery-ui.js' %}" type="text/javascript"></script>
<script src="{% static 'js/jquery-mobile.js' %}" type="text/javascript"></script>
<script src="{% static 'js/d3.js' %}"></script>
<script src="{% static 'js/workout-manager.js' %}" type="text/javascript"></script>
diff --git a/wger/manager/templates/mobile/user/preferences.html b/wger/manager/templates/mobile/user/preferences.html
index c0e22d0d5..a9cba7dfd 100644
--- a/wger/manager/templates/mobile/user/preferences.html
+++ b/wger/manager/templates/mobile/user/preferences.html
@@ -26,6 +26,10 @@
{% yaml_form_field email_form.email %}
<tr>
<td colspan="2">
+ <a href="{% url 'index' %}"
+ data-role="button"
+ data-rel="back"
+ data-mini="true">{% trans "Cancel" %}</a>
<input type="submit" value="{% trans 'Save' %}">
</td>
</tr>
diff --git a/wger/manager/templates/mobile/workout/view.html b/wger/manager/templates/mobile/workout/view.html
index a34ab76db..018e7ff3e 100644
--- a/wger/manager/templates/mobile/workout/view.html
+++ b/wger/manager/templates/mobile/workout/view.html
@@ -121,7 +121,8 @@ $(document).on('pageinit', function () {
</a>
<a href="{% url 'workout-edit' workout.id %}"
- data-role="button">
+ data-role="button"
+ data-ajax="false">
<img src="{% static 'images/icons/edit.svg' %}"
width="32"
height="32"
@@ -131,7 +132,8 @@ $(document).on('pageinit', function () {
</a>
<a href="{% url 'workout-log' workout.id %}"
- data-role="button">
+ data-role="button"
+ data-ajax="false">
<img src="{% static 'images/icons/statistics.svg' %}"
width="32"
height="32"
diff --git a/wger/nutrition/templates/mobile/plan/view.html b/wger/nutrition/templates/mobile/plan/view.html
index c19b9c65c..551b9f440 100644
--- a/wger/nutrition/templates/mobile/plan/view.html
+++ b/wger/nutrition/templates/mobile/plan/view.html
@@ -185,38 +185,67 @@ $(document).ready(function() {
{% block sidebar %}
<h3>{% trans "Nutritional data" %}</h3>
-<table id="nutritional-data-macronutrients">
+<table id="nutritional-data-energy">
<thead>
<tr>
<th colspan="2">
- {% trans "Macronutrients" %}
+ {% trans "Energy" %}
</th>
</tr>
</thead>
<tbody>
<tr>
<td>{% trans "Energy" %}</td>
- <td>{{nutritional_data.energy|floatformat}} kcal</td>
+ <td class="align-right">{{nutritional_data.energy|floatformat:"0"}} kcal</td>
+ </tr>
+ {% if user.userprofile.calories and plan.has_goal_calories %}
+ {% with total=plan.get_calories_approximation %}
+ <tr>
+ <td>{% trans "Goal" %}</td>
+ <td class="align-right" style="color:{% if total == 1 %}#8ae234;{% elif total == 2 %}#fce94f;{% elif total == 3 %}#fcaf3e;{% elif total > 3 %}#ef2929;{% endif %}">
+ <strong>{{user.userprofile.calories|floatformat:"0"}} kcal</strong></td>
+ </tr>
+ {% endwith %}
+ {% endif %}
+ </tbody>
+</table>
+
+
+{% if plan.has_goal_calories %}
+ <p>{% blocktrans %}You have selected that this nutritional plan has a
+ goal amount of calories. Use the calculator or enter the value yourself.{% endblocktrans %}
+ <a href="{% url 'calories-calculator' %}">{% trans "That's done here" %}</a>
+ </p>
+{% endif %}
+
+<table id="nutritional-data-macronutrients">
+ <thead>
+ <tr>
+ <th colspan="2">
+ {% trans "Macronutrients" %}
+ </th>
</tr>
+ </thead>
+ <tbody>
<tr>
<td>{% trans "Protein" %}</td>
- <td>{{nutritional_data.protein|floatformat}} g</td>
+ <td class="align-right">{{nutritional_data.protein|floatformat}} g</td>
</tr>
<tr>
<td>{% trans "Carbohydrates" %}</td>
- <td>{{nutritional_data.carbohydrates|floatformat}} g</td>
+ <td class="align-right">{{nutritional_data.carbohydrates|floatformat}} g</td>
</tr>
<tr>
<td style="padding-left: 2em;">{% trans "Sugar content in carbohydrates" %}</td>
- <td>{{nutritional_data.carbohydrates_sugar|floatformat}} g</td>
+ <td class="align-right">{{nutritional_data.carbohydrates_sugar|floatformat}} g</td>
</tr>
<tr>
<td>{% trans "Fat" %}</td>
- <td>{{nutritional_data.fat|floatformat}} g</td>
+ <td class="align-right">{{nutritional_data.fat|floatformat}} g</td>
</tr>
<tr>
<td style="padding-left: 2em;">{% trans "Saturated fat content in fats" %}</td>
- <td>{{nutritional_data.fat_saturated|floatformat}} g</td>
+ <td class="align-right">{{nutritional_data.fat_saturated|floatformat}} g</td>
</tr>
</tbody>
</table>
@@ -232,11 +261,11 @@ $(document).ready(function() {
<tbody>
<tr>
<td>{% trans "Fibres" %}</td>
- <td>{{nutritional_data.fibres|floatformat}} g</td>
+ <td class="align-right">{{nutritional_data.fibres|floatformat}} g</td>
</tr>
<tr>
<td>{% trans "Sodium" %}</td>
- <td>{{nutritional_data.sodium|floatformat}} g</td>
+ <td class="align-right">{{nutritional_data.sodium|floatformat}} g</td>
</tr>
</tbody>
</table>