summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstilbruch <stilbruch@protonail.com>2022-04-06 18:07:35 -0500
committerstilbruch <stilbruch@protonail.com>2022-04-06 18:07:35 -0500
commit0ff4b0d4fdbadef3d1dcc5320e28d2026fd68a65 (patch)
treedcf0244662de297da1b3d0f139e92c9c99cbc684
parent4d7c4bb40e08c80e336f766375735dbae3c2a20b (diff)
downloadStrengthy-0ff4b0d4fdbadef3d1dcc5320e28d2026fd68a65.tar.xz
Strengthy-0ff4b0d4fdbadef3d1dcc5320e28d2026fd68a65.zip
Add graph template
-rw-r--r--app/templates/base/layout.html6
-rw-r--r--app/templates/home.html34
2 files changed, 32 insertions, 8 deletions
diff --git a/app/templates/base/layout.html b/app/templates/base/layout.html
index cbdb567..33f61d1 100644
--- a/app/templates/base/layout.html
+++ b/app/templates/base/layout.html
@@ -5,6 +5,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Bulma css -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.9.3/css/bulma.min.css">
+ <!-- chart.js -->
+ <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/chart.js@3.7.1/dist/chart.min.js"></script>
<!-- FontAwesome4 -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<!-- custom css -->
@@ -54,11 +56,11 @@
</span>
<span class="navbar-item">
- <a class="button is-white is-outlined" href="/workout/workouts">
+ <a class="button is-white is-outlined" href="/workout/create">
<span class="icon">
<i class="fa fa-archive"></i>
</span>
- <span>Manage Workouts</span>
+ <span>Create a Workout</span>
</a>
</span>
{% endif %}
diff --git a/app/templates/home.html b/app/templates/home.html
index afbed29..d90ef6a 100644
--- a/app/templates/home.html
+++ b/app/templates/home.html
@@ -148,12 +148,7 @@
<div class="columns">
<div class="column is-4">
<div class="card">
- <div class="card-content">
- <p class="title">
- FILLER FILLER FILLER FILLER FILLER FILLER FILLER FILLER FILLER FILLER
- FILLER FILLER FILLER FILLER FILLER FILLER FILLER FILLER FILLER FILLER
- </p>
- </div>
+ <canvas id="chart-1"></canvas>
<footer class="card-footer">
<p class="card-footer-item">
<span>
@@ -199,5 +194,32 @@
</div>
</div>
</div>
+<script>
+
+const ctx = document.getElementById('chart-1');
+const myChart = new Chart(ctx, {
+ type: 'line',
+ data: {
+ labels: ['01/01/22', '01/02/22', '02/01/22', '03/01/22', '04/01/22', '05/01/22', '06/01/22', '07/01/22'],
+ datasets: [{
+ label: 'Bench Press',
+ data: [125, 145, 185, 185, 200, 205, 205],
+ borderWidth: 1,
+ cubicInterpolationMode: 'monotone',
+ tension: 0.4,
+ pointStyle: 'circle',
+ pointRadius: 5,
+ pointHoverRadius: 10
+ }]
+ },
+ options: {
+ scales: {
+ y: {
+ beginAtZero: true
+ }
+ }
+ }
+});
+</script>
{% endblock %}