@model EFB.Models.NavdataModel
@{
    ViewData["Title"] = "Welcome";
}

<div class="row d-flex justify-content-center">

    <div class="card-body col-md-6">
        <div class="container jumbotron">
            <h3>Navdata Lookup</h3>

            <br />
            <br />

            <form asp-controller="Navdata" asp-action="Index">
                <div class="form-group">
                    <input type="text" class="form-control" placeholder="Identifier" name="identifier" value="@TempData["identifier"]">
                </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>
        </div>
    </div>

    @{
        if(Model != null){
            <div class="card-body bg-warning col-md-6">      
                <div class="container jumbotron">
                    <h3>@Model.Name (@Model.Type) [@Model.Id]</h3>

                    <br />

                    <h4>Latitude</h4>
                    @Model.Latitude

                    <h4>Longitude</h4>
                    @Model.Longitude

                    @{
                        if(Model.Frequency != null){
                            <h4>Frequency</h4>
                            @Model.Frequency
                        }
                    }
                </div>
            </div>
        }
    }

</div>

