Skip to content

Commit

Permalink
Redesign (broken navigation, ugly tables).
Browse files Browse the repository at this point in the history
  • Loading branch information
ashmind committed Dec 1, 2013
1 parent 61a7fc0 commit 4a0b007
Show file tree
Hide file tree
Showing 22 changed files with 3,446 additions and 10,751 deletions.
131 changes: 0 additions & 131 deletions #framework/Runner/Outputs/Html/FeatureTests.cshtml

This file was deleted.

16 changes: 0 additions & 16 deletions #framework/Runner/Outputs/Html/HtmlNavigationLink.cs

This file was deleted.

6 changes: 3 additions & 3 deletions #framework/Runner/Outputs/Html/HtmlResultModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

namespace FeatureTests.Runner.Outputs.Html {
public class HtmlResultModel {
public HtmlResultModel(IReadOnlyList<FeatureTable> tables, IReadOnlyList<HtmlNavigationLink> navigationLinks) {
public HtmlResultModel(IReadOnlyList<FeatureTable> tables, IReadOnlyList<NavigationLinkModel> navigationLinks) {
this.Tables = tables;
this.NavigationLinks = navigationLinks;
}

public IReadOnlyList<FeatureTable> Tables { get; set; }
public IReadOnlyList<HtmlNavigationLink> NavigationLinks { get; set; }
public IReadOnlyList<FeatureTable> Tables { get; private set; }
public IReadOnlyList<NavigationLinkModel> NavigationLinks { get; private set; }

public dynamic Labels { get; set; }
public string HtmlAfterAll { get; set; }
Expand Down
18 changes: 18 additions & 0 deletions #framework/Runner/Outputs/Html/NavigationLinkModel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;

namespace FeatureTests.Runner.Outputs.Html {
public class NavigationLinkModel {
public NavigationLinkModel(string url, string name) {
this.Url = url;
this.Name = name;
this.Children = new List<NavigationLinkModel>();
}

public string Url { get; set; }
public string Name { get; set; }
public bool IsTopLevelLinkToCurrentPage { get; set; }
public IReadOnlyList<NavigationLinkModel> Children { get; private set; }
}
}
116 changes: 116 additions & 0 deletions #framework/Runner/Outputs/Html/Templates/FeatureTests.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
@using System.Linq
@using FeatureTests.Runner.Sources
@inherits FeatureTests.Runner.Outputs.Html.HtmlTemplateBase<FeatureTests.Runner.Outputs.Html.HtmlResultModel>

<!DOCTYPE html>
@* Metanote: Ignore the following note in Razor template, it is only relevant to the result. *@
<!-- Note: This file has been generated by TableGenerator and should not be edited manually. -->
<html>
<head>
<title>@Model.Labels.Title</title>
<link rel='stylesheet' href='css/main.css' />

<script type="text/javascript" src="http://code.jquery.com/jquery-2.0.3.min.js"></script>
<script type="text/javascript" src="js/jquery.toc.js"></script>
</head>
<body>
<nav class="main-nav">
<ul>
@foreach (var link in Model.NavigationLinks) {
<li class="@(link.IsTopLevelLinkToCurrentPage ? "current" : null)"><a href="@link.Url">@link.Name</a></li>
}
</ul>

<!--ul class="toc"></ul-->
</nav>

<main class="content">
<h1>@Model.Labels.Title</h1>

<!-- TODO: move this to a separate (navigable) file -->
<section>
<h2 id="GeneralInformation">General information</h2>
<div class="section-description">
<p>The goal of this project is to monitor support for important features across multiple libraries.</p>
<p>You can find the code behind these tables in <a href="https://github.com/ashmind/net-feature-tests">net-feature-tests GitHub project</a>.</p>

<p>Please note the following:</p>
<ol>
<li>The list of features is based on what I consider to be important. It is not an objective measure on which library is "better".</li>
<li>It is not possible to test for all features automatically. For example, extensibility is very important, but impossible to test/measure.</li>
<li>The test results might not necessary be up to date (see the version for each library).</li>
<li>The test code should not be seen as best practice for each library — it forces all of them to the same test interface.</li>
<li>I am not an expert on all libraries and not all adapters were reviewed by authors. So feature may fail because of incorrect adapter.</li>
</ol>

<p>Thanks for reading!</p>
</div>
</section>
<!-- End of TODO -->

@foreach (var table in Model.Tables) {
var tableDisplayName = ((table.Key == MetadataKeys.GeneralInfoTable) ? ((string)Model.Labels.GeneralInfo) : null) ?? @table.DisplayName;
var tableLinkName = GenerateAnchor(tableDisplayName);

<section>
<h2 id="@tableLinkName">@tableDisplayName</h2>
<div class="section-description">@FormatDescription(table.Description)</div>

@{ var featuresWithDescription = table.Features.Where(f => !string.IsNullOrEmpty(f.Description)).ToArray(); }
@if (featuresWithDescription.Any()) {
<dl class="feature-descriptions">
@foreach (var feature in featuresWithDescription) {
<dt>@feature.Name</dt>
<dd>@FormatDescription(feature.Description)</dd>
}
</dl>
}

<table>
<tr>
<th>Name</th>
@foreach (var library in table.Libraries) {
<th title="@library.Name">@library.Name</th>
}
</tr>

@{ var comments = table.GetFeatureRows().SelectMany(r => r.Item2)
.Where(c => c.HasComment)
.Select(c => c.Comment)
.GroupBy(c => c)
.Select((g, index) => new { comment = g.Key, index = index + 1 })
.ToList(); }

@foreach (var row in table.GetFeatureRows()) {
<tr>
<td class="row-name">@row.Item1.Name</td>
@foreach (var cell in row.Item2) {
<td class="@GetCssClassesForCell(cell)">
@if (cell.HasComment) {
var index = @comments.Single(x => x.comment == @cell.Comment).index;
<a class="local" href="#@tableLinkName-note-@index">@FormatDisplayValue(cell.DisplayValue)<sup>@index</sup></a>
}
else if (cell.DisplayUri != null) {
<a href="@cell.DisplayUri">@FormatDisplayValue(cell.DisplayValue)</a>
}
else {
@FormatDisplayValue(cell.DisplayValue)
}
</td>
}
</tr>
}
</table>

<ol class="comments">
@foreach (var x in comments) {
<li id="@tableLinkName-note-@x.index">@FormatDescription(x.comment)</li>
}
</ol>
</section>
}

@RawHtml(Model.HtmlAfterAll)
</main>
</body>
</html>
Loading

0 comments on commit 4a0b007

Please sign in to comment.