Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Add some more templates adapted to mobile (more or less)

Roland Geider1115b51484d9
diff --git a/wger/exercises/templates/mobile/view.html b/wger/exercises/templates/mobile/view.html
new file mode 100644
index 000000000..3141ec2a6
--- /dev/null
+++ b/wger/exercises/templates/mobile/view.html
@@ -0,0 +1,207 @@
+{% extends "base.html" %}
+{% load i18n %}
+{% load staticfiles %}
+{% load manager_extras %}
+
+
+{% block header %}
+<script src="{% static 'js/tinymce/tiny_mce.js' %}"></script>
+
+<script>
+function custom_modal_init()
+{
+ // Set up the tinyMCE editor on modal dialogs
+ init_tinymce();
+
+ // Initialise the datepicker for the modal dialog
+ init_weight_log_datepicker();
+}
+</script>
+{% endblock %}
+<!--
+ Title
+-->
+{% block title %}{{ exercise.name }}{% endblock %}
+
+
+<!--
+ Main Content
+-->
+{% block content %}
+<p>{% trans "Category" %}: <strong>{{ exercise.category.name }}</strong></p>
+
+<p>{{ exercise.description|safe }}</p>
+
+{% with comments=exercise.exercisecomment_set.all %}
+{% if comments %}
+<h3>{% trans "Comments for this exercise" %}</h3>
+
+<ul>
+{% for comment in comments %}
+ <li>
+ {{ comment }}
+ {% if perms.exercises %}
+ <span class="editoptions">
+ <a href="{% url wger.exercises.views.exercisecomment_delete comment.id %}"
+ title="{% trans 'Delete' %}">
+ <img src="{% static 'images/icons/trash.svg' %}"
+ width="16"
+ height="16"
+ alt="{% trans 'Delete' %}">
+ </a>
+ <a href="{% url exercisecomment-edit comment.id %}"
+ title="{% trans 'Edit' %}"
+ class="modal-dialog">
+ <img src="{% static 'images/icons/edit.svg' %}"
+ width="16"
+ height="16"
+ alt="{% trans 'Edit' %}">
+ </a>
+ </span>
+ {% endif %}
+ </li>
+{% endfor %}
+</ul>
+{% endif %}
+{% endwith %}
+
+
+{% if perms.exercises %}
+<p>
+ <a href="{% url exercisecomment-add exercise.id %}"
+ title="{% trans 'Add' %}"
+ class="modal-dialog">
+ <img src="{% static 'images/icons/add.svg' %}"
+ width="16"
+ height="16"
+ alt="{% trans 'Add new comment' %}">
+ {% trans "Add new comment" %}</a>
+</p>
+{% endif %}
+
+
+{% if logs %}
+
+<h3>{% trans "Weight log" %}</h3>
+
+{% render_weight_log logs svg_uuid %}
+<script src="{% static 'js/d3.js' %}"></script>
+<script src="{% static 'js/jquery-globalize/lib/globalize.js' %}"></script>
+
+<script>
+$(document).ready(function() {
+weight_log_chart({{json|safe}}, "{{svg_uuid}}", "{{reps}}")
+});
+</script>
+
+{% endif %}
+
+{% endblock %}
+
+
+<!--
+ Side bar
+-->
+{% block sidebar %}
+
+<h3>{% trans "Back to overview" %}</h3>
+<p>
+ <a href="{% url wger.exercises.views.exercise_overview %}">
+ <img src="{% static 'images/icons/list.svg' %}"
+ width="32"
+ height="32"
+ alt="{% trans 'Back to overview' %}"
+ >
+ {% trans "Back to exercise overview" %}
+ </a>
+</p>
+
+
+
+{% with muscles=exercise.muscles.all %}
+{% with muscles_secondary=exercise.muscles_secondary.all %}
+
+{% if muscles %}
+<h3>{% trans "Muscles" %}</h3>
+<p>
+ {% trans "The diagram shows the most used muscles on this exercise" %}
+</p>
+
+
+<div>
+ <div style="width:1em;height:1em;background-color:#cc0000;float:left;margin-right:0.5em;"></div>
+ {% trans "Main muscles" %}
+</div>
+
+{% if muscles_secondary %}
+<div>
+ <div style="width:1em;height:1em;background-color:#f57900;float:left;margin-right:0.5em;"></div>
+ {% trans "Secondary muscles" %}
+</div>
+{% endif %}
+
+{% if muscle_backgrounds_front %}
+<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>
+ </div>
+ </div>
+ <div class="ym-g40 ym-gr">
+ <div class="ym-gbox-right">
+ <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>
+</div>
+{% endif %}
+
+
+{% if muscle_backgrounds_back %}
+<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_back %}url({% static background %}){% if not forloop.last %},{% endif %}{% endfor %};">
+ </div>
+ </div>
+ </div>
+ <div class="ym-g40 ym-gr">
+ <div class="ym-gbox-right">
+ <ul>
+ {% for muscle in muscles %}
+ {% if not muscle.is_front %}
+ <li>{{muscle.name}}</li>
+ {% endif %}
+ {% endfor %}
+
+ {% for muscle in muscles_secondary %}
+ {% if not muscle.is_front %}
+ <li>{{muscle.name}}</li>
+ {% endif %}
+ {% endfor %}
+ </ul>
+ </div>
+ </div>
+</div>
+{% endif %}
+
+{% endif %}
+{% endwith %}
+{% endwith %}
+
+
+{% cc_by_sa_sidebar language %}
+
+{% endblock %}
diff --git a/wger/manager/templates/mobile/workout/overview.html b/wger/manager/templates/mobile/workout/overview.html
new file mode 100644
index 000000000..26049e761
--- /dev/null
+++ b/wger/manager/templates/mobile/workout/overview.html
@@ -0,0 +1,59 @@
+{% extends "base.html" %}
+{% load i18n %}
+{% load staticfiles %}
+
+{% block title %}{% trans "Your workouts" %}{% endblock %}
+
+
+{% block content %}
+{% if workouts %}
+
+
+ <table id="workout-table" data-role="table" class="ui-responsive table-stroke table-stripe">
+ <thead>
+ <tr>
+ <th>{% trans "Description" %}</th>
+ <th>{% trans "Date" %}</th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for workout in workouts %}
+ <tr>
+ <td>
+ <a href="{% url wger.manager.views.view_workout workout.id %}">
+ {% if workout.comment %}
+ {{ workout.comment }}
+ {% else %}
+ {% trans "Workout" %}
+ {% endif %}
+ </a>
+ </td>
+ <td>
+ {{ workout.creation_date }}
+ </td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+{% else %}
+ <div class="box warning">
+ {% trans "No workouts found." %} {% trans "Use link to add one." %}
+ </div>
+{% endif %}
+
+
+{% endblock %}
+
+
+{% block sidebar %}
+<h3>{% trans "Options" %}</h3>
+<p>
+ <a href="{% url wger.manager.views.add %}">
+ <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 %}
diff --git a/wger/manager/templates/mobile/workout/view.html b/wger/manager/templates/mobile/workout/view.html
new file mode 100644
index 000000000..a04946e9e
--- /dev/null
+++ b/wger/manager/templates/mobile/workout/view.html
@@ -0,0 +1,157 @@
+{% extends "base.html" %}
+{% load i18n %}
+{% load staticfiles %}
+{% load manager_extras %}
+
+{% block title %}{% trans "Workout" %} – {{ workout.creation_date }}{% endblock %}
+
+{% block header %}
+{% endblock %}
+
+{% block content %}
+
+
+{% if workout.comment %}
+<p>
+ <strong>{% trans "Goal" %}:</strong>
+ <span class="dimmed">{{workout.comment}}</span>
+</p>
+{% endif %}
+
+{% for day in workout.day_set.select_related %}
+ <div id="div-day-{{ day.id }}">
+ {% render_day day %}
+ </div>
+{% empty %}
+<div class="box warning">
+ {% trans "No days for this workout." %}
+ <a href="{% url day-add workout.id %}" class="modal-dialog">
+ {% trans "Add training day." %}
+ </a>
+</div>
+{% endfor %}
+
+
+<p>
+<a href="{% url day-add workout.id %}" class="modal-dialog">
+ {% trans "Add training day" %}
+</a>
+
+|
+<a id="exercise-comments-toggle" href="{% url wger.manager.views.preferences %}">
+ {% trans "Show/Hide exercise comments" %}
+</a>
+
+
+</p>
+{% endblock %}
+
+
+
+<!--
+ Side bar
+-->
+{% block sidebar %}
+<h3>{% trans "Steps" %}</h3>
+
+<ol>
+ <li>{% trans "Add training days" %}</li>
+ <li>{% trans "Add working sets to days" %}</li>
+ <li>
+ {% trans "Set the repetitions for each set" %}
+ ({% trans "use '99' for 'all repetitions you can do'" %})
+ </li>
+</ol>
+
+
+<h3>{% trans "Muscles trained" %}</h3>
+
+<p>
+ {% trans "Images show combined muscles as trained by the exercises on the workout." %}
+</p>
+
+<div class="ym-grid linearize-level-1">
+ <div class="ym-g40 ym-gl">
+ <div class="ym-gbox-left">
+ <div id="muscle-front"
+ class="muscle-background"
+ style="width: 120px; height: 220px; background-size: 120px; background-image: {% for background in muscle_backgrounds_front %}url({% static background %}){% if not forloop.last %},{% endif %}{% endfor %};">
+ </div>
+ </div>
+ </div>
+ <div class="ym-g60 ym-gr">
+ <div class="ym-gbox-right">
+ <div id="muscle-back"
+ class="muscle-background"
+ style="width: 120px; height: 220px; background-size: 120px; background-image: {% for background in muscle_backgrounds_back %}url({% static background %}){% if not forloop.last %},{% endif %}{% endfor %};">
+ </div>
+ </div>
+ </div>
+</div>
+
+<h3>{% trans "Options" %}</h3>
+<p>
+<a href="{% url wger.manager.pdf.workout_log workout.id %}"
+ target="_blank">
+ <img src="{% static 'images/icons/save.svg' %}"
+ width="32"
+ height="32"
+ alt="{% trans 'Download as PDF' %}"
+ title="{% trans 'Download as PDF' %}">
+ {% trans "Download as PDF" %}
+</a>
+</p>
+
+<p>
+<a href="{% url workout-edit workout.id %}"
+ class="modal-dialog"
+ data-transition="pop"
+ data-rel="dialog">
+ <img src="{% static 'images/icons/edit.svg' %}"
+ width="32"
+ height="32"
+ alt="{% trans 'Edit workout' %}"
+ title="{% trans 'Edit workout' %}">
+ {% trans "Edit workout" %}
+</a>
+</p>
+
+<p>
+<a href="{% url workout-log workout.id %}">
+ <img src="{% static 'images/icons/statistics.svg' %}"
+ width="32"
+ height="32"
+ alt="{% trans 'View weight log' %}"
+ title="{% trans 'View weight log' %}">
+ {% trans "View weight log" %}
+</a>
+</p>
+
+<p>
+<a href="{% url workout-copy workout.id %}"
+ class="modal-dialog"
+ data-transition="pop"
+ data-rel="dialog">
+ <img src="{% static 'images/icons/copy.svg' %}"
+ width="32"
+ height="32"
+ alt="{% trans 'Make a copy of this workout' %}"
+ title="{% trans 'Make a copy of this workout' %}">
+ {% trans "Make a copy of this workout" %}
+</a>
+</p>
+
+
+<p>
+<a href="{% url workout-delete workout.id %}"
+ data-rel="dialog"
+ data-transition="pop"
+ class="modal-dialog">
+ <img src="{% static 'images/icons/trash.svg' %}"
+ width="32"
+ height="32"
+ alt="{% trans 'Delete this workout' %}">
+ {% trans "Delete this workout" %}
+</a>
+</p>
+{% endblock %}