Blogifier icon indicating copy to clipboard operation
Blogifier copied to clipboard

Please add comments section

Open sriramkumarm1 opened this issue 3 years ago • 9 comments

Have been using Blogifier for quite a long time for my Blog in production. It has all the features needed, except for comment section.

It'd be very great if we could have individual post comments implemented on the lines of WordPress. Please think about it and try adding it in a future release.

Thanks in advance!

sriramkumarm1 avatar Apr 22 '22 06:04 sriramkumarm1

Hi, I tried to add the comment function myself.

  • People and post comment and edit after posting:

image

  • The comments have a simple tree structure to collect the sub-comments which responds another comment. User can choose to fold or unfold it:

image

  • Comment needs user to login to post comment or thumb-up/revoke thumb-up. Post author had a 'Author' tab in pill shape: image

I haven't raise the PR yet, because I haven't communicated with the repo owner about the solution, yet.

LinQiaoPorco avatar May 30 '22 07:05 LinQiaoPorco

Solution:

  • New table 'Comments' to store comments and user id who posted them, foreign key to 'Posts' table;
  • New table 'CommentsLikes' to store thumb-ups and user id, foreign key to 'Comments' table;
  • Embed a Blazor Server to 'Blogifier' project, hosting and embeding 'Comments.razor' into each post.cshtml;
  • 'CommentCard.razor' show the contents, and 'CommentEditor.razor' show the easyMDE editor to edit or post new comment, are also embeded into 'Comments.razor';

Flaws:

  • Blazor Server embeded into existing MVC can not share httpcontext, so the Login function may need changes to avoid user login again for comment;
  • As for myself, I changed the Auth funciton to SSO using IdentityServer4, so I haven't study how the original Blogifier project should handle it.

Full size screenshot: localhost_5002_posts_draft-post

LinQiaoPorco avatar May 30 '22 07:05 LinQiaoPorco

@LinQiaoPorco hello Whether you submit your implemented comment feature to a pr I'm looking forward to implementing comments This project is being upgraded, please push it to the dev branch if possible

dorthl avatar Jun 08 '23 05:06 dorthl

Hi, I haven't looked into the project for quite a long time. I will try to PR from latest branch to see if it works. My previous repo was revised to use OpenID connect, so it is not proper to PR the original one.

I found that dev branch is in .NET 7 already, while I did not plan to hasve .NET 7 SDK. Can I just pr to main branch?

LinQiaoPorco avatar Jun 08 '23 06:06 LinQiaoPorco

It can be in the mian-bak branch, the mian branch was wrongly submitted by me and I am asking the warehouse manager to fix it, [mian-bak] is the original warehouse code But the .net7 update in the dev branch will be updated to the mian branch soon. If you submit to the mian branch, the request will probably not be merged.

dorthl avatar Jun 08 '23 07:06 dorthl

You can try to push to the dev branch and we can solve the problem together

dorthl avatar Jun 08 '23 07:06 dorthl

OK. That will be a messy though. BTW, did you read description on my solution? Would that be OK to progress?

LinQiaoPorco avatar Jun 08 '23 07:06 LinQiaoPorco

Yes, there may be a big difference in the login plan My idea is to use the code that can be used as much as possible to realize the comment function, structure table, logic, etc... even css..

dorthl avatar Jun 08 '23 07:06 dorthl

image

I remember that the changes target comments function added since this commit.

LinQiaoPorco avatar Jun 08 '23 07:06 LinQiaoPorco