@model DR.FV2016.Web.Models.BannerViewModel @using DR.FV2016.Web.Helpers @using DR.FV2016.Service.Models @using DR.FV2016.Web.Models.Results; @using DR.FV2016.Web.Models.Candidate; @{ var timestampUTC = (Int64)Model.Servertime.ToUniversalTime().Subtract(new DateTime(1970, 1, 1)).TotalSeconds; /* Set these to the correct electiontime once known. Else set far into the future!*/ var electionEndUTC = (Int64)(new DateTime(2015, 6, 18, 20, 0, 0).ToUniversalTime()).Subtract(new DateTime(1970, 1, 1)).TotalSeconds; //var electionTimerStart = new DateTime(2015, 6, 18, 8, 58, 0); /* Note To prevent imagescaler caching issues the image querystring should match the one used in js. */ var screenGrabUrl = Model.StreamingImageUrl; var fallbackScreenGrabURL = Url.Content("~/Content/images/external/fallback.jpg"); var serverPath = Url.CrossServerContent("~/"); var CSS = Html.GetFileContent("~/content/build/external/banner.css"); var staticCSS = Html.GetFileContent("~/content/build/external/banner-static.css"); CSS = MvcHtmlString.Create(CSS.ToString().Replace("url(\"content", "url(\"" + serverPath + "content")); staticCSS = MvcHtmlString.Create(staticCSS.ToString().Replace("url(\"content", "url(\"" + serverPath + "content")); @* Model.ElectionState = ElectionState.ResultsIn; *@ @* Model.ElectionState = ElectionState.ElectedCandidatesIn; *@ } @if (Model.ElectionState == ElectionState.ElectionDay || Model.ElectionState == ElectionState.ResultsIn || Model.ElectionState == ElectionState.ElectedCandidatesIn) { } @if (Model.ElectionState == ElectionState.PreElection) {
@Html.Partial("BannerCandidateTest", Model)
@Html.Partial("BannerVideo", Model) @Html.Partial("BannerScribble", Model)
@Html.Partial("BannerCandidateTestMobile", Model)
} @if (Model.ElectionState == ElectionState.ElectionDay) {
@Html.Partial("BannerCandidateTestB", Model)
@Html.Partial("BannerVideo", Model) @Html.Partial("BannerCountdown", Model)
@Html.Partial("BannerCandidateTestMobile", Model)
} @if (Model.ElectionState == ElectionState.ResultsIn) { foreach (var result in Model.Result.Results) { if (result.RenderMandateView) {
@Html.Partial("BannerForecastBlocks", Model)
@Html.Partial("BannerForecastMandates", result)
}
@Html.Partial("BannerForecastBlocks", Model)
@Html.Partial("BannerForecastDistrictVotes", result)
}
@Html.Partial("BannerForecastBlocksMobile", Model)
} @if (Model.ElectionState == ElectionState.ElectedCandidatesIn) { ViewBag.ShareRed = Model.Result.ShareRed; ViewBag.ShareBlue = Model.Result.ShareBlue; foreach (var result in Model.Result.Results) { if (result.ResultType == ResultType.Resultat) {
@Html.Partial("BannerResultsBlocks", result)
@Html.Partial("BannerVideo", Model) @Html.Partial("BannerScribble", Model)
@Html.Partial("BannerResultsMandates", result)
@Html.Partial("BannerVideo", Model) @Html.Partial("BannerScribble", Model)
} if (result.ResultType == ResultType.Valgte) {
@Html.Partial("BannerResultsDistrictVotes", result)
@Html.Partial("BannerVideo", Model) @Html.Partial("BannerScribble", Model)
} }
@Html.Partial("BannerResultsBlocksMobile", Model)
}