Hi all!
I'm currently working on creating a lightweight attendance app for my wife's small school. I have it set up with a "Users" model, which has many "Records", which are either "signed in", "signed out", "excused absence", or "unexcused absence".
My wife has asked me to build a page that would resemble a report they currently produce on excel - the status of every student (names going across the top/x-axis) for every day within a range (running along the side/y-axis). I'm assuming that I'll need to loop through each User, and then loop through each User's Records to construct the view I want but I have two questions I'd love some suggestions on:
I'm currently working on creating a lightweight attendance app for my wife's small school. I have it set up with a "Users" model, which has many "Records", which are either "signed in", "signed out", "excused absence", or "unexcused absence".
My wife has asked me to build a page that would resemble a report they currently produce on excel - the status of every student (names going across the top/x-axis) for every day within a range (running along the side/y-axis). I'm assuming that I'll need to loop through each User, and then loop through each User's Records to construct the view I want but I have two questions I'd love some suggestions on:
- How should I construct the table, considering it's organized with one user per column? Put each user loop in its own table? Construct in divs and then wrangle them into a grid with CSS?
- What's the best way normalize the table so that each row (running across Users) represents the same date? Each record comes with a created_at timestamp, and I've been using that to divide it into days in other areas of the app.