📄 Documentation: _myModalProperty.cshtml
Location:
IrbyImaging/Views/LegalImaging/_myModalProperty.cshtml
📑 Table of Contents
- Overview & Purpose
- Dependencies & Technologies
- View Model & Data Model
- Key Functional Areas
- Code Walkthrough
- UML Diagram of GeoLocation Model
- Styling & Layout
- Usage Example
- Error Handling & Accessibility
- Third‑Party Integrations
- Conclusion
1. 🏠 Overview & Purpose
The _myModalProperty.cshtml partial view renders a Bootstrap modal displaying detailed information about a real estate property. It is used in the LegalImaging section of the IrbyImaging application to present key lease and location data in a pop‑up dialog.
- When it's shown:
Invoked via JavaScript (e.g., on a map pin click or “View Details” button). - What it shows:
Lease details—name, address, dates, costs, execution status, and more.
2. ⚙️ Dependencies & Technologies
| Technology | Purpose |
|---|---|
| ASP.NET MVC Razor | Server‑side templating |
| Bootstrap 5 | Modal markup & styling |
| HTML5 & CSS3 | Structure & inline styling |
| IrbyImaging.DomainClasses.GeoLocation | Data model passed to view |
3. 📦 View Model & Data Model
Bound Model
@model IrbyImaging.DomainClasses.GeoLocation
The view expects a GeoLocation object, which holds all the property/lease details.
GeoLocation (Sample Properties)
| Property Name | Type | Description |
|---|---|---|
| Landlord | string | Name of the property or landlord |
| Address | string | Full street address |
| CommencementDate | DateTime | Lease start date |
| LeasePurpose | string | Purpose of the lease (e.g., retail, office) |
| LeaseCode | string | Internal lease identifier |
| RegionLead | string | Person responsible for region |
| ExpiratinDate | DateTime | Lease end date |
| FullyExecuted | bool | Lease fully executed? |
| SubjectToEscalation | bool | Rent escalation clause? |
| MonthlyBaseRent | decimal | Base rent per month |
| MonthlySalesTax | decimal | Monthly sales tax amount |
| MonthlyAVTax | decimal | Assessment & valuation tax |
| MonthlyInsurancePayment | decimal | Insurance component |
| TotalCost | decimal | Total monthly obligation |
Note:
GeoLocationmay contain additional properties; only commonly displayed fields are listed.
4. 🔑 Key Functional Areas
- Modal Shell
- Wraps header, body, and footer in
<div class="modal-content">.
- Wraps header, body, and footer in
- Header
- Title (
Property Details) - Close button (
×)
- Title (
- Body
- Displays Landlord via
@Html.DisplayFor(...). - Uses a styled container to list all property fields.
- Displays Landlord via
- Footer
- “Close” button to dismiss modal.
- (Optional “Print Document” button is commented out for future use.)
5. 🛠 Code Walkthrough
@model IrbyImaging.DomainClasses.GeoLocation
<div class="modal-content">
<!-- 1. Modal Header -->
<div class="modal-header">
<h5 class="modal-title" id="transaction-detailModalLabel">
Property Details
</h5>
<button type="button"
class="btn-close"
data-bs-dismiss="modal"
aria-label="Close">
</button>
</div>
<!-- 2. Custom Styling for Line Breaks -->
<style>
.line-breaks { white-space: pre-line; }
</style>
<!-- 3. Modal Body -->
<div class="modal-body">
<p class="mb-2">
Property Name:
<span class="text-primary">
@Html.DisplayFor(model => model.Landlord)
</span>
</p>
<div class="table-responsive">
<div style="background-color: #f5f5f5; padding: 10px; border: 1px solid #ccc;">
<strong>Address: </strong> @Model.Address<br>
<strong>Commencement Date: </strong> @Model.CommencementDate<br>
<strong>Lease Purpose: </strong> @Model.LeasePurpose<br>
<strong>Lease Code: </strong> @Model.LeaseCode<br>
<strong>Lead: </strong> @Model.RegionLead<br>
<strong>Expiration Date: </strong> @Model.ExpiratinDate<br>
<strong>Fully Executed? </strong> @Model.FullyExecuted<br>
<strong>Subject To Escalation? </strong> @Model.SubjectToEscalation<br>
<strong>Monthly Base Rent: $</strong> @Model.MonthlyBaseRent<br>
<strong>Monthly Sales Tax: $</strong> @Model.MonthlySalesTax<br>
<strong>Monthly AV Tax: $</strong> @Model.MonthlyAVTax<br>
<strong>Monthly Insurance Payment: $</strong> @Model.MonthlyInsurancePayment<br>
<strong>Total Cost: $</strong> @Model.TotalCost<br>
</div>
</div>
</div>
<!-- 4. Modal Footer -->
<div class="modal-footer">
@* Optional “Print Document” button:
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">
Print Document
</button>
*@
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">
Close
</button>
</div>
</div>
6. 🖥 UML Diagram of GeoLocation Model
+--------------------------------+
| GeoLocation (Class) |
+--------------------------------+
| - string Landlord |
| - string Address |
| - DateTime CommencementDate |
| - string LeasePurpose |
| - string LeaseCode |
| - string RegionLead |
| - DateTime ExpiratinDate |
| - bool FullyExecuted |
| - bool SubjectToEscalation |
| - decimal MonthlyBaseRent |
| - decimal MonthlySalesTax |
| - decimal MonthlyAVTax |
| - decimal MonthlyInsurancePayment |
| - decimal TotalCost |
+--------------------------------+
7. 🎨 Styling & Layout
- Bootstrap 5 classes:
modal-content/modal-header/modal-body/modal-footerbtn-closefor the “×” iconbtn btn-secondaryfor the Close button
- Inline Styles:
- Light grey background for the details box.
- Simple border and padding for readability.
8. 🔍 Usage Example
1) Rendering from Controller
public ActionResult PropertyDetails(int id) {
var geo = _geoService.GetById(id);
return PartialView("_myModalProperty", geo);
}
2) Trigger via JavaScript
$('#viewPropertyBtn').on('click', function() {
var propertyId = $(this).data('id');
$.get('/LegalImaging/PropertyDetails/' + propertyId, function(html) {
$('#myModal .modal-content').html(html);
$('#myModal').modal('show');
});
});
9. ⚠️ Error Handling & Accessibility
- Error Handling:
- If
Modelisnull, the modal will render empty fields. - Recommendation: Add a null‑check in controller or wrap in
@if (Model != null) { ... }.
- If
- Accessibility:
aria-label="Close"on the close button improves screen-reader compliance.- Consider adding
role="dialog"andaria-labelledby="transaction-detailModalLabel"on the outer modal container.
10. 🔌 Third‑Party Integrations
- Bootstrap 5
- jQuery (for AJAX modal loading)
- No other external libraries are directly referenced in this partial.
11. ✅ Conclusion
This partial view is a reusable, Bootstrap‐powered component to show comprehensive property and lease details in a modal dialog. By accepting a GeoLocation model, it cleanly separates data concerns from presentation. You can easily extend it (e.g., add printing, map visualization, or further actions) thanks to its simple, self‑contained structure.
Happy coding! 🚀