Permalink
Browse files

changed dependency set headers from italic to underline; changed depe…

…ndency set headers to use friendly framework names
  • Loading branch information...
half-ogre committed Jun 15, 2012
1 parent a155556 commit 5048bc7a9038a5c35bcb3e6749b3ff9b5889bc5d
Showing with 20 additions and 10 deletions.
  1. +4 −7 Website/Content/Site.css
  2. +13 −0 Website/ExtensionMethods.cs
  3. +3 −3 Website/ViewModels/DependencySetsViewModel.cs
View
@@ -571,23 +571,20 @@ header.main {
padding: 0;
}
- #dependencySets > li {
- font-style: italic;
- }
-
- #dependencySets > li > h4 {
+ #dependencySets > li > h4
+ {
margin: 2px 0;
+ text-decoration: underline;
}
ul.dependencySet {
list-style: none;
- margin: 0 0 5px 0;
+ margin: 0 0 10px 0;
padding: 0;
}
ul.dependencySet li {
font-size: 1.25em;
- font-style: normal;
padding-right: 6px;
}
@@ -8,6 +8,7 @@
using System.Runtime.Versioning;
using System.Security.Principal;
using System.ServiceModel.Activation;
+using System.Text;
using System.Web.Mvc;
using System.Web.Routing;
using System.Web.WebPages;
@@ -224,5 +225,17 @@ public static string ToShortNameOrNull(this FrameworkName frameworkName)
{
return frameworkName == null ? null : VersionUtility.GetShortFrameworkName(frameworkName);
}
+
+ public static string ToFriendlyName(this FrameworkName frameworkName)
+ {
+ if (frameworkName == null)
+ throw new ArgumentNullException("frameworkName");
+
+ var sb = new StringBuilder();
+ sb.AppendFormat("{0} {1}", frameworkName.Identifier, frameworkName.Version);
+ if (string.IsNullOrEmpty(frameworkName.Profile))
+ sb.AppendFormat(" {0}", frameworkName.Profile);
+ return sb.ToString();
+ }
}
}
@@ -15,13 +15,13 @@ public DependencySetsViewModel(IEnumerable<PackageDependency> packageDependencie
.GroupBy(d => d.TargetFramework)
.OrderBy(ds => ds.Key);
+ OnlyHasAllFrameworks = dependencySets.Count() == 1 && dependencySets.First().Key == null;
+
foreach(var dependencySet in dependencySets)
{
- var targetFramework = dependencySet.Key ?? "All";
+ var targetFramework = dependencySet.Key == null ? "All Frameworks" : VersionUtility.ParseFrameworkName(dependencySet.Key).ToFriendlyName();
DependencySets.Add(targetFramework, dependencySet.Select(d => new DependencyViewModel(d.Id, d.VersionSpec)));
}
-
- OnlyHasAllFrameworks = DependencySets.Count == 1 && DependencySets.First().Key == "All";
}
public IDictionary<string, IEnumerable<DependencyViewModel>> DependencySets { get; private set; }

0 comments on commit 5048bc7

Please sign in to comment.