summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFivePixels <o5pxels@gmail.com>2022-05-02 18:37:06 -0500
committerFivePixels <o5pxels@gmail.com>2022-05-02 18:37:06 -0500
commit746d2c2d31f47e3e475c0bf5ffbf2492db78be41 (patch)
tree6d9d0bdf6f99962fde5f86af536058821b510797
parent8a8463c20da456f1ed93ba6a57460dd7a19fcefc (diff)
downloadStrengthy-746d2c2d31f47e3e475c0bf5ffbf2492db78be41.tar.xz
Strengthy-746d2c2d31f47e3e475c0bf5ffbf2492db78be41.zip
Fix indentation in record.html, update record.js logic
to add event listener to added sets, fix add sets button, update the home page href to prevent bug that sent user from /workout/record to just /workout
-rw-r--r--app/static/js/record.js3
-rw-r--r--app/templates/base/layout.html2
-rw-r--r--app/templates/workout/record.html24
3 files changed, 15 insertions, 14 deletions
diff --git a/app/static/js/record.js b/app/static/js/record.js
index 3037c2f..137786e 100644
--- a/app/static/js/record.js
+++ b/app/static/js/record.js
@@ -87,11 +87,12 @@ function onClickSetCheck(elem) {
function onClickAddSet(elem) {
// Create the new row
- let tableBody = elem.parentElement.parentElement.children[1].children[1];
+ let tableBody = elem.parentElement.parentElement.children[2].children[1];
let row = tableBody.children[0].cloneNode(true);
// Add new row to table
setReset(row);
setSetid(row, tableBody.children.length)
+ row.addEventListener('keydown', handleEnterKey)
tableBody.appendChild(row)
}
diff --git a/app/templates/base/layout.html b/app/templates/base/layout.html
index a738cec..afe6143 100644
--- a/app/templates/base/layout.html
+++ b/app/templates/base/layout.html
@@ -24,7 +24,7 @@
<div class="hero-head">
<nav class="navbar">
<div class="navbar-brand">
- <a class="navbar-item" href="../">
+ <a class="navbar-item" href="/">
<img src="/static/favicon/apple-touch-icon.png" alt="Logo">
</a>
<span class="navbar-burger burger" data-target="nav-menu">
diff --git a/app/templates/workout/record.html b/app/templates/workout/record.html
index aa58ff4..b953a3d 100644
--- a/app/templates/workout/record.html
+++ b/app/templates/workout/record.html
@@ -16,18 +16,18 @@
</thead>
<tbody>
{% for set in exercise.sets.entries %}
- <tr>
- <th>{{ loop.index }}</th>
- <td>{{ set['lbs'](class_='input') }}</td>
- <td>{{ set['units'](class_='input') }}</td>
- <td>
- <a class="button" onClick="onClickSetCheck(this)">
- <span class="icon is-small">
- <i class="fa fa-check"></i>
- </span>
- </a>
- </td>
- </tr>
+ <tr>
+ <th>{{ loop.index }}</th>
+ <td>{{ set['lbs'](class_='input') }}</td>
+ <td>{{ set['units'](class_='input') }}</td>
+ <td>
+ <a class="button" onClick="onClickSetCheck(this)">
+ <span class="icon is-small">
+ <i class="fa fa-check"></i>
+ </span>
+ </a>
+ </td>
+ </tr>
{% endfor %}
</tbody>
</table>