Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Add equipment overview to mobile site

Roland Geider6384e2a4022e
diff --git a/wger/exercises/templates/mobile/equipment/overview.html b/wger/exercises/templates/mobile/equipment/overview.html
new file mode 100644
index 000000000..ad28f1751
--- /dev/null
+++ b/wger/exercises/templates/mobile/equipment/overview.html
@@ -0,0 +1,142 @@
+{% extends "base.html" %}
+{% load i18n %}
+{% load staticfiles %}
+{% load wger_extras %}
+{% load thumbnail %}
+
+<!--
+ Title
+-->
+{% block title %}{% trans "Exercises" %}{% endblock %}
+
+
+<!--
+ Main Content
+-->
+{% block content %}
+
+<div data-role="collapsible-set" data-theme="c" data-content-theme="c">
+{% for equipment in equipment_list %}
+ <div data-role="collapsible">
+ <h3>{% trans equipment.name %}</h3>
+
+ <ul data-role="listview">
+ {% for exercise in equipment.exercise_set.all %}
+ <li>
+ <a href="{{ exercise.get_absolute_url }}" data-ajax="false">
+ {% if exercise.main_image.image %}
+ <img src="{{ exercise.main_image.image|thumbnail_url:'small' }}">
+ {% endif %}
+ {{ exercise.name }}</a>
+ </li>
+ {% endfor %}
+ </ul>
+ </div>
+{% endfor %}
+
+</div>
+
+
+{% endblock %}
+
+
+<!--
+ Side bar
+-->
+{% block sidebar %}
+<h3>{% trans "Search" %}</h3>
+<br>
+
+<ul data-role="listview"
+ 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 %}
+ {% for exercise in category|get_active_exercises:active_languages %}
+ <li>
+ <a href="{{ exercise.get_absolute_url }}" data-ajax="false">
+ {% if exercise.main_image.image %}
+ <img src="{{ exercise.main_image.image|thumbnail_url:'small' }}">
+ {% endif %}
+ {{ exercise.name }}</a>
+ </li>
+ {% endfor %}
+ {% endfor %}
+</ul>
+
+
+<h3>{% trans "Add new exercise" %}</h3>
+<p>
+ {% if user.is_authenticated and not user.userprofile.is_temporary %}
+ <a href="{% url 'exercise-add' %}" data-role="button">
+ <img src="{% static 'images/icons/new.svg' %}"
+ width="32"
+ height="32"
+ alt="{% trans 'Add new exercise' %}"
+ title="{% trans 'Add new exercise' %}">
+ {% trans "Add new exercise" %}
+ </a>
+ {% else %}
+ <span data-role="button" class="ui-disabled">
+ <img src="{% static 'images/icons/new.svg' %}"
+ width="32"
+ height="32"
+ alt="{% trans 'Add new exercise' %}"
+ title="{% trans 'Add new exercise' %}">
+ {% trans "Only registered users can do this" %}
+ </span>
+ {% endif %}
+</p>
+
+
+{% if perms.exercises %}
+ <h3>{% trans "Options" %}</h3>
+ {% if categories %}
+ <p>
+ {% with category=categories|first %}
+ <a href="{% url 'exercisecategory-edit' category.id %}"
+ data-role="button"
+ id="current-category-edit">
+ <img src="{% static 'images/icons/edit.svg' %}"
+ width="32"
+ height="32"
+ alt="{% trans 'Edit category' %}"
+ title="{% trans 'Edit category' %}">
+ {% trans "Edit category" %}:
+ <span class="current-category-name">{{category.name}}</span>
+ </a>
+ </p>
+ {% endwith %}
+ <p>
+ {% with category=categories|first %}
+ <a href="{% url 'exercisecategory-delete' category.id %}"
+ data-role="button"
+ id="current-category-delete">
+ <img src="{% static 'images/icons/trash.svg' %}"
+ width="32"
+ height="32"
+ alt="{% trans 'Delete category' %}"
+ title="{% trans 'Delete category' %}">
+ {% trans "Delete category" %}:
+ <span class="current-category-name">{{category.name}}</span>
+ </a>
+ {% endwith %}
+ </p>
+ {% endif %}
+
+ <p>
+ <a href="{% url 'exercisecategory-add' %}"
+ data-role="button">
+ <img src="{% static 'images/icons/folder-new.svg' %}"
+ width="32"
+ height="32"
+ alt="{% trans 'Add category' %}"
+ title="{% trans 'Add category' %}">
+ {% trans "Add category" %}
+ </a>
+ </p>
+{% endif %}
+{% endblock %}
diff --git a/wger/manager/templates/mobile/navigation.html b/wger/manager/templates/mobile/navigation.html
index bf016c4ac..ede14bc21 100644
--- a/wger/manager/templates/mobile/navigation.html
+++ b/wger/manager/templates/mobile/navigation.html
@@ -48,6 +48,7 @@
<ul data-role="listview" data-divider-theme="a">
<li><a href="{% url 'exercise-overview' %}">{% trans "Exercises" %}</a></li>
<li><a href="{% url 'muscle-overview' %}" data-ajax="false">{% trans "Muscle overview" %}</a></li>
+ <li><a href="{% url 'equipment-overview' %}">{% trans "Equipment overview" %}</a></li>
{% if user.is_authenticated and not user.userprofile.is_temporary %}
<li><a href="{% url 'exercise-add' %}" data-ajax="false">{% trans "Add new exercise" %}</a></li>
{% endif %}