Self hosted FLOSS fitness/workout, nutrition and weight tracker
Add and improve more templates and navigation
Roland Geider03b554912462
diff --git a/wger/exercises/templates/mobile/view.html b/wger/exercises/templates/mobile/view.htmlindex 27198aa56..6383bb6cb 100644--- a/wger/exercises/templates/mobile/view.html+++ b/wger/exercises/templates/mobile/view.html@@ -143,30 +143,32 @@ included in the database.{% endblocktrans %}{% trans "Secondary muscles" %}</div>-<div class="ym-grid linearize-level-1">- <div class="ym-g50 ym-gl">- <div class="ym-gbox-left">- <div id="muscle-front" class="muscle-background" style="background-image: {% for background in muscle_backgrounds_front %}url({% static background %}){% if not forloop.last %},{% endif %}{% endfor %};">- </div>- <ul>- {% for muscle in muscles %}- {% if muscle.is_front %}- <li>{{muscle.name}}</li>- {% endif %}- {% endfor %}-- {% for muscle in muscles_secondary %}- {% if muscle.is_front %}- <li>{{muscle.name}}</li>- {% endif %}- {% endfor %}- </ul>- </div>++<div class="ui-grid-a">+ <div class="ui-block-a">+ <div id="muscle-front" class="muscle-background" style="background-image: {% for background in muscle_backgrounds_front %}url({% static background %}){% if not forloop.last %},{% endif %}{% endfor %};"></div></div>- <div class="ym-g50 ym-gr">- <div class="ym-gbox-right">- <div id="muscle-front" class="muscle-background" style="background-image: {% for background in muscle_backgrounds_back %}url({% static background %}){% if not forloop.last %},{% endif %}{% endfor %};">- </div>+ <div class="ui-block-b">+ <div id="muscle-back" class="muscle-background" style="background-image: {% for background in muscle_backgrounds_back %}url({% static background %}){% if not forloop.last %},{% endif %}{% endfor %};"></div>+ </div>+</div>+<div class="ui-grid-a">+ <div class="ui-block-a">+ <ul>+ {% for muscle in muscles %}+ {% if muscle.is_front %}+ <li>{{muscle.name}}</li>+ {% endif %}+ {% endfor %}++ {% for muscle in muscles_secondary %}+ {% if muscle.is_front %}+ <li>{{muscle.name}}</li>+ {% endif %}+ {% endfor %}+ </ul>+ </div>+ <div class="ui-block-b"><ul>{% for muscle in muscles %}{% if not muscle.is_front %}@@ -180,7 +182,7 @@ included in the database.{% endblocktrans %}{% endif %}{% endfor %}</ul>- </div>+</div></div>@@ -211,7 +213,7 @@ weight_log_chart({{json|safe}}, "{{svg_uuid}}", "{{reps}}")-->{% block sidebar %}-<h3>{% trans "Back to overview" %}</h3>+<h3>{% trans "Options" %}</h3><p><a href="{% url 'wger.exercises.views.exercises.overview' %}"data-role="button">diff --git a/wger/manager/static/css/workout-manager-mobile.css b/wger/manager/static/css/workout-manager-mobile.cssindex 652086170..a7518258d 100644--- a/wger/manager/static/css/workout-manager-mobile.css+++ b/wger/manager/static/css/workout-manager-mobile.css@@ -114,11 +114,11 @@ table {border-top: 1px #ccc solid;border-bottom: 1px #ccc solid;}-+table.bordertable {border:1px #ccc solid;}-+.bordertable thead th {background:#e0e0e0;border-right:1px #ccc solid;@@ -147,4 +147,15 @@ tbody td {.bordertable tbody td {border-right:1px solid #ccc;+}+++/*+ * Set the sizes for the background where the muscles are shown on the exercise view page+ */+div.muscle-background+{+ width: 200px;+ height: 369px;+ background-repeat: no-repeat;}\ No newline at end of filediff --git a/wger/manager/templates/mobile/index.html b/wger/manager/templates/mobile/index.htmlindex d60a8c030..ee49ecd15 100644--- a/wger/manager/templates/mobile/index.html+++ b/wger/manager/templates/mobile/index.html@@ -45,7 +45,7 @@{% else %}<p><a href="{% url 'wger.manager.views.workout.add' %}" data-role="button">- {% trans "No workouts found." %} {% trans "Add one now." %}+ {% trans "No workouts found." %}<br>{% trans "Add one now." %}</a></p>{% endif %}@@ -84,7 +84,7 @@{% else %}<p><a href="{% url 'wger.nutrition.views.plan.add' %}" data-role="button">- {% trans "No nutrition plans." %} {% trans "Add one now." %}+ {% trans "No nutrition plans." %}<br>{% trans "Add one now." %}</a></p>{% endif %}@@ -99,6 +99,13 @@{% block sidebar %}+<h3>{% trans "Info" %}</h3>+<p>{% blocktrans %}The current workout is selected from your active schedule+or, if you don't have one, simply by date.{% endblocktrans %}</p>++<p>{% trans "After adding a workout or a nutritional plan, you can edit them to set a goal." %}+</p>+<h3>{% trans "Options" %}</h3><a href="{% url 'wger.manager.views.workout.add' %}" data-role="button"><img src="{% static 'images/icons/new.svg' %}"@@ -123,11 +130,4 @@alt="{% trans 'My preferences' %}"title="{% trans 'My preferences' %}">{% trans "My preferences" %}</a>--<h3>{% trans "Info" %}</h3>-<p>{% blocktrans %}The current workout is selected from your active schedule-or, if you don't have one, simply by date.{% endblocktrans %}</p>--<p>{% trans "After adding a workout or a nutritional plan, you can edit them to set a goal." %}-</p>{% endblock %}diff --git a/wger/manager/templates/mobile/navigation.html b/wger/manager/templates/mobile/navigation.htmlindex c247ea02f..13c457c98 100644--- a/wger/manager/templates/mobile/navigation.html+++ b/wger/manager/templates/mobile/navigation.html@@ -4,7 +4,7 @@{# #}{# User tab #}{# #}- <div data-role="collapsible">+ <div data-role="collapsible" data-content-theme="c"><h3>{% trans "Dashboard" %}</h3><ul data-role="listview"><li {% if active_tab == 'user' %}class="active"{% endif %}><a href="{% url 'index' %}">{% trans "Dashboard" %}</a></li>@@ -15,7 +15,7 @@{# #}{# Workout tab #}{# #}- <div data-role="collapsible">+ <div data-role="collapsible" data-content-theme="c"><h3>{% trans "Workouts" %}</h3><ul data-role="listview"><li><a href="{% url 'wger.manager.views.workout.overview' %}" rel="nofollow">{% trans "Workouts" %}</a></li>@@ -26,7 +26,7 @@{# #}{# Exercises tab #}{# #}- <div data-role="collapsible">+ <div data-role="collapsible" data-content-theme="c"><h3>{% trans "Exercises" %}</h3><ul data-role="listview"><li><a href="{% url 'wger.exercises.views.exercises.overview' %}">{% trans "Exercises" %}</a></li>@@ -45,7 +45,7 @@{# #}{# Weight tab #}{# #}- <div data-role="collapsible">+ <div data-role="collapsible" data-content-theme="c"><h3>{% trans "Weight" %}</h3><ul data-role="listview"><li><a href="{% url 'wger.weight.views.overview' %}" rel="nofollow">{% trans "Weight overview" %}</a></li>@@ -56,7 +56,7 @@{# #}{# Nutrition tab #}{# #}- <div data-role="collapsible">+ <div data-role="collapsible" data-content-theme="c"><h3>{% trans "Nutrition" %}</h3><ul data-role="listview"><li><a href="{% url 'wger.nutrition.views.plan.overview' %}" rel="nofollow">{% trans "Nutrition plans" %}</a></li>@@ -74,7 +74,7 @@{# #}{# Software tab #}{# #}- <div data-role="collapsible">+ <div data-role="collapsible" data-content-theme="c"><h3>{% trans "About this software" %}</h3><ul data-role="listview"><li><a href="{% url 'software:features' %}">{% trans "Features" %}</a></li>@@ -95,4 +95,12 @@</ul></div>-</div>\ No newline at end of file+</div>++<a href=""+ data-rel="close"+ data-role="button"+ data-icon="delete"+ data-iconpos="notext"+ data-inline="true"+ data-theme="b"></a>\ No newline at end of filediff --git a/wger/manager/templates/mobile/tags/render_day.html b/wger/manager/templates/mobile/tags/render_day.htmlindex 634d59340..1cdd94743 100644--- a/wger/manager/templates/mobile/tags/render_day.html+++ b/wger/manager/templates/mobile/tags/render_day.html@@ -9,13 +9,13 @@<th colspan="2"><h4><a href="#editoptions-day-{{ day.id }}"- class="ui-icon-nodisc"+ class="ui-icon-nodisc ui-icon-alt"data-rel="popup"data-role="button"data-inline="true"data-transition="slideup"data-icon="gear"- data-theme="b"+ data-theme="d"data-iconpos="notext"data-mini="true"data-iconshadow="false"></a>{{day.description}}</h4>@@ -77,13 +77,13 @@<td class="ym-g10"><!--{{ forloop.counter }}--><a href="#editoptions-set-{{ set.id }}"- class="ui-icon-nodisc"+ class="ui-icon-nodisc ui-icon-alt"data-rel="popup"data-role="button"data-inline="true"data-transition="slideup"data-icon="gear"- data-theme="b"+ data-theme="c"data-iconpos="notext"data-mini="true"data-iconshadow="false"></a>@@ -177,7 +177,7 @@<a href="{% url 'set-add' day.id %}"class="modal-dialog"data-role="button">- {% trans "No exercises selected for this day." %}+ {% trans "No exercises selected for this day." %}<br>{% trans "Add one now." %}</a>{% endfor %} <!--for set in day-->diff --git a/wger/manager/templates/mobile/template.html b/wger/manager/templates/mobile/template.htmlindex d918f14ac..938e0114d 100644--- a/wger/manager/templates/mobile/template.html+++ b/wger/manager/templates/mobile/template.html@@ -48,7 +48,7 @@<div data-role="page"><header data-role="header">- <h1>wger Workout Manager</h1>+ <h1>wger</h1><a href="#main-panel-navigation"class="ui-icon-nodisc"data-rel="popup"@@ -56,9 +56,38 @@data-icon="bars"data-iconpos="notext"data-iconshadow="false"></a>+ {% if not user.is_authenticated or user.get_profile.is_temporary %}+ <a href="#popupGuestUser"+ data-rel="popup"+ data-role="button"+ data-inline="true"+ data-transition="pop"+ data-theme="b"+ data-icon="info"+ data-iconpos="notext"></a>+ {% endif %}</header>- <div data-role="navbar">+ <div data-role="panel" id="main-panel-navigation" data-display="overlay">+ {% include 'navigation.html' %}+ </div>++++ <div data-role="content">+ {% if not user.is_authenticated or user.get_profile.is_temporary %}+ <div data-role="popup" id="popupGuestUser" class="ui-content">+ {% trans "You are using a guest account, data entered will be deleted after a week."%}+ {% if not has_demo_data %}+ <a href="{% url 'demo-entries' %}" rel="nofollow" data-role="button" data-mini="true">{% trans "Create some demo entries" %} »</a>+ {% endif %}+ </div>+ {% endif %}+ {% block content %}{% endblock %}+ {% block sidebar %}{% endblock %}+ </div>++ <div data-role="navbar" data-role="footer"><ul><li {% if active_tab == 'user' %}class="active"{% endif %}>{% if not user.is_authenticated %}@@ -85,29 +114,6 @@</ul></div>- <div data-role="panel" id="main-panel-navigation">- {% include 'navigation.html' %}- </div>---- <div data-role="content">- {% block content %}{% endblock %}- {% block sidebar %}{% endblock %}- </div>-- <div data-role="footer">- <div class="ui-grid-a">- <div class="ui-block-a">- © <a href="mailto:roland@NO!SPAM!geider.net">Roland Geider</a>- </div>-- <div class="ui-block-b">- <em class="dimmed">{{version}}</em>- </div>- </div>- </div>-</div><!-- /page --></body>diff --git a/wger/manager/templates/mobile/user/preferences.html b/wger/manager/templates/mobile/user/preferences.htmlnew file mode 100644index 000000000..b69e47926--- /dev/null+++ b/wger/manager/templates/mobile/user/preferences.html@@ -0,0 +1,60 @@+{% extends "base.html" %}+{% load url from future %}+{% load i18n %}+{% load staticfiles %}+{% load wger_extras %}++{% block title %}{% trans "Preferences" %}{% endblock %}+++{% block content %}+<form action="{% url 'preferences' %}"+ method="post"+ class="ym-form">+ {% csrf_token %}+ {{ form.non_field_errors }}+<table>+{% yaml_form_field form.show_comments %}+{% yaml_form_field form.show_english_ingredients %}+</table>+++<h3>{% trans "Email" %}</h3>++{{ email_form.non_field_errors }}+<table>+{% yaml_form_field email_form.email %}+ <tr>+ <td colspan="2">+ <input type="submit" value="{% trans 'Save' %}">+ </td>+ </tr>+</table>+</form>+++{% endblock %}++{% block sidebar %}+<h3>{% trans "Options" %}</h3>+<p>+ <a href="{% url 'logout' %}"+ data-role="button">+ <img src="{% static 'images/icons/logout.svg' %}"+ width="32"+ height="32"+ alt="{% trans 'Logout' %}"+ title="{% trans 'Logout' %}">+ {% trans "Logout" %}</a>+</p>+<p>+ <a href="{% url 'change-password' %}"+ data-role="button">+ <img src="{% static 'images/icons/preferences.svg' %}"+ width="32"+ height="32"+ alt="{% trans 'Change password' %}"+ title="{% trans 'Change password' %}">+ {% trans "Change password" %}</a>+</p>+{% endblock %}diff --git a/wger/manager/templates/mobile/workout/overview.html b/wger/manager/templates/mobile/workout/overview.htmlindex 46c1f9cb7..f88364508 100644--- a/wger/manager/templates/mobile/workout/overview.html+++ b/wger/manager/templates/mobile/workout/overview.html@@ -7,8 +7,6 @@{% block content %}{% if workouts %}--<table id="workout-table" data-role="table" class="ui-responsive table-stroke table-stripe"><thead><tr>@@ -39,12 +37,10 @@</tbody></table>{% else %}- <div class="box warning">- {% trans "No workouts found." %} {% trans "Use link to add one." %}- </div>+ <a href="{% url 'wger.manager.views.workout.add' %}" data-role="button">+ {% trans "No workouts found." %}<br>{% trans "Add one now." %}+ </a>{% endif %}--{% endblock %}diff --git a/wger/nutrition/templates/mobile/plan/overview.html b/wger/nutrition/templates/mobile/plan/overview.htmlindex c7b26faa7..65bef66e7 100644--- a/wger/nutrition/templates/mobile/plan/overview.html+++ b/wger/nutrition/templates/mobile/plan/overview.html@@ -36,8 +36,8 @@</table>{% else %}<p>- <a href="{% url 'wger.nutrition.views.plan.add' %}" class="btn btn-block">- {% trans "No nutrition plans." %} {% trans "Add one now." %}+ <a href="{% url 'wger.nutrition.views.plan.add' %}" data-role="button">+ {% trans "No nutrition plans." %}<br> {% trans "Add one now." %}</a></p>{% endif %}diff --git a/wger/weight/templates/mobile/weight_overview.html b/wger/weight/templates/mobile/weight_overview.htmlnew file mode 100644index 000000000..1d0cfcf6e--- /dev/null+++ b/wger/weight/templates/mobile/weight_overview.html@@ -0,0 +1,139 @@+{% extends "base.html" %}+{% load url from future %}+{% load i18n %}+{% load staticfiles %}++<!--+ Title+-->+{% block title %}{% trans "Weight overview" %}{% endblock %}++<!--+ Header data+-->+{% block header %}+<script src="{% static 'js/d3.js' %}"></script>+<script src="{% static 'js/jquery-globalize/lib/globalize.js' %}"></script>++++<script type="text/javascript">++// Initialise the datepicker for the modal dialog+function custom_modal_init()+{+ init_weight_datepicker();+}+++$(document).ready(function () {++ // Load the chart data, without arguments this returns all weight entries+ var date_min = $("#weight_filter_from").val();+ var date_max = $("#weight_filter_to").val();+ var filter_data = {}+ if( date_min && date_max)+ {+ filter_data = {'date_min': date_min,+ 'date_max': date_max}+ }++ $.getJSON("/weight/api/get_weight_data/", filter_data, function(json) {+ weight_chart(json);+ });++ // Add datepickers to the filter elements++ $("#weight_filter_from").datepicker({ dateFormat: "yy-mm-dd",+ {% if min_date %}minDate: {{ min_date }}{% endif %}+ });+ $("#weight_filter_to").datepicker({ dateFormat: "yy-mm-dd",+ {% if max_date %}maxDate: {{max_date}}{% endif %}+ });++ // Process the filter+ $("#weight_diagram_refresh").click(function(e) {++ e.preventDefault();++ var date_min = $("#weight_filter_from").val();+ var date_max = $("#weight_filter_to").val();++ $.getJSON("/weight/api/get_weight_data/",+ {'date_min': date_min,+ 'date_max': date_max},+ function(json) {+ weight_chart(json);+ });+ });+});+</script>+{% endblock %}+++<!--+ Main Content+-->+{% block content %}+{% if not min_date %}+<p>+ {% trans "There is no chart here because there are no weight entries." %}+ {% trans "Use link to add one." %}+</p>+{% endif %}++<div id="weight_diagram"></div>++<p>+<a href="{% url 'weight-add' %}"+ class="modal-dialog"+ id="add-weight-entry"+ data-role="button">{% trans "Add weight entry" %}</a>+</p>++<p>+ <em>{% trans "You can click on a value on the chart to edit it. "%}</em>+</p>++{% endblock %}+++<!--+ Side bar+-->+{% block sidebar %}+<h3>{% trans "Filter options" %}</h3>+<p>{% blocktrans %}+Use the second chart to pan or zoom by clicking and dragging the selection. Clicking+on the background resets it.+{% endblocktrans %}</p>+++<h3>{% trans "Options" %}</h3>+<p>+ <a href="{% url 'wger.weight.views.export_csv' %}"+ target="_blank"+ data-role="button">+ <img src="{% static 'images/icons/save.svg' %}"+ width="32"+ height="32"+ alt="{% trans 'Export as CSV' %}"+ title="{% trans 'Export as CSV' %}">+ {% trans "Export as CSV" %}+ </a>+</p>++<p>+ <a href="{% url 'weight-import-csv' %}"+ data-role="button">+ <img src="{% static 'images/icons/csv-table.svg' %}"+ width="32"+ height="32"+ alt="{% trans 'Import from spreadsheet' %}"+ title="{% trans 'Import from spreadsheet' %}">+ {% trans "Import from spreadsheet" %}+ </a>+</p>+++{% endblock %}