EFB/Views/Charts/ViewCharts.cshtml

109 lines
3.9 KiB
Plaintext
Raw Permalink Normal View History

2022-02-15 16:03:46 +00:00
@using Newtonsoft.Json;
2022-02-18 22:47:00 +00:00
@using EFB.Metar;
2022-02-15 16:03:46 +00:00
@model EFB.Models.ViewChartModel;
@{
ViewData["Title"] = "Welcome";
}
<div class="row d-flex justify-content-center">
<div class="card-body col-md-4">
<div class="container jumbotron">
<form asp-controller="Charts" asp-action="Index">
<div class="form-group">
<input type="text" class="form-control" placeholder="ICAO Code" name="ICAO" value="@TempData["ICAO"]">
</div>
<button type="submit" class="btn btn-secondary">Search</button>
@{
if (TempData["Error"] != null)
{//If an error has been flagged, information will be displayed to the user
<br />
<br />
<div class="alert alert-danger">
<strong>Warning!</strong> @TempData["Error"] <button type='button' class='close' data-dismiss='alert' aria-hidden='true' />&times;
</div>
}
}
</form>
2022-02-15 16:03:46 +00:00
@{
2022-02-15 16:03:46 +00:00
<br />
<h4>Charts for: @Model.Charts.ICAO</h4>
2022-02-15 16:03:46 +00:00
<form asp-action="ViewCharts" method="post">
<div class="form-group">
<label>Select Charts</label><br />
<select name="chart" class="form-control">
2022-02-15 16:03:46 +00:00
@if (Model.Charts != null) {
<option value=""></option>
foreach(var item in Model.Charts.GroundLayout) {
var itemString = JsonConvert.SerializeObject(item);
2022-02-15 16:03:46 +00:00
<option value="@itemString">@item.Name</option>
}
2022-02-15 16:03:46 +00:00
<option value=""></option>
foreach(var item in Model.Charts.SID) {
var itemString = JsonConvert.SerializeObject(item);
2022-02-15 16:03:46 +00:00
<option value="@itemString">@item.Name</option>
}
2022-02-15 16:03:46 +00:00
<option value=""></option>
foreach(var item in Model.Charts.STAR) {
var itemString = JsonConvert.SerializeObject(item);
2022-02-15 16:03:46 +00:00
<option value="@itemString">@item.Name</option>
}
<option value=""></option>
foreach(var item in Model.Charts.Approach) {
var itemString = JsonConvert.SerializeObject(item);
<option value="@itemString">@item.Name</option>
}
<option value=""></option>
foreach(var item in Model.Charts.TextualData) {
var itemString = JsonConvert.SerializeObject(item);
<option value="@itemString">@item.Name</option>
}
}
</select>
<button type="submit" class="btn btn-primary">View</button>
</div>
</form>
}
2022-02-18 22:47:00 +00:00
<br />
<h4>Current Weather</h4>
@await Metar.GetMETAR(@Model.Charts.ICAO);
</div>
</div>
2022-02-15 16:03:46 +00:00
<div class="card-body col-md-8 vh-80">
<div class="container jumbotron vh-100">
@{
if (Model.Selected != null)
{
<h3>@Model.Selected.Name</h3>
2022-02-15 16:03:46 +00:00
<br />
<br />
<iframe src="@Model.Selected.URL" width="100%" height="90%"></iframe>
2022-02-15 16:03:46 +00:00
}
}
</div>
</div>
2022-02-18 22:47:00 +00:00
2022-02-15 16:03:46 +00:00
</div>