Browse Source

Added RSS Help.

Fixed returns for bad data and index to be RSS feeds.
master
Teknikode 7 years ago
parent
commit
a15842f17d
  1. 8
      Teknik/Areas/Help/Controllers/HelpController.cs
  2. 7
      Teknik/Areas/Help/HelpAreaRegistration.cs
  3. 12
      Teknik/Areas/Help/Views/Help/RSS.cshtml
  4. 10
      Teknik/Areas/RSS/Controllers/RSSController.cs
  5. 1
      Teknik/Teknik.csproj

8
Teknik/Areas/Help/Controllers/HelpController.cs

@ -76,6 +76,14 @@ namespace Teknik.Areas.Help.Controllers @@ -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()
{

7
Teknik/Areas/Help/HelpAreaRegistration.cs

@ -65,6 +65,13 @@ namespace Teknik.Areas.Help @@ -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

12
Teknik/Areas/Help/Views/Help/RSS.cshtml

@ -0,0 +1,12 @@ @@ -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>

10
Teknik/Areas/RSS/Controllers/RSSController.cs

@ -20,7 +20,9 @@ namespace Teknik.Areas.RSS.Controllers @@ -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 @@ -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 @@ -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]

1
Teknik/Teknik.csproj

@ -453,6 +453,7 @@ @@ -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" />

Loading…
Cancel
Save