mirror of
https://github.com/lempamo/Project-Unite.git
synced 2025-01-23 01:32:16 +00:00
Ambiguity list update.
This commit is contained in:
parent
e8b18cbf92
commit
7bc9017b0f
2 changed files with 20 additions and 1 deletions
|
@ -99,7 +99,14 @@ public WikiPage[] AmbiguousReferences
|
|||
{
|
||||
var db = new ApplicationDbContext();
|
||||
|
||||
return db.WikiPages.Where(w => w.Id != this.Id && w.Name.ToLower().Contains(this.Name.ToLower())).ToArray();
|
||||
var ambiguous1 = db.WikiPages.Where(w => w.Id != this.Id && w.Name.ToLower().Contains(this.Name.ToLower())).ToArray();
|
||||
var ambiguous2 = db.WikiPages.Where(w => w.Id != this.Id && this.Name.ToLower().Contains(w.Name.ToLower())).ToArray();
|
||||
|
||||
var list = new List<WikiPage>();
|
||||
list.AddRange(ambiguous1);
|
||||
list.AddRange(ambiguous2);
|
||||
|
||||
return list.ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -56,6 +56,18 @@
|
|||
{
|
||||
<h1>@Model.Page.Name</h1>
|
||||
|
||||
if(Model.Page.AmbiguousReferences.Length > 0)
|
||||
{
|
||||
<p>Ambiguity detected. Here's a list of pages that may relate to this page.</p>
|
||||
|
||||
<ul>
|
||||
@foreach(var page in Model.Page.AmbiguousReferences)
|
||||
{
|
||||
<li>@Html.ActionLink(page.Name, "Index", new { id = page.Id })</li>
|
||||
}
|
||||
</ul>
|
||||
}
|
||||
|
||||
var edit = Model.Page.EditHistory.First();
|
||||
|
||||
<p><strong>Last edited by @Html.UserLink(edit.UserId) on @edit.EditedAt</strong></p>
|
||||
|
|
Loading…
Reference in a new issue