private static void MakeTopNavBar([NotNull] Scenario scenario, [NotNull] HtmlTextWriter w) { w.Nav(new { @class = "navbar navbar-dark sticky-top bg-dark flex-md-nowrap p-0" }); w.A(new { @class = "navbar-brand col-sm-3 col-md-2 mr-0", href = "#" }).WriteContent("SimZukunft").EndTag(); w.A(new { @class = "w-100 navbar-brand", href = "#top" }).WriteContent("Report für Szenario " + scenario).EndTag(); w.Ul(new { @class = "navbar-nav px-3" }); w.Li(new { @class = "nav-item text-nowrap" }); w.A(new { @class = "nav-link", href = "#" }).WriteContent("Back to top").EndTag(); w.EndTag(); //li w.EndTag(); //ul w.EndTag(); //nav w.WriteLine(); w.WriteLine(); }
private static void WriteSideNavBar([NotNull][ItemNotNull] List <FlaResultFileEntry> f1Rfes, [NotNull] HtmlTextWriter w, [NotNull] List <int> years) { w.Nav(new { @class = "col-md-2 d-none d-md-block bg-light sidebar d-print-none" }); w.Div(new { @class = "sidebar-sticky" }); w.Ul(new { @class = "nav flex-column" }); w.WriteLine(); w.Li(new { @class = "nav-item" }); w.A(new { @class = "nav-link active", href = "#" }); w.Span(new[] { "data-feather=home" }).WriteContent("Dashboard").EndTag(); w.Span(new { @class = "sr-only" }).WriteContent("(current)").EndTag(); w.EndTag(); //a w.EndTag(); //li w.WriteLine(); foreach (var year in years) { WriteMenuItem(w, year.ToString(CultureInfo.InvariantCulture), "year" + year, "h4"); var stages = f1Rfes.Select(x => x.SrcStageStr).Distinct().ToList(); foreach (var stage in stages) { WriteMenuItem(w, stage, "stage" + CleanStageName(stage), "h5"); var sections = f1Rfes.Where(x => x.SrcStageStr == stage).Select(x => x.Section.ToString(CultureInfo.InvariantCulture)).Distinct() .ToList(); foreach (var section in sections) { WriteMenuItem(w, section, "section" + CleanStageName(section), "h6"); } } } w.EndTag(); //ul w.EndTag(); //div w.EndTag(); //nav }
private static void WriteMenuItem([NotNull] HtmlTextWriter w, [NotNull] string txt, [NotNull] string key, [NotNull] string size) { w.Li(new { @class = "nav-item" }); w.A(new { @class = "nav-link", href = "#" + key }); w.Span(new[] { "data-feather=file", "class=" + size }).WriteContent(txt).EndTag(); w.EndTag(); //a w.EndTag(); //li }
private static void WriteYearSection([NotNull] HtmlTextWriter w, int year, [NotNull][ItemNotNull] List <FlaResultFileEntry> f2Fres, [NotNull] Dictionary <FlaResultFileEntry, string> dstFileNameByRfe, [NotNull] Dictionary <FlaResultFileEntry, string> dstFileNameSmallByRfe) { w.Div(new { @class = "row" }); w.P(new { id = "year" + year, style = "padding-top: 90px;" }).EndTag(); w.EndTag(); w.Div(new { @class = "row" }); w.H1().WriteContent("Year " + year).EndTag(); w.EndTag(); //div row var stages = f2Fres.Select(x => x.SrcStage.ToString()).Distinct().ToList(); foreach (string stage in stages) { w.Div(new { @class = "row" }); w.P(new { id = "stage" + CleanStageName(stage), style = "padding-top: 90px;" }).EndTag(); w.EndTag(); w.Div(new { @class = "row" }); w.H2().WriteContent("Stage " + stage).EndTag(); w.EndTag(); //div var f3Fres = f2Fres.Where(x => x.SrcStage.ToString() == stage).ToList(); var sections = f3Fres.Select(x => x.Section.ToString(CultureInfo.InvariantCulture)).Distinct().ToList(); foreach (var section in sections) { w.Div(new { @class = "row" }); w.Hr(new { id = "section" + CleanStageName(section), style = "padding-top: 90px;" }).EndTag(); w.H3().WriteContent("Step " + section).EndTag(); w.EndTag(); //div var files = f2Fres.Where(x => x.Section == section).ToList(); foreach (FlaResultFileEntry entry in files) { w.Div(new { @class = "row" }); w.P().WriteContent(entry.FullFilename).EndTag(); w.EndTag(); w.Div(new { @class = "row" }); string dstfnFull = Resources + "/" + dstFileNameByRfe[entry]; string dstfnSmall = Resources + "/" + dstFileNameSmallByRfe[entry]; w.P(); w.A(new { href = dstfnFull, target = "_blank" }); w.Img(new { src = dstfnSmall, height = "400" }).EndTag(); w.EndTag(); //a w.EndTag(); //p w.EndTag(); //div row } } } //w.EndTag(); //div container // w.Div(new {@class = "outer"}).P().WriteContent("some content").Table().Tr().Td().WriteContent("hi").EndTag().EndTag().EndTag().EndTag().EndTag().EndTag(); }