소스 검색

Added RSS Help.

Fixed returns for bad data and index to be RSS feeds.
tags/2.0.3
Teknikode 4 년 전
부모
커밋
a15842f17d

+ 8
- 0
Teknik/Areas/Help/Controllers/HelpController.cs 파일 보기

@@ -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
- 0
Teknik/Areas/Help/HelpAreaRegistration.cs 파일 보기

@@ -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
- 0
Teknik/Areas/Help/Views/Help/RSS.cshtml 파일 보기

@@ -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>

+ 7
- 3
Teknik/Areas/RSS/Controllers/RSSController.cs 파일 보기

@@ -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]

+ 1
- 0
Teknik/Teknik.csproj 파일 보기

@@ -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…
취소
저장