First pass at adding CO2S query and display
This commit is contained in:
@@ -2,15 +2,30 @@
|
||||
@{
|
||||
//Layout = "~/Views/Shared/DisplayTemplates/_FieldLayout.cshtml";
|
||||
}
|
||||
<div class="row pb-lg-2 pb-sm-1">
|
||||
<div class="col text-truncate border-right border-bottom font-weight-bold">
|
||||
Leaf Input Data
|
||||
</div>
|
||||
</div>
|
||||
@RendDistinctValues("Site Id", Model.Select(m => m.SiteName))
|
||||
@RendDistinctValues("Latitude [°]", Model.Select(m => m.Site.Latitude?.ToString()))
|
||||
@RendDistinctValues("Longitude [°]", Model.Select(m => m.Site.Longitude?.ToString()))
|
||||
@RendDistinctValues("Elevation [m]", Model.Select(m => m.Site.Elevation?.ToString()))
|
||||
@RendDistinctValues("CO2S",
|
||||
Model.Select(m =>
|
||||
m.SiteName + ": "
|
||||
+ string.Join(", ",
|
||||
m.Data?.Select(d => d.CO2S?.ToString())
|
||||
)
|
||||
)
|
||||
)
|
||||
@RendDistinctValues("CO2S Min", Model.Select(m => m.Data?.Min(d => d.CO2S).ToString()))
|
||||
@RendDistinctValues("CO2S Average", Model.Select(m => m.Data?.Average(d => d.CO2S).ToString()))
|
||||
@RendDistinctValues("CO2S Max", Model.Select(m => m.Data?.Max(d => d.CO2S).ToString()))
|
||||
|
||||
@Rend("Site Id", Model.Select(m => m.SiteName))
|
||||
@Rend("Latitude [°]", Model.Select(m => m.Site.Latitude?.ToString()))
|
||||
@Rend("Longitude [°]", Model.Select(m => m.Site.Longitude?.ToString()))
|
||||
@Rend("Elevation [m]", Model.Select(m => m.Site.Elevation?.ToString()))
|
||||
|
||||
@helper Rend(string label, IEnumerable<string> values)
|
||||
@helper RendValue(string label, string value)
|
||||
{
|
||||
var value = string.Join(", ", values.Distinct());
|
||||
<div class="row pb-lg-2 pb-sm-1 @if (ViewData.Model == null){<text>d-none</text> }">
|
||||
<div class="col-sm-3 text-truncate border-right border-bottom pl-4 pl-sm-5">
|
||||
@Html.Raw(label)
|
||||
@@ -21,13 +36,8 @@
|
||||
</div>
|
||||
}
|
||||
|
||||
|
||||
@*@grid.GetHtml(columns:
|
||||
grid.Columns(
|
||||
grid.Column("SiteId"),
|
||||
grid.Column("Latitude"),
|
||||
grid.Column("Longitude"),
|
||||
grid.Column("Elevation")
|
||||
),
|
||||
htmlAttributes: new { @class = "table table-sm table-striped table-bordered table-hover" }
|
||||
)*@
|
||||
@helper RendDistinctValues(string label, IEnumerable<string> values)
|
||||
{
|
||||
var value = string.Join(", ", values.Distinct());
|
||||
@RendValue(label, value)
|
||||
}
|
||||
Reference in New Issue
Block a user