Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Some changes to gym mode to make it work with jQueryMobile 1.4

Roland Geiderec6d1910155e
diff --git a/wger/manager/static/css/workout-manager-mobile.css b/wger/manager/static/css/workout-manager-mobile.css
index 25d584756..862259769 100644
--- a/wger/manager/static/css/workout-manager-mobile.css
+++ b/wger/manager/static/css/workout-manager-mobile.css
@@ -604,11 +604,18 @@ header h1{
/**************************************************************
* Gym mode pages
**************************************************************/
-div#timer-container ul, div#timer-container a, div#timer-container h2{
+div#timer-container ul, div#timer-container h2{
padding:0;
margin:0;
}
+div#timer-container a{
+ padding-left: 0px;
+ padding-right: 0px;
+ padding-top: 0.7em;
+ padding-bottom: 0.7em;
+}
+
div#timer-container ul#workout-timer li {
float:left;
list-style:none;
@@ -636,13 +643,11 @@ div#timer-container canvas{
div#timer-container div.sub_header{
position: absolute;
- bottom: 60px;
+ bottom: 65px;
width: 95%;
}
-
-div#timer-container div.sub_header .ui-btn-inner{
- padding-left: 5px;
- padding-right: 5px;
+div#timer-container div.sub_header a{
+ width: 90%;
}
div#timer-container div.sub_header h2{
@@ -650,11 +655,7 @@ div#timer-container div.sub_header h2{
}
div#timer-container a{
- width: 99%;
-}
-
-div#timer-container div.ui-block-b{
- padding-left: 0.5em;
+ width: 95%;
}
div#timer-container .bottom_buttons{
diff --git a/wger/manager/templates/mobile/index.html b/wger/manager/templates/mobile/index.html
index 3cb842a35..88e0e7a0d 100644
--- a/wger/manager/templates/mobile/index.html
+++ b/wger/manager/templates/mobile/index.html
@@ -89,17 +89,46 @@
</div>
</div>
-<!--
-<a href="{% url 'wger.manager.views.user.preferences' %}" data-role="button">
+<div data-role="popup"
+ id="timer-current-workout-{{request_full_path|slugify}}"
+ data-overlay-theme="a">
+ <div data-role="header">
+ <h4>{% trans "Start gym mode" %}</h4>
+ </div>
+
+ <div role="main" class="ui-content">
+ <div style="margin-bottom: 1.5em;">{% blocktrans %}Use the gym mode to
+start an interactive training session. If you enter lifted weights, they will
+be added to your workout log. A timer between sets helps you keep track of the
+pauses you do.{% endblocktrans %}</div>
+
+ <ul data-role="listview" data-inset="false" data-theme="d" style="margin-bottom:1em;">
+ {% for day in current_workout.canonical_representation %}
+ <li>
+ {% if day.set_list|length > 0 %}<a href="{% url 'workout-timer' day.obj.pk %}" data-ajax="false">{% endif %}
+ {{day.obj.description}}
+ {% if day.set_list|length > 0 %}</a>{% endif %}
+ </li>
+ {% endfor %}
+ </ul>
+ </div>
+</div>
+
+
+
+<a href="#timer-current-workout-{{request_full_path|slugify}}"
+ data-role="button"
+ data-rel="popup">
<img src="{% static 'images/icons/play.svg' %}"
width="32"
height="32"
- alt="{% trans 'Settings' %}"
- title="{% trans 'Settings' %}">
+ alt="{% trans 'Start current workout' %}"
+ title="{% trans 'Start current workout' %}">
<br>
{% trans "Start current workout" %}
</a>
--->
+
+
<div class="ui-grid-a">
<div class="ui-block-a">
{% if current_workout %}
diff --git a/wger/manager/templates/mobile/tags/render_day.html b/wger/manager/templates/mobile/tags/render_day.html
index 6a9e6eb7b..7bb52d609 100644
--- a/wger/manager/templates/mobile/tags/render_day.html
+++ b/wger/manager/templates/mobile/tags/render_day.html
@@ -21,6 +21,18 @@
alt="{% trans 'Add weight log to this day' %}">
{% trans 'Add weight log to this day' %}
</a>
+ {% if day.set_set.select_related|length > 0 %}
+ <a href="{% url 'workout-timer' day.id %}"
+ title="{% trans 'Start gym mode' %}"
+ data-role="button"
+ data-ajax="false">
+ <img src="{% static 'images/icons/play.svg' %}"
+ width="22"
+ height="22"
+ alt="{% trans 'Start gym mode' %}">
+ {% trans "Start gym mode" %}
+ </a>
+ {% endif %}
<a href="{% url 'day-edit' day.id %}"
title="{% trans 'Edit' %}"
data-role="button">