The next generation of the Teknik Services. Written in ASP.NET. https://www.teknik.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

HelpController.cs 4.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. using Microsoft.AspNetCore.Authorization;
  2. using Microsoft.AspNetCore.Mvc;
  3. using Microsoft.Extensions.Logging;
  4. using Teknik.Areas.Help.ViewModels;
  5. using Teknik.Attributes;
  6. using Teknik.Configuration;
  7. using Teknik.Controllers;
  8. using Teknik.Data;
  9. using Teknik.Filters;
  10. using Teknik.Logging;
  11. namespace Teknik.Areas.Help.Controllers
  12. {
  13. [TeknikAuthorize]
  14. [Area("Help")]
  15. public class HelpController : DefaultController
  16. {
  17. public HelpController(ILogger<Logger> logger, Config config, TeknikEntities dbContext) : base(logger, config, dbContext) { }
  18. [AllowAnonymous]
  19. public IActionResult Index()
  20. {
  21. ViewBag.Title = "Help - " + _config.Title;
  22. HelpViewModel model = new HelpViewModel();
  23. return View(model);
  24. }
  25. [AllowAnonymous]
  26. public IActionResult API(string version, string service)
  27. {
  28. HelpViewModel model = new HelpViewModel();
  29. if (string.IsNullOrEmpty(version) && string.IsNullOrEmpty(service))
  30. {
  31. ViewBag.Title = "API Help - " + _config.Title;
  32. return View("~/Areas/Help/Views/Help/API/API.cshtml", model);
  33. }
  34. else if(!string.IsNullOrEmpty(version) && !string.IsNullOrEmpty(service))
  35. {
  36. ViewBag.Title = service + " API " + version + " Help - " + _config.Title;
  37. return View("~/Areas/Help/Views/Help/API/" + version + "/" + service + ".cshtml", model);
  38. }
  39. return RedirectToRoute("Error.Http404");
  40. }
  41. [AllowAnonymous]
  42. public IActionResult Blog()
  43. {
  44. ViewBag.Title = "Blogging Help - " + _config.Title;
  45. HelpViewModel model = new HelpViewModel();
  46. return View("~/Areas/Help/Views/Help/Blog.cshtml", model);
  47. }
  48. [AllowAnonymous]
  49. public IActionResult Git()
  50. {
  51. ViewBag.Title = "Git Service Help - " + _config.Title;
  52. HelpViewModel model = new HelpViewModel();
  53. return View("~/Areas/Help/Views/Help/Git.cshtml", model);
  54. }
  55. [AllowAnonymous]
  56. public IActionResult IRC()
  57. {
  58. ViewBag.Title = "IRC Server Help - " + _config.Title;
  59. HelpViewModel model = new HelpViewModel();
  60. return View("~/Areas/Help/Views/Help/IRC.cshtml", model);
  61. }
  62. [AllowAnonymous]
  63. public IActionResult Mail()
  64. {
  65. ViewBag.Title = "Mail Server Help - " + _config.Title;
  66. HelpViewModel model = new HelpViewModel();
  67. return View("~/Areas/Help/Views/Help/Mail.cshtml", model);
  68. }
  69. [AllowAnonymous]
  70. public IActionResult Markdown()
  71. {
  72. ViewBag.Title = "Markdown Help - " + _config.Title;
  73. HelpViewModel model = new HelpViewModel();
  74. return View("~/Areas/Help/Views/Help/Markdown.cshtml", model);
  75. }
  76. [AllowAnonymous]
  77. public IActionResult Mumble()
  78. {
  79. ViewBag.Title = "Mumble Server Help - " + _config.Title;
  80. HelpViewModel model = new HelpViewModel();
  81. return View("~/Areas/Help/Views/Help/Mumble.cshtml", model);
  82. }
  83. [AllowAnonymous]
  84. public IActionResult RSS()
  85. {
  86. ViewBag.Title = "RSS Help - " + _config.Title;
  87. HelpViewModel model = new HelpViewModel();
  88. return View("~/Areas/Help/Views/Help/RSS.cshtml", model);
  89. }
  90. [AllowAnonymous]
  91. public IActionResult Tools()
  92. {
  93. ViewBag.Title = "Tool Help - " + _config.Title;
  94. HelpViewModel model = new HelpViewModel();
  95. return View("~/Areas/Help/Views/Help/Tools.cshtml", model);
  96. }
  97. [AllowAnonymous]
  98. public IActionResult Upload()
  99. {
  100. ViewBag.Title = "Upload Service Help - " + _config.Title;
  101. HelpViewModel model = new HelpViewModel();
  102. return View("~/Areas/Help/Views/Help/Upload.cshtml", model);
  103. }
  104. }
  105. }