fix small screen spacing.

This commit is contained in:
DESKTOP-T0O5CDB\DESK-555BD
2024-10-31 23:41:23 -06:00
parent 745b262dfc
commit f6e0873d83
4 changed files with 37 additions and 18 deletions

View File

@@ -55,9 +55,16 @@ namespace CarCareTracker.Controllers
{
return View(model: tab);
}
public IActionResult Kiosk()
public IActionResult Kiosk(string exceptions)
{
return View();
try {
var exceptionList = string.IsNullOrWhiteSpace(exceptions) ? new List<int>() : exceptions.Split(',').Select(x => int.Parse(x)).ToList();
return View(exceptionList);
}
catch (Exception ex)
{
return View(new List<int>());
}
}
public IActionResult KioskContent(List<int> exceptionList)
{

View File

@@ -43,7 +43,7 @@ namespace CarCareTracker.Helper
case "PastDue":
return "Past Due";
default:
return input.ToString();
return input;
}
}

View File

@@ -1,6 +1,7 @@
@{
ViewData["Title"] = "Kiosk";
}
@model List<int>
<div class="progress" role="progressbar" aria-label="Refresh Progress" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100" style="height: 1px">
<div class="progress-bar" style="width: 0%"></div>
</div>
@@ -9,9 +10,20 @@
<script>
let refreshTimer;
let exceptionList = [];
let subtractAmount = 0;
@foreach(int exception in Model)
{
@:exceptionList.push(@exception);
}
function initKiosk() {
$("body > div").removeClass("container");
$("body > div").css('height', '100vh');
subtractAmount = parseInt($("#kioskContainer").width() * 0.0016); //remove 0.0016% of width every 100 ms which will approximate to one minute.
if (subtractAmount < 2) {
subtractAmount = 2;
}
retrieveKioskContent();
}
function retrieveKioskContent(){
@@ -26,7 +38,7 @@
refreshTimer = setInterval(function () {
var currentWidth = $(".progress-bar").width();
if (currentWidth > 0) {
$(".progress-bar").width(currentWidth - 20);
$(".progress-bar").width(currentWidth - subtractAmount);
} else {
retrieveKioskContent();
}

View File

@@ -16,22 +16,22 @@
<div class="card-body" style="padding-top:0.25rem; padding-bottom:0.25rem;">
<h5 class="card-title">@($"{vehicle.VehicleData.Year} {vehicle.VehicleData.Make} {vehicle.VehicleData.Model} ({StaticHelper.GetVehicleIdentifier(vehicle.VehicleData)})")</h5>
<div class="row">
<div class="col-md-3 text-center">
<div class="col-3 text-center">
<p class="display-7">@vehicle.ServiceRecordCount</p>
<p class="lead text-truncate">@translator.Translate(userLanguage, "Service")</p>
<p class="lead text-truncate">@vehicle.ServiceRecordCost.ToString("C0")</p>
</div>
<div class="col-md-3 text-center">
<div class="col-3 text-center">
<p class="display-7">@vehicle.RepairRecordCount</p>
<p class="lead text-truncate">@translator.Translate(userLanguage, "Repairs")</p>
<p class="lead text-truncate">@vehicle.RepairRecordCost.ToString("C0")</p>
</div>
<div class="col-md-3 text-center">
<div class="col-3 text-center">
<p class="display-7">@vehicle.UpgradeRecordCount</p>
<p class="lead text-truncate">@translator.Translate(userLanguage, "Upgrades")</p>
<p class="lead text-truncate">@vehicle.UpgradeRecordCost.ToString("C0")</p>
</div>
<div class="col-md-3 text-center">
<div class="col-3 text-center">
<p class="display-7">@vehicle.GasRecordCount</p>
<p class="lead text-truncate">@translator.Translate(userLanguage, "Fuel")</p>
<p class="lead text-truncate">@vehicle.GasRecordCost.ToString("C0")</p>
@@ -44,19 +44,19 @@
<div class="card-body" style="padding-top:0.25rem; padding-bottom:0.25rem;">
<h5 class="card-title">@translator.Translate(userLanguage, "Reminders")</h5>
<div class="row">
<div class="col-md-3 text-center">
<div class="col-3 text-center">
<p class="display-7">@vehicle.PastDueReminderCount</p>
<p class="lead text-wrap">@translator.Translate(userLanguage, "Past Due")</p>
</div>
<div class="col-md-3 text-center">
<div class="col-3 text-center">
<p class="display-7">@vehicle.VeryUrgentReminderCount</p>
<p class="lead text-wrap">@translator.Translate(userLanguage, "Very Urgent")</p>
</div>
<div class="col-md-3 text-center">
<div class="col-3 text-center">
<p class="display-7">@vehicle.UrgentReminderCount</p>
<p class="lead text-wrap">@translator.Translate(userLanguage, "Urgent")</p>
</div>
<div class="col-md-3 text-center">
<div class="col-3 text-center">
<p class="display-7">@vehicle.NotUrgentReminderCount</p>
<p class="lead text-wrap">@translator.Translate(userLanguage, "Not Urgent")</p>
</div>
@@ -69,7 +69,7 @@
<div class="card-body" style="padding-top:0.25rem; padding-bottom:0.25rem;">
<h5 class="card-title">@translator.Translate(userLanguage, "Upcoming Reminder")</h5>
<div class="row">
<div class="col-md-12">
<div class="col-12">
<p class="display-7">@vehicle.NextReminder.Description</p>
<p class="lead text-wrap">@translator.Translate(userLanguage, StaticHelper.GetTitleCaseReminderUrgency(vehicle.NextReminder.Urgency))</p>
<div class="row">
@@ -92,19 +92,19 @@
<div class="card-body" style="padding-top:0.25rem; padding-bottom:0.25rem;">
<h5 class="card-title">@translator.Translate(userLanguage, "Plans")</h5>
<div class="row">
<div class="col-md-3 text-center">
<div class="col-3 text-center">
<p class="display-7">@vehicle.PlanRecordBackLogCount</p>
<p class="lead text-wrap">@translator.Translate(userLanguage, "Planned")</p>
</div>
<div class="col-md-3 text-center">
<div class="col-3 text-center">
<p class="display-7">@vehicle.PlanRecordInProgressCount</p>
<p class="lead text-wrap">@translator.Translate(userLanguage, "Doing")</p>
</div>
<div class="col-md-3 text-center">
<div class="col-3 text-center">
<p class="display-7">@vehicle.PlanRecordTestingCount</p>
<p class="lead text-wrap">@translator.Translate(userLanguage, "Testing")</p>
</div>
<div class="col-md-3 text-center">
<div class="col-3 text-center">
<p class="display-7">@vehicle.PlanRecordDoneCount</p>
<p class="lead text-wrap">@translator.Translate(userLanguage, "Done")</p>
</div>