Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Move more templates to bootstrap 4

Rolande8e0241397e8
diff --git a/wger/core/static/css/bootstrap-custom.css b/wger/core/static/css/bootstrap-custom.css
index 22cfbea93..40b315b49 100644
--- a/wger/core/static/css/bootstrap-custom.css
+++ b/wger/core/static/css/bootstrap-custom.css
@@ -89,51 +89,7 @@ body {
text-overflow: ellipsis;
}
-.btn-default {
- color: #333;
- background-color: #eeeeec;
- border-color: #ccc;
-}
-
-.btn-default:hover,
-.btn-default:focus,
-.btn-default:active,
-.btn-default.active,
-.open .dropdown-toggle.btn-default {
- color: black;
- background-color: #babdb6;
- border-color: #888a85;
-}
-
-.btn-default:active,
-.btn-default.active,
-.open .dropdown-toggle.btn-default {
- background-image: none;
-}
-
-.btn-default.disabled,
-.btn-default[disabled],
-fieldset[disabled] .btn-default,
-.btn-default.disabled:hover,
-.btn-default[disabled]:hover,
-fieldset[disabled] .btn-default:hover,
-.btn-default.disabled:focus,
-.btn-default[disabled]:focus,
-fieldset[disabled] .btn-default:focus,
-.btn-default.disabled:active,
-.btn-default[disabled]:active,
-fieldset[disabled] .btn-default:active,
-.btn-default.disabled.active,
-.btn-default[disabled].active,
-fieldset[disabled] .btn-default.active {
- background-color: #babdb6;
- border-color: #ccc;
-}
-.btn-default .badge {
- color: #fff;
- background-color: #babdb6;
-}
/**************************************************************
* Headers in sidebar
diff --git a/wger/core/templates/user/api_key.html b/wger/core/templates/user/api_key.html
index 8576b304e..ec0b24479 100644
--- a/wger/core/templates/user/api_key.html
+++ b/wger/core/templates/user/api_key.html
@@ -13,11 +13,11 @@ anything). You must pass this information in the header in the format shown belo
{% endwith %}
<p>{% blocktrans %}For security reasons, you should only access the API via HTTPS.{% endblocktrans %}</p>
-<div class="panel {% if token %}panel-success{% else %}panel-default{% endif %}">
- <div class="panel-heading">
- <h3 class="panel-title">{% trans "Your API key" %}</h3>
+<div class="card mb-4 {% if token %}text-white bg-success{% else %}bg-light{% endif %}" >
+ <div class="card-header">
+ {% trans "Your API key" %}
</div>
- <div class="panel-body">
+ <div class="card-body">
{% if token %}
<strong>{{token.key}}</strong>
{% else %}
@@ -25,12 +25,14 @@ anything). You must pass this information in the header in the format shown belo
{% endif %}
</div>
</div>
+
+<h5>In the request header</h5>
<pre>
-# In the request header
Authorization: Token {% if token %}{{token.key}}{% else %}1234567890abcde...{% endif %}
+</pre>
-
-# Example with curl
+<h5>Example with curl</h5>
+<pre>
curl -X GET https://wger.de/api/v2/workout/ \
-H 'Authorization: Token {% if token %}{{token.key}}{% else %}1234567890abcde...{% endif %}'
</pre>
diff --git a/wger/exercises/templates/equipment/overview.html b/wger/exercises/templates/equipment/overview.html
index 89471b9d5..a3100bd14 100644
--- a/wger/exercises/templates/equipment/overview.html
+++ b/wger/exercises/templates/equipment/overview.html
@@ -34,18 +34,16 @@ $(function() {
-->
{% block content %}
{% cache cache_timeout equipment-overview language.id %}
-<div class="panel-group" id="accordion">
+<div class="accordion">
{% for equipment in equipment_list %}
- <div class="panel panel-default">
- <div class="panel-heading">
- <h4 class="panel-title">
- <a data-toggle="collapse" data-parent="#accordion" href="#collapse-{{equipment.pk}}">
- {% trans equipment.name %}
- </a>
- </h4>
+ <div class="card">
+ <div class="card-header" id="header-{{equipment.pk}}">
+ <button class="btn btn-block text-left" type="button" data-toggle="collapse" data-target="#collapse-{{equipment.pk}}" aria-expanded="true" aria-controls="collapse-{{equipment.pk}}">
+ {% trans equipment.name %}
+ </button>
</div>
- <div id="collapse-{{equipment.pk}}" class="panel-collapse collapse">
- <div class="panel-body">
+ <div class="collapse" id="collapse-{{equipment.pk}}" >
+ <div class="card-body">
<div class="list-group">
{% for exercise in equipment.exercise_set.all %}
{% if exercise.language in exercise_languages %}
diff --git a/wger/exercises/templates/exercise/overview.html b/wger/exercises/templates/exercise/overview.html
index a6559e575..25a881db2 100644
--- a/wger/exercises/templates/exercise/overview.html
+++ b/wger/exercises/templates/exercise/overview.html
@@ -42,8 +42,11 @@ $(document).ready(function() {
{% regroup exercises by category as exercise_list %}
<ul class="nav nav-tabs">
{% for item in exercise_list %}
- <li {% if forloop.first %}class="active"{% endif %}>
- <a href="#tab-{{ item.grouper.id }}" id="category-{{ item.grouper.id }}" data-toggle="tab">{% trans item.grouper.name %}</a>
+ <li class="nav-item" >
+ <a class="nav-link {% if forloop.first %}active{% endif %}"
+ href="#tab-{{ item.grouper.id }}"
+ id="category-{{ item.grouper.id }}"
+ data-toggle="tab">{% trans item.grouper.name %}</a>
</li>
{% empty %}
<li>{% trans "No categories." %} {% trans "Use link to create one" %}</li>
@@ -56,38 +59,28 @@ $(document).ready(function() {
<div class="list-group">
{% for exercise in item.list|dictsort:"name" %}
<a href="{{ exercise.get_absolute_url }}" class="list-group-item">
- <div class="visible-xs">
- <span class="glyphicon glyphicon-chevron-right pull-right"></span>
- </div>
<div class="media">
- <div style="width:60px;height:60px;" class="media-left">
-
{% if exercise.main_image %}
<img alt="{{ exercise.name }}"
- class="media-object "
- style="max-width:100%; max-height:100%;"
+ class="mr-3"
src="{{ exercise.main_image.image|thumbnail_url:'thumbnail' }}">
{% else %}
- <img alt="{% trans 'Placeholder image for exercise' %}"
- class="media-object "
- style="max-width:100%; max-height:100%; opacity: 0.4;"
- src="{% static 'images/icons/image-placeholder.svg' %}">
+ <img alt="{% trans 'Placeholder image for exercise' %}"
+ class="mr-3"
+ src="{% static 'images/icons/image-placeholder.svg' %}">
{% endif %}
- </div>
- <div class="media-body" style="position: absolute; top: 10px; left: 100px;">
- <h4 class="media-heading">{{ exercise.name }}</h4>
- <span class="text-muted">
+ <div class="media-body">
+ <h4 class="mt-0">{{ exercise.name }}</h4>
{% for equipment in exercise.equipment.all %}
{% trans equipment.name %}
{% if not forloop.last %},{% endif %}
{% endfor %}
- </span>
</div>
</div>
</a>
{% empty %}
<a href="#" class="list-group-item">
- <div class="offset-md-1 col-md-10" >
+ <div>
{% trans "No exercises in this category. Add or edit an exercise and set its category" %}
</div>
</a>
@@ -97,8 +90,6 @@ $(document).ready(function() {
{% endfor %}
</div>
{% endcache %}
-
-
{% endblock %}
diff --git a/wger/software/templates/api.html b/wger/software/templates/api.html
index 9898979d0..2839b6fcc 100644
--- a/wger/software/templates/api.html
+++ b/wger/software/templates/api.html
@@ -253,70 +253,90 @@ database structure, which is basically exposed through the API 1-to-1. Click on
the images to download a bigger version.</p>
-<div class="panel-group" id="api-accordion">
- <div class="panel panel-default">
- <div class="panel-heading">
- <h4 class="panel-title">
- <a data-toggle="collapse" data-parent="#api-accordion" href="#api-workout">
- Workouts
- </a>
+<div class="accordion mb-4" id="api-accordion">
+ <div class="card">
+ <div class="card-header">
+ <h4 class="mb-0">
+ <button class="btn btn-link btn-block text-left"
+ type="button"
+ data-toggle="collapse"
+ data-target="#api-workout"
+ aria-expanded="true"
+ aria-controls="api-workout">
+ Workouts
+ </button>
</h4>
</div>
- <div id="api-workout" class="panel-collapse collapse in">
- <div class="panel-body">
+ <div id="api-workout" class="collapse" data-parent="#api-accordion">
+ <div class="card-body">
<a href="{% static 'images/api/db-manager.svg' %}">
- <img src="{% static 'images/api/db-manager.svg' %}" class="img-responsive">
+ <img src="{% static 'images/api/db-manager.svg' %}" class="img-fluid">
</a>
</div>
</div>
</div>
- <div class="panel panel-default">
- <div class="panel-heading">
- <h4 class="panel-title">
- <a data-toggle="collapse" data-parent="#api-accordion" href="#api-nutrition">
+ <div class="card">
+ <div class="card-header">
+ <h4 class="mb-0">
+ <button class="btn btn-link btn-block text-left"
+ type="button"
+ data-toggle="collapse"
+ data-target="#api-nutrition"
+ aria-expanded="true"
+ aria-controls="api-nutrition">
Nutrition
- </a>
+ </button>
</h4>
</div>
- <div id="api-nutrition" class="panel-collapse collapse">
- <div class="panel-body">
+ <div id="api-nutrition" class="collapse" data-parent="#api-accordion">
+ <div class="card-body">
<a href="{% static 'images/api/db-nutrition.svg' %}">
- <img src="{% static 'images/api/db-nutrition.svg' %}" class="img-responsive">
+ <img src="{% static 'images/api/db-nutrition.svg' %}" class="img-fluid">
</a>
</div>
</div>
</div>
- <div class="panel panel-default">
- <div class="panel-heading">
- <h4 class="panel-title">
- <a data-toggle="collapse" data-parent="#api-accordion" href="#api-exercises">
+ <div class="card">
+ <div class="card-header">
+ <h4 class="mb-0">
+ <button class="btn btn-link btn-block text-left"
+ type="button"
+ data-toggle="collapse"
+ data-target="#api-exercises"
+ aria-expanded="true"
+ aria-controls="api-exercises">
Exercises
- </a>
+ </button>
</h4>
</div>
- <div id="api-exercises" class="panel-collapse collapse">
- <div class="panel-body">
+ <div id="api-exercises" class="collapse" data-parent="#api-accordion">
+ <div class="card-body">
<a href="{% static 'images/api/db-exercises.svg' %}">
- <img src="{% static 'images/api/db-exercises.svg' %}" class="img-responsive">
+ <img src="{% static 'images/api/db-exercises.svg' %}" class="img-fluid">
</a>
</div>
</div>
</div>
- <div class="panel panel-default">
- <div class="panel-heading">
- <h4 class="panel-title">
- <a data-toggle="collapse" data-parent="#api-accordion" href="#api-all">
+ <div class="card">
+ <div class="card-header">
+ <h4 class="mb-0">
+ <button class="btn btn-link btn-block text-left"
+ type="button"
+ data-toggle="collapse"
+ data-target="#api-all"
+ aria-expanded="true"
+ aria-controls="api-all">
Complete DB
- </a>
+ </button>
</h4>
</div>
- <div id="api-all" class="panel-collapse collapse">
- <div class="panel-body">
+ <div id="api-all" class="collapse" data-parent="#api-accordion">
+ <div class="card-body">
<a href="{% static 'images/api/db-all.svg' %}">
- <img src="{% static 'images/api/db-all.svg' %}" class="img-responsive">
+ <img src="{% static 'images/api/db-all.svg' %}" class="img-fluid">
</a>
</div>
</div>
diff --git a/wger/software/templates/contribute.html b/wger/software/templates/contribute.html
index 0381ec72c..33e23228c 100644
--- a/wger/software/templates/contribute.html
+++ b/wger/software/templates/contribute.html
@@ -1,4 +1,4 @@
-{% extends "base_wide.html" %}
+{% extends "base.html" %}
{% load static %}
{% load i18n %}
@@ -6,8 +6,6 @@
{% block title %}{% trans "Contribute!" %}{% endblock %}
{% block content %}
-<div class="row">
- <div class="col-md-6">
<p>{% blocktrans %}wger Workout Manager is build by volunteers,
the development process is open and freely accessible to anybody interested.
If you are new to the free software world, we recommend to take a
@@ -19,83 +17,61 @@ article</a> which summarizes they way open source projects work very well. {% en
Use this opportunity and influence the direction of the
project. {% endblocktrans %}</p>
- </div>
- <div class="col-md-6">
- <div class="panel panel-primary">
- <div class="panel-heading">
- <h3 class="panel-title">{% trans "Our goal" %}</h3>
- </div>
- <div class="panel-body">
- <span style="text-align:center;"><strong>{% blocktrans %}The goal is to build an awesome
-and flexible fitness manager, along with a comprehensive and complete list of exercises and
-ingredients, all released under a free license.{% endblocktrans %}</strong></span>
- </div>
- </div>
- </div>
-</div>
-<div class="row" style="margin-bottom: 1em;">
- <div class="col-md-3">
- <h4>{% trans "Use the site" %}</h4>
- </div>
- <div class="col-md-9">
- <p>{% blocktrans %}Simply use the site and tell your friends
+<h5>{% trans "Use the site" %}</h5>
+<p>{% blocktrans %}Simply use the site and tell your friends
how useful it is! ;) . When you find something that you specially liked,
could need some improvements or just doesn't work, tell us! This might not sound
like much, but is incredibly important!{% endblocktrans %}</p>
-<a class="btn btn-default" href="{% url 'core:contact' %}">{% trans "Get in touch" %} »</a>
- </div>
-</div>
+<a class="btn btn-secondary mb-4" href="{% url 'core:contact' %}">{% trans "Get in touch" %} »</a>
-<div class="row" style="margin-bottom: 1em;">
- <div class="col-md-3">
- <h4>{% trans "Submit exercises" %}</h4>
- </div>
- <div class="col-md-9">
- <p>{% blocktrans %}Submit those cool exercises that you absolutely
+<h5>{% trans "Submit exercises" %}</h5>
+<p>{% blocktrans %}Submit those cool exercises that you absolutely
love and do every week but are not in the list yet. If you think some description
is too short or some other detail is missing or could be improved, tell!{% endblocktrans %}</p>
+
{% if user.is_authenticated and not user.userprofile.is_temporary %}
- <a class="btn btn-default" href="{% url 'exercise:exercise:add' %}">{% trans "Add exercise" %} »</a>
+ <a class="btn btn-secondary mb-4" href="{% url 'exercise:exercise:add' %}">{% trans "Add exercise" %} »</a>
{% else %}
- <a class="btn disabled btn-default" href="#">{% trans "Only registered users can do this" %} »</a>
+ <a class="btn disabled btn-secondary mb-4" href="#">{% trans "Only registered users can do this" %} »</a>
{% endif %}
- </div>
-</div>
-<div class="row" style="margin-bottom: 1em;">
- <div class="col-md-3">
- <h4>{% trans "Translate" %}</h4>
- </div>
- <div class="col-md-9">
- <p>{% blocktrans %}Do you want to use wger in your own language?
+<h5>{% trans "Translate" %}</h5>
+<p>{% blocktrans %}Do you want to use wger in your own language?
Do you think the current translation could be improved?
The translations are easily managed and edited online, if you are interested,
go to the transifex site, request access and we will set everything
up. {% endblocktrans %}</p>
- <a class="btn btn-default"
- href="https://www.transifex.com/rge/wger-workout-manager/">{% trans "Translate with Transifex" %} »</a>
- </div>
-</div>
+ <a class="btn btn-secondary mb-4"
+ href="https://www.transifex.com/rge/wger-workout-manager/">{% trans "Translate with Transifex" %} »</a>
-<div class="row" style="margin-bottom: 1em;">
- <div class="col-md-3">
- <h4>{% trans "Code" %}</h4>
- </div>
- <div class="col-md-9">
- <p>{% blocktrans %}Obviously, you are highly encouraged to clone the
+
+<h5>{% trans "Code" %}</h5>
+<p>{% blocktrans %}Obviously, you are highly encouraged to clone the
repo and start hacking! Once you are ready, send a pull request and we
will show the world. Take a look at the developer guide for more details
on this.{% endblocktrans %}</p>
- <a class="btn btn-default" href="{% url 'software:code' %}">{% trans "Get the code" %} »</a>
+<a class="btn btn-secondary" href="{% url 'software:code' %}">{% trans "Get the code" %} »</a>
+{% endblock %}
+
+
+{% block sidebar %}
+<div class="card text-white bg-info mb-3">
+ <div class="card-header">
+ {% trans "Our goal" %}
+ </div>
+ <div class="card-body">
+ {% blocktrans %}The goal is to build an awesome
+and flexible fitness manager, along with a comprehensive and complete list of exercises and
+ingredients, all released under a free license.{% endblocktrans %}
</div>
</div>
+{% endblock %}
-{% endblock %}