Browse Source

Fixed blog comments and added blog styles

master
Teknikode 7 years ago
parent
commit
98569322a9
  1. 1
      Teknik/Areas/Blog/BlogAreaRegistration.cs
  2. 90
      Teknik/Areas/Blog/Content/Blog.css
  3. 2
      Teknik/Areas/Blog/Scripts/Blog.js
  4. 4
      Teknik/Areas/Blog/Views/Blog/Blog.cshtml
  5. 2
      Teknik/Areas/Blog/Views/Blog/Comment.cshtml
  6. 2
      Teknik/Areas/Blog/Views/Blog/ViewPost.cshtml
  7. 1
      Teknik/Teknik.csproj

1
Teknik/Areas/Blog/BlogAreaRegistration.cs

@ -66,6 +66,7 @@ namespace Teknik.Areas.Blog @@ -66,6 +66,7 @@ namespace Teknik.Areas.Blog
"~/Areas/Blog/Scripts/Blog.js"));
// Register Style Bundles
BundleTable.Bundles.Add(new StyleBundle("~/Content/blog").Include(
"~/Areas/Blog/Content/Blog.css",
"~/Content/bootstrap-markdown.min.css"));
}
}

90
Teknik/Areas/Blog/Content/Blog.css

@ -0,0 +1,90 @@ @@ -0,0 +1,90 @@
/* Pagination */
.pager {
margin-bottom: 60px;
text-align: left;
}
.pager > li > a {
width: 140px;
padding: 10px 20px;
text-align: center;
border-radius: 30px;
}
/*
* Blog name and description
*/
.blog-header {
padding-top: 20px;
padding-bottom: 20px;
}
.blog-title {
margin-top: 30px;
margin-bottom: 0;
font-size: 60px;
font-weight: normal;
}
.blog-description {
font-size: 20px;
}
/*
* Main column and sidebar layout
*/
.blog-main {
font-size: 18px;
line-height: 1.5;
}
/*
* Blog posts
*/
.blog-post {
margin-bottom: 60px;
}
.blog-post-sm {
margin-bottom: 5px;
}
.blog-post-title {
margin-bottom: 5px;
font-size: 40px;
}
.blog-post-title-sm {
margin-bottom: 5px;
font-size: 18px;
line-height: 1;
}
/*.blog-post-title a {
color: rgb(51, 51, 51);
}*/
.blog-post-meta {
margin-bottom: 20px;
}
.blog-post-meta-sm {
margin-bottom: 5px;
font-size: 12px;
line-height: 1;
}
.post-comment {
margin-bottom: 20px;
}
.post-comment-title {
margin-bottom: 5px;
font-size: 40px;
}
.post-comment-meta {
margin-bottom: 20px;
}
/*
* Markdown Edits
*/
blockquote {
border-left: 2px dotted #888;
padding-left: 5px;
background: #d0f0ff;
}

2
Teknik/Areas/Blog/Scripts/Blog.js

@ -96,7 +96,7 @@ @@ -96,7 +96,7 @@
$("#edit_comment_postid").val(commentID);
$.ajax({
type: "POST",
url: getCommentContentURL,
url: getCommentArticleURL,
data: { commentID: commentID },
success: function (html) {
if (html.result) {

4
Teknik/Areas/Blog/Views/Blog/Blog.cshtml

@ -17,8 +17,8 @@ @@ -17,8 +17,8 @@
var getCommentsURL = '@Url.Action("GetComments", "Blog", new { area = "Blog" })';
var getCommentArticleURL = '@Url.Action("GetCommentArticle", "Blog", new { area = "Blog" })';
var addCommentURL = '@Url.Action("CreatePost", "Blog", new { area = "Blog" })';
var editCommentURL = '@Url.Action("EditPost", "Blog", new { area = "Blog" })';
var addCommentURL = '@Url.Action("CreateComment", "Blog", new { area = "Blog" })';
var editCommentURL = '@Url.Action("EditComment", "Blog", new { area = "Blog" })';
var deleteCommentURL = '@Url.Action("DeleteComment", "Blog", new { area = "Blog" })';
</script>

2
Teknik/Areas/Blog/Views/Blog/Comment.cshtml

@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
<div class="col-sm-8 col-sm-offset-2">
<div class="post-comment">
<p class="post-comment-meta text-muted">
<a href="@Url.Action("Index", "Profile", new { area = "Profile", username = Model.Post.Blog.User.Username })">@Model.Post.Blog.User.Username</a> replied at @Model.DatePosted.ToString("H:m:s tt") on @Model.DatePosted.ToString("MMMM dd, yyyy")
<a href="@Url.Action("Index", "Profile", new { area = "Profile", username = Model.Post.Blog.User.Username })">@Model.Post.Blog.User.Username</a> replied at @Model.DatePosted.ToString("HH:mm:ss tt") on @Model.DatePosted.ToString("MMMM dd, yyyy")
@if (Model.Post.Blog.User.Username == User.Identity.Name || User.IsInRole("Admin"))
{
<br />

2
Teknik/Areas/Blog/Views/Blog/ViewPost.cshtml

@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
var deletePostURL = '@Url.Action("DeletePost", "Blog", new { area = "Blog" })';
var getCommentsURL = '@Url.Action("GetComments", "Blog", new { area = "Blog" })';
var getCommentContentURL = '@Url.Action("GetCommentContent", "Blog", new { area = "Blog" })';
var getCommentArticleURL = '@Url.Action("GetCommentArticle", "Blog", new { area = "Blog" })';
var addCommentURL = '@Url.Action("CreateComment", "Blog", new { area = "Blog" })';
var editCommentURL = '@Url.Action("EditComment", "Blog", new { area = "Blog" })';
var deleteCommentURL = '@Url.Action("DeleteComment", "Blog", new { area = "Blog" })';

1
Teknik/Teknik.csproj

@ -185,6 +185,7 @@ @@ -185,6 +185,7 @@
<Compile Include="App_Start\SubdomainRouteExtension.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="Areas\Blog\Content\Blog.css" />
<Content Include="Areas\Blog\Scripts\Blog.js" />
<Content Include="Areas\Contact\Scripts\Contact.js" />
<Content Include="Areas\Home\Scripts\Home.js" />

Loading…
Cancel
Save