Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Move exercise templates to appropriate folder

Roland Geider09b3e3919d23
diff --git a/wger/exercises/templates/overview.html b/wger/exercises/templates/exercise/overview.html
similarity index 100%
rename from wger/exercises/templates/overview.html
rename to wger/exercises/templates/exercise/overview.html
diff --git a/wger/exercises/templates/view.html b/wger/exercises/templates/exercise/view.html
similarity index 100%
rename from wger/exercises/templates/view.html
rename to wger/exercises/templates/exercise/view.html
diff --git a/wger/exercises/templates/mobile/view.html b/wger/exercises/templates/mobile/exercise/view.html
similarity index 100%
rename from wger/exercises/templates/mobile/view.html
rename to wger/exercises/templates/mobile/exercise/view.html
diff --git a/wger/exercises/templates/mobile/overview.html b/wger/exercises/templates/mobile/overview.html
deleted file mode 100644
index 56bb2dc69..000000000
--- a/wger/exercises/templates/mobile/overview.html
+++ /dev/null
@@ -1,139 +0,0 @@
-{% 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 category in categories %}
- <div data-role="collapsible">
- <h3>{% trans category.name %}</h3>
-
- <ul data-role="listview">
- {% 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 %}
- </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/exercises/views/exercises.py b/wger/exercises/views/exercises.py
index eae72ff59..b35ada181 100644
--- a/wger/exercises/views/exercises.py
+++ b/wger/exercises/views/exercises.py
@@ -78,7 +78,7 @@ def overview(request):
template_data['categories'] = categories
template_data['active_languages'] = languages
- return render_to_response('overview.html',
+ return render_to_response('exercise/overview.html',
template_data,
context_instance=RequestContext(request))
@@ -144,7 +144,7 @@ def view(request, id, slug=None):
template_data['reps'] = _("Reps")
# Render
- return render_to_response('view.html',
+ return render_to_response('exercise/view.html',
template_data,
context_instance=RequestContext(request))