From b573550660d9b28daa3529046aa6250327fbb869 Mon Sep 17 00:00:00 2001 From: Thomas Hounsell Date: Thu, 11 Dec 2014 12:24:42 +0000 Subject: [PATCH] Titles for search results --- Controllers/apiController.cs | 5 +++++ Models/ApiModel/SearchResult.cs | 1 + Views/build/index.cshtml | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Controllers/apiController.cs b/Controllers/apiController.cs index a99098d..c13bfd2 100644 --- a/Controllers/apiController.cs +++ b/Controllers/apiController.cs @@ -41,6 +41,7 @@ orderby s.IndexOf(query) ascending { Url = Url.Route("Source Root", new { controller = "build", action = "source", source = s }), Label = s.Replace(query, "" + query + ""), + Title = s, Group = "Source" }; @@ -54,6 +55,7 @@ where string.Format("{0}.{1}", v.Major, v.Minor).StartsWith(query) { Url = Url.Route("Version Root", new { controller = "build", action = "version", major = v.Major, minor = v.Minor }), Label = string.Format("{0}.{1}", v.Major, v.Minor).Replace(query, "" + query + ""), + Title = "", Group = "Version" }; @@ -67,6 +69,7 @@ orderby y descending { Url = Url.Route("Year Root", new { controller = "build", action = "year", year = y }), Label = y.ToString().Replace(query, "" + query + ""), + Title = "", Group = "Year" }; @@ -80,6 +83,7 @@ orderby l.IndexOf(query) ascending { Url = Url.Route("Lab Root", new { controller = "build", action = "lab", lab = l }), Label = l.Replace(query, "" + query + ""), + Title = l, Group = "Lab" }; @@ -94,6 +98,7 @@ b.BuildTime descending { Url = Url.Route("Actions", new { controller = "build", action = "info", id = b.Id }), Label = b.FullBuildString.Replace(query, "" + query + ""), + Title = b.FullBuildString, Group = "Build" }; diff --git a/Models/ApiModel/SearchResult.cs b/Models/ApiModel/SearchResult.cs index b20d0ce..b03ba9f 100644 --- a/Models/ApiModel/SearchResult.cs +++ b/Models/ApiModel/SearchResult.cs @@ -9,6 +9,7 @@ public class SearchResult { public string Url { get; set; } public string Label { get; set; } + public string Title { get; set; } public string Group { get; set; } } } \ No newline at end of file diff --git a/Views/build/index.cshtml b/Views/build/index.cshtml index e3d2f16..d15583f 100644 --- a/Views/build/index.cshtml +++ b/Views/build/index.cshtml @@ -169,7 +169,7 @@ @Scripts.Render("~/bundles/jsrender")