Misc. bug fixes

Issues fixed: #33, #34, #35 and #36
This commit is contained in:
Thomas Hounsell 2015-10-20 22:26:29 +01:00
parent 0290d04d4e
commit cd57521e62
3 changed files with 17 additions and 2 deletions

View File

@ -78,6 +78,7 @@ public async Task<ActionResult> viewGroup(byte major, byte minor, ushort number,
public async Task<ActionResult> viewBuild(Guid id) public async Task<ActionResult> viewBuild(Guid id)
{ {
BuildModel b = await bModel.SelectById(id); BuildModel b = await bModel.SelectById(id);
if (b == null) return new HttpNotFoundResult();
return View(b); return View(b);
} }
@ -85,17 +86,19 @@ public async Task<ActionResult> viewBuild(Guid id)
public async Task<ActionResult> viewBuild(long id) public async Task<ActionResult> viewBuild(long id)
{ {
BuildModel b = await bModel.SelectByLegacyId(id); BuildModel b = await bModel.SelectByLegacyId(id);
if (b == null) return new HttpNotFoundResult();
return RedirectToAction("viewBuild", new { id = b.Id }); return RedirectToAction("viewBuild", new { id = b.Id });
} }
[Route("twitter/{id}/")] [Route("twitter/{id:guid}/", Name = "Twitter")]
#if !DEBUG #if !DEBUG
// [OutputCache(Duration = 600, VaryByParam = "none")] // [OutputCache(Duration = 600, VaryByParam = "none")]
[CustomContentType(ContentType = "image/png", Order = 2)] [CustomContentType(ContentType = "image/png", Order = 2)]
#endif #endif
public async Task<ActionResult> twitterCard(Guid id) public async Task<ActionResult> twitterCard(Guid id)
{ {
BuildModel b = await bModel.SelectById(id); BuildModel b = await bModel.SelectById(id);
if (b == null) return new HttpNotFoundResult();
using (Bitmap bm = new Bitmap(560, 300)) using (Bitmap bm = new Bitmap(560, 300))
{ {
@ -124,6 +127,14 @@ public async Task<ActionResult> twitterCard(Guid id)
return new EmptyResult(); return new EmptyResult();
} }
[Route("twitter/{id:long}/", Name = "Twitter (Legacy)")]
public async Task<ActionResult> twitterCard(long id)
{
BuildModel b = await bModel.SelectByLegacyId(id);
if (b == null) return new HttpNotFoundResult();
return RedirectToAction("twitterCard", new { id = b.Id });
}
[Route("lab/{lab}/", Order = 1, Name = "Lab Root")] [Route("lab/{lab}/", Order = 1, Name = "Lab Root")]
#if !DEBUG #if !DEBUG
// [OutputCache(Duration = 600, VaryByParam = "none", VaryByCustom = "userName")] // [OutputCache(Duration = 600, VaryByParam = "none", VaryByCustom = "userName")]

View File

@ -1,5 +1,6 @@
@model System.Web.Mvc.HandleErrorInfo @model System.Web.Mvc.HandleErrorInfo
@{ @{
Layout = null;
bool IsRTL = System.Globalization.CultureInfo.CurrentUICulture.TextInfo.IsRightToLeft; bool IsRTL = System.Globalization.CultureInfo.CurrentUICulture.TextInfo.IsRightToLeft;
} }
<!DOCTYPE html> <!DOCTYPE html>

View File

@ -70,6 +70,9 @@
</rules> </rules>
<rewriteMaps> <rewriteMaps>
<rewriteMap name="Support Pages"> <rewriteMap name="Support Pages">
<add key="/rss/feed/low/" value="/rss/feed/wif/" />
<add key="/rss/feed/medium/" value="/rss/feed/msit/" />
<add key="/rss/feed/high/" value="/rss/feed/osg/" />
<add key="/support/question/" value="/" /> <add key="/support/question/" value="/" />
<add key="/support/stats/" value="/statistics/" /> <add key="/support/stats/" value="/statistics/" />
<add key="/support/rss/" value="/rss/" /> <add key="/support/rss/" value="/rss/" />