<%# /templates/timers/dashboard.html.ep %> % layout 'default'; % title 'My Timers'; <% content_for 'head' => begin %> <% end %>
% if (@$timers == 0) {

📱 You don't have any timers set up yet.

Contact an admin to create timers for you.

% } else {
% for my $timer (@$timers) {
% if ($timer->{category} eq 'Computer') { 💻 % } elsif ($timer->{category} eq 'Phone') { 📱 % } elsif ($timer->{category} eq 'Tablet') { 📱 % } elsif ($timer->{category} eq 'Gaming Console') { 🎮 % } elsif ($timer->{category} eq 'TV') { 📺 % }

<%= $timer->{name} %>

<%= $timer->{category} %>
Time Used: <%= sprintf("%d:%02d:%02d", int($timer->{elapsed_seconds} / 3600), int(($timer->{elapsed_seconds} % 3600) / 60), $timer->{elapsed_seconds} % 60) %>
Remaining: <% if ($timer->{remaining_seconds} > 0) { %> <%= sprintf('%02d:%02d:%02d', int($timer->{remaining_seconds} / 3600), int(($timer->{remaining_seconds} % 3600) / 60), $timer->{remaining_seconds} % 60) %> <% } elsif ($timer->{remaining_seconds} < 0) { %> -<%= sprintf('%02d:%02d', int(abs($timer->{remaining_seconds}) / 3600), int((abs($timer->{remaining_seconds}) % 3600) / 60)) %> OVER <% } else { %> EXPIRED <% } %>
Daily Limit: <%= int($timer->{limit_seconds} / 60) %> minutes
% if ($timer->{bonus_seconds} && $timer->{bonus_seconds} > 0) {
🎁 Bonus Time: +<%= int($timer->{bonus_seconds} / 60) %> minutes
% }
% if ($timer->{is_running}) { % } elsif ($timer->{is_paused}) { % } else { % if ($timer->{remaining_seconds} > 0) { % } else { % } % }
% if ($timer->{is_running}) {
RUNNING
% } % if ($timer->{remaining_seconds} <= 0) {
🚫

Time's Up!

Ask an admin for more time
% }
% }
% }