Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Further work on the mobile templates for manager app

Roland Geiderfa6fec4a7098
diff --git a/wger/core/static/css/bootstrap-custom.css b/wger/core/static/css/bootstrap-custom.css
index 1b167620c..b24cf69e7 100644
--- a/wger/core/static/css/bootstrap-custom.css
+++ b/wger/core/static/css/bootstrap-custom.css
@@ -33,9 +33,10 @@ body {
background-color: #204A87;
}
-
-#main-content{
- min-height: 40em;
+@media (min-width: 992px) {
+ #main-content{
+ min-height: 40em;
+ }
}
.navbar {
@@ -53,6 +54,15 @@ body {
background-color: transparent;
}
+.wger-list-group-item {
+ background-color: #F5F5F5;
+}
+
+.page-header {
+ margin-top: 10px;
+}
+
+
/**************************************************************
* Alerts
**************************************************************/
diff --git a/wger/core/templates/base.html b/wger/core/templates/base.html
index fc1506dd5..341dfc598 100644
--- a/wger/core/templates/base.html
+++ b/wger/core/templates/base.html
@@ -12,7 +12,9 @@
{% endfor %}
{% endif %}
+ <div id="content">
{% block content %}{% endblock %}
+ </div>
</div>
<div class="col-md-4" id="main-sidebar">
{% block sidebar %}
diff --git a/wger/core/templates/mobile/base.html b/wger/core/templates/mobile/base.html
deleted file mode 100644
index fc1506dd5..000000000
--- a/wger/core/templates/mobile/base.html
+++ /dev/null
@@ -1,22 +0,0 @@
-{% extends "template.html" %}
-{% block template %}
-<h2 id="page-title" class="page-header">{% block title %}{% endblock %}</h2>
-<div class="row">
- <div class="col-md-8" id="main-content">
- {% if messages and not no_messages %}
- {% for message in messages %}
- <div class="alert {% if message.tags == 'warning'%}alert-error{% elif message.tags == 'info' %}alert-info{% elif message.tags == 'success' %}alert-success{% endif %}">
- <a href="#" class="close extra-bold" data-dismiss="alert">&times;</a>
- {{message}}
- </div>
- {% endfor %}
- {% endif %}
-
- {% block content %}{% endblock %}
- </div>
- <div class="col-md-4" id="main-sidebar">
- {% block sidebar %}
- {% endblock %}
- </div>
-</div>
-{% endblock %}
diff --git a/wger/core/templates/mobile/base_wide.html b/wger/core/templates/mobile/base_wide.html
deleted file mode 100644
index 87832bfb7..000000000
--- a/wger/core/templates/mobile/base_wide.html
+++ /dev/null
@@ -1,12 +0,0 @@
-{% extends "template.html" %}
-{% load i18n %}
-{% block template %}
- <div id="current-url" data-current-url="{{request_full_path}}"></div>
- <div id="current-language" data-current-language="{{language.short_name}}"></div>
-
- <div data-role="content" id="content">
- <h2 style="margin-top: 0px;">{% block title %}{% endblock %}</h2>
- {% block content %}{% endblock %}
- {% block sidebar %}{% endblock %}
- </div>
-{% endblock %}
diff --git a/wger/core/templates/mobile/index.html b/wger/core/templates/mobile/index.html
index 3e2807a1f..3c96bfaf9 100644
--- a/wger/core/templates/mobile/index.html
+++ b/wger/core/templates/mobile/index.html
@@ -104,7 +104,8 @@ its default duration in your settings.{% endblocktrans %}
{% if current_workout %}
{% for day in current_workout.canonical_representation.day_list %}
{% if day.set_list|length > 0 %}
- <a href="{% url 'workout-timer' day.obj.pk %}" class="list-group-item">
+ <a href="{% url 'workout-timer' day.obj.pk %}" class="list-group-item wger-list-group-item">
+ <span class="glyphicon glyphicon-chevron-right pull-right"></span>
{{day.obj.description}}
</a>
{% else %}
@@ -112,13 +113,15 @@ its default duration in your settings.{% endblocktrans %}
{% endif %}
{% empty %}
<a href="{% url 'day-add' current_workout.id %}" class="list-group-item">
+ <span class="glyphicon glyphicon-chevron-right pull-right"></span>
{% trans "No days for this workout." %}<br>
{% trans "Add training day." %}
</a>
{% endfor %}
{% else %}
<a href="{% url 'workout-add' %}" class="list-group-item">
- {% trans "No workouts found." %}<br>
+ <span class="glyphicon glyphicon-chevron-right pull-right"></span>
+ {% trans "No workouts found." %}<br>
{% trans "Add one now." %}
</a>
{% endif %}
diff --git a/wger/manager/templates/day/log.html b/wger/manager/templates/day/log.html
index a67bb62cf..65eb8e8e9 100644
--- a/wger/manager/templates/day/log.html
+++ b/wger/manager/templates/day/log.html
@@ -77,7 +77,7 @@ will simply be edited. Weight entries are always added.{% endblocktrans %}</p>
<h3>{% trans "Options" %}</h3>
<p>
-<a href="{% url 'workout-view' day.training.id %}">
+<a href="{% url 'workout-view' day.training.id %}" {% auto_link_css flavour %}>
<img src="{% static 'images/icons/list.svg' %}"
width="32"
height="32"
diff --git a/wger/manager/templates/day/view.html b/wger/manager/templates/day/view.html
index 52a50036e..433c67b7d 100644
--- a/wger/manager/templates/day/view.html
+++ b/wger/manager/templates/day/view.html
@@ -1,4 +1,4 @@
{% load i18n %}
{% load wger_extras %}
-{% render_day day %}
\ No newline at end of file
+{% render_day day flavour %}
\ No newline at end of file
diff --git a/wger/manager/templates/mobile/day/log.html b/wger/manager/templates/mobile/day/log.html
deleted file mode 100644
index e4bfeb2e6..000000000
--- a/wger/manager/templates/mobile/day/log.html
+++ /dev/null
@@ -1,111 +0,0 @@
-{% extends "base.html" %}
-{% load i18n %}
-{% load staticfiles %}
-{% load wger_extras %}
-
-{% block title %}{% trans "New weight log" %} – {{day.description}}{% endblock %}
-
-{% block header %}
-<script type="text/javascript">
-$(document).ready(function () {
- get_workout_session();
-});
-</script>
-
-{% endblock %}
-
-{% block content %}
-<form action="{{form_action}}"
- method="POST"
- style="overflow-x: auto;"
- data-ajax="false">
-{% csrf_token %}
-{{formset.management_form}}
-
-{% if session_form.non_field_errors %}
-<div class="form-error">
- {% for error in session_form.non_field_errors %}
- <p class="form-error-message">{% trans error %}</p>
- {% endfor %}
-</div>
-{% endif %}
-
-<table class="workout-log-table">
-{% render_form_field dateform.date %}
-
-{% for field in session_form %}
- {% if field.name == 'impression' %}
- {% render_form_field field %}
- {% else %}
- {% render_form_field field %}
- {% endif %}
-{% endfor %}
-</table>
-
-<h3>{% trans "Exercises" %}</h3>
-{% for key, value in exercises.items %}
- <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 %}
- <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>
- </p>
-{% endfor %}
-</table>
-
-
-<p>
- <a href="{% url 'core:index' %}"
- data-role="button"
- data-rel="back"
- data-mini="true">{% trans "Cancel" %}</a>
- <input type="submit" value="{% trans 'Save' %}" id="form-save">
- </td>
-</p>
-</form>
-
-{% endblock %}
-
-
-{% block sidebar %}
-<h3>{% trans "Info" %}</h3>
-<p>{% blocktrans %}A new workout session (impression, notes, time) will
-be created if there isn't already one for the selected date. If there is, it
-will simply be edited. Weight entries are always added.{% endblocktrans %}</p>
-
-<h3>{% trans "Options" %}</h3>
-<p>
-<a href="{% url 'workout-view' day.training.id %}"
- data-role="button">
- <img src="{% static 'images/icons/list.svg' %}"
- width="32"
- height="32"
- alt="{% trans 'Back to workout' %}">
- {% trans "Back to workout" %}
-</a>
-</p>
-{% endblock %}
diff --git a/wger/manager/templates/mobile/schedule/overview.html b/wger/manager/templates/mobile/schedule/overview.html
index 624757d0e..f9036cd85 100644
--- a/wger/manager/templates/mobile/schedule/overview.html
+++ b/wger/manager/templates/mobile/schedule/overview.html
@@ -9,27 +9,25 @@
{% endblock %}
{% block content %}
-<ul data-role="listview" data-inset="false">
+<div class="list-group">
{% for schedule in schedules %}
- <li>
- <a href="{% url 'schedule-view' schedule.id %}" data-ajax="false">
- <h3>{{ schedule.name }}</h3>
- <p>{{ schedule.start_date }}</p>
+ <a href="{% url 'schedule-view' schedule.id %}" class="list-group-item wger-list-group-item">
+ <span class="glyphicon glyphicon-chevron-right pull-right"></span>
+
{% if schedule.is_active %}
- <p class="ui-li-aside"><em>{% trans "active" %}</em></p>
+ <span class="label label-primary pull-right"><em>{% trans "active" %}</em></span>
{% endif %}
+ <h3 class="list-group-item-heading">{{ schedule.name }}</h3>
+ <p class="list-group-item-text">{{ schedule.start_date }}</p>
</a>
- </li>
{% empty %}
- <li>
- <a href="{% url 'schedule-add' %}">
+ <a href="{% url 'schedule-add' %}" class="list-group-item">
{% trans "No schedules found." %}<br>
{% trans "Add one now." %}
</a>
- </li>
{% endfor %}
-</ul>
+</div>
{% endblock %}
@@ -48,13 +46,13 @@ deactivate it, if it is a loop.{% endblocktrans %}</p>
<h3>{% trans "Add schedule" %}</h3>
<p>
-<a href="{% url 'schedule-add' %}"
- data-role="button">
-<img src="{% static 'images/icons/new.svg' %}"
- width="32"
- height="32"
- alt="{% trans 'Add schedule' %}"
- title="{% trans 'Add schedule' %}">
-{% trans "Add schedule" %}</a>
+ <a href="{% url 'schedule-add' %}"
+ class="btn btn-default btn-block">
+ <img src="{% static 'images/icons/new.svg' %}"
+ width="32"
+ height="32"
+ alt="{% trans 'Add schedule' %}"
+ title="{% trans 'Add schedule' %}">
+ {% trans "Add schedule" %}</a>
</p>
{% endblock %}
diff --git a/wger/manager/templates/mobile/schedule/view.html b/wger/manager/templates/mobile/schedule/view.html
index 1b8270d09..f27318ee6 100644
--- a/wger/manager/templates/mobile/schedule/view.html
+++ b/wger/manager/templates/mobile/schedule/view.html
@@ -1,6 +1,5 @@
{% extends "base.html" %}
-{% load i18n %}
-{% load staticfiles %}
+{% load i18n staticfiles wger_extras %}
{% block title %}{{schedule.name}}{% endblock %}
@@ -9,69 +8,71 @@
{% block content %}
{% for step in schedule.schedulestep_set.select_related %}
-<div data-role="popup"
- id="step-{{step.id}}"
- data-theme="d"
- data-overlay-theme="a">
- <div data-role="header" data-theme="b">
- <h3>{%trans "Options" %}</h3>
- </div>
-
- <div role="main" class="ui-content">
- <a href="{% url 'step-edit' step.id %}"
- title="{% trans 'Edit' %}"
- data-role="button">
- <img src="{% static 'images/icons/edit.svg' %}"
- width="22"
- height="22"
- alt="{% trans 'Edit' %}">{% trans 'Edit' %}</a>
- <a href="{% url 'step-delete' step.id %}"
- title="{% trans 'Delete' %}"
- data-role="button">
- <img src="{% static 'images/icons/trash.svg' %}"
- width="22"
- height="22"
- alt="{% trans 'Delete' %}">{% trans 'Delete' %}</a>
+<div class="modal fade" id="step-{{step.id}}">
+ <div class="modal-dialog">
+ <div class="modal-content">
+ <div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
+ <h4 class="modal-title">{%trans "Options" %}</h4>
+ </div>
+ <div class="modal-body">
+ <a href="{% url 'workout-view' step.workout.id %}"
+ title="{% trans 'Workout' %}"
+ class="btn btn-default btn-block">
+ {% trans 'Workout' %}</a>
+
+ <a href="{% url 'step-edit' step.id %}"
+ title="{% trans 'Edit' %}"
+ class="btn btn-default btn-block">
+ <img src="{% static 'images/icons/edit.svg' %}"
+ width="22"
+ height="22"
+ alt="{% trans 'Edit' %}">{% trans 'Edit' %}</a>
+ <a href="{% url 'step-delete' step.id %}"
+ title="{% trans 'Delete' %}"
+ class="btn btn-default btn-block">
+ <img src="{% static 'images/icons/trash.svg' %}"
+ width="22"
+ height="22"
+ alt="{% trans 'Delete' %}">{% trans 'Delete' %}</a>
+ </p>
+ </div>
+ </div>
</div>
</div>
{% endfor %}
-<ul data-role="listview" data-inset="false" data-split-icon="gear" data-split-theme="d">
+<div class="list-group wger-mobile-list-group">
{% for step in schedule.schedulestep_set.select_related %}
- <li>
- <a href="{% url 'workout-view' step.workout.id %}">
- <h3>{{ forloop.counter }} - {{ step.workout }}</h3>
- <p>{{ workout.creation_date }}</p>
-
- <p>{% trans "Weeks" %}: {{ step.duration }}</p>
+ <a href="#step-{{step.id}}" data-toggle="modal" class="list-group-item wger-list-group-item">
+ <span class="glyphicon glyphicon-cog pull-right"></span>
- {% if active_workout == step %}
- <p class="ui-li-aside"><em>{% trans "active" %}</em></p>
- {% endif %}
- </a>
+ {% if active_workout == step %}
+ <span class="label label-primary pull-right"><em>{% trans "active" %}</em></span>
+ {% endif %}
- <a href="#step-{{step.id}}"
- data-rel="popup"
- data-position-to="window"
- data-transition="pop"></a>
- </a>
- </li>
+ <h4 class="list-group-item-heading">{{ forloop.counter }} - {{ step.workout }}</h4>
+ <div class="list-group-item-text">
+ <p>{{ workout.creation_date }}</p>
+ <p>{% trans "Weeks" %}: {{ step.duration }}</p>
+ </div>
+ </a>
{% empty %}
- <li>
- <a href="{% url 'step-add' schedule.id %}">
+ <a href="{% url 'step-add' schedule.id %}" class="list-group-item wger-list-group-item">
{% trans "No workouts found." %}<br>{% trans "Add one now." %}
</a>
- </li>
{% endfor %}
-<li>
- <a href="{% url 'step-add' schedule.id %}">{% trans "Add workout" %}</a>
-</li>
+ <a href="{% url 'step-add' schedule.id %}" class="list-group-item list-group-item-success">
+ <span class="glyphicon glyphicon-plus"></span>
+ {% trans "Add workout" %}
+ </a>
+</div>
{% if schedule.is_loop %}
- <li>
+ <div class="alert alert-info" style="margin-bottom:0px;">
{% trans "This schedule is a loop and will go through the workouts above till you deactivate it" %}
- </li>
+ </div>
{% endif %}
-</ul>
+
{% endblock %}
@@ -86,9 +87,8 @@ than once.{% endblocktrans %}</p>
<h3>{% trans "Options" %}</h3>
<p>
<a href="#export-ical-link"
- data-rel="popup"
- data-role="button"
- data-position-to="window">
+ class="btn btn-default btn-block"
+ data-toggle="modal">
<img src="{% static 'images/icons/calendar.svg' %}"
width="32"
height="32"
@@ -99,7 +99,7 @@ than once.{% endblocktrans %}</p>
<p>
<a href="{% url 'schedule-edit' schedule.id %}"
- data-role="button">
+ class="btn btn-default btn-block">
<img src="{% static 'images/icons/edit.svg' %}"
width="32"
height="32"
@@ -110,7 +110,7 @@ than once.{% endblocktrans %}</p>
<p>
<a href="{% url 'schedule-delete' schedule.id %}"
- data-role="button">
+ class="btn btn-default btn-block">
<img src="{% static 'images/icons/trash.svg' %}"
width="32"
height="32"
@@ -119,29 +119,30 @@ than once.{% endblocktrans %}</p>
{% trans "Delete schedule" %}</a>
</p>
-<div data-role="popup"
- id="export-ical-link"
- data-overlay-theme="a">
- <div data-role="header" data-theme="b">
- <h3>{% trans "Export calendar file" %}</h3>
- </div>
- <div role="main" class="ui-content">
- <p>{% trans "Export this schedule as a calendar file." %}</p>
- <p>{% blocktrans %}You can then import the file it into your calendar
+<div class="modal fade" id="export-ical-link">
+ <div class="modal-dialog">
+ <div class="modal-content">
+ <div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
+ <h4 class="modal-title">{% trans "Export calendar file" %}</h4>
+ </div>
+ <div class="modal-body">
+ <p>{% trans "Export this schedule as a calendar file." %}</p>
+ <p>{% blocktrans %}You can then import the file it into your calendar
application for example google calendar, outlook or iCal. This will create
an appointment for each training day with the appropriate exercises.{% endblocktrans %}</p>
- <p>
- <a href="{% url 'schedule-ical' schedule.id %}"
- data-role="button"
- target="_blank">
- <img src="{% static 'images/icons/calendar.svg' %}"
- width="32"
- height="32"
- alt="{% trans 'Export calendar file' %}"
- title="{% trans 'Export calendar file' %}">
- {% trans "Export calendar file" %}
- </a>
- </p>
+ <p>
+ <a href="{% url 'schedule-ical' schedule.id %}" {% auto_link_css flavour %}>
+ <img src="{% static 'images/icons/calendar.svg' %}"
+ width="32"
+ height="32"
+ alt="{% trans 'Export calendar file' %}"
+ title="{% trans 'Export calendar file' %}">
+ {% trans "Export calendar file" %}
+ </a>
+ </p>
+ </div>
+ </div>
</div>
</div>
{% endblock %}
diff --git a/wger/manager/templates/mobile/tags/render_day.html b/wger/manager/templates/mobile/tags/render_day.html
index 76c0ba364..71999968f 100644
--- a/wger/manager/templates/mobile/tags/render_day.html
+++ b/wger/manager/templates/mobile/tags/render_day.html
@@ -109,6 +109,8 @@
style="margin-top: 3em;">
<a href="#editoptions-day-{{ day.obj.id }}" class="list-group-item active" data-toggle="modal">
+ <span class="glyphicon glyphicon-cog pull-right"></span>
+
<h4>{{ day.obj.description }}</h4>
{{ day.days_of_week.text }}
</a>
@@ -116,17 +118,19 @@
{% for set in day.set_list %}
{% if set.has_settings %}
<a href="#editoptions-set-{{ set.obj.id }}"
- class="list-group-item"
+ class="list-group-item wger-list-group-item"
data-toggle="modal"
id="set-{{ set.obj.id }}">
{% else %}
<a href="{% url 'set-edit' set.obj.id %}"
id="set-{{ set.obj.id }}"
- class="list-group-item">
+ class="list-group-item wger-list-group-item">
{% endif %}
+ <span class="glyphicon glyphicon-cog pull-right"></span>
{% for exercise in set.exercise_list %}
<div id="exercise-{{ exercise.obj.id }}" class="ajax-set-edit-target">
+
<h3>{{ exercise.obj.name }}</h3>
<p><strong>{{exercise.setting_text}}</strong></p>
@@ -137,7 +141,7 @@
</p>
{% endif %}
- <p class="exercise-comments">
+ <p class="text-muted">
{% for comment in exercise.comment_list %}
{{comment}}<br>
{% endfor %}
@@ -146,18 +150,18 @@
{% endfor %} <!--for exercise in set-->
</a>
{% empty %}
- <li>
- <a href="{% url 'set-add' day.obj.id %}"
- class="list-group-item">
- {% trans "No exercises selected for this day." %}<br>
- {% trans "Add one now." %}
- </a>
- </li>
+ <a href="{% url 'set-add' day.obj.id %}"
+ class="list-group-item list-group-item-success">
+ {% trans "No exercises selected for this day." %}<br>
+ {% trans "Add one now." %}
+ </a>
{% endfor %} <!--for set in day-->
{% if day.set_list %}
- <a href="{% url 'set-add' day.obj.id %}"
- {% auto_link_css flavour 'list-group-item' %}>{% trans "Add exercises to this workout day" %}</a>
+ <a href="{% url 'set-add' day.obj.id %}" class="list-group-item list-group-item-success">
+ <span class="glyphicon glyphicon-plus"></span>
+ {% trans "Add exercises to this workout day" %}
+ </a>
{% endif %}
</div>
diff --git a/wger/manager/templates/mobile/workout/calendar.html b/wger/manager/templates/mobile/workout/calendar.html
index b438fed2b..bc1f3750f 100644
--- a/wger/manager/templates/mobile/workout/calendar.html
+++ b/wger/manager/templates/mobile/workout/calendar.html
@@ -31,33 +31,34 @@ $(document).ready(function() {
{# #}
{% for i in grouped_logs %}
{% for log in i.list %}
-<div data-role="popup"
- id="log-popup-{{log.pk}}"
- data-overlay-theme="a">
-
- <div data-role="header" data-theme="b">
- <h3>{% trans "Options" %} - {{log.reps}} × {{log.weight}}</h3>
- </div>
-
- <div role="main" class="ui-content">
- <a href="{% url 'workout-log-delete' log.pk %}"
- title="{% trans 'Delete' %}"
- data-role="button">
- <img src="{% static 'images/icons/trash.svg' %}"
- width="22"
- height="22"
- alt="{% trans 'Delete' %}">
- {% trans 'Delete' %}
- </a>
- <a href="{% url 'workout-log-edit' log.pk %}"
- title="{% trans 'Edit' %}"
- data-role="button">
- <img src="{% static 'images/icons/edit.svg' %}"
- width="22"
- height="22"
- alt="{% trans 'Edit' %}">
- {% trans 'Edit' %}
- </a>
+<div class="modal fade" id="log-popup-{{log.pk}}">
+ <div class="modal-dialog">
+ <div class="modal-content">
+ <div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
+ <h4 class="modal-title">{% trans "Options" %} - {{log.reps}} × {{log.weight}}</h4>
+ </div>
+ <div class="modal-body">
+ <a href="{% url 'workout-log-delete' log.pk %}"
+ title="{% trans 'Delete' %}"
+ class="btn btn-default btn-block">
+ <img src="{% static 'images/icons/trash.svg' %}"
+ width="22"
+ height="22"
+ alt="{% trans 'Delete' %}">
+ {% trans 'Delete' %}
+ </a>
+ <a href="{% url 'workout-log-edit' log.pk %}"
+ title="{% trans 'Edit' %}"
+ class="btn btn-default btn-block">
+ <img src="{% static 'images/icons/edit.svg' %}"
+ width="22"
+ height="22"
+ alt="{% trans 'Edit' %}">
+ {% trans 'Edit' %}
+ </a>
+ </div>
+ </div>
</div>
</div>
{% endfor %}
@@ -73,17 +74,17 @@ $(document).ready(function() {
{% with session=first_log.get_workout_session %}
<a href="{{first_log.workout.get_absolute_url}}"
- data-role="button">{{ first_log.workout }}</a>
+ class="btn btn-default btn-block">{{ first_log.workout }}</a>
<a href="{% url 'workout-log' first_log.workout.id %}"
- data-role="button">{% trans "Log overview" %}</a>
+ class="btn btn-default btn-block">{% trans "Log overview" %}</a>
{% if session %}
<a href="{% url 'workout-session-edit' session.pk %}"
- data-role="button">{% trans "Edit workout session" %}</a>
+ class="btn btn-default btn-block">{% trans "Edit workout session" %}</a>
{% else %}
<a href="{% url 'workout-session-add' first_log.workout_id date|date:'Y' date|date:'m' date|date:'d' %}"
- data-role="button">{% trans "Add workout impression" %}</a>
+ class="btn btn-default btn-block">{% trans "Add workout impression" %}</a>
{% endif %}
@@ -109,12 +110,17 @@ $(document).ready(function() {
{# #}
<ul class="grouper-list">
{% for i in grouped_logs %}
- <li>{{i.grouper}}
- <ul>
- {% for log in i.list %}
- <li><a href="#log-popup-{{log.pk}}" data-rel="popup">{{log.reps}} × {{log.weight}}</a></li>
- {% endfor %}
- </ul>
+ <li>
+ {{i.grouper}}
+ <ul>
+ {% for log in i.list %}
+ <li>
+ <a href="#log-popup-{{log.pk}}" data-toggle="modal">
+ {{log.reps}} × {{log.weight}}
+ </a>
+ </li>
+ {% endfor %}
+ </ul>
</li>
{% endfor %}
</ul>
@@ -125,41 +131,48 @@ $(document).ready(function() {
{% block sidebar %}
-<div data-role="popup"
- id="calendar-day-select-popup"
- data-overlay-theme="a">
- <div data-role="header" data-theme="b">
- <h3>{% trans "Add log to day" %}</h3>
- </div>
- <div role="main" class="ui-content">
- {% if current_workout %}
- <p>{% blocktrans %}Click to add weight logs to a training
+<div class="modal fade" id="calendar-day-select-popup">
+ <div class="modal-dialog">
+ <div class="modal-content">
+ <div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
+ <h4 class="modal-title">{% trans "Add log to day" %}</h4>
+ </div>
+ <div class="modal-body">
+ {% if current_workout %}
+ <p>{% blocktrans %}Click to add weight logs to a training
day in your current workout:{% endblocktrans %} {{current_workout}}</p>
- <ul data-role="listview" data-inset="true">
- {% for day in current_workout.day_set.all %}
- <li><a href="{% url 'day-log' day.pk %}">{{day.description}}</a></li>
- {% endfor %}
- </ul>
- {% else %}
- <p><em>{% trans "No workouts found." %}</em></p>
- <a href="{% url 'workout-add' %}" data-role="button">
- <img src="{% static 'images/icons/add.svg' %}"
- width="22"
- height="22"
- alt="">
- {% trans "Add one now." %}
- </a>
- {% endif %}
+ <div class="list-group">
+ {% for day in current_workout.day_set.all %}
+ <a href="{% url 'day-log' day.pk %}" class="list-group-item wger-list-group-item">
+ <span class="glyphicon glyphicon-chevron-right pull-right"></span>
+ {{day.description}}
+ </a>
+ {% endfor %}
+ </div>
+ {% else %}
+ <p><em>{% trans "No workouts found." %}</em></p>
+ <a href="{% url 'workout-add' %}" class="btn btn-default btn-block">
+ <img src="{% static 'images/icons/add.svg' %}"
+ width="22"
+ height="22"
+ alt="">
+ {% trans "Add one now." %}
+ </a>
+ {% endif %}
+ </div>
+ </div>
</div>
</div>
+
<h3>{% trans 'Info' %}</h3>
<p>{% blocktrans %}The coloured days in the calendar have weight logs,
you can click on them to see the details.{% endblocktrans %}</p>
<h3>{% trans 'Log' %}</h3>
- <a href="{% url 'workout-calendar' %}" data-role="button" data-ajax="false">
+ <a href="{% url 'workout-calendar' %}" class="btn btn-default btn-block">
<img src="{% static 'images/icons/calendar.svg' %}"
width="32"
height="32"
@@ -167,26 +180,33 @@ you can click on them to see the details.{% endblocktrans %}</p>
>
{% trans "Go to current month" %}</a>
- <a href="#calendar-day-select-popup" data-role="button" data-rel="popup">
+ <a href="#calendar-day-select-popup" class="btn btn-default btn-block" data-toggle="modal">
<img src="{% static 'images/icons/add.svg' %}"
width="32"
height="32"
alt="{% trans 'Add new log' %}">
{% trans "Add new log" %}</a>
-<div class="timeline-log">
-<ul data-role="listview" data-inset="true">
-{% for date in month_list %}
- {% ifchanged date.year %}
- <li data-role="list-divider" data-theme="b">{{ date|date:"Y" }}</li>
- {% endifchanged %}
- {% if current_month = date.month and current_year = date.year %}
- <li>{{date|date:"F"}}</li>
- {% else %}
- <li><a href="{% url 'workout-calendar' date.year date.month %}" data-ajax="false">{{date|date:"F"}}</a></li>
- {% endif %}
-{% endfor %}
-</ul>
+<div class="timeline-log" style="margin-top: 1em;">
+ <div class="list-group">
+ {% for date in month_list %}
+ {% ifchanged date.year %}
+ <a href="#" class="list-group-item active">
+ {{ date|date:"Y" }}
+ </a>
+ {% endifchanged %}
+ {% if current_month = date.month and current_year = date.year %}
+ <a href="{% url 'workout-calendar' date.year date.month %}" class="list-group-item wger-list-group-item">
+ <em>{{date|date:"F"}}</em>
+ </a>
+ {% else %}
+ <a href="{% url 'workout-calendar' date.year date.month %}" class="list-group-item wger-list-group-item">
+ <span class="glyphicon glyphicon-chevron-right pull-right"></span>
+ {{date|date:"F"}}
+ </a>
+ {% endif %}
+ {% endfor %}
+ </div>
</div>
{% endblock %}
diff --git a/wger/manager/templates/mobile/workout/log.html b/wger/manager/templates/mobile/workout/log.html
deleted file mode 100644
index adf572400..000000000
--- a/wger/manager/templates/mobile/workout/log.html
+++ /dev/null
@@ -1,114 +0,0 @@
-{% extends "base.html" %}
-{% load i18n %}
-{% load staticfiles %}
-{% load wger_extras %}
-
-{% block title %}{% trans "Weight log for workout" %}{% endblock %}
-
-
-{% block header %}{% endblock %}
-
-
-{% block scripts %}
-<script type="text/javascript">
-$(document).on('pageinit', function(){
- // Init the data toggle for the weight log tables
- toggle_weight_log_table();
-});
-</script>
-{% endblock %}
-
-
-{% block content %}
-{% if workout.comment %}
-<p>
- <strong>{% trans "Goal" %}:</strong> {{workout.comment}}
-</p>
-{% endif %}
-
-
-{% for day in workout.canonical_representation.day_list %}
-<ul data-role="listview"
- style="margin-top: 3em;"
- data-icon="plus">
- <li data-theme="b">
- <a href="{% url 'day-log' day.obj.id %}">
- <h3>{{ day.obj.description }}</h3>
- </a>
- </li>
-</ul>
-
- {% for set in day.set_list %}
- {% for exercise in set.exercise_list %}
-
- {% with day_list=workout_log|get_item:day.obj.id %}
- {% with exercise_list=day_list|get_item:exercise.obj.id %}
-
- <ul data-role="listview"
- style="margin-top: 3em;">
- <li>
- <a href="{{ exercise.obj.get_absolute_url }}">{{ exercise.obj.name }}</a>
- </li>
- </ul>
-
- {% if exercise_list.log_by_date %}
- {% with list=exercise_list.log_by_date %}
- {% render_weight_log list exercise_list.div_uuid %}
-
- <script>
- $(document).ready(function() {
- weight_log_chart({{exercise_list.chart_data|safe}},
- "{{exercise_list.div_uuid}}",
- "{{reps}}",
- $('#content').width() * 0.95)
- });
- </script>
- {% endwith %}
- {% else %}
- <p><em>{% trans "No weight entries here." %}</em></p>
- {% endif %}
-
- {% endwith %}
- {% endwith %}
-
- {% empty%}
- <p>
- <em>{% trans "No exercises for this day." %}</em>
- </p>
- {% endfor %}
- {% endfor %}
-{% endfor %}
-
-
-{% endblock %}
-
-
-
-<!--
- Side bar
--->
-{% block sidebar %}
-<h3>{% trans "Options" %}</h3>
-<p>
-<a href="{% url 'workout-view' workout.id %}"
- data-role="button">
- <img src="{% static 'images/icons/list.svg' %}"
- width="32"
- height="32"
- alt="{% trans 'Back to workout' %}">
- {% trans "Back to workout" %}
-</a>
-</p>
-
-<h3>{% trans "Notes" %}</h3>
-<p>{% blocktrans %}This page shows the weight logs belonging to this workout
-only. Click on an exercise to see all the historical data for
-it.{% endblocktrans %}</p>
-
-<p>{% blocktrans %}Click on a value on a chart to edit the log
-entry.{% endblocktrans %}</p>
-
-<p>{% blocktrans %}If on a single day there is more than one entry with the
-same number of repetitions, but different weights, only the entry with the
-higher weight is shown in the diagram.{% endblocktrans %}</p>
-{% endblock %}
diff --git a/wger/manager/templates/mobile/workout/overview.html b/wger/manager/templates/mobile/workout/overview.html
index 7a00ae69f..a1bb01aa2 100644
--- a/wger/manager/templates/mobile/workout/overview.html
+++ b/wger/manager/templates/mobile/workout/overview.html
@@ -9,10 +9,13 @@
{% block content %}
<div class="list-group">
{% for workout in workouts %}
- <a href="{% url 'workout-view' workout.id %}" class="list-group-item">
+ <a href="{% url 'workout-view' workout.id %}" class="list-group-item wger-list-group-item">
+ <span class="glyphicon glyphicon-chevron-right pull-right"></span>
+
{% if workout == current_workout %}
<span class="label label-primary pull-right"><em>{% trans "active" %}</em></span>
{% endif %}
+
<h3 class="list-group-item-heading">{{ workout }}</h3>
<p class="list-group-item-text">{{ workout.creation_date }}</p>
</a>
diff --git a/wger/manager/templates/mobile/workout/view.html b/wger/manager/templates/mobile/workout/view.html
index 1341307e8..431ee8c09 100644
--- a/wger/manager/templates/mobile/workout/view.html
+++ b/wger/manager/templates/mobile/workout/view.html
@@ -51,33 +51,25 @@ $( document ).off("pageinit").on("pageinit", function() {
</div>
{% empty %}
- <ul data-role="listview" data-inset="false">
- <li>
- <a href="{% url 'day-add' workout.id %}">
+ <div class="list-group">
+ <a href="{% url 'day-add' workout.id %}" class="list-group-item list-group-item-success">
{% trans "No days for this workout." %}<br>
{% trans "Add training day." %}
- </a>
- </li>
- </ul>
+ </a>
+ </div>
{% endfor %}
<p style="margin-top:2em;">
-<a href="{% url 'day-add' workout.id %}"
- data-role="button"
- data-mini="true">
- {% trans "Add training day" %}
-</a>
-
-
-<a id="exercise-comments-toggle"
- href="{% url 'core:preferences' %}"
- data-role="button"
- data-mini="true">
- {% trans "Show/Hide exercise comments" %}
-</a>
-
-
+ <a href="{% url 'day-add' workout.id %}" {% auto_link_css flavour %}>
+ {% trans "Add training day" %}
+ </a>
+
+ <a id="exercise-comments-toggle"
+ href="{% url 'core:preferences' %}"
+ {% auto_link_css flavour %}>
+ {% trans "Show/Hide exercise comments" %}
+ </a>
</p>
{% endblock %}
diff --git a/wger/manager/templates/workout/log.html b/wger/manager/templates/workout/log.html
index f0de95771..12c1b7d1a 100644
--- a/wger/manager/templates/workout/log.html
+++ b/wger/manager/templates/workout/log.html
@@ -6,6 +6,11 @@
{% block title %}{% trans "Weight log for workout" %}{% endblock %}
{% block header %}
+<script>
+$(document).ready(function() {
+ toggle_weight_log_table();
+});
+</script>
{% endblock %}
{% block content %}
@@ -20,7 +25,8 @@
<p>
<a href="{% url 'day-log' day.obj.id %}"
- title="{% trans 'Add weight log to this day' %}">
+ title="{% trans 'Add weight log to this day' %}"
+ {% auto_link_css flavour %}>
<img src="{% static 'images/icons/statistics.svg' %}"
width="32"
height="32"
@@ -45,7 +51,10 @@
<script>
$(document).ready(function() {
- weight_log_chart({{exercise_list.chart_data|safe}}, "{{exercise_list.div_uuid}}", "{{reps}}")
+ weight_log_chart({{exercise_list.chart_data|safe}},
+ "{{exercise_list.div_uuid}}",
+ "{{reps}}",
+ $('#content').width());
});
</script>
{% endwith %}
@@ -73,7 +82,7 @@
{% block sidebar %}
<h3>{% trans "Options" %}</h3>
<p>
-<a href="{% url 'workout-view' workout.id %}">
+<a href="{% url 'workout-view' workout.id %}" {% auto_link_css flavour %}>
<img src="{% static 'images/icons/list.svg' %}"
width="32"
height="32"
diff --git a/wger/manager/templatetags/wger_extras.py b/wger/manager/templatetags/wger_extras.py
index d69e690c0..afb5c15d5 100644
--- a/wger/manager/templatetags/wger_extras.py
+++ b/wger/manager/templatetags/wger_extras.py
@@ -115,17 +115,15 @@ def get_item(dictionary, key):
'''
return dictionary.get(key)
-from django import template
-
@register.simple_tag
-def auto_link_css(flavour='full', css='css'):
+def auto_link_css(flavour='full', css=''):
'''
- dddd
+ Adds the appropriate classes to a sidebar link depending on the site version
- :param flavour:
- :param css:
- :return:
+ :param flavour: flavour of the site: 'mobile' or 'full'
+ :param css: the CSS class, if any, of the link
+ :return: the complete CSS classes, wrapped in class="foo"
'''
css = css + ' btn btn-default btn-block' if flavour == 'mobile' else css
return 'class="{0}"'.format(css)