Style fixes. Allow anyone to comment.

pull/441/head
Halil ibrahim Kalkan 7 years ago
parent 3c9c77bf59
commit b474599d71

@ -81,7 +81,7 @@ namespace Volo.Blogging.Comments
ObjectMapper.Map<List<Comment>, List<CommentWithDetailsDto>>(comments)); ObjectMapper.Map<List<Comment>, List<CommentWithDetailsDto>>(comments));
} }
[Authorize(BloggingPermissions.Comments.Create)] //[Authorize(BloggingPermissions.Comments.Create)] TODO: Temporary removed
public async Task<CommentWithDetailsDto> CreateAsync(CreateCommentDto input) public async Task<CommentWithDetailsDto> CreateAsync(CreateCommentDto input)
{ {
var comment = new Comment(_guidGenerator.Create(), input.PostId, input.RepliedCommentId, input.Text); var comment = new Comment(_guidGenerator.Create(), input.PostId, input.RepliedCommentId, input.Text);

@ -2,6 +2,7 @@
@inherits Volo.Blogging.Pages.Blog.BloggingPage @inherits Volo.Blogging.Pages.Blog.BloggingPage
@using Microsoft.AspNetCore.Authorization @using Microsoft.AspNetCore.Authorization
@using Microsoft.AspNetCore.Http.Extensions @using Microsoft.AspNetCore.Http.Extensions
@using Volo.Abp.Users
@using Volo.Blogging @using Volo.Blogging
@using Volo.Blogging.Pages.Blog.Posts @using Volo.Blogging.Pages.Blog.Posts
@using Volo.Blogging.Areas.Blog.Helpers.TagHelpers @using Volo.Blogging.Areas.Blog.Helpers.TagHelpers
@ -9,6 +10,7 @@
@model DetailModel @model DetailModel
@{ @{
ViewBag.PageTitle = "Blog"; ViewBag.PageTitle = "Blog";
var hasCommentingPermission = CurrentUser.IsAuthenticated; //TODO: Apply real policy!
} }
@section scripts { @section scripts {
<abp-script-bundle name="@typeof(DetailModel).FullName"> <abp-script-bundle name="@typeof(DetailModel).FullName">
@ -100,13 +102,13 @@
} }
</div> </div>
<a class="btn btn-blue float-right" @*<a class="btn btn-blue float-right" TODO: Disabled temporary
href="@Model.GetTwitterShareUrl(Model.Post.Title, HttpContext.Request.GetEncodedUrl(), "@" + (Model.Blog.Twitter??""))" target="_blank"> href="@Model.GetTwitterShareUrl(Model.Post.Title, HttpContext.Request.GetEncodedUrl(), "@" + (Model.Blog.Twitter??""))" target="_blank">
<i class="fa fa-twitter"></i> <i class="fa fa-twitter"></i>
@L["ShareOnTwitter"] @L["ShareOnTwitter"]
</a> </a>*@
@if (await Authorization.IsGrantedAsync(BloggingPermissions.Comments.Create)) @if (hasCommentingPermission)
{ {
<div class="comment-form mt-4"> <div class="comment-form mt-4">
<div class="vs-blog-title mb-0"> <div class="vs-blog-title mb-0">
@ -131,7 +133,7 @@
@foreach (var commentWithRepliesDto in Model.CommentsWithReplies) @foreach (var commentWithRepliesDto in Model.CommentsWithReplies)
{ {
<div class="media"> <div class="media">
<img gravatar-email="@commentWithRepliesDto.Comment.Writer.Email" default-image="Identicon" class="d-flex mr-3 rounded-circle comment-avatar" /> <img gravatar-email="@commentWithRepliesDto.Comment.Writer.Email" default-image="Identicon" class="d-flex mr-3 rounded-circle comment-avatar" />
<div class="media-body"> <div class="media-body">
<h5 class="comment-owner"> <h5 class="comment-owner">
@(commentWithRepliesDto.Comment.Writer == null ? "" : commentWithRepliesDto.Comment.Writer.UserName) @(commentWithRepliesDto.Comment.Writer == null ? "" : commentWithRepliesDto.Comment.Writer.UserName)
@ -142,7 +144,7 @@
</p> </p>
<div class="comment-buttons font-75 bg-light"> <div class="comment-buttons font-75 bg-light">
@if (await Authorization.IsGrantedAsync(BloggingPermissions.Comments.Create)) @if (hasCommentingPermission)
{ {
<a href="#" class="tag replyLink" data-relpyid="@commentWithRepliesDto.Comment.Id"> <a href="#" class="tag replyLink" data-relpyid="@commentWithRepliesDto.Comment.Id">
<i class="fa fa-reply" aria-hidden="true"></i> @L["Reply"] <i class="fa fa-reply" aria-hidden="true"></i> @L["Reply"]
@ -166,7 +168,7 @@
} }
</div> </div>
@if (await Authorization.IsGrantedAsync(BloggingPermissions.Comments.Create)) @if (hasCommentingPermission)
{ {
<div class="comment-form mt-4 replyForm"> <div class="comment-form mt-4 replyForm">
<div class="clearfix bg-light p-4"> <div class="clearfix bg-light p-4">
@ -208,7 +210,7 @@
@foreach (var reply in commentWithRepliesDto.Replies) @foreach (var reply in commentWithRepliesDto.Replies)
{ {
<div class="media"> <div class="media">
<img gravatar-email="@reply.Writer.Email" default-image="Identicon" class="d-flex mr-3 rounded-circle comment-avatar" /> <img gravatar-email="@reply.Writer.Email" default-image="Identicon" class="d-flex mr-3 rounded-circle comment-avatar" />
<div class="media-body"> <div class="media-body">
<h5 class="comment-owner"> <h5 class="comment-owner">
@(reply.Writer == null ? "" : reply.Writer.UserName) @(reply.Writer == null ? "" : reply.Writer.UserName)
@ -219,7 +221,7 @@
</p> </p>
<div class="comment-buttons font-75 bg-light"> <div class="comment-buttons font-75 bg-light">
@if (await Authorization.IsGrantedAsync(BloggingPermissions.Comments.Create)) @if (hasCommentingPermission)
{ {
<a href="#" class="tag replyLink" data-relpyid="@commentWithRepliesDto.Comment.Id"> <a href="#" class="tag replyLink" data-relpyid="@commentWithRepliesDto.Comment.Id">
<i class="fa fa-reply" aria-hidden="true"></i> @L["Reply"] <i class="fa fa-reply" aria-hidden="true"></i> @L["Reply"]
@ -242,7 +244,7 @@
} }
</div> </div>
@if (await Authorization.IsGrantedAsync(BloggingPermissions.Comments.Create)) @if (hasCommentingPermission)
{ {
<div class="comment-form mt-4 replyForm"> <div class="comment-form mt-4 replyForm">
<div class="clearfix bg-light p-4"> <div class="clearfix bg-light p-4">

@ -4,10 +4,9 @@ a, a:hover {
} }
p { p {
color: #444; color: #444;
font-family: 'PT Sans', 'Times New Roman', Times, serif;
} }
h1,h2,h3,h4,h5,h6,.tab-title { h1, h2, h3, h4, h5, h6, .tab-title {
font-family: Helvetica, Roboto, sans-serif; font-family: Helvetica, Arial, sans-serif;
font-weight: 700; font-weight: 700;
} }
h1 { h1 {

@ -10,10 +10,9 @@
text-decoration: none; text-decoration: none;
color: #000000; } color: #000000; }
div.vs-blog p { div.vs-blog p {
color: #444; color: #444; }
font-family: 'PT Sans', 'Times New Roman', Times, serif; }
div.vs-blog h1, div.vs-blog h2, div.vs-blog h3, div.vs-blog h4, div.vs-blog h5, div.vs-blog h6, div.vs-blog .tab-title { div.vs-blog h1, div.vs-blog h2, div.vs-blog h3, div.vs-blog h4, div.vs-blog h5, div.vs-blog h6, div.vs-blog .tab-title {
font-family: Helvetica, Roboto, sans-serif; font-family: Helvetica, Arial, sans-serif;
font-weight: 700; } font-weight: 700; }
div.vs-blog h1 { div.vs-blog h1 {
font-size: 2.25em; font-size: 2.25em;

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save