Browse Source

Updated titles and descriptions.

tags/2.0.3
Teknikode 4 years ago
parent
commit
6fa093175d

+ 16
- 3
Teknik/Areas/Blog/Controllers/BlogController.cs View File

@@ -27,7 +27,8 @@ namespace Teknik.Areas.Blog.Controllers
// The blog is the main site's blog
if (string.IsNullOrEmpty(username))
{
ViewBag.Title = "Teknik Blog - " + Config.Title;
ViewBag.Title = Config.BlogConfig.Title + " - " + Config.Title;
ViewBag.Description = Config.BlogConfig.Description;
bool isAuth = User.IsInRole("Admin");
var foundPosts = db.BlogPosts.Include("Blog").Include("Blog.User").Where(p => ((p.System || isAuth) && p.Published));
model = new BlogViewModel();
@@ -49,6 +50,11 @@ namespace Teknik.Areas.Blog.Controllers
if (blog != null)
{
ViewBag.Title = blog.User.Username + "'s Blog - " + Config.Title;
if (!string.IsNullOrEmpty(blog.User.BlogSettings.Title))
{
ViewBag.Title = blog.User.BlogSettings.Title + " - " + ViewBag.Title;
}
ViewBag.Description = blog.User.BlogSettings.Description;
bool isAuth = User.IsInRole("Admin");
var foundPosts = db.BlogPosts.Include("Blog").Include("Blog.User").Where(p => (p.BlogId == blog.BlogId && !p.System) &&
(p.Published || p.Blog.User.Username == User.Identity.Name || isAuth)).FirstOrDefault();
@@ -85,11 +91,18 @@ namespace Teknik.Areas.Blog.Controllers

if (post.System)
{
ViewBag.Title = model.Title + " - Teknik Blog - " + Config.Title;
ViewBag.Title = model.Title + " - " + Config.BlogConfig.Title + " - " + Config.Title;
ViewBag.Description = Config.BlogConfig.Description;
}
else
{
ViewBag.Title = model.Title + " - " + username + "'s Blog - " + Config.Title;
ViewBag.Title = username + "'s Blog - " + Config.Title;
if (!string.IsNullOrEmpty(post.Blog.User.BlogSettings.Title))
{
ViewBag.Title = post.Blog.User.BlogSettings.Title + " - " + ViewBag.Title;
}
ViewBag.Title = model.Title + " - " + ViewBag.Title;
ViewBag.Description = post.Blog.User.BlogSettings.Description;
}
return View("~/Areas/Blog/Views/Blog/ViewPost.cshtml", model);
}

+ 3
- 1
Teknik/Areas/Paste/Controllers/PasteController.cs View File

@@ -22,7 +22,8 @@ namespace Teknik.Areas.Paste.Controllers
[AllowAnonymous]
public ActionResult Index()
{
ViewBag.Title = Config.Title + " Paste";
ViewBag.Title = "Paste - " + Config.Title;
ViewBag.Description = "Paste your code or text easily and securely. Set an expiration, set a password, or leave it open for the world to see.";
PasteCreateViewModel model = new PasteCreateViewModel();
return View(model);
}
@@ -34,6 +35,7 @@ namespace Teknik.Areas.Paste.Controllers
if (paste != null)
{
ViewBag.Title = ((string.IsNullOrEmpty(paste.Title)) ? string.Empty : paste.Title + " - ") + Config.Title + " Paste";
ViewBag.Description = "Paste your code or text easily and securely. Set an expiration, set a password, or leave it open for the world to see.";
// Increment Views
paste.Views += 1;
db.Entry(paste).State = EntityState.Modified;

+ 2
- 1
Teknik/Areas/Podcast/Controllers/PodcastController.cs View File

@@ -24,7 +24,8 @@ namespace Teknik.Areas.Podcast.Controllers
model.Description = Config.PodcastConfig.Description;
try
{
ViewBag.Title = "Teknikast - " + Config.Title;
ViewBag.Title = Config.PodcastConfig.Title + " - " + Config.Title;
ViewBag.Description = Config.PodcastConfig.Description;
bool editor = User.IsInRole("Podcast");
var foundPodcasts = db.Podcasts.Where(p => (p.Published || editor)).FirstOrDefault();
if (foundPodcasts != null)

+ 1
- 1
Teknik/Areas/Privacy/Controllers/PrivacyController.cs View File

@@ -14,7 +14,7 @@ namespace Teknik.Areas.Privacy.Controllers
[AllowAnonymous]
public ActionResult Index()
{
ViewBag.Title = Config.Title + " - Privacy";
ViewBag.Title = "Privacy Policy - " + Config.Title;
ViewBag.Message = "Teknik privacy policy.";

return View(new PrivacyViewModel());

+ 2
- 0
Teknik/Areas/Transparency/Controllers/TransparencyController.cs View File

@@ -17,6 +17,8 @@ namespace Teknik.Areas.Transparency.Controllers
[AllowAnonymous]
public ActionResult Index()
{
ViewBag.Title = "Transparency - " + Config.Title;
ViewBag.Message = "Teknik transparency and statistics.";
TransparencyViewModel model = new TransparencyViewModel();

Upload.Models.Upload upload = db.Uploads.OrderByDescending(u => u.UploadId).FirstOrDefault();

Loading…
Cancel
Save