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

Updated titles and descriptions.

This commit is contained in:
Uncled1023 2016-02-26 21:42:31 -08:00
parent 3e2551d1fb
commit 6fa093175d
5 changed files with 24 additions and 6 deletions

View File

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

View File

@ -22,7 +22,8 @@ namespace Teknik.Areas.Paste.Controllers
[AllowAnonymous] [AllowAnonymous]
public ActionResult Index() 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(); PasteCreateViewModel model = new PasteCreateViewModel();
return View(model); return View(model);
} }
@ -34,6 +35,7 @@ namespace Teknik.Areas.Paste.Controllers
if (paste != null) if (paste != null)
{ {
ViewBag.Title = ((string.IsNullOrEmpty(paste.Title)) ? string.Empty : paste.Title + " - ") + Config.Title + " Paste"; 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 // Increment Views
paste.Views += 1; paste.Views += 1;
db.Entry(paste).State = EntityState.Modified; db.Entry(paste).State = EntityState.Modified;

View File

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

View File

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

View File

@ -17,6 +17,8 @@ namespace Teknik.Areas.Transparency.Controllers
[AllowAnonymous] [AllowAnonymous]
public ActionResult Index() public ActionResult Index()
{ {
ViewBag.Title = "Transparency - " + Config.Title;
ViewBag.Message = "Teknik transparency and statistics.";
TransparencyViewModel model = new TransparencyViewModel(); TransparencyViewModel model = new TransparencyViewModel();
Upload.Models.Upload upload = db.Uploads.OrderByDescending(u => u.UploadId).FirstOrDefault(); Upload.Models.Upload upload = db.Uploads.OrderByDescending(u => u.UploadId).FirstOrDefault();