1
0
mirror of https://git.teknik.io/Teknikode/Teknik.git synced 2023-08-02 14:16:22 +02:00

Added RSS Help.

Fixed returns for bad data and index to be RSS feeds.
This commit is contained in:
Uncled1023 2016-01-27 13:04:16 -08:00
parent bd49fa66b9
commit a15842f17d
5 changed files with 35 additions and 3 deletions

View File

@ -76,6 +76,14 @@ namespace Teknik.Areas.Help.Controllers
return View("~/Areas/Help/Views/Help/Mumble.cshtml", model);
}
[AllowAnonymous]
public ActionResult RSS()
{
ViewBag.Title = "RSS Help - " + Config.Title;
HelpViewModel model = new HelpViewModel();
return View("~/Areas/Help/Views/Help/RSS.cshtml", model);
}
[AllowAnonymous]
public ActionResult Upload()
{

View File

@ -65,6 +65,13 @@ namespace Teknik.Areas.Help
new { controller = "Help", action = "Mumble" }, // Parameter defaults
new[] { typeof(Controllers.HelpController).Namespace }
);
context.MapSubdomainRoute(
"Help.RSS", // Route name
new List<string>() { "dev", "help" }, // Subdomains
"RSS", // URL with parameters
new { controller = "Help", action = "RSS" }, // Parameter defaults
new[] { typeof(Controllers.HelpController).Namespace }
);
context.MapSubdomainRoute(
"Help.Upload", // Route name
new List<string>() { "dev", "help" }, // Subdomains

View File

@ -0,0 +1,12 @@
@model Teknik.Areas.Help.ViewModels.HelpViewModel
<div class="container">
<div class="row">
<h2><b>RSS</b></h2>
<hr>
<h3>RSS Info</h3>
<p>
RSS feeds are available for the Teknik Podcasts, Site Blog, and individual User Blogs.
</p>
</div>
</div>

View File

@ -20,7 +20,9 @@ namespace Teknik.Areas.RSS.Controllers
[AllowAnonymous]
public ActionResult Index()
{
return View();
SyndicationFeed feed = new SyndicationFeed("Teknik RSS", "RSS feeds for the Teknik Services.", new Uri(Url.SubRouteUrl("help", "Help.RSS")));
return new RssResult(feed);
}
[AllowAnonymous]
@ -28,7 +30,7 @@ namespace Teknik.Areas.RSS.Controllers
{
// If empty, grab the main blog
Blog.Models.Blog blog = null;
string blogUrl = string.Empty;
string blogUrl = Url.SubRouteUrl("blog", "Blog.Blog");
string title = string.Empty;
string description = string.Empty;
bool isSystem = string.IsNullOrEmpty(username);
@ -75,7 +77,9 @@ namespace Teknik.Areas.RSS.Controllers
return new RssResult(feed);
}
return Json(new { error = "Blog Not Found" }, JsonRequestBehavior.AllowGet);
SyndicationFeed badFeed = new SyndicationFeed("No Blog Available", "The specified blog does not exist", new Uri(blogUrl));
return new RssResult(badFeed);
}
[AllowAnonymous]

View File

@ -453,6 +453,7 @@
<Content Include="Areas\Transparency\Views\web.config" />
<Content Include="Areas\Transparency\Views\_ViewStart.cshtml" />
<Content Include="Areas\Transparency\Views\Transparency\Index.cshtml" />
<Content Include="Areas\Help\Views\Help\RSS.cshtml" />
<None Include="Properties\PublishProfiles\Teknik Dev.pubxml" />
<None Include="Scripts\jquery-2.1.4.intellisense.js" />
<Content Include="Scripts\bootbox\bootbox.min.js" />