This commit introduces a new "Lawn Care Tips" section to the application and refines the visual layout of the main Dashboard.
**Key Changes:**
* **Lawn Care Tips Feature:**
* Added `LawnCareTip` model with `Title`, `Category`, and `Content` properties.
* Defined `TipCategory` enum for better organization (Mowing, Watering, Fertilizing, Weed Control, Aeration, General).
* Integrated `LawnCareTip` into `ApplicationDbContext` for database persistence.
* Updated `_Layout.cshtml` to include a new "Lawn Tips" navigation link.
* **Dashboard Layout Fix:**
* Refactored `Views/Home/Index.cshtml` to correctly use Bootstrap's grid system by placing the "Log a New Activity" card in its own `div.row`. This resolves the layout issue where the card was appearing immediately after the previous row without proper spacing.
* Updated `HomeController` to include a `LastAerationDate` query for the dashboard display.
* Modified `DashboardViewModel` to include `LastAerationDate`.
* **Build/Dependency Updates:**
* Added `Microsoft.EntityFrameworkCore.SqlServer` (likely a residue from scaffolding, though SQLite is still primary).
* Added `Microsoft.VisualStudio.Web.CodeGeneration.Design` for scaffolding tools.
This enhances the application's functionality by providing a knowledge base and improves the user experience with a cleaner dashboard layout.
106 lines
No EOL
3.3 KiB
Text
106 lines
No EOL
3.3 KiB
Text
@model turf_tasker.Models.DashboardViewModel
|
|
@{
|
|
ViewData["Title"] = "Dashboard";
|
|
}
|
|
|
|
<div class="text-center">
|
|
<h1 class="display-4">Lawn Care Dashboard</h1>
|
|
<p>Your lawn's status at a glance.</p>
|
|
</div>
|
|
|
|
<div class="row mt-4 text-center">
|
|
|
|
<!-- Last Mowed Card -->
|
|
<div class="col-md-3">
|
|
<div class="card h-100">
|
|
<div class="card-body">
|
|
<h5 class="card-title">Last Mowed</h5>
|
|
<p class="card-text fs-4">
|
|
@if (Model.LastMowDate.HasValue)
|
|
{
|
|
@Model.LastMowDate.Value.ToString("D")
|
|
}
|
|
else
|
|
{
|
|
<span class="text-muted">Not yet logged</span>
|
|
}
|
|
</p>
|
|
</div>
|
|
<div class="card-footer">
|
|
Next Pattern: <strong>@Model.NextMowingPattern</strong>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Last Watered Card -->
|
|
<div class="col-md-3">
|
|
<div class="card h-100">
|
|
<div class="card-body">
|
|
<h5 class="card-title">Last Watered</h5>
|
|
<p class="card-text fs-4">
|
|
@if (Model.LastWaterDate.HasValue)
|
|
{
|
|
@Model.LastWaterDate.Value.ToString("D")
|
|
}
|
|
else
|
|
{
|
|
<span class="text-muted">Not yet logged</span>
|
|
}
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Last Fertilized Card -->
|
|
<div class="col-md-3">
|
|
<div class="card h-100">
|
|
<div class="card-body">
|
|
<h5 class="card-title">Last Fertilized</h5>
|
|
<p class="card-text fs-4">
|
|
@if (Model.LastFertilizeDate.HasValue)
|
|
{
|
|
@Model.LastFertilizeDate.Value.ToString("D")
|
|
}
|
|
else
|
|
{
|
|
<span class="text-muted">Not yet logged</span>
|
|
}
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Last aeration card -->
|
|
<div class="col-md-3">
|
|
<div class="card h-100">
|
|
<div class="card-body">
|
|
<h5 class="card-title">Last Aeration</h5>
|
|
<p class="card-text fs-4">
|
|
@if (Model.LastAerationDate.HasValue)
|
|
{
|
|
@Model.LastAerationDate.Value.ToString("D")
|
|
}
|
|
else
|
|
{
|
|
<span class="text-muted">Not yet logged</span>
|
|
}
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Add New Event Card -->
|
|
<div class="row mt-4 text-center">
|
|
<div class="col-md-3">
|
|
<div class="card h-100 bg-light">
|
|
<div class="card-body d-flex flex-column justify-content-center">
|
|
<h5 class="card-title">Log a New Activity</h5>
|
|
<p class="card-text">Keep your dashboard up to date.</p>
|
|
<a asp-controller="LawnCareEvents" asp-action="Create" class="btn btn-primary mt-auto">
|
|
Add New Event
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div> |