-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
249 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,3 +34,8 @@ django-cors-headers | |
|
||
# Python3 compatibility | ||
six | ||
|
||
#fitbit | ||
django-fitbit==0.3.0 | ||
fitbit==0.3.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{% extends "base.html" %} | ||
{% load i18n staticfiles wger_extras %} | ||
{% block title %} | ||
<div class="text-center"> | ||
{% trans "Click the button below to sync your fitbit data" %} | ||
</div> | ||
{% endblock %} | ||
|
||
{% block content %} | ||
|
||
<a href="{{ fitbit_authentication }}" class="btn btn-primary btn-block"> Connect with Fitbit. </a> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
{% extends "base.html" %} | ||
{% load i18n staticfiles wger_extras %} | ||
|
||
{# #} | ||
{# Title #} | ||
{# #} | ||
{% block title %}{% trans "Fitbit Exercise data" %} | ||
{% endblock %} | ||
|
||
{# #} | ||
{# Header #} | ||
{# #} | ||
{% block header %} | ||
|
||
{% endblock %} | ||
|
||
|
||
|
||
{# #} | ||
{# Content #} | ||
{# #} | ||
{% block content %} | ||
|
||
<div id="current-username" data-current-username="{{ owner_user.username }}"></div> | ||
|
||
|
||
{% if not data %} | ||
<p> | ||
{% trans "There is no chart here because fibit hasnt synced." %} | ||
<a href="{{ fitbit_authentication }}"> Connect to view your fitbit exercises . </a> | ||
|
||
</p> | ||
{% endif %} | ||
|
||
{% if data %} | ||
<table class="table"> | ||
<legend class="text-center">Your Fitbit exercise data</legend> | ||
<tr> | ||
<th>{% trans 'Activity Name' %}</th> | ||
<th>{% trans 'Calories' %}</th> | ||
<th>{% trans 'Duration (milisecs)' %}</th> | ||
<th>{% trans 'Discription' %}</th> | ||
<th>{% trans 'Distance' %}</th> | ||
</tr> | ||
{% for datum in data %} | ||
<tr> | ||
<td> | ||
{{ datum.name }} | ||
</td> | ||
<td> | ||
{% if datum.calories %} | ||
{{ datum.calories }} | ||
{% else %} | ||
{% trans 'N/A' %} | ||
{% endif %} | ||
</td> | ||
|
||
<td> | ||
{% if datum.description %} | ||
{{ datum.duration }} | ||
{% else %} | ||
{% trans 'N/A'%} | ||
{% endif %} | ||
</td> | ||
<td> | ||
{% if datum.description %} | ||
{{ datum.description }} | ||
{% else %} | ||
{% trans 'N/A' %} | ||
{% endif %} | ||
</td> | ||
<td> | ||
{% if datum.distance%} | ||
{{datum.distance}} | ||
{% else %} | ||
{% trans 'N/A' %} | ||
{% endif %} | ||
</td> | ||
</tr> | ||
{% endfor %} | ||
</table> | ||
{% endif %} | ||
<!-- Since we are not persisting fitbit data, | ||
reloading will lead to losing it so we prompt the user --> | ||
{% if data %} | ||
<script> | ||
window.onbeforeunload = function (evt) { | ||
var message = 'Are you sure you want to leave?'; | ||
if (typeof evt == 'undefined') { | ||
evt = window.event; | ||
} | ||
if (evt) { | ||
evt.returnValue = message; | ||
} | ||
return message; | ||
} | ||
</script> | ||
{% endif %} | ||
{% endblock %} | ||
|
||
{# #} | ||
{# Side bar #} | ||
{# #} | ||
{% block sidebar %} | ||
{% endblock %} | ||
|
||
{# #} | ||
{# Options #} | ||
{# #} | ||
{% block options %} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters