Improved the status page with the suggestion from #29

pull/83/head
tidusjar 9 years ago
parent 8f7098d048
commit c4f57169ad

@ -31,7 +31,9 @@ namespace PlexRequests.Core.Models
{
public string Version { get; set; }
public bool UpdateAvailable { get; set; }
public int ReleasesBehind { get; set; }
public string UpdateUri { get; set; }
public string DownloadUri { get; set; }
public string ReleaseNotes { get; set; }
public string ReleaseTitle { get; set; }
}
}

@ -70,7 +70,11 @@ namespace PlexRequests.Core
{
model.UpdateAvailable = true;
model.UpdateUri = latestRelease.Result.HtmlUrl;
}
}
model.ReleaseNotes = latestRelease.Result.Body;
model.DownloadUri = latestRelease.Result.Assets[0].BrowserDownloadUrl;
model.ReleaseTitle = latestRelease.Result.Name;
return model;
}

@ -27,6 +27,8 @@
using System.Dynamic;
using System.Linq;
using MarkdownSharp;
using Nancy;
using Nancy.Extensions;
using Nancy.ModelBinding;
@ -376,6 +378,8 @@ namespace PlexRequests.UI.Modules
{
var checker = new StatusChecker();
var status = checker.GetStatus();
var md = new Markdown();
status.ReleaseNotes = md.Transform(status.ReleaseNotes);
return View["Status", status];
}

@ -73,6 +73,10 @@
<HintPath>..\packages\Humanizer.Core.2.0.1\lib\dotnet\Humanizer.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="MarkdownSharp, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MarkdownSharp.1.13.0.0\lib\35\MarkdownSharp.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Owin, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Owin.3.0.1\lib\net45\Microsoft.Owin.dll</HintPath>
<Private>True</Private>

@ -14,7 +14,7 @@
<label class="control-label">Update Available: </label>
@if (Model.UpdateAvailable)
{
<label class="control-label"><a href="@Model.UpdateUri" target="_blank"><i class="fa fa-check"></i> Click Here!</a></label>
<label class="control-label"><a href="@Model.UpdateUri" target="_blank"><i class="fa fa-check"></i></a></label>
}
else
{
@ -23,6 +23,16 @@
</div>
@if (Model.UpdateAvailable)
{
<h2>
<a href="@Model.DownloadUri">@Model.ReleaseTitle</a>
</h2>
<hr/>
<label>Release Notes:</label>
@Html.Raw(Model.ReleaseNotes)
}
</fieldset>
</div>

@ -4,6 +4,7 @@
<package id="FluentScheduler" version="3.1.46" targetFramework="net46" />
<package id="FluentValidation" version="6.2.1.0" targetFramework="net46" />
<package id="Humanizer.Core" version="2.0.1" targetFramework="net452" />
<package id="MarkdownSharp" version="1.13.0.0" targetFramework="net46" />
<package id="Microsoft.AspNet.Razor" version="2.0.30506.0" targetFramework="net452" />
<package id="Microsoft.Owin" version="3.0.1" targetFramework="net452" />
<package id="Microsoft.Owin.Host.HttpListener" version="3.0.1" targetFramework="net452" />

Loading…
Cancel
Save